dotfiles/.config/dmenu/dmenu_run
2022-05-28 01:56:42 +02:00

30 lines
648 B
Bash
Executable File

#!/bin/bash
list_binaries() {
binaries=0
path_binaries=${PATH}
count_path=1
while [ ${binaries} -eq 0 ] ; do
current_path=$(echo ${path_binaries} | cut -d ":" -f ${count_path})
if [ -z "${current_path}" ] ; then
binaries=1
else
ls -1 ${current_path}/
count_path=$(expr ${count_path} + 1)
fi
done
}
list_binaries_icons() {
list_binaries | while read current_binary ; do
echo "${current_binary}"
done
}
#list_output=$(list_binaries | dmenu "$@")
#${list_output}
list_output=$(list_binaries_icons | dmenu "$@" -p " run:")
run_output=$(echo "${list_output}" | cut -c4-999)
${run_output}