This repository was archived by the owner on May 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -28,24 +28,29 @@ function load_theme() {
28
28
fi
29
29
}
30
30
31
- function list_applications() {
32
- list_raw=$( xlsclients | cut -d " " -f 3 | sed -e ' s/soffice/libreoffice/g' )
33
- for process in ${list_raw} ; do
34
- echo " ${process} "
35
- done
31
+ function check_wmctrl() {
32
+ wmctrl -h & > /dev/null
33
+ error=$?
34
+ if [ ${error} -ne 0 ] ; then
35
+ echo " Error: You need install 'wmctrl'" | dmenu -i -nb " ${NBCOLOR} " -nf " ${NFCOLOR} " -sb " ${SBCOLOR} " -sf " ${SFCOLOR} " -l 18 -p " window:"
36
+ exit
37
+ fi
36
38
}
37
39
38
40
function list_applications_icons() {
39
- list_applications | while read current_app ; do
41
+ wmctrl -l | while read current_app ; do
40
42
echo " ${current_app} "
41
43
done
42
44
}
43
45
44
46
load_theme
47
+ check_wmctrl
45
48
list_output=$( list_applications_icons | dmenu -i -nb " ${NBCOLOR} " -nf " ${NFCOLOR} " -sb " ${SBCOLOR} " -sf " ${SFCOLOR} " -l 18 -p " window:" )
46
49
run_output=$( echo ${list_output} | cut -c 5-999)
50
+ echo " # Selected: ${run_output} "
51
+ run_output=$( echo " ${run_output} " | cut -d " " -f 1)
47
52
if [ -z " ${run_output} " ] ; then
48
53
echo " # Selection window canceled"
49
54
else
50
- xdotool search " .* ${run_output} .* " windowactivate & > /dev/null
55
+ wmctrl -ia " ${run_output} " & > /dev/null
51
56
fi
You can’t perform that action at this time.
0 commit comments