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
|
|
|
|
# Kill cached password
|
|
|
|
# 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
|
|
|
|
2014-09-23 01:11:00 +02:00
|
|
|
# SSH Connections
|
|
|
|
killall ssh
|
|
|
|
rm -rf ~/.ssh/socks/*
|
2018-01-10 16:19:54 +01:00
|
|
|
|
2014-09-23 01:11:00 +02:00
|
|
|
# SSH Agent
|
|
|
|
killall ssh-agent
|
|
|
|
rm -rf /tmp/ssh-*
|
2018-01-10 16:19:54 +01:00
|
|
|
|
2014-09-23 01:11:00 +02:00
|
|
|
# GPG Agent
|
2016-01-14 09:44:54 +01:00
|
|
|
keychain --agents gpg --clear
|
2017-06-26 13:52:51 +02:00
|
|
|
kill $(pidof gpg-agent)
|
2018-01-10 16:19:54 +01:00
|
|
|
|
2014-09-23 01:11:00 +02:00
|
|
|
# Delete everything link to ssh-agent or gpg-agent
|
|
|
|
rm -rf ~/.keychain/*
|
2018-01-10 16:19:54 +01:00
|
|
|
|
|
|
|
# git-credential sockets
|
|
|
|
killall git-credential-cache--daemon
|
|
|
|
rm -f ~/.git-credential-cache/*
|
|
|
|
|
2015-09-21 16:05:15 +02:00
|
|
|
# Keepass2 (killall keepass, both those launch with 'mono' and those launch with 'cli)
|
|
|
|
ps ax | grep -v 'awk' | awk '/keepass2/,NF=1' | xargs kill
|
2018-01-10 16:19:54 +01:00
|
|
|
|
2015-09-21 17:14:53 +02:00
|
|
|
# Delete sensitive files can contains unwanted clear passwords
|
2019-01-08 14:15:46 +01:00
|
|
|
rm -f ~/.config/evince/print-settings ~/.config/eog/eog-print-settings.ini
|
|
|
|
|
|
|
|
# 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
|
|
|
|
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
|
2015-09-03 22:33:26 +02:00
|
|
|
i3lock -i /home/jegardai/Images/system/empire_needs_you.png --pointer win -d -e -t
|