From 5a769d3fa80d71dadf5ebfcb3d933c581997a0ee Mon Sep 17 00:00:00 2001 From: Stacy Harper Date: Sun, 22 Aug 2021 13:00:11 +0200 Subject: [PATCH] Fix swmo shellcheck issues --- scripts/core/sxmo_appmenu.sh | 32 +++++++++++++++----------------- scripts/core/sxmo_postwake.sh | 6 +++--- scripts/core/sxmo_winit.sh | 2 +- scripts/core/sxmo_wmtoggle.sh | 2 -- 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/scripts/core/sxmo_appmenu.sh b/scripts/core/sxmo_appmenu.sh index 45cf5f7..be0c15b 100755 --- a/scripts/core/sxmo_appmenu.sh +++ b/scripts/core/sxmo_appmenu.sh @@ -249,6 +249,21 @@ programchoicesinit() { " WINNAME=Sxiv && return ;; + *sthotkeys* ) + # St hotkeys + CHOICES=" + Send Ctrl-C ^ 0 ^ sxmo_type -M Ctrl -k c + Send Ctrl-Z ^ 0 ^ sxmo_type -M Ctrl -k z + Send Ctrl-L ^ 0 ^ sxmo_type -M Ctrl -k l + Send Ctrl-D ^ 0 ^ sxmo_type -M Ctrl -k d + Send Ctrl-A ^ 0 ^ sxmo_type -M Ctrl -k a + Send Ctrl-B ^ 0 ^ sxmo_type -M Ctrl -k b + Send ESC:w ^ 0 ^ sxmo_type -k Escape -M Shift -k semicolon -m Shift -k w -k Return + Send ESC:wq ^ 0 ^ sxmo_type -k Escape -M Shift -k semicolon -m Shift -k w -k q -k Return + Send ESC:wq! ^ 0 ^ sxmo_type -k Escape -M Shift -k semicolon -m Shift -k q -k exclam -k Return + " + WINNAME=St + ;; *foot*|*st* ) # First we try to handle the app running inside the terminal: WMNAME="${1:-$(printf %s "$XPROPOUT" | grep title: | cut -d" " -f2- | tr '[:upper:]' '[:lower:]')}" @@ -438,21 +453,6 @@ programchoicesinit() { ;; esac fi - ;; - *sthotkeys* ) - # St hotkeys - CHOICES=" - Send Ctrl-C ^ 0 ^ sxmo_type -M Ctrl -k c - Send Ctrl-Z ^ 0 ^ sxmo_type -M Ctrl -k z - Send Ctrl-L ^ 0 ^ sxmo_type -M Ctrl -k l - Send Ctrl-D ^ 0 ^ sxmo_type -M Ctrl -k d - Send Ctrl-A ^ 0 ^ sxmo_type -M Ctrl -k a - Send Ctrl-B ^ 0 ^ sxmo_type -M Ctrl -k b - Send ESC:w ^ 0 ^ sxmo_type -k Escape -M Shift -k semicolon -m Shift -k w -k Return - Send ESC:wq ^ 0 ^ sxmo_type -k Escape -M Shift -k semicolon -m Shift -k w -k q -k Return - Send ESC:wq! ^ 0 ^ sxmo_type -k Escape -M Shift -k semicolon -m Shift -k q -k exclam -k Return - " - WINNAME=St ;; *netsurf* ) # Netsurf @@ -609,7 +609,6 @@ mainloop() { echo "$PICKED" | grep . || quit LOOP="$(echo "$PROGCHOICES" | grep -m1 -F "$PICKED" | cut -d '^' -f2)" CMD="$(echo "$PROGCHOICES" | grep -m1 -F "$PICKED" | cut -d '^' -f3)" - DMENUIDX="$(echo "$PROGCHOICES" | grep -m1 -F -n "$PICKED" | cut -d ':' -f1)" echo "sxmo_appmenu: Eval: <$CMD> from picked <$PICKED> with loop <$LOOP>">&2 if echo "$LOOP" | grep 1; then eval "$CMD" @@ -622,7 +621,6 @@ mainloop() { } pgrep -f "$(command -v sxmo_appmenu.sh)" | grep -Ev "^${$}$" | xargs -r kill -TERM -DMENUIDX=0 PICKED="" ARGS="$*" mainloop diff --git a/scripts/core/sxmo_postwake.sh b/scripts/core/sxmo_postwake.sh index 22b5d55..d2afa72 100755 --- a/scripts/core/sxmo_postwake.sh +++ b/scripts/core/sxmo_postwake.sh @@ -34,7 +34,7 @@ finish() { echo 0 > "$REDLED_PATH" echo 0 > "$BLUELED_PATH" - wait $HOOKPID + wait "$HOOKPID" # Going back to crust if [ "$(sxmo_screenlock.sh getCurState)" != "unlock" ]; then @@ -82,5 +82,5 @@ HOOKPID=$! checkstate & CHECKPID=$! -wait $SLEEPPID -wait $HOOKPID +wait "$SLEEPPID" +wait "$HOOKPID" diff --git a/scripts/core/sxmo_winit.sh b/scripts/core/sxmo_winit.sh index 207d3c8..71443ba 100644 --- a/scripts/core/sxmo_winit.sh +++ b/scripts/core/sxmo_winit.sh @@ -4,8 +4,8 @@ envvars() { # shellcheck disable=SC1091 [ -f /etc/profile ] && . /etc/profile - # shellcheck source=/dev/null export BEMENU_OPTS='--fn "Monospace 11"' + # shellcheck source=/dev/null [ -f "$HOME"/.profile ] && . "$HOME"/.profile export MOZ_ENABLE_WAYLAND=1 command -v "$TERMCMD" || export TERMCMD="foot" diff --git a/scripts/core/sxmo_wmtoggle.sh b/scripts/core/sxmo_wmtoggle.sh index 990f5df..f94427b 100644 --- a/scripts/core/sxmo_wmtoggle.sh +++ b/scripts/core/sxmo_wmtoggle.sh @@ -1,7 +1,5 @@ #!/bin/sh -wm="$(sxmo_wm.sh)" - case "$(realpath /var/lib/tinydm/default-session.desktop)" in /usr/share/wayland-sessions/swmo.desktop) sudo tinydm-set-session -f -s /usr/share/xsessions/sxmo.desktop