diff options
Diffstat (limited to 'oni')
-rw-r--r-- | oni/home/data/config.scm | 9 | ||||
-rw-r--r-- | oni/home/services/polybar.scm | 50 |
2 files changed, 57 insertions, 2 deletions
diff --git a/oni/home/data/config.scm b/oni/home/data/config.scm index 606334b..26d5178 100644 --- a/oni/home/data/config.scm +++ b/oni/home/data/config.scm @@ -16,7 +16,8 @@ #:use-module (oni home services compton) #:use-module (oni home services xbindkeys) #:use-module (oni home services zsh) - #:use-module (oni home services herbstluftwm)) + #:use-module (oni home services herbstluftwm) + #:use-module (oni home services polybar)) (home-environment (packages (list (specification->package+output "glibc-locales"))) @@ -304,4 +305,8 @@ "keybind Mod4-apostrophe spawn dunstctl close" "keybind Mod4-quotedbl spawn dunstctl close-all" "keybind Mod4-Control-apostrophe spawn dunstctl history-pop" - "keybind Mod4-Mod1-apostrophe spawn dunstctl context"))))))) + "keybind Mod4-Mod1-apostrophe spawn dunstctl context")))) + + (service home-polybar-service-type + (home-polybar-configuration + (bar "data")))))) diff --git a/oni/home/services/polybar.scm b/oni/home/services/polybar.scm new file mode 100644 index 0000000..3fbbadc --- /dev/null +++ b/oni/home/services/polybar.scm @@ -0,0 +1,50 @@ +(define-module (oni home services polybar) + #:use-module (gnu services configuration) + #:use-module (gnu packages wm) + #:use-module (gnu home services) + #:use-module (gnu home services shepherd) + #:use-module (gnu home services utils) + #:use-module (guix packages) + #:use-module (guix gexp) + + #:export (home-polybar-service-type + home-polybar-configuration)) + +(define-configuration home-polybar-configuration + (package + (package polybar) + "Package to use for setting polybar") + (bar + (string "default") + "Bar to use at startup") + (no-serialization)) + +(define (add-polybar-packages config) + (list (home-polybar-configuration-package config))) + +(define (home-polybar-shepherd-service config) + (list + (shepherd-service + (documentation "Start polybar") + (provision '(polybar statusbar)) + (auto-start? #t) + (start + #~(make-forkexec-constructor + (list #$(file-append (home-polybar-configuration-package config) "/bin/polybar") + #$(home-polybar-configuration-bar config)) + #:log-file (format #f "~a/.local/var/log/polybar.log" (getenv "HOME")))) + (stop #~(make-kill-destructor))))) + +(define home-polybar-service-type + (service-type + (name 'home-polybar) + (extensions + (list (service-extension + home-profile-service-type + add-polybar-packages) + (service-extension + home-shepherd-service-type + home-polybar-shepherd-service))) + (compose identity) + (default-value (home-polybar-configuration)) + (description "Install and configure polybar."))) |