2022-05-28 01:39:17 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Search through open programs and switch to their tag
|
|
|
|
application=$(
|
|
|
|
# List all running programs
|
|
|
|
xlsclients |\
|
|
|
|
# Fix Virtualbox and LibreOffice
|
|
|
|
sed -e 's/.*VirtualBox/foobar virtualbox/g' -e 's/.*soffice/foobar libreoffice/g' |\
|
|
|
|
# Remove flash from results
|
|
|
|
grep -v "plugin-container" |\
|
|
|
|
# Show only app-names
|
|
|
|
cut -d" " -f3 |\
|
|
|
|
# Pipe to dmenu ($@ to include font settings from dwm/config.h)
|
2022-05-28 01:56:42 +02:00
|
|
|
dmenu -i -p " window:" $@
|
2022-05-28 01:39:17 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
# Switch to chosen application
|
|
|
|
case $application in
|
|
|
|
gimp | truecrypt)
|
|
|
|
xdotool search --onlyvisible -classname "$application" windowactivate &> /dev/null
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
xdotool search ".*${application}.*" windowactivate &> /dev/null
|
|
|
|
;;
|
|
|
|
esac
|