From 44f0915ba9758a361b148fa5589f00ad349b1158 Mon Sep 17 00:00:00 2001 From: vikingowl Date: Fri, 2 Jan 2026 18:56:19 +0100 Subject: [PATCH] docs: improve dmenu examples with proper output handling - Clarify that dmenu outputs to stdout (doesn't execute) - Add screenshot menu example with | sh pattern - Use printf instead of echo -e for POSIX compliance - Add xdg-open example for opening files - Use shorter -p flag instead of --prompt --- README.md | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d830fda..9804c74 100644 --- a/README.md +++ b/README.md @@ -109,29 +109,34 @@ owlry --help # Show all options with examples ### dmenu Mode -Owlry is dmenu-compatible. Pipe input for interactive selection: +Owlry is dmenu-compatible. Pipe input for interactive selection - the selected item is printed to stdout (not executed), so you pipe the output to execute it: ```bash -# Basic selection -echo -e "Option A\nOption B\nOption C" | owlry -m dmenu - -# Select from files -ls ~/Documents | owlry -m dmenu +# Screenshot menu (execute selected command) +printf '%s\n' \ + "grimblast --notify copy screen" \ + "grimblast --notify copy area" \ + "grimblast --notify edit screen" \ + | owlry -m dmenu -p "Screenshot" \ + | sh # Git branch checkout -git branch | owlry -m dmenu --prompt "checkout:" | xargs git checkout +git branch | owlry -m dmenu -p "checkout" | xargs git checkout # Kill a process -ps -eo comm | sort -u | owlry -m dmenu --prompt "kill:" | xargs pkill +ps -eo comm | sort -u | owlry -m dmenu -p "kill" | xargs pkill # Select and open a project find ~/projects -maxdepth 1 -type d | owlry -m dmenu | xargs code # Package manager search -pacman -Ssq | owlry -m dmenu --prompt "install:" | xargs sudo pacman -S +pacman -Ssq | owlry -m dmenu -p "install" | xargs sudo pacman -S + +# Open selected file +ls ~/Documents | owlry -m dmenu | xargs xdg-open ``` -The `--prompt` flag sets a custom label for the search input. +The `-p` / `--prompt` flag sets a custom label for the search input. ### Keyboard Shortcuts