From 463bfb8291cc6824a2ea188feeb869fb7d167513 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Thu, 30 Mar 2023 07:38:32 -0700 Subject: [PATCH] sway: stop passing commands from rofi to swaymsg exec There are issues with escaping and arguments splitting that we're unable to solve at the moment. For example, `.desktop` files with whitespaces and other characters treated specially by Sway in the `Exec=` field are known to be broken[1][2]. Removing `-run-command`/`-run-shell-command` costs us pid-based workspace assignment. I.e. the applications that take a while to load will appear on the current workspace instead of the one they were launched on. That is at least partially mitigated by the fact that the app will inherit `XDG_ACTIVATION_TOKEN` and `DESKTOP_STARTUP_ID` variables created for for `exec rofi` command with a default lifetime of 30s[3]. But not all applications or UI frameworks support that. This could be revisited later, once we have a solution that correctly escapes the command to pass it through `swaymsg exec`. [1]: https://i3wm.org/docs/userguide.html#exec_quoting [2]: https://github.com/swaywm/sway/issues/5931 [3]: https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/0.16/types/wlr_xdg_activation_v1.c#L361 --- sway/config.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/sway/config.in b/sway/config.in index 7ad1ec2..6e57ce5 100644 --- a/sway/config.in +++ b/sway/config.in @@ -21,8 +21,6 @@ set $term foot # on the original workspace that the command was run on. # Recommends: rofi-wayland set $rofi_cmd rofi \ - -run-command 'swaymsg -q exec -- {cmd}' \ - -run-shell-command 'swaymsg -q exec -- {terminal} -e {cmd}' \ -terminal '$term' # Shows a combined list of the applications with desktop files and # executables from PATH.