Created
October 25, 2018 12:33
-
-
Save mguentner/3142a6eba5e0f6fb4b3479103cfb5a7f to your computer and use it in GitHub Desktop.
a script that kills either tmux or the respective focused window. For use with i3 or other window managers
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
bindsym --release $mod+q exec --no-startup-id /home/anon/bin/kill.sh |
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 | |
ID=$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') | |
CLASS=$(xprop -id $ID | grep WM_CLASS | cut -d= -f 2 | cut -d\" -f 2) | |
PID=$(xprop -id $ID | grep WM_PID | cut -d= -f 2) | |
if [[ "$CLASS" == "Alacritty"* ]]; then | |
IDINT=$(printf "%d" "$ID") | |
xdotool key --window $IDINT --clearmodifiers "ctrl+b" type --clearmodifiers --window $IDINT "&y" | |
else | |
kill $PID | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment