From 0c6cc8103834f6ac3ec91cbec2e5eae69fd2a9e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Thu, 21 Jan 2021 21:59:27 +0100 Subject: #33 Only print resulting command if the output is being redirected --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index e69d22f..07ef6a5 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,15 @@ You can override the default icons/glyphs by setting the appropriate GLYPH_ vari set $menu exec $term --class=launcher -e env GLYPH_COMMAND="" GLYPH_DESKTOP="" GLYPH_PROMPT="? " sway-launcher ``` +By default, the launcher will use a generic & WM-agnostic command to launch the selected program. +However, it will detect if its output is being piped to another program and merely print +the selected command in that case - instead of launching it by itself. You can use this to integrate the launcher with other tools. +For example, if you wish to launch your programs with `swaymsg exec`, you can do that like this: + +```shell + swaymsg exec "$(./sway-launcher-desktop.sh)" +``` + ### Setup a Terminal command Some of your desktop entries will probably be TUI programs that expect to be launched in a new terminal window. Those entries have the `Terminal=true` flag set and you need to tell the launcher which terminal emulator to use. Pass the `TERMINAL_COMMAND` environment variable with your terminal startup command to the script to use your preferred terminal emulator. The script will default to `$TERM -e` -- cgit v1.2.3