dotfiles/.config/zsh/.zlogout

22 lines
506 B
Text
Raw Normal View History

2024-08-08 12:55:12 +02:00
#!/bin/zsh
# Clear clipboard
if [[ -n $WAYLAND_DISPLAY ]]; then
wl-copy -c
cliphist wipe
fi
# Kill ssh-agent if it's the only opened session for this user
if [[ $(who | grep "$USER" | wc -l) -le 1 ]]; then
ssh-add -D
pkill -u "$USER" -9 ssh-agent
fi
if [[ -n $HYPRLAND_INSTANCE_SIGNATURE ]]; then
HYPRCMDS=$(hyprctl -j clients | jq -j '.[] | "dispatch closewindow address:\(.address); "')
hyprctl -q --batch "$HYPRCMDS"
hyprctl dispatch exit
fi
loginctl terminate-session $XDG_SESSION_ID