zaphyra's git: nixfiles

zaphyra's nixfiles

commit 3ee4e58933e499e4e28660d5c9b983b1cc7c2a64
parent 5fa5e913d88640e9013c2059bbf230def3ed6f45
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Sat, 26 Jul 2025 21:18:53 +0200

config/home/zaphyra/services/swaync: replace `nwg-bar` with `waylogout`
2 files changed, 50 insertions(+), 67 deletions(-)
M
config/home/zaphyra/services/swaync.nix
|
116
+++++++++++++++++++++++++++++++++----------------------------------------------
M
config/nixos/modules/font.nix
|
1
+
diff --git a/config/home/zaphyra/services/swaync.nix b/config/home/zaphyra/services/swaync.nix
@@ -1,4 +1,4 @@
-{
+  {
   config,
   lib,
   pkgs,

@@ -98,76 +98,58 @@
             label = "";
             command =
               let
-                icons = "${pkgs.nwg-bar}/share/nwg-bar/images";
-                config = pkgs.writeText "nwg-bar.json" (
-                  builtins.toJSON [
-                    {
-                      label = "Lock";
-                      exec = "loginctl lock-session";
-                      icon = "${icons}/system-lock-screen.svg";
-                    }
-                    {
-                      label = "Logout";
-                      exec = "systemctl start niri-shutdown.target";
-                      icon = "${icons}/system-log-out.svg";
-                    }
-                    {
-                      label = "Reboot";
-                      exec = "systemctl reboot";
-                      icon = "${icons}/system-reboot.svg";
-                    }
-                    {
-                      label = "Shutdown";
-                      exec = "systemctl -i poweroff";
-                      icon = "${icons}/system-shutdown.svg";
-                    }
-                  ]
-                );
-                style = pkgs.writeText "nwg-bar.css" ''
-                  window {
-                    background: transparent;
-                    padding: 20px;
-                  }
-
-                  /* Outer bar container, takes all the window width/height */
-                  #outer-box {
-                    margin: 0px;
-                  }
-
-                  /* Inner bar container, surrounds buttons */
-                  #inner-box {
-                    box-shadow: 0 0 10px 0 rgba(0,0,0,.80);
-                    border-radius: 10px;
-                    background-color: #303030;
-                    border: 1px solid rgba(255, 255, 255, 0.08);
-                    margin: 10px;
-                  }
-
-                  button {
-                    border: 1px solid rgba(255, 255, 255, 0.08);
-                    padding-left: 10px;
-                    padding-right: 10px;
-                    margin: 5px;
-                  }
-
-                  button:hover {
-                    background: rgba(255, 255, 255, 0.1);
-                  }
+                configFile = pkgs.writeText "waylogout.conf" ''
+                  screenshots
+                  labels
+                  selection-label
+
+                  font="Adwaita Sans"
+
+                  effect-blur=7x5
+                  indicator-thickness=20
+                  ring-color=888888aa
+                  inside-color=88888866
+                  text-color=eaeaeaaa
+                  line-color=00000000
+                  ring-selection-color=33cc33aa
+                  inside-selection-color=33cc3366
+                  text-selection-color=eaeaeaaa
+                  line-selection-color=00000000
+
+                  default-action="suspend"
+
+                  lock-symbol=
+                  lock-command="loginctl lock-session"
+
+                  logout-symbol=
+                  logout-command="loginctl terminate-session"
+
+                  suspend-symbol=
+                  suspend-command="systemctl suspend"
+
+                  poweroff-symbol=
+                  poweroff-command="systemctl poweroff"
+
+                  reboot-symbol=
+                  reboot-command="systemctl reboot"
+
+                  cancel-symbol=
                 '';
-                nwg-bar = lib.concatStringsSep " " [
-                  (lib.getExe pkgs.nwg-bar)
-                  "-t"
-                  config
-                  "-s"
-                  style
-                  "-p"
-                  "top"
-                  "-mt"
-                  "45"
+                waylogout = lib.concatStringsSep " " [
+                  (lib.getExe (pkgs.waylogout.overrideAttrs rec {
+                    version = "0.3";
+                    src = pkgs.fetchFromGitHub {
+                      owner = "loserMcloser";
+                      repo = "waylogout";
+                      rev = "v${version}";
+                      hash = "sha256-dsuuTjmZm3IpqXU68LsAz86HNbMFvKhWPYOMG/5Z4jE=";
+                    };
+                  }))
+                  "--config=${configFile}"
                 ];
 
               in
-              "swaync-client -cp; ${nwg-bar}";
+              "swaync-client -cp; ${waylogout}";
           }
         ];
       };
diff --git a/config/nixos/modules/font.nix b/config/nixos/modules/font.nix
@@ -33,6 +33,7 @@ in
         fira-code
         fira-mono
         meslo-lgs-nf
+        font-awesome
       ];
     };
   };