From d5d108b98f9b6171fa0ab03b315c90a474cc78a6 Mon Sep 17 00:00:00 2001 From: Maciej Sobkowski Date: Mon, 18 Jan 2016 19:38:01 +0100 Subject: Add SSH agent session clean-up on i3 shutdown --- bin/bin/i3-shutdown.py | 9 +++++++++ i3/.i3/config | 1 + 2 files changed, 10 insertions(+) create mode 100644 bin/bin/i3-shutdown.py diff --git a/bin/bin/i3-shutdown.py b/bin/bin/i3-shutdown.py new file mode 100644 index 0000000..56a60b8 --- /dev/null +++ b/bin/bin/i3-shutdown.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +from gi.repository import i3ipc +from subprocess import call + +def on_shutdown(conn): + call(["ssh-add", "-D"]) + call(["ssh-agent", "-k"]) + diff --git a/i3/.i3/config b/i3/.i3/config index 250b0cd..d8a572e 100644 --- a/i3/.i3/config +++ b/i3/.i3/config @@ -142,3 +142,4 @@ bindsym $mod+Shift+r restart # display the exit i3 bar bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" +exec_always --no-startup-id ~/bin/i3-shutdown.py -- cgit v1.2.3-70-g09d2