const?
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
- Using FZF instead of DMENU
- fzf-dmenu - App Launcher - Linux TUI
- fzf-menu
- Uniting Interfaces: dmenu and fzf
- dmenu-suite
- Why use “nohup &” rather than “exec &"
- Run bash script as daemon