5 Commits acc4064dd6 ... e84d8705f9

Auteur SHA1 Bericht Datum
  bfg e84d8705f9 audiostart.sh 2 jaren geleden
  bfg 6c1ef5e029 lyrics_fetch.sh (weak) 2 jaren geleden
  bfg a9b50d3950 winemenu upd (different prefixes) 2 jaren geleden
  bfg 9d41bcd443 vpngate upd (up/down calls) 2 jaren geleden
  bfg 502cb30e67 gpu modes scripts 2 jaren geleden
7 gewijzigde bestanden met toevoegingen van 134 en 15 verwijderingen
  1. 48 0
      ishell/audiostart.sh
  2. 4 0
      ishell/gpu_pm_mode_3d.sh
  3. 4 0
      ishell/gpu_pm_mode_saving.sh
  4. 4 0
      ishell/gpu_pm_mode_video.sh
  5. 27 0
      ishell/lyrics_fetch.sh
  6. 10 5
      ishell/vpngate.py
  7. 37 10
      shell/winemenu

+ 48 - 0
ishell/audiostart.sh

@@ -0,0 +1,48 @@
+#! /bin/sh
+
+SNDCARD_PLB_NAME="USB"
+SNDCARD_CPT_NAME="USB"
+
+# RATE=48000
+# /usr/bin/jackd -r -m -p128 -d alsa -M -S -d hw:0 -r $RATE -p 1024 -n 2 -D -Chw:DeviceEEPROM,0 &
+# /usr/bin/jackd -r -m -p128 -d alsa -M -S -d hw:0 -r $RATE -p 1024 -n 2 -D &
+# /usr/bin/jackd -r -m -p64 -d alsa -M -S -d hw:0 -r $RATE -p 1024 -n 4 -D -Chw:DeviceEEPROM,0 &
+# /usr/bin/jackd -R -m -d alsa -M -S -d hw:0  -D -Chw:DeviceEEPROM,0 &
+# /usr/bin/jackd -R -d alsa -M -d hw:0  -D -Chw:DeviceEEPROM,0 &
+# /usr/bin/jackd -R -d alsa -M -d hw:0  -D -Chw:0 &
+# /usr/bin/jackd -r -m -d alsa -H -M -d hw:0  -D -Chw:0 -X raw &
+# JACK_NO_AUDIO_RESERVATION=1
+jackd -u -m -d alsa -M -d hw:$SNDCARD_PLB_NAME -D -Chw:$SNDCARD_CPT_NAME -X raw &
+# jackd -u -m -d alsa -M -d hw:USB -D -Chw:USB -X raw
+
+# sleep 2
+#
+# alsa_out -j ploop -dploop -q 1 2>&1 1>/dev/null &
+# alsa_in  -j cloop -dcloop -q 1 2>&1 1>/dev/null &
+#
+# sleep 2
+#
+# jack_connect cloop:capture_1 system:playback_1
+# jack_connect cloop:capture_2 system:playback_2
+#
+# jack_connect system:capture_1 ploop:playback_1
+# # jack_connect system:capture_1 ploop:playback_2
+# jack_connect system:capture_2 ploop:playback_2
+
+sleep 2
+
+pulseaudio --enable-memfd &
+
+alsa_out -j ploop -dploop -q 1 2>&1 1>/dev/null &
+alsa_in  -j cloop -dcloop -q 1 2>&1 1>/dev/null &
+
+sleep 1
+
+jack_connect cloop:capture_1 system:playback_1
+jack_connect cloop:capture_2 system:playback_2
+jack_connect system:capture_1 ploop:playback_1
+jack_connect system:capture_2 ploop:playback_2
+
+sleep 2
+
+exit 0

+ 4 - 0
ishell/gpu_pm_mode_3d.sh

@@ -0,0 +1,4 @@
+#! /bin/sh
+
+echo "manual" > /sys/class/drm/card0/device/power_dpm_force_performance_level
+echo "1" > /sys/class/drm/card0/device/pp_power_profile_mode

+ 4 - 0
ishell/gpu_pm_mode_saving.sh

@@ -0,0 +1,4 @@
+#! /bin/sh
+
+echo "manual" > /sys/class/drm/card0/device/power_dpm_force_performance_level
+echo "2" > /sys/class/drm/card0/device/pp_power_profile_mode

+ 4 - 0
ishell/gpu_pm_mode_video.sh

@@ -0,0 +1,4 @@
+#! /bin/sh
+
+echo "manual" > /sys/class/drm/card0/device/power_dpm_force_performance_level
+echo "3" > /sys/class/drm/card0/device/pp_power_profile_mode

+ 27 - 0
ishell/lyrics_fetch.sh

@@ -0,0 +1,27 @@
+#!/bin/sh
+
+## Script is designed for using with deadbeef-infobar -like plugins, still can be used in command line, see arguments
+## below this commentary.
+##
+## Requires:
+### - curl (may be replaced with other downloaders like wget)
+### - xmllint (included in libxml2)
+### - xmlstarlet (required for removing video links, may be omitted from the formatting pipe)
+### - w3m (for human-friendly output formatting)
+
+ARTIST=$1
+TITLE=$2
+# ALBUM=$3
+
+ARTIST=`echo $ARTIST | tr '[:blank:]' '_'`
+TITLE=`echo $TITLE | tr '[:blank:]' '_'`
+
+XML_XPATH="//div[@class=\"lyrics-body\"]"
+XML_XPATH_EXC="//div[@id=\"video-musictory\"]"
+
+URL_TEMP="https://www.lyricsmania.com/${TITLE}_lyrics_${ARTIST}.html"
+URL_TEMP=`echo ${URL_TEMP} | tr '[:upper:]' '[:lower:]'`
+
+curl -s "${URL_TEMP}" | xmllint --html -xpath "${XML_XPATH}" - 2>/dev/null | xmlstarlet edit -d "$XML_XPATH_EXC" | w3m -dump -T text/html
+
+exit 0;

