aboutsummaryrefslogtreecommitdiffhomepage
path: root/X11/ask_before_close.sh
blob: 7dfeda8bf1bd8a36984b9c44d296245a9bfd4dad (plain)
1
2
3
4
5
6
7
8
9
10
#! /bin/sh

current_window=$(xdotool getactivewindow)

if [ $(xdotool getwindowclassname $current_window) = CONFIRM_BEFORE_CLOSE ]; then
  zenity --question --text "Are you sure you want to close this window?" || \
  exit 1
fi

xdotool windowkill $current_window