openSUSE / openSUSEway

dotfiles for Sway on openSUSE
MIT License
82 stars 17 forks source link

Use late evaluation of $term variable for bindsym $mod+Return #46

Closed mcepl closed 3 years ago

mcepl commented 3 years ago

So that an user can set different terminal application (or use different options for alacritty).

denisok commented 3 years ago

oh, cool - how it works ?

mcepl commented 3 years ago

oh, cool - how it works ?

Lovely, with

set $term alacritty --config-file ~/.config/alacritty/alacritty.yml

in ~/.config/sway/config.d/10-variables.conf I use my personal configuration for alacritty.

denisok commented 3 years ago

cool, could you please point me to the double $$ definition ?

mcepl commented 3 years ago

cool, could you please point me to the double $$ definition ?

sway(5):

set $<name> <value>
           Sets variable $name to value. You can use the new variable in the arguments of future commands.
When the variable is used, it can be escaped with an additional $ (ie $$name) to have the replacement happen
at run time instead of when reading the config. However, it does not always make sense for the variable to be
replaced at run time since some arguments do need to be known at config time.
denisok commented 3 years ago

Thanks for educating me! :)