summaryrefslogtreecommitdiff
path: root/.local/bin/quitapp
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/quitapp')
-rwxr-xr-x.local/bin/quitapp11
1 files changed, 11 insertions, 0 deletions
diff --git a/.local/bin/quitapp b/.local/bin/quitapp
new file mode 100755
index 0000000..60a8644
--- /dev/null
+++ b/.local/bin/quitapp
@@ -0,0 +1,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
+