swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.66k stars 1.11k forks source link

Double escape character in config #426

Closed dotlambda closed 8 years ago

dotlambda commented 8 years ago

I'd like to do something like

set $bg #101b2a
set $fg #dcdccc
set $dmenu dmenu -fn ProFont-11 -nb \\$bg -nf \\$fg -sb \\$fg -sf \\$bg
set $menu j4-dmenu-desktop --dmenu="$dmenu" --term="$term"

But sway won't let me double escape a variable.

mikkeloscar commented 8 years ago

What is this supposed to achieve?

dotlambda commented 8 years ago

I want to run j4-desktop-menu calling dmenu (corrected from dmenu_run) with the specified colors that I also use in other places in the config. I think I made it work:

set $dmenu 'dmenu -fn ProFont-11 -nb "$bg" -nf "$fg" -sb "$fg" -sf "$bg"'
set $menu j4-dmenu-desktop --dmenu=$dmenu --term=urxvt

But having a possibility to write a single backslash in front of a variable would still be nice:

set $color #ffffff
set $menu dmenu_run -nf \\$color

should result in $menu containing dmenu -nf \#ffffff (without the backslash the # indicates a comment I guess)