From fd7c65f8ff7b90be0bd97a39aed6fb06541a1089 Mon Sep 17 00:00:00 2001 From: Louis-Michel Raynauld Date: Thu, 9 May 2019 12:58:41 -0700 Subject: [PATCH] Fix for spawning scripts that require no args For example, "ddspawn vifm" is generating the failing commad "st vifm -e vifm" without this fix. This proposed change fixes this issue so that "ddspawn vifm" generates the correct "st -e vifm". It also simplify the i3 command in my view. Thanks for sharing this helpful script, I used it everywhere! --- .scripts/i3cmds/ddspawn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/i3cmds/ddspawn b/.scripts/i3cmds/ddspawn index ef86abf..3a616b8 100755 --- a/.scripts/i3cmds/ddspawn +++ b/.scripts/i3cmds/ddspawn @@ -13,5 +13,5 @@ then i3 "[instance=\"dropdown_$1\"] scratchpad show; [instance=\"dropdown_$1\"] move position center" else echo "Window not detected... spawning." - i3 "exec --no-startup-id $TERMINAL -n dropdown_$1 $(echo "$@" | cut -d ' ' -f2-) -e $1" + i3 "exec --no-startup-id $TERMINAL -n dropdown_$1 ${@:2} -e $1" fi