dotfiles/.config/zsh/.zlogout

16 lines
304 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
loginctl terminate-session $XDG_SESSION_ID