2014-09-23 01:11:00 +02:00
|
|
|
#!/bin/sh
|
2014-09-22 23:00:59 +02:00
|
|
|
|
2014-09-23 01:11:00 +02:00
|
|
|
# Description: Kill all ssh connections
|
|
|
|
# Ensure to kill all ssh-agent
|
|
|
|
# Ensure to kill all gpg-agent
|
2018-01-10 16:19:54 +01:00
|
|
|
# Ensure to delete everything link to {ssh,gpg}-agent
|
|
|
|
# Ensure to kill all git-credential sockets
|
|
|
|
# Kill keepass2
|
2019-01-08 14:19:52 +01:00
|
|
|
# Remove cached password
|
|
|
|
# Remove recent files
|
2018-01-10 16:19:54 +01:00
|
|
|
# Turn off the screen
|
2014-09-23 01:11:00 +02:00
|
|
|
# Lock the screen
|
|
|
|
### Give an easy way to call this function with a keybind.
|
|
|
|
## For example with herbstluftwm: "hc keybind $Mod-Shift-c spawn ~/bin/veille.sh"
|
2014-09-22 23:00:59 +02:00
|
|
|
|
2014-09-23 01:11:00 +02:00
|
|
|
## depend: i3lock
|
2014-09-22 23:00:59 +02:00
|
|
|
|
2024-07-09 09:52:25 +02:00
|
|
|
# Lock tmux if running
|
|
|
|
pgrep tmux >/dev/null &&
|
|
|
|
tmux lock-client
|
|
|
|
|
2024-03-13 12:20:24 +01:00
|
|
|
# SSH Agent
|
|
|
|
killall --quiet ssh
|
2023-02-26 20:06:47 +01:00
|
|
|
rm --recursive --force -- ~/.ssh/socks/*
|
2018-01-10 16:19:54 +01:00
|
|
|
|
2024-03-13 12:20:24 +01:00
|
|
|
# SSH Agent - default path
|
|
|
|
killall --quiet ssh-agent
|
2023-02-26 20:06:47 +01:00
|
|
|
rm --recursive --force -- /tmp/ssh-*
|
2018-01-10 16:19:54 +01:00
|
|
|
|
2014-09-23 01:11:00 +02:00
|
|
|
# GPG Agent
|
2024-03-18 11:32:54 +01:00
|
|
|
command -v keychain && keychain --agents gpg --clear
|
2023-04-30 13:07:27 +02:00
|
|
|
pkill --uid="$(id -u)" -- "gpg-agent"
|
2018-01-10 16:19:54 +01:00
|
|
|
|
2024-03-13 12:20:24 +01:00
|
|
|
# Keychain - Delete everything link to ssh-agent or gpg-agent
|
|
|
|
test -d ~/.keychain && rm --recursive --force -- ~/.keychain/*
|
2018-01-10 16:19:54 +01:00
|
|
|
|
|
|
|
# git-credential sockets
|
2023-04-30 13:07:27 +02:00
|
|
|
pkill --uid="$(id -u)" --full -- "git-credential-cache"
|
2023-02-26 20:06:47 +01:00
|
|
|
rm --force -- ~/.git-credential-cache/*
|
2018-01-10 16:19:54 +01:00
|
|
|
|
2015-09-21 16:05:15 +02:00
|
|
|
# Keepass2 (killall keepass, both those launch with 'mono' and those launch with 'cli)
|
2023-04-30 13:07:27 +02:00
|
|
|
pkill --uid="$(id -u)" --full -- "keepass"
|
2018-01-10 16:19:54 +01:00
|
|
|
|
2015-09-21 17:14:53 +02:00
|
|
|
# Delete sensitive files can contains unwanted clear passwords
|
2023-02-26 20:06:47 +01:00
|
|
|
rm --force -- ~/.config/evince/print-settings ~/.config/eog/eog-print-settings.ini
|
2019-01-08 14:15:46 +01:00
|
|
|
|
|
|
|
# Delete GIMP's sensitives files
|
|
|
|
find ~/.config -ipath "*GIMP*" -and -iname "print-page-setup" -delete
|
|
|
|
find ~/.config -ipath "*GIMP*" -and -iname "print-settings" -delete
|
2018-01-10 16:19:54 +01:00
|
|
|
|
2019-01-08 14:19:52 +01:00
|
|
|
# Purge local user recent files
|
2023-02-26 20:06:47 +01:00
|
|
|
rm --force -- ~/.local/share/recently-used.xbel
|
|
|
|
rm --force -- ~/.recently-used
|
2023-04-30 13:07:27 +02:00
|
|
|
rm --force --recursive -- ~/.thumbnails/normal
|
2023-02-26 20:06:47 +01:00
|
|
|
rm --force -- ~/.config/vlc/vlc-qt-interface.conf
|
|
|
|
rm --force -- ~/.config/smplayer/smplayer.ini
|
2019-01-08 14:19:52 +01:00
|
|
|
|
2017-03-15 16:22:47 +01:00
|
|
|
# Turn off the screen
|
2017-04-06 07:36:46 +02:00
|
|
|
sleep 3; xset dpms force off
|
2018-01-10 16:19:54 +01:00
|
|
|
|
2014-09-23 01:11:00 +02:00
|
|
|
# Lock the screen
|
2015-03-26 10:48:50 +01:00
|
|
|
#i3lock -c 000000 --pointer win -d
|
2024-03-13 12:37:33 +01:00
|
|
|
#i3lock --image="${HOME}"/Images/system/empire_needs_you.png --pointer win --dpms --ignore-empty-password --tiling
|
|
|
|
i3lock --image="${HOME}"/Images/system/the.it.crowd.jeremy.png --pointer win --dpms --ignore-empty-password --tiling
|