Add support for directories with spaces
Add support for directories with spaces when launching the scratchpad-terminal. NOTE: The exact same command but with 6 backlashes instead of 8 seems to work just fine. That makes no sense in my head. Either I'm missing something or there is a bug in the escaping of backslashes in i3.
This commit is contained in:
@@ -217,10 +217,12 @@ for_window [class="st-256color" title="^scratchpad-terminal$"] \
|
|||||||
resize set 1600 900, \
|
resize set 1600 900, \
|
||||||
border none, \
|
border none, \
|
||||||
move position center
|
move position center
|
||||||
# hide scratchpad-terminal again when restarting i3
|
# Hide scratchpad-terminal again when restarting i3
|
||||||
exec_always i3-msg '[class="St" title="^scratchpad-terminal$"] scratchpad show'
|
exec_always i3-msg '[class="St" title="^scratchpad-terminal$"] scratchpad show'
|
||||||
# show scratchpad-terminal or create one if none exists
|
# Show scratchpad-terminal or create one if none exists
|
||||||
bindsym $mod+comma exec ~/.config/i3/scratchpad-terminal.sh -s -c st-256color -n scratchpad-terminal -e 'st -d "$(xcwd)"'
|
# Pass current working directory of the focused window but escape spaces.
|
||||||
|
# Layers of escaping: i3, sh, sed
|
||||||
|
bindsym $mod+comma exec /bin/sh -c '~/.config/i3/scratchpad-terminal.sh -s -c st-256color -n scratchpad-terminal -e -- st -d $(xcwd | sed "s/ /\\\\\\\\ /g")'
|
||||||
# hide scratchpad-terminal indepedent of where the focus sits
|
# hide scratchpad-terminal indepedent of where the focus sits
|
||||||
bindsym $mod+Shift+comma exec ~/.config/i3/scratchpad-terminal.sh -h -c st-256color -n scratchpad-terminal
|
bindsym $mod+Shift+comma exec ~/.config/i3/scratchpad-terminal.sh -h -c st-256color -n scratchpad-terminal
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,11 @@ while getopts "c:e:hn:s" FLAGS; do
|
|||||||
*) exit 1;;
|
*) exit 1;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
shift $(($OPTIND - 1 ))
|
shift $(($OPTIND - 1))
|
||||||
|
|
||||||
|
if [ "$COMMAND" = "--" ]; then
|
||||||
|
COMMAND="$@"
|
||||||
|
fi
|
||||||
|
|
||||||
[ -n "$W_CLASS" ] || return 1
|
[ -n "$W_CLASS" ] || return 1
|
||||||
[ -n "$W_NAME" ] || return 1
|
[ -n "$W_NAME" ] || return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user