From 1f7b63ae66d101856ef7011c8080705c60d496a4 Mon Sep 17 00:00:00 2001 From: Hilton Chain Date: Thu, 26 Jun 2025 20:20:03 +0800 Subject: [PATCH] services: Add %rosenthal-skeletons. * modules/rosenthal/services/desktop.scm (%rosenthal-skeletons): New variable. (%rosenthal-example-emacs-init): Delete variable. * modules/rosenthal/examples: Update examples. --- modules/rosenthal/examples/emacs/init.el | 13 ++--- modules/rosenthal/examples/niri.kdl | 18 +++---- .../rosenthal/examples/waybar/config.jsonc | 8 +-- modules/rosenthal/services/desktop.scm | 49 ++++++++++++++----- 4 files changed, 54 insertions(+), 34 deletions(-) diff --git a/modules/rosenthal/examples/emacs/init.el b/modules/rosenthal/examples/emacs/init.el index d02d1da..90a53ab 100644 --- a/modules/rosenthal/examples/emacs/init.el +++ b/modules/rosenthal/examples/emacs/init.el @@ -8,7 +8,7 @@ (make-empty-file custom-file) (load custom-file)) -(let ((font-config "$$fonts.el$$")) +(let ((font-config (locate-user-emacs-file "fonts.el"))) (when (file-exists-p font-config) (load-file font-config))) @@ -197,9 +197,8 @@ (use-package geiser :custom (geiser-autodoc-identifier-format "%s → %s") - (geiser-default-implementation 'guile) - (geiser-active-implementation '(guile)) (geiser-mode-smart-tab-p t) + (geiser-mode-start-repl-p t) (geiser-repl-query-on-kill-p nil) :init ;; Context menu on right click. @@ -207,10 +206,6 @@ (defun context-menu () (let ((menu (make-sparse-keymap))) (pcase major-mode - ('geiser-repl-mode - (define-key menu (vector 'insert-image) - '("Insert image" . geiser--guile-picture-language--pict-from-file)) - menu) ('scheme-mode (define-key menu (vector 'switch-to-repl) '("Switch to REPL" . geiser-repl-switch)) @@ -230,6 +225,9 @@ ;;guix:emacs-geiser-guile (use-package geiser-guile :after (geiser) + :custom + (geiser-active-implementation '(guile)) + (geiser-default-implementation 'guile) :config ;; TODO: Make `flycheck-guile' support `guix repl'. (dolist (path @@ -310,7 +308,6 @@ (setopt initial-scratch-message ";;; Type your Guile program here and evaluate it.\n\n") (scheme-mode) - (geiser-repl-switch) (geiser-repl-import-module "(rosenthal)") (geiser-repl-import-module "(nonguix transformations)") (delete-window) diff --git a/modules/rosenthal/examples/niri.kdl b/modules/rosenthal/examples/niri.kdl index 9b5baed..fa7252b 100644 --- a/modules/rosenthal/examples/niri.kdl +++ b/modules/rosenthal/examples/niri.kdl @@ -338,8 +338,8 @@ binds { Mod+Shift+Slash { show-hotkey-overlay; } // Suggested binds for running programs: terminal, app launcher, screen locker. - Mod+T { spawn "$$bin/alacritty$$"; } - Mod+D { spawn "$$bin/rofi$$" "-show" "drun"; } + Mod+T { spawn "foot"; } + Mod+D { spawn "rofi" "-show" "drun"; } // Super+Alt+L { spawn "swaylock"; } // You can also use a shell. Do this if you need pipes, multiple commands, etc. @@ -348,14 +348,14 @@ binds { // Example volume keys mappings for PipeWire & WirePlumber. // The allow-when-locked=true property makes them work even when the session is locked. - XF86AudioRaiseVolume allow-when-locked=true { spawn "$$bin/wpctl$$" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; } - XF86AudioLowerVolume allow-when-locked=true { spawn "$$bin/wpctl$$" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; } - XF86AudioMute allow-when-locked=true { spawn "$$bin/wpctl$$" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } - XF86AudioMicMute allow-when-locked=true { spawn "$$bin/wpctl$$" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } + XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; } + XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; } + XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } + XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } // Example brightness key mappings for light. - XF86MonBrightnessUp allow-when-locked=true { spawn "$$bin/light$$" "-A" "10"; } - XF86MonBrightnessDown allow-when-locked=true { spawn "$$bin/light$$" "-U" "10"; } + XF86MonBrightnessUp allow-when-locked=true { spawn "light" "-A" "10"; } + XF86MonBrightnessDown allow-when-locked=true { spawn "light" "-U" "10"; } Mod+Q { close-window; } @@ -578,7 +578,7 @@ binds { prefer-no-csd spawn-at-startup "sh" "-c" "pgrep --uid $USER shepherd > /dev/null || shepherd" -spawn-at-startup "$$bin/xwayland-satellite$$" ":233" +spawn-at-startup "xwayland-satellite" ":233" environment { DISPLAY ":233" } diff --git a/modules/rosenthal/examples/waybar/config.jsonc b/modules/rosenthal/examples/waybar/config.jsonc index dd2b3e2..5c4f611 100644 --- a/modules/rosenthal/examples/waybar/config.jsonc +++ b/modules/rosenthal/examples/waybar/config.jsonc @@ -85,12 +85,12 @@ "format": "{icon} {volume}%", "format-icons": ["\uF026", "\uF027", "\uF028"], "format-muted": "Muted {volume}%", - "on-click": "$$bin/wpctl$$ set-mute @DEFAULT_AUDIO_SINK@ toggle", - "on-click-right": "$$bin/pavucontrol$$", + "on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle", + "on-click-right": "pavucontrol", }, "backlight": { - "on-scroll-down": "$$bin/light$$ -U 5", - "on-scroll-up": "$$bin/light$$ -A 5", + "on-scroll-down": "light -U 5", + "on-scroll-up": "light -A 5", "format": "{icon} {percent}%", "format-icons": ["\uF186", "\uF0EB"], "tooltip": false, diff --git a/modules/rosenthal/services/desktop.scm b/modules/rosenthal/services/desktop.scm index 1330b5e..ee7aed4 100644 --- a/modules/rosenthal/services/desktop.scm +++ b/modules/rosenthal/services/desktop.scm @@ -28,9 +28,7 @@ #:use-module (rosenthal packages xorg) - #:export (%rosenthal-example-emacs-init - - home-blueman-applet-configuration + #:export (home-blueman-applet-configuration home-blueman-applet-service-type home-fcitx5-configuration @@ -57,19 +55,10 @@ home-waybar-configuration home-waybar-service-type + %rosenthal-skeletons %rosenthal-desktop-services %rosenthal-desktop-home-services)) - -;;; -;;; Configuration file presets. -;;; - -(define %rosenthal-example-emacs-init - (computed-substitution-with-inputs "init.el" - (local-file "../examples/emacs/init.el") - (list (local-file "../examples/emacs" #:recursive? #t)))) - ;;; ;;; Blueman @@ -473,6 +462,40 @@ gtk-key-theme-name = ~a~%" (default-value (home-waybar-configuration)) (description "Run waybar, a status bar for Wayland compositors."))) + +;;; +;;; Configuration file presets. +;;; + + +(define %rosenthal-skeletons + `((".config/emacs/fonts.el" + ,(local-file "../examples/emacs/fonts.el")) + (".config/emacs/init.el" + ,(local-file "../examples/emacs/init.el")) + (".config/foot/foot.ini" + ,(plain-file "foot.ini" "font=monospace:size=12\n")) + (".config/mako/config" + ,(local-file "../examples/mako.conf")) + (".config/niri/config.kdl" + ,(local-file "../examples/niri.kdl")) + (".config/rofi/config.rasi" + ,(plain-file "rofi.rasi" "\ +configuration { + icon-theme: \"Qogir\"; +} +@theme \"/run/current-system/profile/share/rofi/themes/fullscreen-preview.rasi\"\n")) + (".config/waybar/config.jsonc" + ,(local-file "../examples/waybar/config.jsonc")) + (".config/waybar/style.css" + ,(local-file "../examples/waybar/style.css")) + (".config/xfce4/helpers.rc" + ,(plain-file "helpers.rc" "TerminalEmulator=rofi-sensible-terminal\n")) + ;; Selected from the default skeletons. + (".config/gdb/gdbinit" ,%default-gdbinit) + (".config/nano/nanorc" ,%default-nanorc) + (".guile" ,%default-dotguile))) + ;;; ;;; Service presets.