Skip to content

Instantly share code, notes, and snippets.

@farosas
Created September 27, 2021 12:53
Show Gist options
  • Select an option

  • Save farosas/0cd50d7cd60f51a767c9a9959359690a to your computer and use it in GitHub Desktop.

Select an option

Save farosas/0cd50d7cd60f51a767c9a9959359690a to your computer and use it in GitHub Desktop.
#!/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