From d7128cd444fce3129a78e08fe643978fb25c3846 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 6 Jan 2015 13:17:44 -0500 Subject: wmii: think harder about when to fork --- .config/wmii-hg/config.sh | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to '.config/wmii-hg') diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index 437c585..f7ea3f7 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -51,7 +51,7 @@ Event() { done < <(lstags) # Run the autostart action - Action autostart 2>/dev/null & + Action autostart ;; WmiircQuit) ## No args echo ' ==> Stopping wmiirc' @@ -218,24 +218,22 @@ Key() { ## Running programs $MODKEY-a) ## Open wmii actions menu - Action $(path_ls $WMII_CONFPATH | wimenu -h "${HIST}.actions" -n 5000) & ;; + local action="$(path_ls $WMII_CONFPATH | wimenu -h "${HIST}.actions" -n 5000)" + Action "$action" & ;; $MODKEY-x) ## Open program menu - (PATH=$_PATH exec setsid $(path_ls $PATH | wimenu -h "${HIST}.progs" -n 5000)) & ;; + local command="$(path_ls $PATH | wimenu -h "${HIST}.progs" -n 5000)" || return + ( PATH=$_PATH exec setsid $command ) & ;; $MODKEY-Return) ## Launch a terminal - (PATH=$_PATH exec setsid x-terminal-emulator) & ;; + ( PATH=$_PATH exec setsid x-terminal-emulator ) & ;; ## Tag actions $MODKEY-t) ## Change to another tag - { - tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return - echo view $tag >> $WMII_DIR/ctl - }& ;; + local tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return + echo view "$tag" >> $WMII_DIR/ctl;; $MODKEY-Shift-t) ## Retag the selected client - sel=$(sed 1q $WMII_DIR/client/sel/ctl) - { - tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return - echo "$tag" >> $WMII_DIR/client/$sel/tags - }& ;; + local sel=$(sed 1q $WMII_DIR/client/sel/ctl) + local tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return + echo "$tag" >> $WMII_DIR/client/$sel/tags;; esac } -- cgit v1.2.3-2-g168b