diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2023-03-13 10:43:52 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2023-03-13 10:43:52 +0800 |
commit | 3b396b67111ecf963716d70ac5ee93a1522fef5e (patch) | |
tree | 5459d9e0233308e3594ca2f614f9a137c984e608 /X11/ask_before_close.sh | |
parent | f5c7e048fb6b0a3e5f22c0edf31c34911fb326d1 (diff) |
Update
Diffstat (limited to 'X11/ask_before_close.sh')
-rwxr-xr-x | X11/ask_before_close.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/X11/ask_before_close.sh b/X11/ask_before_close.sh new file mode 100755 index 0000000..7dfeda8 --- /dev/null +++ b/X11/ask_before_close.sh | |||
@@ -0,0 +1,10 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | current_window=$(xdotool getactivewindow) | ||
4 | |||
5 | if [ $(xdotool getwindowclassname $current_window) = CONFIRM_BEFORE_CLOSE ]; then | ||
6 | zenity --question --text "Are you sure you want to close this window?" || \ | ||
7 | exit 1 | ||
8 | fi | ||
9 | |||
10 | xdotool windowkill $current_window | ||