Created
June 28, 2018 10:23
-
-
Save jparrill/e8e76c8620dcd60be8b5a47a5c3b5ee3 to your computer and use it in GitHub Desktop.
Rename i3wm shell tile
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
| #!/usr/bin/env bash | |
| # Depends on: xdotool, wmctrl | |
| FOCUSED=$(wmctrl -lp | grep $(xprop -root | grep _NET_ACTIVE_WINDOW | head -1 | awk '{print $5}' | sed 's/,//' | sed 's/^0x/0x0/')) | |
| if [[ -z $FOCUSED ]]; then | |
| FOCUSED=$(wmctrl -lp | grep $(xprop -root | grep _NET_ACTIVE_WINDOW | head -1 | awk '{print $5}' | sed 's/,//' | sed 's/^0x/0x00/')) | |
| fi | |
| FPID=$(echo $FOCUSED | awk '{print $3}') | |
| FNME=$(echo $FOCUSED | cut -f -4 -d ' ' --complement) | |
| xdotool search -all --pid $FPID --name "$FNME" set_window -name "$*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment