summaryrefslogtreecommitdiff
path: root/tw/home/lap.scm
diff options
context:
space:
mode:
authorTimo Wilken2023-09-12 21:16:20 +0200
committerTimo Wilken2023-09-12 21:20:19 +0200
commita082af65ad53e4703b9540647aff9a716fdda86b (patch)
tree4d18f2d547878caa4aec18e80fc7653a984338c7 /tw/home/lap.scm
parentd44b9efda2d387430e63c1d6cd426c88bcde2eda (diff)
Factor out common desktop services
Most of the code for setting desktop layouts is common between machines. Also, make the blueman-applet service reusable.
Diffstat (limited to 'tw/home/lap.scm')
-rw-r--r--tw/home/lap.scm48
1 files changed, 16 insertions, 32 deletions
diff --git a/tw/home/lap.scm b/tw/home/lap.scm
index ae5fb629..b00b8c20 100644
--- a/tw/home/lap.scm
+++ b/tw/home/lap.scm
@@ -38,6 +38,7 @@
#:use-module ((nongnu packages steam-client)
#:select (steam))
#:use-module (tw home)
+ #:use-module (tw services desktop)
#:use-module (tw services git)
#:use-module (tw services gnupg)
#:use-module (tw packages scanner)
@@ -169,38 +170,21 @@
(nighttime-brightness 0.7)
(extra-content "fade=0"))) ; with fade=1, restarting redshift causes flickering for a few secs
- (simple-service 'laptop-gui-services home-shepherd-service-type
- (list
- (shepherd-service
- (documentation "Blueman applet; provides a GUI for connection to bluetooth devices.")
- (provision '(blueman-applet))
- (start #~(make-forkexec-constructor
- (list #$(file-append blueman "/bin/blueman-applet"))))
- (stop #~(make-kill-destructor)))
-
- (polybar-service "eDP-1")
- (polybar-service "HDMI-1-1")
-
- (shepherd-service
- (documentation "Set up X displays on login.")
- (provision '(xorg-setup))
- (one-shot? #t)
- (start #~(lambda _
- (system* #$(file-append numlockx "/bin/numlockx") "on")
- ;; Turn off the monitors if there is no input for 10 minutes.
- (system* #$(file-append xset "/bin/xset") "dpms" "600" "600" "600")
- (system* #$(file-append xrandr "/bin/xrandr")
- "--output" "eDP-1" "--auto"
- ;; Don't use --auto for this monitor. That
- ;; configures it at 60 Hz, which causes
- ;; it to briefly turn off every few minutes.
- "--output" "HDMI-1-1" "--mode" "2560x1440" "--rate" "120.00"
- "--right-of" "eDP-1")
- ;; Set the desktop background picture. Hopefully doing this just after
- ;; xrandr works and sets it for both screens.
- (system* #$(file-append hsetroot "/bin/hsetroot") "-cover"
- (string-append (getenv "HOME")
- "/pictures/Backgrounds/greece/IMG_20181201_104748_DRO.jpg")))))))
+ (service home-blueman-service-type)
+
+ (service home-desktop-layout-service-type
+ (home-desktop-layout-configuration
+ (desktop-background "~/pictures/Backgrounds/greece/IMG_20181201_104748_DRO.jpg")
+ (monitors
+ (list (home-monitor-configuration
+ (name "eDP-1")
+ (xrandr-options '("--auto")))
+ (home-monitor-configuration
+ (name "HDMI-1-1")
+ ;; Don't use --auto for this monitor. That configures it at 60
+ ;; Hz, which causes it to briefly turn off every few minutes.
+ (xrandr-options '("--mode" "2560x1440" "--rate" "120.00"
+ "--right-of" "eDP-1")))))))
;; On my private machine, I want to use my private PGP key normally, and
;; my work key only for work repositories.