added keystroke to toggle xnots on and off

This commit is contained in:
Rudis Muiznieks 2022-08-10 12:50:12 -05:00
parent 8787ace8c0
commit d79f346551
Signed by: rudism
GPG Key ID: CABF2F86EF7884F9
2 changed files with 24 additions and 5 deletions

22
bin/xnots-toggle Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env bash
running=$(pgrep xnots)
curtag=$(herbstclient attr tags.focus.name)
if [ -z "$running" ]; then
exec xnots
else
visible=
for winid in $(xdotool search --class XNots); do
hcid=$(printf "0x%x" "$winid")
if [ -z "$visible" ]; then
visible=$(herbstclient attr clients."$hcid".visible)
fi
wintag=$(herbstclient attr clients."$hcid".tag)
if [ "$visible" = false ] || [ "$wintag" != "$curtag" ]; then
herbstclient bring "$winid"
else
herbstclient set_attr clients."$hcid".minimized true
fi
done
fi

View File

@ -16,10 +16,6 @@ if hc silent new_attr bool my_picom_is_running; then
picom -b
fi
if command -v xnots >/dev/null && hc silent new_attr bool my_xnots_is_running; then
xnots &
fi
hc lock
xsetroot -solid "#1e1e2e" -cursor_name left_ptr &
feh --bg-fill ~/.config/herbstluftwm/wallpaper.png
@ -66,6 +62,7 @@ hc keybind $Mod-Control-r reload
hc keybind $Mod-Shift-c close
hc keybind $Mod-Return spawn st
hc keybind $Mod-grave spawn $HOME/skynet/bin/quake-term
hc keybind $Mod-Control-grave spawn $HOME/skynet/bin/xnots-toggle
hc keybind $Mod-Alt-Return spawn ~/skynet/bin/zenvim
hc keybind $Mod-Control-Return spawn firefox
hc keybind Print spawn flameshot gui
@ -159,7 +156,7 @@ hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
hc rule class='nvim-zen' fullscreen=on
hc rule class='mpv' floating=on
hc rule class='sim_arduboy' floating=on
hc rule class='XNots' floating=on tag=8
hc rule class='XNots' floating=on
hc set tree_style '╾│ ├└╼─┐'