summaryrefslogtreecommitdiff
path: root/.local/bin/quitapp
blob: 60a864495a8177630216f4028e1f5d6c868882ea (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh

active_window="$(xdotool getwindowfocus)"
active_class=$(xprop -id "$active_window" WM_CLASS | awk '{print $4}')

if [ "$active_class" = '"firefox"' ]; then
    xdotool windowclose "$active_window"
else
    kill -15 "$(xdotool getwindowfocus getwindowpid)"
fi