2024-02-28 14:44:05 +00:00
|
|
|
#!/usr/bin/env nix-shell
|
2024-06-15 07:42:04 +00:00
|
|
|
#!nix-shell -i bash -p bash -p gnused -p rofi -p wtype
|
2024-02-28 14:44:05 +00:00
|
|
|
|
|
|
|
# "bookmarking"/snippets inspired by Luke Smith:
|
|
|
|
# - <https://www.youtube.com/watch?v=d_11QaTlf1I>
|
|
|
|
|
2024-05-28 03:38:36 +00:00
|
|
|
# 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
|
2024-05-28 03:23:04 +00:00
|
|
|
cat ~/.config/rofi-snippets/public.txt ~/.config/rofi-snippets/private.txt | \
|
2024-05-28 03:38:36 +00:00
|
|
|
rofi -sync -ellipsize-mode middle -dmenu -i | \
|
2024-05-28 03:23:04 +00:00
|
|
|
sed -z -e 's/ *#.*$//' -e 's/\n$//' | \
|
|
|
|
wtype -
|