From 933ef2b736af0391aa4a17ce96bd984e8292107e Mon Sep 17 00:00:00 2001 From: Anjandev Momi Date: Thu, 4 Jun 2020 21:26:18 -0700 Subject: [PATCH] appmenu: added support for user scripts in $XDG_CONFIG_HOME/sxmo/userscripts Signed-off-by: Miles Alan --- scripts/core/sxmo_appmenu.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/core/sxmo_appmenu.sh b/scripts/core/sxmo_appmenu.sh index f2dec1b..aa102eb 100755 --- a/scripts/core/sxmo_appmenu.sh +++ b/scripts/core/sxmo_appmenu.sh @@ -9,6 +9,7 @@ programchoicesinit() { CHOICES="$(echo " Scripts ^ 0 ^ sxmo_appmenu.sh scripts Apps ^ 0 ^ sxmo_appmenu.sh applications + $([ -d $XDG_CONFIG_HOME/sxmo/userscripts ] && [ -n "$(ls -A $XDG_CONFIG_HOME/sxmo/userscripts)" ] && echo 'Userscripts ^ 0 ^ sxmo_appmenu.sh userscripts') Volume ↑ ^ 1 ^ sxmo_vol.sh up Volume ↓ ^ 1 ^ sxmo_vol.sh down Dialer ^ 0 ^ sxmo_modemcall.sh dial @@ -20,6 +21,12 @@ programchoicesinit() { Logout ^ 0 ^ pkill -9 dwm ")" && WINNAME=Sys + # Userscripts menu + echo $WMCLASS | grep -i "userscripts" && + CHOICES="$(ls -1 $XDG_CONFIG_HOME/sxmo/userscripts | sed 's/ /\\ /' | + awk '{printf "%s\t^ 0 ^ sh $XDG_CONFIG_HOME/sxmo/userscripts/%s \n", $0, $0}')" && + WINNAME=Userscripts && return + # Apps menu echo $WMCLASS | grep -i "applications" && CHOICES="$(echo " Surf ^ 0 ^ surf