From a082af65ad53e4703b9540647aff9a716fdda86b Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Tue, 12 Sep 2023 21:16:20 +0200 Subject: Factor out common desktop services Most of the code for setting desktop layouts is common between machines. Also, make the blueman-applet service reusable. --- tw/home.scm | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'tw/home.scm') diff --git a/tw/home.scm b/tw/home.scm index 4065cf3b..4843baef 100644 --- a/tw/home.scm +++ b/tw/home.scm @@ -246,37 +246,6 @@ ("_JAVA_OPTIONS" . "$_JAVA_OPTIONS${_JAVA_OPTIONS:+ }-Djava.util.prefs.userRoot=$XDG_CONFIG_HOME/java"))))) -(define polybar-wrapper - (program-file "polybar-wrapper" - #~(begin - ;; This wrapper program checks that the monitor we want to start - ;; polybar on is actually connected. - (use-modules (ice-9 popen) - (ice-9 rdelim)) - (let* ((connected-str (string-append (getenv "POLYBAR_MONITOR") " connected")) - (xrandr (open-pipe* OPEN_READ #$(file-append xrandr "/bin/xrandr") "-q")) - (monitor-connected? - (let loop ((line (read-line xrandr))) - (cond - ((eof-object? line) #f) ; we didn't find our monitor connected - ((string-prefix? connected-str line) #t) ; the monitor we want is connected - (else (loop (read-line xrandr))))))) ; keep looking - (close-pipe xrandr) - (when monitor-connected? - (execl #$(file-append polybar "/bin/polybar"))))))) - -(define-public (polybar-service monitor) - (shepherd-service - (documentation (string-append "Polybar desktop bar for monitor " monitor ".")) - (provision (list (symbol-append 'polybar- (string->symbol monitor)))) - (requirement '(xorg-setup)) - (start #~(make-forkexec-constructor - (list #$polybar-wrapper) - #:environment-variables - (cons #$(string-append "POLYBAR_MONITOR=" monitor) - (default-environment-variables)))) - (stop #~(make-kill-destructor)))) - (define-public %interactive-packages (list ;; CLI tools @@ -507,8 +476,6 @@ show_border=1 (local-file "home/files/kitty.conf") catppuccin-kitty)) ("mimeapps.list" ,(local-file "home/files/mimeapps.list")) - ("polybar/config.ini" ,(local-file "home/files/polybar.ini")) - ("polybar/catppuccin.ini" ,catppuccin-polybar) ("rofi/config.rasi" ,(local-file "home/files/rofi.rasi")) ("rofi/themes/catppuccin.rasi" ,catppuccin-rofi) ("xfce4/xfce4-screenshooter" ,xfce4-screenshooter.conf) -- cgit v1.2.3