summaryrefslogtreecommitdiff
path: root/configuration/home-manager/hyprland.nix
diff options
context:
space:
mode:
Diffstat (limited to 'configuration/home-manager/hyprland.nix')
-rw-r--r--configuration/home-manager/hyprland.nix75
1 files changed, 46 insertions, 29 deletions
diff --git a/configuration/home-manager/hyprland.nix b/configuration/home-manager/hyprland.nix
index c545102..77bb675 100644
--- a/configuration/home-manager/hyprland.nix
+++ b/configuration/home-manager/hyprland.nix
@@ -33,9 +33,7 @@ in
"$terminal" = "alacritty";
"$mod" = "SUPER";
- exec-once = [
- "astal-bar"
- ];
+ exec-once = [ ];
debug = {
"disable_logs" = false;
@@ -135,32 +133,6 @@ in
};
};
- programs.waybar.enable = true;
- programs.waybar.settings = {
- mainBar = {
- layer = "top";
- position = "bottom";
- # output = monitor-names;
- modules-left = [
- "hyprland/workspaces"
- ];
- modules-right = [
- "clock"
- "battery"
- ];
-
- "hyprland/workspaces" = {
- all-outputs = true;
- format-icons = {
- active = "";
- default = "";
- };
- format = "{id} {icon}";
- window-rewrite-default = "*";
- };
- };
- };
-
services.hyprpaper.enable = true;
services.hyprpaper.settings = {
preload = [ "${wallpaper}" ];
@@ -277,4 +249,49 @@ in
email = "jaspert.ras@gmail.com";
pinentry = pkgs.pinentry-gnome3;
};
+
+ systemd.user.services.hypr-events = {
+ Unit = {
+ Description = "Listens on Hypr's socket2 for events and handles them";
+ After = [ "graphical-session-pre.target" ];
+ };
+
+ Install = {
+ WantedBy = [ "graphical-session.target" ];
+ };
+
+ Service = {
+ Type = "exec";
+ ExecStart = pkgs.writeShellScript "hyprevents" ''
+ reload_astal() {
+ systemctl --user restart astal
+ }
+
+ handle() {
+ case $1 in
+ monitoradded*) reload_astal ;;
+ monitorremoved*) reload_astal ;;
+ esac
+ }
+
+ ${pkgs.socat}/bin/socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read -r line; do handle "$line"; done
+ '';
+ };
+ };
+
+ systemd.user.services.astal = {
+ Unit = {
+ Description = "Runs the astal bar instance";
+ After = [ "graphical-session-pre.target" ];
+ };
+
+ Service = {
+ Type = "exec";
+ ExecStart = "${inputs.astal-bar.packages.x86_64-linux.default}/bin/astal-bar";
+ };
+
+ Install = {
+ WantedBy = [ "graphical-session.target" ];
+ };
+ };
}