aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Wilken2024-03-10 21:36:20 +0100
committerTimo Wilken2024-03-10 21:41:30 +0100
commit820cbff8e27ca05125a31a5f9203966b59fb8763 (patch)
treeb0fd6c5f50215d54fefe52bf23015a7debe36696
parentde20fc8d904643ffe6957febfc6a24e57c12b512 (diff)
Generate PNG desktop background directly
This avoids having to copy the image to different machines.
-rw-r--r--tw/home/btl.scm1
-rw-r--r--tw/home/cern.scm1
-rw-r--r--tw/home/frm.scm1
-rw-r--r--tw/home/lap.scm1
-rw-r--r--tw/packages/catppuccin.scm25
-rw-r--r--tw/services/desktop.scm5
6 files changed, 28 insertions, 6 deletions
diff --git a/tw/home/btl.scm b/tw/home/btl.scm
index f4ed9d90..dae44c86 100644
--- a/tw/home/btl.scm
+++ b/tw/home/btl.scm
@@ -52,7 +52,6 @@
(home-desktop-configuration
(gaming? #t)
(bluetooth? #t)
- (desktop-background "~/blobs-d.png")
(monitors
(list (home-monitor-configuration
(name "DisplayPort-2")
diff --git a/tw/home/cern.scm b/tw/home/cern.scm
index b7e04ef5..a9e00d06 100644
--- a/tw/home/cern.scm
+++ b/tw/home/cern.scm
@@ -52,7 +52,6 @@
(service home-desktop-service-type
(home-desktop-configuration
- (desktop-background "~/.config/X11/ridge-view.jpg")
(monitors
(list (home-monitor-configuration
(name "DP-2")
diff --git a/tw/home/frm.scm b/tw/home/frm.scm
index bf263679..d7759940 100644
--- a/tw/home/frm.scm
+++ b/tw/home/frm.scm
@@ -56,7 +56,6 @@
(service home-desktop-service-type
(home-desktop-configuration
(bluetooth? #t)
- (desktop-background "~/blobs-d.png")
(battery-name "BAT1")
(ac-adapter-name "ACAD")
(monitors
diff --git a/tw/home/lap.scm b/tw/home/lap.scm
index 959691aa..4a81be37 100644
--- a/tw/home/lap.scm
+++ b/tw/home/lap.scm
@@ -100,7 +100,6 @@
(gaming? #t)
(nvidia-driver? #t)
(bluetooth? #t)
- (desktop-background "~/pictures/Backgrounds/greece/IMG_20181201_104748_DRO.jpg")
(battery-name "BAT0")
(ac-adapter-name "AC")
(monitors
diff --git a/tw/packages/catppuccin.scm b/tw/packages/catppuccin.scm
index b2644147..e79c6be2 100644
--- a/tw/packages/catppuccin.scm
+++ b/tw/packages/catppuccin.scm
@@ -4,6 +4,8 @@
#:select (coreutils gnu-make findutils sed (which . which-package)))
#:use-module (gnu packages bash)
#:use-module (gnu packages gawk)
+ #:use-module ((gnu packages gnome)
+ #:select (gnome-backgrounds))
#:use-module (gnu packages gnome-xyz)
#:use-module (gnu packages gtk)
#:use-module (gnu packages inkscape)
@@ -19,6 +21,7 @@
#:use-module (guix build-system qt)
#:use-module (guix build-system trivial)
#:use-module (guix download)
+ #:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages))
@@ -234,3 +237,25 @@ Catppuccin color palette."))
#:commit "1bda9d8274dd327b7931886ef0c5c1eb33903814"
#:repo-hash "104qmrmb249ly2zp797m652bgsvs09q22p65a73lz0fmv7k9qqqx"
#:install-plan '(("src/" "share/catppuccin/zathura/"))))
+
+(define-public tw-background
+ (package
+ (name "tw-background")
+ (version "1")
+ (source #f)
+ (build-system trivial-build-system)
+ (arguments
+ `(#:builder
+ ,(with-imported-modules '((guix build utils))
+ #~(let* ((out-dir (string-append #$output "/share/backgrounds/tw"))
+ (out-img (string-append out-dir "/blobs.png")))
+ (use-modules (guix build utils))
+ (mkdir-p out-dir)
+ (invoke #+(file-append inkscape "/bin/inkscape") "-C" "-o" out-img
+ #+(file-append gnome-backgrounds "/share/backgrounds/gnome/blobs-d.svg"))))))
+ (native-inputs (list gnome-backgrounds inkscape))
+ (home-page #f)
+ (synopsis "My chosen desktop background image")
+ (description "This package definition generates a rasterised version of my
+chosen desktop background image from @code{gnome-backgrounds}.")
+ (license (package-license gnome-backgrounds))))
diff --git a/tw/services/desktop.scm b/tw/services/desktop.scm
index af728056..14739b2b 100644
--- a/tw/services/desktop.scm
+++ b/tw/services/desktop.scm
@@ -93,8 +93,9 @@ configure this monitor."))
(gaming? (boolean #f) "Install games and other packages useful for gaming?")
(nvidia-driver? (boolean #f) "Adapt the X11 desktop for the proprietary
NVIDIA driver?")
- (desktop-background string "Path to an image that will be set as the desktop
-background. An initial @code{~/} is replaced with $HOME/.")
+ (desktop-background
+ (file-like (file-append tw-background "/share/backgrounds/tw/blobs.png"))
+ "An image that will be set as the desktop background.")
(bluetooth? (boolean #f) "Whether the device has Bluetooth hardware. If
true, configure the user interface to use it.")
(battery-name maybe-string "The device name of the system's battery, if any.