aboutsummaryrefslogtreecommitdiffstats
path: root/stumpwm
diff options
context:
space:
mode:
authorGravatar Tom Willemse2020-04-13 15:09:46 -0700
committerGravatar Tom Willemse2020-04-13 15:09:46 -0700
commita5c3e484a160bfc60566e37a9d107e3c71ebae83 (patch)
tree067e9a1c812696e902f07f94042d5ccc91b05e6c /stumpwm
parentcda0cab8598fe65c54ad8036c8edfd3930336393 (diff)
downloadnew-dotfiles-a5c3e484a160bfc60566e37a9d107e3c71ebae83.tar.gz
new-dotfiles-a5c3e484a160bfc60566e37a9d107e3c71ebae83.zip
Add stumpwm configuration
Diffstat (limited to 'stumpwm')
-rw-r--r--stumpwm/.stumpwmrc39
1 files changed, 39 insertions, 0 deletions
diff --git a/stumpwm/.stumpwmrc b/stumpwm/.stumpwmrc
new file mode 100644
index 0000000..3e46748
--- /dev/null
+++ b/stumpwm/.stumpwmrc
@@ -0,0 +1,39 @@
+;; -*- mode: lisp; -*-
+
+(in-package :stumpwm-user)
+
+(ql:quickload "swank")
+
+(load-module "swm-gaps")
+
+(defvar *lock-screen-hook* nil
+ "Hook that gets run right before the screen gets locked.")
+
+(defvar *screen-unlocked-hook* nil
+ "Hook that gets run right after the screen is unlocked.")
+
+(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 #'run-stumpwm-hook-on-exit))
+
+(setf swm-gaps:*inner-gaps-size* 7)
+(setf swm-gaps:*outer-gaps-size* 7)
+
+(set-prefix-key (kbd "C-z"))
+
+(define-key *top-map* (kbd "C-M-l") "lock-screen")
+
+(toggle-gaps)
+
+(swank:create-server :dont-close t)