+ 10 - 5
ishell/vpngate.py

@@ -10,8 +10,8 @@ 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}"
+fmtstrhead = "{:^4} | {:^4} | {:^4} | {:^30} | {:^10}"
+fmtstr     = "[{:>2}] |  {}  | {:>4} | {:<30} | {:^10}"
 
 response = urllib.request.urlopen(listurl).read().decode('utf-8').split('\n')
 reader = csv.reader(response, delimiter=',')
@@ -20,16 +20,21 @@ reader = csv.reader(response, delimiter=',')
 reader.__next__()
 reader.__next__()
 
-print(fmtstrhead.format( "INDX", "LCTN", "Server ID", "Score", "Ping" ))
+print(fmtstrhead.format( "INDX", "LCTN", "Ping", "Server ID", "Score" ))
 for i in range(serversnum):
     current = reader.__next__()
-    print(fmtstr.format( i, current[6], current[0], current[2], current[3] ))
+    print(fmtstr.format( i, current[6], current[3], current[0], current[2] ))
     profiles.append(current[14])
 
 while choice < 0 or choice > serversnum:
     choice = int(input("Choose a profile: "))
 
+scriptdir = os.path.expanduser("~/.config/openvpn")
 with open(ovpnpath, 'w') as f:
     f.write(base64.b64decode(profiles[choice]).decode('ascii'))
+    f.write( "script-security 2\n" )
+    f.write( "up \"" + scriptdir + "/up.sh\"\n" )
+    f.write( "down \"" + scriptdir + "/down.sh\"\n" )
 
-os.system("sudo openvpn /tmp/profile.opvn")
+# os.system( "sudo openvpn " + runopts + "--config" + ovpnpath )
+os.system( "sudo openvpn " + ovpnpath )

+ 37 - 10
shell/winemenu

@@ -2,24 +2,51 @@
 
 . $(realpath "$0" | xargs dirname)/../menu/dmenuconf
 
-PSEUDOPREFIX="$HOME/bin/apps/wine"
-WINE64CMD="wine"
-WINE32CMD="env WINEPREFIX=$HOME/.wine32 wine"
+WINEAPPSDIR="$HOME/bin/apps/wine"
+
+OPT_VANILLA="WINEPREFIX=$HOME/.wine_vanilla"
+OPT_JAP="LANG=ja_JP.UTF-8"
+# WINE_CALL="wine start /unix"
+WINE_CALL="wine"
 
 DLIST="\
 anydesk
 irfan
 winecfg
+telegram
+winrar
+magnify
+"
+
+WLIST="\
+default
+default-jap
+vanilla
+vanilla-jap
 "
 
-AAA="$(echo -e "$DLIST" | dmenu -i -b -p WINE  -nb "$DMENUBG" -nf "$DMENUFG" -sb "$DMENUFG" -sf "$DMENUBG" -fn "$DMENUFONT")"
+WINE_CMD=""
+WineDmenu="$(echo -e "$WLIST" | dmenu -i -b -p WINELAUNCHOPTS  -nb "$DMENUBG" -nf "$DMENUFG" -sb "$DMENUFG" -sf "$DMENUBG" -fn "$DMENUFONT")"
+case "$WineDmenu"
+{
+	"default")     WINE_CMD="$WINE_CALL" ;;
+	"default-jap") WINE_CMD="env $OPT_JAP $WINE_CALL" ;;
+	"vanilla")     WINE_CMD="env $OPT_VANILLA $WINE_CALL" ;;
+	"vanilla-jap") WINE_CMD="env $OPT_JAP $OPT_VANILLA $WINE_CALL" ;;
+}
+
+AAA="$(echo -e "$DLIST" | dmenu -i -b -p RunIn:$WineDmenu -nb "$DMENUBG" -nf "$DMENUFG" -sb "$DMENUFG" -sf "$DMENUBG" -fn "$DMENUFONT")"
 
-cd $PSEUDOPREFIX
+cd $WINEAPPSDIR
 
-case "$AAA" in
-	"irfan")    $WINE64CMD $PSEUDOPREFIX/IrfanView/i_view32.exe ;;
-	"anydesk")  $WINE64CMD $PSEUDOPREFIX/anydesk/AnyDesk.exe ;;
-	"winecfg")  $WINE64CMD winecfg ;;
-esac
+case "$AAA"
+{
+	"irfan")    cd ./IrfanView && $WINE_CMD ./i_view32.exe ;;
+	"anydesk")  cd ./anydesk && $WINE_CMD ./AnyDesk.exe ;;
+	"winecfg")  $WINE_CMD winecfg ;;
+	"telegram") cd ./Telegram && $WINE_CMD ./Telegram.exe ;;
+	"winrar")   cd ./WinRAR && $WINE_CMD ./WinRAR.exe ;;
+	"magnify")  cd "./Magnifixer" && $WINE_CMD ./Magnifixer.exe ;;
+}
 
 exit 0