dmenu-scripts/dmenu_wrun

35 lines
1.2 KiB
Plaintext
Raw Normal View History

2022-05-29 15:49:43 +02:00
#!/bin/bash
################################################################
# dmenu_wrun - dmenu script that simulates 'rofi -show window' #
# #
# Author: q3aql <q3aql@duck.com> #
# Last update: 29-05-2022 #
################################################################
list_applications() {
list_raw=$(xlsclients | cut -d " " -f 3 | sed -e 's/soffice/libreoffice/g')
for process in ${list_raw}; do
echo "${process}"
done
}
list_applications_icons() {
list_applications | while read current_app ; do
echo " ${current_app}"
done
}
list_output=$(list_applications_icons | dmenu "$@" -p " window:")
run_output=$(echo ${list_output} | cut -c 4-999)
if [ "${run_output}" == "gimp" ] ; then
xdotool search --onlyvisible -classname "${run_output}" windowactivate &> /dev/null
elif [ "${run_output}" == "gimp-2.10" ] ; then
xdotool search --onlyvisible -classname "${run_output}" windowactivate &> /dev/null
elif [ "${run_output}" == "truecrypt" ] ; then
xdotool search --onlyvisible -classname "${run_output}" windowactivate &> /dev/null
else
xdotool search ".*${run_output}.*" windowactivate &> /dev/null
fi