summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Wilken2022-12-31 11:43:30 +0100
committerTimo Wilken2022-12-31 11:45:34 +0100
commitc629e4243330b5081c4b85563fe9c028e43310c2 (patch)
tree70558580c981cf85b0bb0fbbb26b78d4e3badd08
parent54f0a727c312b82e5d1c25ca81b62344bbb56e10 (diff)
Extract theming files into separate module
-rw-r--r--.gitmodules18
-rw-r--r--tw/gexp.scm21
-rw-r--r--tw/home/lap.scm111
-rw-r--r--tw/theme.scm88
m---------tw/theme/catppuccin/dunst (renamed from tw/home/files/catppuccin/dunst)0
m---------tw/theme/catppuccin/emacs (renamed from tw/home/files/catppuccin/emacs)0
m---------tw/theme/catppuccin/kde (renamed from tw/home/files/catppuccin/kde)0
m---------tw/theme/catppuccin/kitty (renamed from tw/home/files/catppuccin/kitty)0
m---------tw/theme/catppuccin/neomutt (renamed from tw/home/files/catppuccin/neomutt)0
m---------tw/theme/catppuccin/newsboat (renamed from tw/home/files/catppuccin/newsboat)0
m---------tw/theme/catppuccin/polybar (renamed from tw/home/files/catppuccin/polybar)0
m---------tw/theme/catppuccin/rofi (renamed from tw/home/files/catppuccin/rofi)0
m---------tw/theme/catppuccin/zathura (renamed from tw/home/files/catppuccin/zathura)0
13 files changed, 134 insertions, 104 deletions
diff --git a/.gitmodules b/.gitmodules
index dc51e262..c3ec2737 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,29 +1,29 @@
[submodule "catppuccin/kitty"]
- path = tw/home/files/catppuccin/kitty
+ path = tw/theme/catppuccin/kitty
url = https://github.com/catppuccin/kitty
[submodule "catppuccin/rofi"]
- path = tw/home/files/catppuccin/rofi
+ path = tw/theme/catppuccin/rofi
url = https://github.com/catppuccin/rofi
[submodule "catppuccin/dunst"]
- path = tw/home/files/catppuccin/dunst
+ path = tw/theme/catppuccin/dunst
url = https://github.com/catppuccin/dunst
[submodule "catppuccin/zathura"]
- path = tw/home/files/catppuccin/zathura
+ path = tw/theme/catppuccin/zathura
url = https://github.com/catppuccin/zathura
[submodule "catppuccin/neomutt"]
- path = tw/home/files/catppuccin/neomutt
+ path = tw/theme/catppuccin/neomutt
url = https://github.com/catppuccin/neomutt
[submodule "catppuccin/polybar"]
- path = tw/home/files/catppuccin/polybar
+ path = tw/theme/catppuccin/polybar
url = https://github.com/catppuccin/polybar
[submodule "catppuccin/emacs"]
- path = tw/home/files/catppuccin/emacs
+ path = tw/theme/catppuccin/emacs
url = https://github.com/catppuccin/emacs
[submodule "catppuccin/kde"]
- path = tw/home/files/catppuccin/kde
+ path = tw/theme/catppuccin/kde
url = https://github.com/catppuccin/kde
[submodule "catppuccin/newsboat"]
- path = tw/home/files/catppuccin/newsboat
+ path = tw/theme/catppuccin/newsboat
url = https://github.com/catppuccin/newsboat
[submodule "neomutt"]
path = tw/home/files/neomutt
diff --git a/tw/gexp.scm b/tw/gexp.scm
new file mode 100644
index 00000000..2f1705b7
--- /dev/null
+++ b/tw/gexp.scm
@@ -0,0 +1,21 @@
+(define-module (tw gexp)
+ #:use-module (guix gexp)
+ #:use-module (guix modules))
+
+;; See also: `file-join' in (gnu home services ssh).
+(define-public (combined-text-file name . files)
+ "A file which is the concatenation of the contents of other files."
+ ;; We need to use #$output for `computed-file' to work.
+ ;; Of course this isn't documented anywhere!
+ (computed-file name
+ (with-imported-modules (source-module-closure
+ '((guix build utils))) ; for `dump-port'
+ #~(begin
+ (use-modules (guix build utils))
+ (call-with-output-file #$output
+ (lambda (oport)
+ (for-each (lambda (in-file)
+ (call-with-input-file in-file
+ (lambda (iport)
+ (dump-port iport oport))))
+ '#$files)))))))
diff --git a/tw/home/lap.scm b/tw/home/lap.scm
index f7439a21..33683af1 100644
--- a/tw/home/lap.scm
+++ b/tw/home/lap.scm
@@ -7,20 +7,6 @@
;; See also, for some tips:
;; https://github.com/alezost/shepherd-config/blob/master/init.scm
-;; TODO: Integrate upstream (ctp) configs into ~/guix-home using git submodules:
-;; https://github.com/catppuccin/grub ; TODO: make this system-wide
-;; https://github.com/catppuccin/tty ; system-wide
-;; https://github.com/catppuccin/papirus-folders
-;; https://github.com/catppuccin/Kvantum
-;; https://github.com/catppuccin/fzf
-;; https://github.com/catppuccin/obs
-;; https://github.com/catppuccin/insomnia
-;; https://github.com/catppuccin/firefox ; for icecat
-
-;; Manual installation needed?
-;; https://github.com/catppuccin/dark-reader
-;; https://github.com/catppuccin/github
-
(define-module (tw home lap)
#:use-module ((gnu)
#:select (use-package-modules))
@@ -38,14 +24,15 @@
#:use-module (gnu services shepherd)
#:use-module (guix channels)
#:use-module (guix gexp)
- #:use-module (guix modules)
#:use-module ((nongnu packages messaging)
#:select (signal-desktop zoom))
#:use-module (tw packages alice)
#:use-module (tw packages catppuccin)
#:use-module (tw packages games)
#:use-module (tw packages shell)
- #:use-module (tw packages xorg))
+ #:use-module (tw packages xorg)
+ #:use-module (tw gexp)
+ #:use-module (tw theme))
(use-package-modules
admin android base bittorrent calendar cmake compression compton curl
@@ -56,37 +43,6 @@
rsync shells shellutils sqlite ssh syndication tcl terminals textutils tmux
video version-control vim web web-browsers wm xdisorg xorg)
-(fluid-set! read-eval? #t) ; allow #. read expansions in this file
-
-;; One of "latte" (light theme), "frappe", "macchiato", "mocha" (dark
-;; themes); ordered brightest to darkest.
-;; Set and use this at read time so that `local-file' gets a literal
-;; argument. Anything else confuses it and causes it to search
-;; relative to the working directory, not this file's directory.
-#.(define catppuccin-theme-variant "mocha")
-
-;; "Base" colour from the active Catppuccin theme (see
-;; https://github.com/catppuccin/catppuccin).
-(define catppuccin-background-color "1e1e2e")
-
-;; See also: `file-join' in (gnu home services ssh).
-(define (combined-text-file name . files)
- "A file which is the concatenation of the contents of other files."
- ;; We need to use #$output for `computed-file' to work.
- ;; Of course this isn't documented anywhere!
- (computed-file name
- (with-imported-modules (source-module-closure
- '((guix build utils))) ; for `dump-port'
- #~(begin
- (use-modules (guix build utils))
- (call-with-output-file #$output
- (lambda (oport)
- (for-each (lambda (in-file)
- (call-with-input-file in-file
- (lambda (iport)
- (dump-port iport oport))))
- '#$files)))))))
-
(define gui-packages
(list
;; i3 and Xorg. i3 itself must be installed system-wide for gdm to pick it up.
@@ -238,56 +194,28 @@
(simple-service
'gui-config home-xdg-configuration-files-service-type
`(("dunst/dunstrc" ,(local-file "files/dunstrc"))
- ("dunst/dunstrc.d/50-catppuccin.conf"
- ,(local-file #.(string-append "files/catppuccin/dunst/src/"
- catppuccin-theme-variant ".conf")
- "dunst-theme.conf"))
+ ("dunst/dunstrc.d/50-catppuccin.conf" ,catppuccin-dunstrc)
("emacs/include" ,(local-file "files/emacs-packages" #:recursive? #t))
("emacs/init.el" ,(local-file "files/emacs-init.el"))
- (#.(string-append "emacs/catppuccin-" catppuccin-theme-variant "-theme.el")
- ,(local-file #.(string-append "files/catppuccin/emacs/catppuccin-"
- catppuccin-theme-variant "-theme.el")))
+ (,(string-append "emacs/" (local-file-name catppuccin-emacs-theme))
+ ,catppuccin-emacs-theme)
("gtk-2.0/gtkrc" ,(local-file "files/gtk2.ini"))
("gtk-3.0/settings.ini" ,(local-file "files/gtk3.ini"))
("i3/config" ,(local-file "files/i3.conf"))
;; TODO: "kdeglobals" works for some programs (e.g. kdeconnect-app),
;; but not for others (e.g. nheko, kdeconnect-settings)...
- ("kdeglobals"
- ,(local-file #.(let ((variant (string-upcase catppuccin-theme-variant 0 1)))
- (string-append "files/catppuccin/kde/" variant
- "/Catppuccin" variant ".colors"))))
- ("kitty/diff.conf"
- ,(local-file #.(string-append "files/catppuccin/kitty/diff-"
- catppuccin-theme-variant ".conf")
- "kitty-diff-theme.conf"))
+ ("kdeglobals" ,catppuccin-kdeglobals)
+ ("kitty/diff.conf" ,catppuccin-kitty-diff)
("kitty/kitty.conf"
,(combined-text-file "kitty.conf"
- (local-file "files/kitty.conf")
- (local-file #.(string-append "files/catppuccin/kitty/"
- catppuccin-theme-variant ".conf")
- "kitty-theme.conf")))
+ (local-file "files/kitty.conf")
+ catppuccin-kitty))
("polybar/config.ini" ,(local-file "files/polybar.ini"))
- ("polybar/catppuccin.ini"
- ,(local-file #.(string-append "files/catppuccin/polybar/themes/"
- catppuccin-theme-variant ".ini")))
+ ("polybar/catppuccin.ini" ,catppuccin-polybar)
("rofi/config.rasi" ,(local-file "files/rofi.rasi"))
- ("rofi/themes/catppuccin.rasi"
- ,(computed-file "catppuccin.rasi"
- (with-imported-modules (source-module-closure
- '((guix build utils)))
- #~(begin
- (use-modules (guix build utils))
- (copy-file #$(local-file #.(string-append
- "files/catppuccin/rofi/basic/.local/share/rofi/themes/catppuccin-"
- catppuccin-theme-variant ".rasi"))
- #$output)
- (substitute* #$output
- (("JetBrainsMono Nerd Font 14") "Fira Sans 12") ; default font
- (("border-col: #[0-9a-f]*;") "border-col: #585b70;")))))) ; i3 border colour
+ ("rofi/themes/catppuccin.rasi" ,catppuccin-rofi)
("zathura/zathurarc" ,(local-file "files/zathurarc"))
- ("zathura/catppuccin"
- ,(local-file #.(string-append "files/catppuccin/zathura/src/catppuccin-"
- catppuccin-theme-variant)))))
+ ("zathura/catppuccin" ,catppuccin-zathura)))
(simple-service
'gui-files home-files-service-type
@@ -424,7 +352,7 @@
emacs-yaml-mode
gui-packages))
-
+
;; To search for available home services, run 'guix home search KEYWORD'.
(services
(cons*
@@ -466,16 +394,9 @@
("khard/khard.conf" ,(local-file "files/khard.conf"))
("lesskey" ,(local-file "files/lesskey"))
("mutt/muttrc" ,(local-file "files/muttrc"))
- ("mutt/catppuccin.muttrc"
- ,(local-file #.(if (string=? catppuccin-theme-variant "latte")
- "files/catppuccin/neomutt/latte-neomuttrc"
- "files/catppuccin/neomutt/neomuttrc")))
+ ("mutt/catppuccin.muttrc" ,catppuccin-muttrc)
("newsboat/config" ,(local-file "files/newsboat.conf"))
- ("newsboat/config.catppuccin"
- ,(local-file #.(if (string=? catppuccin-theme-variant "latte")
- "files/catppuccin/newsboat/themes/latte"
- "files/catppuccin/newsboat/themes/dark")
- "newsboat-theme.conf"))
+ ("newsboat/config.catppuccin" ,catppuccin-newsboat)
("ranger/rc.conf" ,(local-file "files/ranger.conf"))
("user-dirs.locale" ,(plain-file "user-dirs.locale" "C")) ; Not sure if this is needed. Arch has it.
("user-dirs.dirs" ,(local-file "files/user-dirs.dirs"))
diff --git a/tw/theme.scm b/tw/theme.scm
new file mode 100644
index 00000000..a7ee78a5
--- /dev/null
+++ b/tw/theme.scm
@@ -0,0 +1,88 @@
+;; TODO: Integrate upstream (ctp) configs into ~/guix-home using git submodules:
+;; https://github.com/catppuccin/grub ; TODO: make this system-wide
+;; https://github.com/catppuccin/tty ; system-wide
+;; https://github.com/catppuccin/papirus-folders
+;; https://github.com/catppuccin/Kvantum
+;; https://github.com/catppuccin/fzf
+;; https://github.com/catppuccin/obs
+;; https://github.com/catppuccin/insomnia
+;; https://github.com/catppuccin/firefox ; for icecat
+
+;; Manual installation needed?
+;; https://github.com/catppuccin/dark-reader
+;; https://github.com/catppuccin/github
+
+(define-module (tw theme)
+ #:use-module (guix gexp)
+ #:use-module ((guix modules)
+ #:select (source-module-closure)))
+
+(fluid-set! read-eval? #t) ; allow #. read expansions in this file
+
+;; One of "latte" (light theme), "frappe", "macchiato", "mocha" (dark
+;; themes); ordered brightest to darkest.
+;; Set and use this at read time so that `local-file' gets a literal
+;; argument. Anything else confuses it and causes it to search
+;; relative to the working directory, not this file's directory.
+#.(define catppuccin-theme-variant "mocha")
+
+;; "Base" colour from the active Catppuccin theme (see
+;; https://github.com/catppuccin/catppuccin).
+(define-public catppuccin-background-color "1e1e2e")
+
+(define-public catppuccin-muttrc
+ (local-file #.(if (string=? catppuccin-theme-variant "latte")
+ "theme/catppuccin/neomutt/latte-neomuttrc"
+ "theme/catppuccin/neomutt/neomuttrc")))
+
+(define-public catppuccin-newsboat
+ (local-file #.(if (string=? catppuccin-theme-variant "latte")
+ "theme/catppuccin/newsboat/themes/latte"
+ "theme/catppuccin/newsboat/themes/dark")
+ "newsboat-theme.conf"))
+
+(define-public catppuccin-dunstrc
+ (local-file #.(string-append "theme/catppuccin/dunst/src/"
+ catppuccin-theme-variant ".conf")
+ "dunst-theme.conf"))
+
+(define-public catppuccin-emacs-theme
+ (local-file #.(string-append "theme/catppuccin/emacs/catppuccin-"
+ catppuccin-theme-variant "-theme.el")))
+
+(define-public catppuccin-kdeglobals
+ (local-file #.(let ((variant (string-upcase catppuccin-theme-variant 0 1)))
+ (string-append "theme/catppuccin/kde/" variant
+ "/Catppuccin" variant ".colors"))))
+
+(define-public catppuccin-kitty-diff
+ (local-file #.(string-append "theme/catppuccin/kitty/diff-"
+ catppuccin-theme-variant ".conf")
+ "kitty-diff-theme.conf"))
+
+(define-public catppuccin-kitty
+ (local-file #.(string-append "theme/catppuccin/kitty/"
+ catppuccin-theme-variant ".conf")
+ "kitty-theme.conf"))
+
+(define-public catppuccin-polybar
+ (local-file #.(string-append "theme/catppuccin/polybar/themes/"
+ catppuccin-theme-variant ".ini")))
+
+(define-public catppuccin-rofi
+ (computed-file "catppuccin.rasi"
+ (with-imported-modules (source-module-closure
+ '((guix build utils)))
+ #~(begin
+ (use-modules (guix build utils))
+ (copy-file #$(local-file #.(string-append
+ "theme/catppuccin/rofi/basic/.local/share/rofi/themes/catppuccin-"
+ catppuccin-theme-variant ".rasi"))
+ #$output)
+ (substitute* #$output
+ (("JetBrainsMono Nerd Font 14") "Fira Sans 12") ; default font
+ (("border-col: #[0-9a-f]*;") "border-col: #585b70;")))))) ; i3 border colour
+
+(define-public catppuccin-zathura
+ (local-file #.(string-append "theme/catppuccin/zathura/src/catppuccin-"
+ catppuccin-theme-variant)))
diff --git a/tw/home/files/catppuccin/dunst b/tw/theme/catppuccin/dunst
-Subproject a72991e56338289a9fce941b5df9f0509d2cba0
+Subproject a72991e56338289a9fce941b5df9f0509d2cba0
diff --git a/tw/home/files/catppuccin/emacs b/tw/theme/catppuccin/emacs
-Subproject b4be30de73aa295ab56a20c21dff07fba3dec05
+Subproject b4be30de73aa295ab56a20c21dff07fba3dec05
diff --git a/tw/home/files/catppuccin/kde b/tw/theme/catppuccin/kde
-Subproject d95dd080b3e6a064390aceb8af0a6dc9506a40c
+Subproject d95dd080b3e6a064390aceb8af0a6dc9506a40c
diff --git a/tw/home/files/catppuccin/kitty b/tw/theme/catppuccin/kitty
-Subproject 43b08da1e1168aff2edb74105f293a90b4567c4
+Subproject 43b08da1e1168aff2edb74105f293a90b4567c4
diff --git a/tw/home/files/catppuccin/neomutt b/tw/theme/catppuccin/neomutt
-Subproject f6ce83da47cc36d5639b0d54e7f5f63cdaf69f1
+Subproject f6ce83da47cc36d5639b0d54e7f5f63cdaf69f1
diff --git a/tw/home/files/catppuccin/newsboat b/tw/theme/catppuccin/newsboat
-Subproject be3d0ee1ba0fc26baf7a47c2aa7032b7541deb0
+Subproject be3d0ee1ba0fc26baf7a47c2aa7032b7541deb0
diff --git a/tw/home/files/catppuccin/polybar b/tw/theme/catppuccin/polybar
-Subproject 9ee66f83335404186ce979bac32fcf3cd047396
+Subproject 9ee66f83335404186ce979bac32fcf3cd047396
diff --git a/tw/home/files/catppuccin/rofi b/tw/theme/catppuccin/rofi
-Subproject 62a78eaf0e12b69b75fdee9def6d333cebcb74a
+Subproject 62a78eaf0e12b69b75fdee9def6d333cebcb74a
diff --git a/tw/home/files/catppuccin/zathura b/tw/theme/catppuccin/zathura
-Subproject d85d8750acd0b0247aa10e0653998180391110a
+Subproject d85d8750acd0b0247aa10e0653998180391110a