How to assign whole commands to variables?
The screenshot part of my config:
set $ftsc jpg
set $selsc import $SCREENSHOT.$ftsc
set $selfsc import -window root $SCREENSHOT.$ftsc
set $editsc pinta $SCREENSHOT.$ftsc
set $uplsc imup $SCREENSHOT.$ftsc | loliclip -c
set $kselfsc Control
set $keditsc Shift
set $kuplsc Mod1
bindsym Print $selsc
bindsym $keditsc+Print $selsc && $editsc
bindsym $kselfsc+Print $selfsc
bindsym $kselfsc+$keditsc+Print $selfsc && $editsc
bindsym $kuplsc+Print $selsc && $uplsc
bindsym $kuplsc+$kselfsc+Print $selfsc && $uplsc
Only problem: It doesn’t work:
ERROR: Expected one of these tokens: <end>, '[', 'move', 'exec', 'exit', 'restart', 'reload', 'border', 'layout', 'append_layout', 'workspace', 'focus', 'kill', 'open', 'fullscreen', 'split', 'floating', 'mark', 'resize', 'rename', 'nop', 'scratchpad', 'mode'
ERROR: Your command: import $SCREENSHOT.$ftsc
ERROR: ^^^^^^^^^^^^^^^^^^^^^^^^
This looks suspiciously like variables can’t take any spaces, which is rather unfortunate.
Is there any way to do this? I want to keep this DRY.
add a comment