aboutsummaryrefslogtreecommitdiff
path: root/bin/safequit
diff options
context:
space:
mode:
authorAlec Goncharow <alec@goncharow.dev>2024-01-12 08:48:32 -0500
committerAlec Goncharow <alec@goncharow.dev>2024-01-12 08:48:32 -0500
commit803274ed25384b4ffb134f35c910347c022999fd (patch)
tree7ae72fc76bedac20c36e289afcbad0bb250369b7 /bin/safequit
parent7ccc0f409ededaf3a19395f1bc1fb5e2686c37a0 (diff)
binding exploration
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 "$@"