diff --git a/oni/home/config/rincewind.scm b/oni/home/config/rincewind.scm index b54d081..b892498 100644 --- a/oni/home/config/rincewind.scm +++ b/oni/home/config/rincewind.scm @@ -60,6 +60,9 @@ home-polybar-configuration)) #:use-module ((oni home services rofi) #:select (home-rofi-default-service)) + #:use-module ((oni home services stumpwm) + #:select (home-stumpwm-service-type + home-stumpwm-configuration)) #:use-module ((oni home services syncthing) #:select (home-syncthing-service-type)) #:use-module ((oni home services zsh) @@ -157,8 +160,7 @@ mpd-random-albums emacs-inkplate emacs-outli - emacs-oni-org-roam - stumpwm+swank)) + emacs-oni-org-roam)) (services (list @@ -228,4 +230,8 @@ #:path "/tmp/mpd.fifo" #:format "44100:16:2"))))) (service home-mpc-update-service-type) - (service home-mpd-notify-service-type)))) + (service home-mpd-notify-service-type) + + (service home-stumpwm-service-type + (home-stumpwm-configuration + (package stumpwm+swank)))))) diff --git a/oni/home/services/stumpwm.scm b/oni/home/services/stumpwm.scm new file mode 100644 index 0000000..b6ba4fd --- /dev/null +++ b/oni/home/services/stumpwm.scm @@ -0,0 +1,43 @@ +(define-module (oni home services stumpwm) + #:use-module ((gnu services configuration) + #:select (serialize-package + define-configuration)) + #:use-module ((gnu packages wm) + #:select (stumpwm)) + #:use-module ((gnu home services) + #:select (service-type + service-extension + home-profile-service-type + home-xdg-configuration-files-service-type)) + #:use-module ((guix gexp) + #:select (local-file)) + #: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")) + +(define (add-stumpwm-packages config) + (list (home-stumpwm-configuration-package config))) + +(define (home-stumpwm-config-files config) + `(("stumpwm/config" ,(local-file "stumpwm/config")))) + +(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))) + (compose identity) + (default-value (home-stumpwm-configuration)) + (description "Install and configure stumpwm."))) diff --git a/oni/home/services/stumpwm/config b/oni/home/services/stumpwm/config new file mode 100644 index 0000000..170f0db --- /dev/null +++ b/oni/home/services/stumpwm/config @@ -0,0 +1,30 @@ +;; -*- mode: lisp; -*- +(in-package :stumpwm-user) + +(require 'swank) + +(set-prefix-key (kbd "s-x")) + +(defcommand raise-browser () () + "Open or show my browser" + (run-or-raise "firefox" '(:class "firefox"))) + +(defcommand raise-emacs () () + "Open or show Emacs" + (run-or-raise "emacsclient -c" '(:class "Emacs"))) + +(defcommand raise-terminal () () + "Open or show my terminal" + (run-or-raise "kitty" '(:class "kitty"))) + +(define-key *top-map* (kbd "s-b") "raise-browser") +(define-key *top-map* (kbd "s-e") "raise-emacs") +(define-key *top-map* (kbd "s-t") "raise-terminal") + +(define-remapped-keys + '(("teams-for-linux" + ("C-M-Break" . "C-S-m")))) + +(mode-line) +(restore-from-file "default") +(swank:create-server :dont-close t)