summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSisiutl <sisiutl@egregore.fun>2024-11-07 21:23:27 +0100
committerSisiutl <sisiutl@egregore.fun>2024-11-07 21:23:27 +0100
commit0a616d8ed652683b95bcb9ed292065b2c4fb1f2a (patch)
tree7a78c8b23caf6cd90834f4dfd04f9621cb603e93
parent57d47ad4f05cb6cdc4c3a21b08199ebf5098ac18 (diff)
add plugin infrastructure for hyprland
-rw-r--r--sigils/home/services/hyprland.scm20
-rw-r--r--sigils/packages/hyprland.scm51
2 files changed, 62 insertions, 9 deletions
diff --git a/sigils/home/services/hyprland.scm b/sigils/home/services/hyprland.scm
index aeb22b3..696a88e 100644
--- a/sigils/home/services/hyprland.scm
+++ b/sigils/home/services/hyprland.scm
@@ -1,5 +1,6 @@
(define-module (sigils home services hyprland)
#:use-module (guix gexp)
+ #:use-module (guix packages)
#:use-module (gnu home services)
#:use-module (gnu services configuration)
#:use-module (sigils packages hyprland)
@@ -174,17 +175,24 @@
(windowrulev2 "suppressevent maximize" class:.*)
(windowrulev2 nofocus class:^$ title:^$ xwayland:1 floating:1 fullscreen:0 pinned:0)))
-(define-configuration home-hyprland-configuration
+(define-configuration/no-serialization home-hyprland-configuration
+ (plugins
+ (list-of-packages '())
+ "Additional plugins to load with Hyprland.")
(config
(hypr-config %default-hyprland-config)
"Hyprland configuration"))
-(define (add-hyprland-configuration config)
+(define (hyprland-configuration->file config)
`(("hypr/hyprland.conf"
- ,(mixed-text-file
+ ,(apply
+ mixed-text-file
"hyprland-config"
- (serialize-hypr-config
- (home-hyprland-configuration-config config))))))
+ `(,@(append-map (lambda (plugin)
+ `("plugin = " ,plugin "/lib/lib" ,(package-name plugin) ".so\n"))
+ (home-hyprland-configuration-plugins config))
+ ,(serialize-hypr-config
+ (home-hyprland-configuration-config config)))))))
(define hyprctl-reload-gexp
#~(begin
@@ -196,7 +204,7 @@
(extensions
(list (service-extension
home-xdg-configuration-files-service-type
- add-hyprland-configuration)
+ hyprland-configuration->file)
(service-extension
home-activation-service-type
(const hyprctl-reload-gexp))))
diff --git a/sigils/packages/hyprland.scm b/sigils/packages/hyprland.scm
index 5488969..32a599f 100644
--- a/sigils/packages/hyprland.scm
+++ b/sigils/packages/hyprland.scm
@@ -28,8 +28,6 @@
#:use-module (gnu packages compression)
#:use-module (gnu packages gnome)
#:use-module (gnu packages cpp)
- ;; #:use-module (gnu packages bash)
- ;; #:use-module (gnu packages base)
#:use-module (gnu packages python))
;;; To upstream before the heat death of the universe
@@ -98,6 +96,8 @@ instruction set architectures.")
;;; Hyprland
+(define hyprland-version "0.44.1")
+
(define-public hyprutils
(package
(name "hyprutils")
@@ -257,7 +257,7 @@ replacement for XCursor.")
(define-public hyprland
(package
(name "hyprland")
- (version "0.44.1")
+ (version hyprland-version)
(home-page "https://hyprland.org/")
(source
(origin
@@ -306,3 +306,48 @@ replacement for XCursor.")
(synopsis "Independent, dynamic tiling Wayland compositor")
(description "Hyprland is a 100% independent, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.")
(license license:bsd-3)))
+
+(define-public hyprsplit
+ (package
+ (name "hyprsplit")
+ (version hyprland-version)
+ (home-page "https://github.com/shezdy/hyprsplit")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/shezdy/hyprsplit")
+ (commit (string-append "v" version))))
+ (sha256
+ (base32 "0dvisiff3c69wqfb5xsh4jf8lcm1d1aj0nx8djbl1jfcccfx1q4p"))))
+ (build-system meson-build-system)
+ ;; Hyprland plugins need the same inputs as Hyprland, and Hyprland itself
+ (native-inputs (package-native-inputs hyprland))
+ (inputs (modify-inputs (package-inputs hyprland)
+ (append hyprland)))
+ (synopsis "awesome / dwm like workspaces for hyprland")
+ (description "hyprland plugin for separate sets of workspaces on each monitor")
+ (license license:bsd-3)))
+
+(define-public split-monitor-workspaces
+ (let ((hyprpm-pin "7c0cec6e8661facf252b2c974f214b60c4f87466"))
+ (package
+ (name "split-monitor-workspaces")
+ (version hyprland-version)
+ (home-page "https://github.com/Duckonaut/split-monitor-workspaces")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/Duckonaut/split-monitor-workspaces")
+ (commit hyprpm-pin)))
+ (sha256
+ (base32 "1i6xlpcgqz8xn8hxjynipv84hkpknsszf2h9adpx4ka5hndjg16i"))))
+ (build-system meson-build-system)
+ ;; Hyprland plugins need the same inputs as Hyprland, and Hyprland itself
+ (native-inputs (package-native-inputs hyprland))
+ (inputs (modify-inputs (package-inputs hyprland)
+ (append hyprland)))
+ (synopsis "awesome / dwm like workspaces for hyprland")
+ (description "hyprland plugin for separate sets of workspaces on each monitor")
+ (license license:bsd-3))))