swaywm / sway

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

Launching applications with `$exec`, defined as `set $exec exec`, does not work #7718

Open dev-forty-two opened 1 year ago

dev-forty-two commented 1 year ago

I am trying to have a shared config file between i3 and sway, containing most of my keybindings, list of startup applications, etc., which is added to my main i3/sway config files via include directives. In my main i3 config file, I have shorthand variables $exec and $exec_always defined as follows:

set $exec exec --no-startup-id
set $exec_always exec_always --no-startup-id

Then in the shared config, I call $exec instead of exec --no-startup-id. This works perfectly in i3.

In my main sway config file, I tried to define

set $exec exec
set $exec_always exec_always

in order to be able to use the shared config file. It does work when used in keybindings. For example,

bindsym $mod+Return $exec alacritty

works perfectly --- if I press $mod+Return, alacritty does launch. However, for launching applications directly, it does not work. For example,

$exec thunderbird

does not work. This seems to be incompatible with i3's behavior.

dankcatlord commented 11 months ago

AFAIK, --no-startup-id is simply ignored on sway #194 but I don't see why $exec variable wouldn't work.

zDEFz commented 10 months ago

Came across this issue today. Super annoying as I made my configuration in i3 and now its not working in sway. I can reproduce the behavior.

Why would you do that in the first place? Well, for instance, set $ensi exec --no-startup-id helps cause then you just call $ensi firefox. It is much shorter and helps for readability.