3 Коміти e444d8c4e8 ... acc4064dd6

Автор SHA1 Опис Дата
  bfg acc4064dd6 vpngate 3 роки тому
  bfg 35b14643d7 jackmenu 3 роки тому
  bfg cc92e11762 remove dmenu entry 3 роки тому
3 змінених файлів з 77 додано та 1 видалено
  1. 35 0
      ishell/vpngate.py
  2. 0 1
      menu/dmenuconf
  3. 42 0
      shell/jackmenu

+ 35 - 0
ishell/vpngate.py

@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+
+import os
+import csv
+import urllib.request
+import base64
+
+serversnum = 20
+profiles = []
+choice = -1
+listurl = "http://www.vpngate.net/api/iphone/"
+ovpnpath = "/tmp/profile.ovpn"
+fmtstrhead = "{:^4} | {:^4} | {:^30} | {:^10} | {:^4}"
+fmtstr     = "[{:>2}] |  {}  | {:<30} | {:^10} | {:>4}"
+
+response = urllib.request.urlopen(listurl).read().decode('utf-8').split('\n')
+reader = csv.reader(response, delimiter=',')
+
+# Get rid of irrelevant headers
+reader.__next__()
+reader.__next__()
+
+print(fmtstrhead.format( "INDX", "LCTN", "Server ID", "Score", "Ping" ))
+for i in range(serversnum):
+    current = reader.__next__()
+    print(fmtstr.format( i, current[6], current[0], current[2], current[3] ))
+    profiles.append(current[14])
+
+while choice < 0 or choice > serversnum:
+    choice = int(input("Choose a profile: "))
+
+with open(ovpnpath, 'w') as f:
+    f.write(base64.b64decode(profiles[choice]).decode('ascii'))
+
+os.system("sudo openvpn /tmp/profile.opvn")

+ 0 - 1
menu/dmenuconf

@@ -26,7 +26,6 @@ st
 bfm
 qjackctl
 obs
-discord
 picunic-gui
 palemoon-jailed
 "

+ 42 - 0
shell/jackmenu

@@ -0,0 +1,42 @@
+#! /bin/mksh
+
+. $(realpath "$0" | xargs dirname)/../menu/dmenuconf
+
+EXCON="jack_connect"
+EXDISCON="jack_disconnect"
+
+PulseClient="PulseAudio JACK Source-01"
+MicClient="ardour:MicFiltered"
+KbdClient="ardour:MidiFiltered"
+DdbClient="deadbeef"
+
+PulseClientL="${PulseClient}:front-left"
+PulseClientR="${PulseClient}:front-right"
+MicClientOutL="${MicClient}/audio_out 1"
+MicClientOutR="${MicClient}/audio_out 2"
+KbdClientOutL="${KbdClient}/audio_out 1"
+KbdClientOutR="${KbdClient}/audio_out 2"
+DdbClientOutL="${DdbClient}:deadbeef_1"
+DdbClientOutR="${DdbClient}:deadbeef_2"
+
+DLIST="\
+mic-pulse-connect
+mic-pulse-disconnect
+deadbeef-pulse-connect
+deadbeef-pulse-disconnect
+midi-pulse-connect
+midi-pulse-disconnect
+"
+
+AAA="$(echo -e "$DLIST" | dmenu -i -b -p WINE  -nb "$DMENUBG" -nf "$DMENUFG" -sb "$DMENUFG" -sf "$DMENUBG" -fn "$DMENUFONT")"
+
+case "$AAA" in
+	"mic-pulse-connect")         $EXCON    "$MicClientOutL" "$PulseClientL"    && $EXCON "$MicClientOutR" "$PulseClientR" ;;
+	"mic-pulse-disconnect")      $EXDISCON "$MicClientOutL" "$PulseClientL" && $EXDISCON "$MicClientOutR" "$PulseClientR" ;;
+	"deadbeef-pulse-connect")    $EXCON    "$DdbClientOutL" "$PulseClientL"    && $EXCON "$DdbClientOutR" "$PulseClientR" ;;
+	"deadbeef-pulse-disconnect") $EXDISCON "$DdbClientOutL" "$PulseClientL" && $EXDISCON "$DdbClientOutR" "$PulseClientR" ;;
+	"midi-pulse-connect")        $EXCON    "$KbdClientOutL" "$PulseClientL"    && $EXCON "$KbdClientOutR" "$PulseClientR" ;;
+	"midi-pulse-disconnect")     $EXDISCON "$KbdClientOutL" "$PulseClientL" && $EXDISCON "$KbdClientOutR" "$PulseClientR" ;;
+esac
+
+exit 0