From 3676f88e2342453e2a0f4fdf5512cebe3a986560 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 10 Mar 2017 17:27:37 -0800 Subject: [PATCH] [Linux] Add rofi_command.sh --- dotfiles/lib/bin/rofi_command.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 dotfiles/lib/bin/rofi_command.sh diff --git a/dotfiles/lib/bin/rofi_command.sh b/dotfiles/lib/bin/rofi_command.sh new file mode 100755 index 00000000..b5dc5a1a --- /dev/null +++ b/dotfiles/lib/bin/rofi_command.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +function get_all_commands { + IFS=: + for exec_path in $PATH; do + test -r "$exec_path" && \ + find "$exec_path" -maxdepth 1 -executable ! -type d -printf "%f\n" + done +} + +selected=$(get_all_commands | rofi -dmenu -i) +"$selected"