From df3495a160878fd28e3642b47087024429bd512f Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Wed, 27 Jul 2022 15:00:05 +0100 Subject: Fix window workspaces in drun mode. Previously, tofi-drun would print the filename of the selected .desktop file to stdout. This could then be passed to `xargs swaymsg exec gio launch` to be executed. The problem is that this ends up defeating the purpose of passing the command to swaymsg exec, and the workspace the command was selected on may not be the one that it starts up on, if for example it takes a long time and the user switches workspaces in the meantime. The solution is to instead print the Exec= line from the .desktop file, and pass that directly to `xargs swaymsg exec --` for execution. To avoid too much breaking of configs for the few people who use tofi currently, this commit adds a new option, --drun-print-exec, to enable the fixed behaviour. A future release will change this to be the default, however. --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index b16bdcc..c5152f5 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,12 @@ executables under the user's `$PATH`. list of applications found in desktop files as described by the [Desktop Entry Specification](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html). +**WARNING**: Currently, when a selection is made in drun mode, the +filename of the selected desktop file is printed to stdout. In the next +version of tofi, this will change to an executable command line, to be +passed to swaymsg exec or similar. The new behaviour can be enabled now +by passing --drun-print-exec=true to tofi-drun. + To use as a launcher for Sway, add something similar to the following to your Sway config file: ``` @@ -67,7 +73,7 @@ bindsym $mod+d exec $menu For `tofi-drun`, there are two possible methods: ``` # Launch via Sway -set $drun tofi-drun | xargs swaymsg exec gio launch +set $drun tofi-drun --drun-print-exec=true | xargs swaymsg exec -- bindsym $mod+Shift+d exec $drun # Launch directly -- cgit v1.2.3