From d90fe264ea5809996eb6993bb651b687c259cf04 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 9 Apr 2013 16:51:39 +0200 Subject: [PATCH] Stumpwm: Use function instead of lambda --- .stumpwmrc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.stumpwmrc b/.stumpwmrc index 79767c9..3583e68 100644 --- a/.stumpwmrc +++ b/.stumpwmrc @@ -117,15 +117,18 @@ "Open URxvt" (run-or-raise *urxvt-program* '(:class "URxvt"))) +(defun run-stumpwm-hook-on-exit (process) + "Run `*screen-unlocked-hook*' if PROCESS' status is `:exited'." + (when (eq (sb-ext:process-status process) :exited) + (run-hook *screen-unlocked-hook*))) + (defcommand lock-screen () () "Lock the screen using i3lock. Run *lock-screen-hook* before locking it and run *screen-unlocked-hook* after it has been unlocked." (run-hook *lock-screen-hook*) (sb-ext:run-program "/usr/bin/i3lock" '("-n" "-c" "000000") :wait nil - :status-hook (lambda (p) - (when (eq (sb-ext:process-status p) :exited) - (run-hook *screen-unlocked-hook*))))) + :status-hook #'run-stumpwm-hook-on-exit)) (set-bg-color (colour :dwhite)) (set-border-color (colour :lwhite))