summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/sxhkd/sxhkdrc3
-rwxr-xr-x.local/bin/quitapp11
2 files changed, 13 insertions, 1 deletions
diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc
index be0e7c0..e35821f 100644
--- a/.config/sxhkd/sxhkdrc
+++ b/.config/sxhkd/sxhkdrc
@@ -27,7 +27,8 @@ super + shift + q
dwmc quit
## Quit Current/focused App
super + q
- kill -15 `xdotool getwindowfocus getwindowpid`
+ quitapp
+ # kill -15 `xdotool getwindowfocus getwindowpid`
## Toggle the dwm bar
super + b
dwmc togglebar
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
+