Created
September 27, 2021 12:53
-
-
Save farosas/0cd50d7cd60f51a767c9a9959359690a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -x | |
| exec 1>/tmp/test 2>/tmp/test | |
| if [ $# -lt 1 ] | |
| then | |
| echo "Usage: $(basename $0) executable_name" | |
| exit 1 | |
| fi | |
| win=$(wmctrl -lx | awk '/'"$1"'/ {print $1}' | cut -c4-) | |
| active_win=$(xprop -root _NET_ACTIVE_WINDOW | awk '{print $5}' | cut -c3-) | |
| if [ ${win} == ${active_win/,/} ]; then | |
| wmctrl -i -r 0x${win} -b add,skip_pager,below | |
| else | |
| wmctrl -i -r 0x${win} -b remove,skip_pager,below | |
| wmctrl -i -a 0x${win} | |
| fi | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment