From 1121e29b3ed21ec008642a8ec6aee765d435fdb0 Mon Sep 17 00:00:00 2001 From: noneofyourbusiness Date: Fri, 4 Jun 2021 11:11:36 +0200 Subject: [PATCH] replace "st -e" with sxmo_terminal.sh and edit it to use st -e instead of st Signed-off-by: Maarten van Gompel --- scripts/appscripts/sxmo_record.sh | 4 +- scripts/appscripts/sxmo_rss.sh | 2 +- scripts/appscripts/sxmo_weather.sh | 2 +- scripts/appscripts/sxmo_youtube.sh | 4 +- scripts/core/sxmo_appmenu.sh | 68 ++++++++++++++--------------- scripts/core/sxmo_bluetoothmenu.sh | 4 +- scripts/core/sxmo_edit_screen.sh | 2 +- scripts/core/sxmo_gpsutil.sh | 4 +- scripts/core/sxmo_networks.sh | 6 +-- scripts/core/sxmo_terminal.sh | 4 +- scripts/core/sxmo_timezonechange.sh | 2 +- scripts/core/sxmo_urlhandler.sh | 4 +- scripts/modem/sxmo_modeminfo.sh | 2 +- scripts/modem/sxmo_modemtext.sh | 2 +- 14 files changed, 56 insertions(+), 54 deletions(-) diff --git a/scripts/appscripts/sxmo_record.sh b/scripts/appscripts/sxmo_record.sh index c2fb30c..b4161b3 100755 --- a/scripts/appscripts/sxmo_record.sh +++ b/scripts/appscripts/sxmo_record.sh @@ -23,7 +23,7 @@ record() { TEMPFILE="$(mktemp --suffix=.wav)" NOW="$(date '+%y%m%d_%H%M%S')" - st -e arecord -D plug:"$DEVICE" -vv -f cd -c "$CHANNELS" "$TEMPFILE" + sxmo_terminal.sh arecord -D plug:"$DEVICE" -vv -f cd -c "$CHANNELS" "$TEMPFILE" FILENAME="${NOW}_${PRETTYNAME}_$(getdur "$TEMPFILE").wav" FILE="${SXMO_RECDIR}/${FILENAME}" mv "$TEMPFILE" "$FILE" @@ -46,7 +46,7 @@ recordconfirm() { dmenu -p "$DUR" -c -l 10 )" if echo "$PICK" | grep "Playback"; then - st -e mpv -ao=alsa -v "$FILE" + sxmo_terminal.sh mpv -ao=alsa -v "$FILE" elif echo "$PICK" | grep "Delete Recording"; then rm "$FILE" echo "File deleted." | dmenu -c -l 10 diff --git a/scripts/appscripts/sxmo_rss.sh b/scripts/appscripts/sxmo_rss.sh index 47d16c0..0ac9c21 100755 --- a/scripts/appscripts/sxmo_rss.sh +++ b/scripts/appscripts/sxmo_rss.sh @@ -78,7 +78,7 @@ rsstimespanmenu() { # Update Sfeed via sfeed_update (as long as user didn't request cached) [ $FETCHENABLED = 1 ] && - st -e sh -c "echo Fetching Feeds && sfeed_update $SFEEDCONF" + sxmo_terminal.sh sh -c "echo Fetching Feeds && sfeed_update $SFEEDCONF" rssreadmenu } diff --git a/scripts/appscripts/sxmo_weather.sh b/scripts/appscripts/sxmo_weather.sh index 9f87217..37921e5 100755 --- a/scripts/appscripts/sxmo_weather.sh +++ b/scripts/appscripts/sxmo_weather.sh @@ -143,7 +143,7 @@ weathermenu() { PLACE="$(printf %b "$CHOICE" | cut -d: -f1 | awk '{$1=$1};1')" LAT="$(printf %b "$CHOICE" | cut -d: -f2- | awk '{$1=$1};1' | cut -d ' ' -f1)" LON="$(printf %b "$CHOICE" | cut -d: -f2- | awk '{$1=$1};1' | cut -d ' ' -f2)" - st -e "$0" getweathertexttable "$LAT" "$LON" "$PLACE" + sxmo_terminal.sh "$0" getweathertexttable "$LAT" "$LON" "$PLACE" fi } diff --git a/scripts/appscripts/sxmo_youtube.sh b/scripts/appscripts/sxmo_youtube.sh index 97da972..c127263 100755 --- a/scripts/appscripts/sxmo_youtube.sh +++ b/scripts/appscripts/sxmo_youtube.sh @@ -73,10 +73,10 @@ resultsmenu() { exit 0 elif [ "$AUDIOONLY" = 1 ]; then URL="$(echo "$PICKED" | awk -F " " '{print $NF}')" - st -e mpv -ao=alsa -v --no-video "$URL" & + sxmo_terminal.sh mpv -ao=alsa -v --no-video "$URL" & else URL="$(echo "$PICKED" | awk -F " " '{print $NF}')" - st -e mpv -ao=alsa -v --ytdl-format='[height<420]' "$URL" & + sxmo_terminal.sh mpv -ao=alsa -v --ytdl-format='[height<420]' "$URL" & fi done } diff --git a/scripts/core/sxmo_appmenu.sh b/scripts/core/sxmo_appmenu.sh index a1c8e8d..4bcd315 100755 --- a/scripts/core/sxmo_appmenu.sh +++ b/scripts/core/sxmo_appmenu.sh @@ -54,16 +54,16 @@ programchoicesinit() { CHOICES=$("$XDG_CONFIG_HOME/sxmo/hooks/apps") else CHOICES=" - $(command -v aerc >/dev/null && echo "$icon_eml Aerc ^ 0 ^ st -e aerc") - $(command -v amfora >/dev/null && echo "$icon_glb Amfora ^ 0 ^ st -e amfora") - $(command -v alpine >/dev/null && echo "$icon_eml Alpine ^ 0 ^ st -e alpine") + $(command -v aerc >/dev/null && echo "$icon_eml Aerc ^ 0 ^ sxmo_terminal.sh aerc") + $(command -v amfora >/dev/null && echo "$icon_glb Amfora ^ 0 ^ sxmo_terminal.sh amfora") + $(command -v alpine >/dev/null && echo "$icon_eml Alpine ^ 0 ^ sxmo_terminal.sh alpine") $(command -v anbox-launch >/dev/null && echo "$icon_and Anbox ^ 0 ^ anbox") $(command -v audacity >/dev/null && echo "$icon_mic Audacity ^ 0 ^ audacity") - $(command -v calcurse >/dev/null && echo "$icon_clk Calcurse ^ 0 ^ st -e calcurse") - $(command -v cmus >/dev/null && echo "$icon_mus Cmus ^ 0 ^ st -e cmus") + $(command -v calcurse >/dev/null && echo "$icon_clk Calcurse ^ 0 ^ sxmo_terminal.sh calcurse") + $(command -v cmus >/dev/null && echo "$icon_mus Cmus ^ 0 ^ sxmo_terminal.sh cmus") $(command -v dino >/dev/null && echo "$icon_clk Dino ^ 0 ^ GDK_SCALE=1 dino") $(command -v dolphin >/dev/null && echo "$icon_dir Dolphin ^ 0 ^ dolphin") - $(command -v emacs >/dev/null && echo "$icon_edt Emacs ^ 0 ^ st -e emacs") + $(command -v emacs >/dev/null && echo "$icon_edt Emacs ^ 0 ^ sxmo_terminal.sh emacs") $(command -v epiphany >/dev/null && echo "$icon_glb Epiphany ^ 0 ^ epiphany") $(command -v firefox >/dev/null && echo "$icon_ffx Firefox ^ 0 ^ firefox") $(command -v foliate >/dev/null && echo "$icon_bok Foliate ^ 0 ^ foliate") @@ -72,48 +72,48 @@ programchoicesinit() { $(command -v gedit >/dev/null && echo "$icon_edt Gedit ^ 0 ^ gedit") $(command -v geeqie >/dev/null && echo "$icon_img Geeqie ^ 0 ^ geeqie") $(command -v giara >/dev/null && echo "$icon_red Giara ^ 0 ^ giara") - $(command -v gomuks >/dev/null && echo "$icon_msg Gomuks ^ 0 ^ st -e gomuks") + $(command -v gomuks >/dev/null && echo "$icon_msg Gomuks ^ 0 ^ sxmo_terminal.sh gomuks") $(command -v gucharmap >/dev/null && echo "$icon_inf Gucharmap ^ 0 ^ gucharmap") $(command -v hexchat >/dev/null && echo "$icon_msg Hexchat ^ 0 ^ hexchat") - $(command -v htop >/dev/null && echo "$icon_cfg Htop ^ 0 ^ st -e htop") - $(command -v irssi >/dev/null && echo "$icon_msg Irssi ^ 0 ^ st -e irssi") - $(command -v ii >/dev/null && echo "$icon_msg Ii ^ 0 ^ st -e ii") - $(command -v ipython >/dev/null && echo "$icon_trm IPython ^ 0 ^ st -e ipython") + $(command -v htop >/dev/null && echo "$icon_cfg Htop ^ 0 ^ sxmo_terminal.sh htop") + $(command -v irssi >/dev/null && echo "$icon_msg Irssi ^ 0 ^ sxmo_terminal.sh irssi") + $(command -v ii >/dev/null && echo "$icon_msg Ii ^ 0 ^ sxmo_terminal.sh ii") + $(command -v ipython >/dev/null && echo "$icon_trm IPython ^ 0 ^ sxmo_terminal.sh ipython") $(command -v kmail >/dev/null && echo "$icon_eml KMail ^ 0 ^ kmail") $(command -v kontact >/dev/null && echo "$icon_msg Kontact ^ 0 ^ kontact") $(command -v konversation >/dev/null && echo "$icon_msg Konversation ^ 0 ^ konversation") $(command -v kwrite >/dev/null && echo "$icon_edt Kwrite ^ 0 ^ kwrite") $(command -v lagrange >/dev/null && echo "$icon_glb Lagrange ^ 0 ^ lagrange") - $(command -v lf >/dev/null && echo "$icon_dir Lf ^ 0 ^ st -e lf") + $(command -v lf >/dev/null && echo "$icon_dir Lf ^ 0 ^ sxmo_terminal.sh lf") $(command -v lollypop >/dev/null && echo "$icon_mus Lollypop ^ 0 ^ lollypop") $(command -v midori >/dev/null && echo "$icon_glb Midori ^ 0 ^ midori") - $(command -v mutt >/dev/null && echo "$icon_eml Mutt ^ 0 ^ st -e mutt") - $(command -v nano >/dev/null && echo "$icon_edt Nano ^ 0 ^ st -e nano") + $(command -v mutt >/dev/null && echo "$icon_eml Mutt ^ 0 ^ sxmo_terminal.sh mutt") + $(command -v nano >/dev/null && echo "$icon_edt Nano ^ 0 ^ sxmo_terminal.sh nano") $(command -v navit >/dev/null && echo "$icon_gps Navit ^ 0 ^ navit") - $(command -v ncmpcpp >/dev/null && echo "$icon_mus Ncmpcpp ^ 0 ^ st -e ncmpcpp") - $(command -v neomutt >/dev/null && echo "$icon_eml Neomutt ^ 0 ^ st -e neomutt") - $(command -v nvim >/dev/null && echo "$icon_vim Neovim ^ 0 ^ st -e nvim") + $(command -v ncmpcpp >/dev/null && echo "$icon_mus Ncmpcpp ^ 0 ^ sxmo_terminal.sh ncmpcpp") + $(command -v neomutt >/dev/null && echo "$icon_eml Neomutt ^ 0 ^ sxmo_terminal.sh neomutt") + $(command -v nvim >/dev/null && echo "$icon_vim Neovim ^ 0 ^ sxmo_terminal.sh nvim") $(command -v netsurf >/dev/null && echo "$icon_glb Netsurf ^ 0 ^ netsurf") - $(command -v newsboat >/dev/null && echo "$icon_rss Newsboat ^ 0 ^ st -e newsboat") - $(command -v nnn >/dev/null && echo "$icon_dir Nnn ^ 0 ^ st -e nnn") + $(command -v newsboat >/dev/null && echo "$icon_rss Newsboat ^ 0 ^ sxmo_terminal.sh newsboat") + $(command -v nnn >/dev/null && echo "$icon_dir Nnn ^ 0 ^ sxmo_terminal.sh nnn") $(command -v pidgin >/dev/null && echo "$icon_msg Pidgin ^ 0 ^ pidgin") - $(command -v profanity >/dev/null && echo "$icon_msg Profanity ^ 0 ^ st -e profanity") + $(command -v profanity >/dev/null && echo "$icon_msg Profanity ^ 0 ^ sxmo_terminal.sh profanity") $(command -v qutebrowser>/dev/null && echo "$icon_glb Qutebrowser ^ 0 ^ qutebrowser") - $(command -v ranger >/dev/null && echo "$icon_dir Ranger ^ 0 ^ st -e ranger") - $(command -v sacc >/dev/null && echo "$icon_itm Sacc ^ 0 ^ st -e sacc i-logout.cz/1/bongusta") - $(command -v sic >/dev/null && echo "$icon_itm Sic ^ 0 ^ st -e sic") - $(command -v st >/dev/null && echo "$icon_trm St ^ 0 ^ st -e $SHELL") + $(command -v ranger >/dev/null && echo "$icon_dir Ranger ^ 0 ^ sxmo_terminal.sh ranger") + $(command -v sacc >/dev/null && echo "$icon_itm Sacc ^ 0 ^ sxmo_terminal.sh sacc i-logout.cz/1/bongusta") + $(command -v sic >/dev/null && echo "$icon_itm Sic ^ 0 ^ sxmo_terminal.sh sic") + $(command -v st >/dev/null && echo "$icon_trm St ^ 0 ^ sxmo_terminal.sh $SHELL") $(command -v surf >/dev/null && echo "$icon_glb Surf ^ 0 ^ surf") $(command -v syncthing >/dev/null && echo "$icon_rld Syncthing ^ 0 ^ syncthing") $(command -v telegram-desktop >/dev/null && echo "$icon_tgm Telegram ^ 0 ^ telegram-desktop") - $(command -v thunar >/dev/null && echo "$icon_dir Thunar ^ 0 ^ st -e thunar") + $(command -v thunar >/dev/null && echo "$icon_dir Thunar ^ 0 ^ sxmo_terminal.sh thunar") $(command -v thunderbird >/dev/null && echo "$icon_eml Thunderbird ^ 0 ^ thunderbird") $(command -v totem >/dev/null && echo "$icon_mvi Totem ^ 0 ^ totem") - $(command -v tuir >/dev/null && echo "$icon_red Tuir ^ 0 ^ st -e tuir") - $(command -v weechat >/dev/null && echo "$icon_msg Weechat ^ 0 ^ st -e weechat") - $(command -v w3m >/dev/null && echo "$icon_glb W3m ^ 0 ^ st -e w3m duck.com") - $(command -v vim >/dev/null && echo "$icon_vim Vim ^ 0 ^ st -e vim") - $(command -v vis >/dev/null && echo "$icon_vim Vis ^ 0 ^ st -e vis") + $(command -v tuir >/dev/null && echo "$icon_red Tuir ^ 0 ^ sxmo_terminal.sh tuir") + $(command -v weechat >/dev/null && echo "$icon_msg Weechat ^ 0 ^ sxmo_terminal.sh weechat") + $(command -v w3m >/dev/null && echo "$icon_glb W3m ^ 0 ^ sxmo_terminal.sh w3m duck.com") + $(command -v vim >/dev/null && echo "$icon_vim Vim ^ 0 ^ sxmo_terminal.sh vim") + $(command -v vis >/dev/null && echo "$icon_vim Vis ^ 0 ^ sxmo_terminal.sh vis") $(command -v vlc >/dev/null && echo "$icon_mvi Vlc ^ 0 ^ vlc") $(command -v xcalc >/dev/null && echo "$icon_clc Xcalc ^ 0 ^ xcalc") " @@ -145,8 +145,8 @@ programchoicesinit() { printf %b "On → Off ^ 0 ^ sxmo_proximitylocktoggle.sh &" || printf %b "Off → On ^ 0 ^ sxmo_proximitylocktoggle.sh &" ) $icon_ror Rotate ^ 1 ^ sxmo_rotate.sh rotate - $icon_upc Upgrade Pkgs ^ 0 ^ st -e sxmo_upgrade.sh - $icon_cfg Edit configuration ^ 0 ^ st -e $EDITOR $XDG_CONFIG_HOME/sxmo/xinit + $icon_upc Upgrade Pkgs ^ 0 ^ sxmo_terminal.sh sxmo_upgrade.sh + $icon_cfg Edit configuration ^ 0 ^ sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/xinit " WINNAME=Config ;; @@ -170,8 +170,8 @@ programchoicesinit() { $icon_lck Lock (Screen off) ^ 0 ^ sxmo_lock.sh --screen-off $icon_zzz Suspend ^ 0 ^ sxmo_lock.sh --suspend $icon_out Logout ^ 0 ^ pkill -9 dwm - $icon_rld Reboot ^ 0 ^ st -e sudo reboot - $icon_pwr Poweroff ^ 0 ^ st -e sudo poweroff + $icon_rld Reboot ^ 0 ^ sxmo_terminal.sh sudo reboot + $icon_pwr Poweroff ^ 0 ^ sxmo_terminal.sh sudo poweroff " WINNAME="Power" ;; diff --git a/scripts/core/sxmo_bluetoothmenu.sh b/scripts/core/sxmo_bluetoothmenu.sh index 56b2b21..c8ead16 100755 --- a/scripts/core/sxmo_bluetoothmenu.sh +++ b/scripts/core/sxmo_bluetoothmenu.sh @@ -58,13 +58,13 @@ devicemenu() { elif echo "$PICKED" | grep -q "Close Menu"; then exit elif echo "$PICKED" | grep -q "Disconnect"; then - st -e sh -c "bluetoothctl disconnect; sleep 1" + sxmo_terminal.sh sh -c "bluetoothctl disconnect; sleep 1" elif echo "$PICKED" | grep -q "Scan"; then notify-send "Scanning BT devices for 30 seconds..." bluetoothctl --timeout=30 scan on && notify-send "End of scan" & else devicemac="$(echo "$DEVICES" | grep " \^ $PICKED$" | sed 's| ^ .*||' )" - st -e sh -c "$0 connect $devicemac; sleep 1" + sxmo_terminal.sh sh -c "$0 connect $devicemac; sleep 1" fi done } diff --git a/scripts/core/sxmo_edit_screen.sh b/scripts/core/sxmo_edit_screen.sh index aa51faa..c50be58 100755 --- a/scripts/core/sxmo_edit_screen.sh +++ b/scripts/core/sxmo_edit_screen.sh @@ -2,4 +2,4 @@ tmpfile=$(mktemp /tmp/st-edit.XXXXXX) trap 'rm "$tmpfile"' 0 1 15 cat > "$tmpfile" -st -e "$EDITOR" "$tmpfile" +sxmo_terminal.sh "$EDITOR" "$tmpfile" diff --git a/scripts/core/sxmo_gpsutil.sh b/scripts/core/sxmo_gpsutil.sh index 529e108..e4f6d48 100755 --- a/scripts/core/sxmo_gpsutil.sh +++ b/scripts/core/sxmo_gpsutil.sh @@ -106,7 +106,7 @@ gpslatlonset() { X="$(echo "$(lon2px "$LON" "$ZOOM") - ($WINW / 2)" | bc -l | cut -d. -f1)" killexistingfoxtrotgps - st -e sh -c " + sxmo_terminal.sh sh -c " gsettings set org.foxtrotgps global-zoom $ZOOM; gsettings set org.foxtrotgps global-x $X; gsettings set org.foxtrotgps global-y $Y; @@ -231,7 +231,7 @@ menumaptype() { IDX="$(printf %b "$CHOICES" | grep -n "$CHOICE" | cut -d: -f1)" killexistingfoxtrotgps gsettings set org.foxtrotgps repo-name "$SETCHOICE" - st -e foxtrotgps & + sxmo_terminal.sh foxtrotgps & done } diff --git a/scripts/core/sxmo_networks.sh b/scripts/core/sxmo_networks.sh index 943c6e8..7563146 100755 --- a/scripts/core/sxmo_networks.sh +++ b/scripts/core/sxmo_networks.sh @@ -124,13 +124,13 @@ networksmenu() { deletenetworkmenu ;; "Launch Nmtui" ) - st -e nmtui & + sxmo_terminal.sh nmtui & ;; "Launch Ifconfig" ) - st -e watch -n 2 ifconfig & + sxmo_terminal.sh watch -n 2 ifconfig & ;; "Scan Wifi Networks" ) - st -e watch -n 2 nmcli d wifi list & + sxmo_terminal.sh watch -n 2 nmcli d wifi list & ;; *) toggleconnection "$CHOICE" diff --git a/scripts/core/sxmo_terminal.sh b/scripts/core/sxmo_terminal.sh index 076749a..b169ead 100755 --- a/scripts/core/sxmo_terminal.sh +++ b/scripts/core/sxmo_terminal.sh @@ -1,5 +1,7 @@ #!/usr/bin/env sh +# You can export a different terminal in your xinit +TERMCMD="${TERMCMD:-st}" TERMMODE=$([ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && echo "true") if [ "$TERMMODE" = "true" ]; then @@ -8,7 +10,7 @@ if [ "$TERMMODE" = "true" ]; then done shift else - set -- st "$@" + set -- "$TERMCMD" -e "$@" fi if [ -z "$*" ]; then diff --git a/scripts/core/sxmo_timezonechange.sh b/scripts/core/sxmo_timezonechange.sh index e7fc41c..31e8d31 100755 --- a/scripts/core/sxmo_timezonechange.sh +++ b/scripts/core/sxmo_timezonechange.sh @@ -15,7 +15,7 @@ menu() { sort | sxmo_dmenu_with_kb.sh -p Timezone -c -l 10 -i )" - st -e "$0" change "$T" + sxmo_terminal.sh "$0" change "$T" } if [ $# -gt 0 ]; then diff --git a/scripts/core/sxmo_urlhandler.sh b/scripts/core/sxmo_urlhandler.sh index 86f8b28..071e20d 100755 --- a/scripts/core/sxmo_urlhandler.sh +++ b/scripts/core/sxmo_urlhandler.sh @@ -53,7 +53,7 @@ COMMAND=$( [ -z "$COMMAND" ] && exit 1 RUN=$(echo "$URL" | xargs -IURL echo "$COMMAND") if [ "$FORK" = fork ]; then - st -e sh -c "$RUN" & + sxmo_terminal.sh sh -c "$RUN" & else - st -e sh -c "$RUN" + sxmo_terminal.sh sh -c "$RUN" fi diff --git a/scripts/modem/sxmo_modeminfo.sh b/scripts/modem/sxmo_modeminfo.sh index 4fbcd54..a009930 100755 --- a/scripts/modem/sxmo_modeminfo.sh +++ b/scripts/modem/sxmo_modeminfo.sh @@ -11,4 +11,4 @@ modem_n() { echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2 } -st -e sh -c "mmcli -m $(modem_n) && read" +sxmo_terminal.sh sh -c "mmcli -m $(modem_n) && read" diff --git a/scripts/modem/sxmo_modemtext.sh b/scripts/modem/sxmo_modemtext.sh index 863494c..8a4d4d5 100755 --- a/scripts/modem/sxmo_modemtext.sh +++ b/scripts/modem/sxmo_modemtext.sh @@ -54,7 +54,7 @@ sendtextmenu() { fi if [ "$TERMMODE" != "true" ]; then - st -e "$EDITOR" "$DRAFT" + sxmo_terminal.sh "$EDITOR" "$DRAFT" else "$EDITOR" "$DRAFT" fi