mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-11-29 22:58:06 +00:00
home: services: Add home-gtk[234]-service-type.
* modules/rosenthal/home/services/gtk.scm (home-gtk2-xdg-configuration-files) (home-gtk3-xdg-configuration-files (home-gtk4-xdg-configuration-files): New procedures. (home-gtk2-environment-variables) (home-gtk2-service-type) (home-gtk3-service-type) (home-gtk4-service-type): New variables. * modules/rosenthal/services/desktop.scm (home-theme-gtk2, home-theme-gtk3): New procedures. (%home-theme-xdg-config): Delete procedure. (home-theme-service-type) [extensions]: Replace home-xdg-configuration-files-service-type to these new services.
This commit is contained in:
2 files changed
+102
-12
No files matched your search
@@ -0,0 +1,78 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal home services gtk)
|
||||
;; Guilt builtins
|
||||
#:use-module (srfi srfi-1)
|
||||
;; Utilities
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix records)
|
||||
#:use-module (rosenthal utils file)
|
||||
;; Guix Home - services
|
||||
#:use-module (gnu home services)
|
||||
#:export (home-gtk2-service-type
|
||||
home-gtk3-service-type
|
||||
home-gtk4-service-type))
|
||||
|
||||
(define home-gtk2-environment-variables
|
||||
;; https://wiki.archlinux.org/title/XDG_Base_Directory
|
||||
'(("GTK2_RC_FILES" . "$XDG_CONFIG_HOME/gtk-2.0/gtkrc")))
|
||||
|
||||
(define (home-gtk2-xdg-configuration-files config)
|
||||
`(("gtk-2.0/gtkrc"
|
||||
,(computed-file "gtkrc"
|
||||
#~(begin
|
||||
(use-modules (ice-9 match))
|
||||
(call-with-output-file #$output
|
||||
(lambda (port)
|
||||
(for-each (match-lambda
|
||||
((key . val)
|
||||
(format port "~a = ~a~%" key val)))
|
||||
'#$config))))
|
||||
#:options '(#:substitutable? #f)))))
|
||||
|
||||
(define (home-gtk3-xdg-configuration-files config)
|
||||
`(("gtk-3.0/settings.ini"
|
||||
,(ini-file "settings.ini" #~'(("Settings" #$@config))))))
|
||||
|
||||
(define (home-gtk4-xdg-configuration-files config)
|
||||
`(("gtk-4.0/settings.ini"
|
||||
,(ini-file "settings.ini" #~'(("Settings" #$@config))))))
|
||||
|
||||
(define home-gtk2-service-type
|
||||
(service-type
|
||||
(name 'home-gtk2)
|
||||
(extensions
|
||||
(list (service-extension home-environment-variables-service-type
|
||||
(const home-gtk2-environment-variables))
|
||||
(service-extension home-xdg-configuration-files-service-type
|
||||
home-gtk2-xdg-configuration-files)))
|
||||
(compose concatenate)
|
||||
(extend
|
||||
(lambda (config extension)
|
||||
(delete-duplicates
|
||||
;; Allow overriding extensions via configuration.
|
||||
(append config extension)
|
||||
equal?)))
|
||||
(description "Set up GTK2 settings in @file{~/.config/gtk-2.0/gtkrc}")
|
||||
(default-value '())))
|
||||
|
||||
(define home-gtk3-service-type
|
||||
(service-type
|
||||
(inherit home-gtk2-service-type)
|
||||
(name 'home-gtk3)
|
||||
(extensions
|
||||
(list (service-extension home-xdg-configuration-files-service-type
|
||||
home-gtk3-xdg-configuration-files)))
|
||||
(description
|
||||
"Set up GTK3 settings in @file{~/.config/gtk-3.0/settings.ini}")))
|
||||
|
||||
(define home-gtk4-service-type
|
||||
(service-type
|
||||
(inherit home-gtk2-service-type)
|
||||
(name 'home-gtk4)
|
||||
(extensions
|
||||
(list (service-extension home-xdg-configuration-files-service-type
|
||||
home-gtk4-xdg-configuration-files)))
|
||||
(description
|
||||
"Set up GTK4 settings in @file{~/.config/gtk-4.0/settings.ini}")))
|
||||
Reference in new issue
Block a user