Stumpwm: Use function instead of lambda
This commit is contained in:
parent
13b625585a
commit
d90fe264ea
1 changed files with 6 additions and 3 deletions
|
@ -117,15 +117,18 @@
|
||||||
"Open URxvt"
|
"Open URxvt"
|
||||||
(run-or-raise *urxvt-program* '(:class "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 () ()
|
(defcommand lock-screen () ()
|
||||||
"Lock the screen using i3lock. Run *lock-screen-hook* before locking
|
"Lock the screen using i3lock. Run *lock-screen-hook* before locking
|
||||||
it and run *screen-unlocked-hook* after it has been unlocked."
|
it and run *screen-unlocked-hook* after it has been unlocked."
|
||||||
(run-hook *lock-screen-hook*)
|
(run-hook *lock-screen-hook*)
|
||||||
(sb-ext:run-program
|
(sb-ext:run-program
|
||||||
"/usr/bin/i3lock" '("-n" "-c" "000000") :wait nil
|
"/usr/bin/i3lock" '("-n" "-c" "000000") :wait nil
|
||||||
:status-hook (lambda (p)
|
:status-hook #'run-stumpwm-hook-on-exit))
|
||||||
(when (eq (sb-ext:process-status p) :exited)
|
|
||||||
(run-hook *screen-unlocked-hook*)))))
|
|
||||||
|
|
||||||
(set-bg-color (colour :dwhite))
|
(set-bg-color (colour :dwhite))
|
||||||
(set-border-color (colour :lwhite))
|
(set-border-color (colour :lwhite))
|
||||||
|
|
Loading…
Reference in a new issue