dotfiles/.config/dmenu/dmenu_run

30 lines
634 B
Plaintext
Raw Normal View History

2022-05-26 23:26:07 +02:00
#!/bin/bash
2022-05-26 21:38:45 +02:00
2022-05-26 23:26:07 +02:00
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
2022-05-26 21:38:45 +02:00
}
2022-05-26 23:26:07 +02:00
list_binaries_icons() {
list_binaries | while read current_binary ; do
echo " ${current_binary}"
done
}
#list_output=$(list_binaries | dmenu "$@")
2022-05-26 23:56:27 +02:00
#${list_output}
2022-05-26 23:26:07 +02:00
list_output=$(list_binaries_icons | dmenu "$@")
2022-05-26 23:56:27 +02:00
run_output=$(echo "${list_output}" | cut -c4-999)
${run_output}