aboutsummaryrefslogtreecommitdiff
path: root/bin/safequit
diff options
context:
space:
mode:
Diffstat (limited to 'bin/safequit')
-rwxr-xr-xbin/safequit14
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/safequit b/bin/safequit
new file mode 100755
index 0000000..6b366ba
--- /dev/null
+++ b/bin/safequit
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+FOCUSED=$(swaymsg -t get_tree | jq -r '.. | (.nodes? // empty)[] | select(.focused) | .name')
+
+main() {
+ echo "$FOCUSED"
+ if [[ "$FOCUSED" == neovim* ]]; then
+ notify-send "pls dont kill neovims like this"
+ exit 0
+ fi
+
+ swaymsg kill
+}
+
+main "$@"