1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2025-07-01 10:29:26 +00:00

Add script to switch window states between active/minimize and use it when clicking Spotify module

This commit is contained in:
2019-08-06 16:25:59 +02:00
parent 6e6445203c
commit 7a6d7ca172
3 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,22 @@
#!/bin/bash
set -e
[[ -z $1 ]] && exit 1
active_window=$(xdotool getactivewindow)
window=$(xdotool search --name "$1")
[[ $? -ne 0 ]] && exit 1
if [[ $active_window == $window ]]; then
xdotool windowminimize $window
else
xdotool windowactivate $window
fi
exit 0