diff options
| author | Alec Goncharow <alec@goncharow.dev> | 2024-01-12 08:48:32 -0500 |
|---|---|---|
| committer | Alec Goncharow <alec@goncharow.dev> | 2024-01-12 08:48:32 -0500 |
| commit | 803274ed25384b4ffb134f35c910347c022999fd (patch) | |
| tree | 7ae72fc76bedac20c36e289afcbad0bb250369b7 /bin/safequit | |
| parent | 7ccc0f409ededaf3a19395f1bc1fb5e2686c37a0 (diff) | |
binding exploration
Diffstat (limited to 'bin/safequit')
| -rwxr-xr-x | bin/safequit | 14 |
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 "$@" |
