Skip to content

Instantly share code, notes, and snippets.

@wknapik
Last active January 24, 2020 16:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wknapik/5101aaea12172eff6ab6b2fb7666143c to your computer and use it in GitHub Desktop.
Save wknapik/5101aaea12172eff6ab6b2fb7666143c to your computer and use it in GitHub Desktop.
An application launcher with fuzzy search via fzy (fzf would also work)
#!/usr/bin/env bash
# Requirements: bash, coreutils, fzy, xdotool, xterm.
#
# Position and decorations can be set in i3 with something like:
# for_window [class="^FuzzyRun"] floating enable border none move position center
#
# Either `-fullscreen', or `-geometry' should be used. With both in place,
# `-fullscreen' takes precedence.
xdotool search --class FuzzyRun windowactivate ||
exec xterm -class FuzzyRun \
-fullscreen -geometry "50x45+-9+0" -fa "TerminessTTF Nerd Font Mono" \
-bg black -bd black -fg gray -bw 0 -b 0 +sb -ls -title "" \
-e bash -c 'exec nohup "$(compgen -c|sort -u|fzy -p "run >> " -l 100)" </dev/null >/dev/null' &
@AcarBurak
Copy link

Brilliant; thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment