dotfiles/oni/home/services/stumpwm.scm
Tom Willemse b775263a34 Add gaps to my stumpwm configuration
I had to copy in and redefine the ‘stumpwm::maximize-window’ function from the
‘swm-gaps’ package because for some reason ‘(frame-width ...)’ returns a ratio
on my machine (is it because high-dpi, or ultra-wide? I don't know) and not an
integer, which screws up the ‘(setf (xlib:drawable-width ...) ...)’ call.
2023-06-20 22:51:40 -07:00

67 lines
2.3 KiB
Scheme

(define-module (oni home services stumpwm)
#:use-module ((gnu services configuration)
#:select (serialize-package
define-configuration))
#:use-module ((gnu packages lisp)
#:select (sbcl))
#:use-module ((gnu packages wm)
#:select (stumpwm
stumpish
sbcl-stumpwm-swm-gaps))
#:use-module ((gnu home services)
#:select (service-type
service-extension
home-profile-service-type
home-xdg-configuration-files-service-type
home-run-on-change-service-type))
#:use-module ((guix gexp)
#:select (local-file
gexp
file-append))
#:use-module ((guix packages)
#:select (package?))
#:export (home-stumpwm-service-type
home-stumpwm-configuration))
(define-configuration home-stumpwm-configuration
(package
(package stumpwm)
"Package to use for setting Stumpwm")
(gaps-package
(package sbcl-stumpwm-swm-gaps)
"Package to use for setting Stumpwm Gaps")
(stumpish-package
(package stumpish)
"Package to use for setting Stumpish"))
(define (add-stumpwm-packages config)
(list sbcl
(home-stumpwm-configuration-package config)
(list stumpwm "lib")
(home-stumpwm-configuration-stumpish-package config)
(home-stumpwm-configuration-gaps-package config)))
(define (home-stumpwm-config-files config)
`(("stumpwm/config" ,(local-file "stumpwm/config"))))
(define (reload-stumpwm-config-gexp _)
`(("files/.config/stumpwm/config"
,#~(system* #$(file-append stumpish "/bin/stumpish") "reload"))))
(define home-stumpwm-service-type
(service-type
(name 'home-stumpwm)
(extensions
(list (service-extension
home-profile-service-type
add-stumpwm-packages)
(service-extension
home-xdg-configuration-files-service-type
home-stumpwm-config-files)
(service-extension
home-run-on-change-service-type
reload-stumpwm-config-gexp)))
(compose identity)
(default-value (home-stumpwm-configuration))
(description "Install and configure stumpwm.")))