From 231013623dff3e6eb68ab9e3883e5e2262bdab60 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Fri, 26 Jan 2024 14:20:13 -0500 Subject: Closing a firefox window no longer kills it --- .local/bin/quitapp | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 .local/bin/quitapp (limited to '.local/bin') 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 + -- cgit v1.2.3