nix-files/hosts/common/programs/rofi/rofi-snippets
Colin c50a4d1d71 static-nix-shell: fix mkBash scripts to actually be invokable from the CLI
they need the `bash` package! how did this work before?
2024-06-15 07:42:04 +00:00

15 lines
628 B
Plaintext
Executable File

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash -p gnused -p rofi -p wtype
# "bookmarking"/snippets inspired by Luke Smith:
# - <https://www.youtube.com/watch?v=d_11QaTlf1I>
# rofi flags (see: `man rofi-dmenu`):
# `-i`: case insensitive filtering
# `-sync -ellipsize-mode middle`: for lengthy entries, replace the *middle* with an ellipsis instead of the end
# requires rofi 1.7.6, and `-sync`, wich must come *before* the `-dmenu` flag
cat ~/.config/rofi-snippets/public.txt ~/.config/rofi-snippets/private.txt | \
rofi -sync -ellipsize-mode middle -dmenu -i | \
sed -z -e 's/ *#.*$//' -e 's/\n$//' | \
wtype -