Use wmctrl for show and select windows (dmenu_wrun)
This commit is contained in:
parent
23e25e5d09
commit
2defffd521
19
dmenu_wrun
19
dmenu_wrun
|
@ -28,24 +28,29 @@ function load_theme() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function list_applications() {
|
function check_wmctrl() {
|
||||||
list_raw=$(xlsclients | cut -d " " -f 3 | sed -e 's/soffice/libreoffice/g')
|
wmctrl -h &> /dev/null
|
||||||
for process in ${list_raw}; do
|
error=$?
|
||||||
echo "${process}"
|
if [ ${error} -ne 0 ] ; then
|
||||||
done
|
echo " Error: You need install 'wmctrl'" | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -l 18 -p " window:"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function list_applications_icons() {
|
function list_applications_icons() {
|
||||||
list_applications | while read current_app ; do
|
wmctrl -l | while read current_app ; do
|
||||||
echo " ${current_app}"
|
echo " ${current_app}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
load_theme
|
load_theme
|
||||||
|
check_wmctrl
|
||||||
list_output=$(list_applications_icons | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -l 18 -p " window:")
|
list_output=$(list_applications_icons | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -l 18 -p " window:")
|
||||||
run_output=$(echo ${list_output} | cut -c 5-999)
|
run_output=$(echo ${list_output} | cut -c 5-999)
|
||||||
|
echo "# Selected: ${run_output}"
|
||||||
|
run_output=$(echo "${run_output}" | cut -d " " -f 1)
|
||||||
if [ -z "${run_output}" ] ; then
|
if [ -z "${run_output}" ] ; then
|
||||||
echo "# Selection window canceled"
|
echo "# Selection window canceled"
|
||||||
else
|
else
|
||||||
xdotool search ".*${run_output}.*" windowactivate &> /dev/null
|
wmctrl -ia "${run_output}" &> /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user