github soundcloud
FZF
Dec 9, 2018
One minute read

Since I already have dmenu, I use dmenu_path to list everything in $PATH (with the added benefit of some cache magic). You can use any other method you like.

selection=$(dmenu_path | fzf)
nohup "$selection" > /dev/null 2>&1 &

Here we redirect stderr to stdout so we can dump it all to /dev/null. If we don’t do this, nohup will write to $PWD/nohup.out, which is no fun.

There’s more than one way to do it.

With i3wm you can do this:

selection=$(dmenu_path | fzf)
i3-msg exec "$selection"

With setsid:

selection=$(dmenu_path | fzf)
setsid "$selection" >/dev/null 2>&1 < /dev/null &

If you enjoy stuff like this, you should check out other terminal user interface tools like dialog, whiptail and zenity. These tools let you choose from glorius full screen dialog boxes, lists, input boxes, calendars and more.

inspiration


Back to posts