From 1bb36771dd4b1ceb82bc7769f39416db5710361a Mon Sep 17 00:00:00 2001 From: kptltd00m Date: Sun, 28 Jun 2026 14:42:33 +0200 Subject: [PATCH] chore(home): add elephant service and improve waybar configuration - Add elephant backend service with systemd user service - Update walker service to depend on elephant service - Improve waybar configuration with new modules (tray, bluetooth, battery) - Add click handlers for network, pulseaudio, and bluetooth - Update colors and styling for better visibility - Include gaming-apps in laptop home configuration --- home/system/walker/default.nix | 27 +++++++++++---- home/system/waybar/default.nix | 60 ++++++++++++++++++++++++++++++---- hosts/laptop/home.nix | 1 + 3 files changed, 75 insertions(+), 13 deletions(-) diff --git a/home/system/walker/default.nix b/home/system/walker/default.nix index 3d1060c..78284ef 100644 --- a/home/system/walker/default.nix +++ b/home/system/walker/default.nix @@ -6,24 +6,37 @@ elephant ]; + systemd.user.services.elephant = { + Unit = { + Description = "Elephant backend service"; + PartOf = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + + Service = { + ExecStart = "${pkgs.elephant}/bin/elephant"; + Restart = "on-failure"; + RestartSec = 5; + }; + }; + systemd.user.services.walker = { Unit = { Description = "Walker application service"; - After = [ "graphical-session.target" ]; PartOf = [ "graphical-session.target" ]; + After = [ "elephant.service" "graphical-session.target" ]; + Requires = [ "elephant.service" ]; }; Service = { ExecStart = "${pkgs.walker}/bin/walker --gapplication-service"; Restart = "on-failure"; - }; - - Install = { - WantedBy = [ "graphical-session.target" ]; + RestartSec = 5; }; }; wayland.windowManager.hyprland.settings.exec-once = [ - "sh -lc 'elephant service enable && systemctl --user start elephant.service'" + "dbus-update-activation-environment --systemd --all" + "systemctl --user start elephant.service walker.service" ]; -} \ No newline at end of file +} diff --git a/home/system/waybar/default.nix b/home/system/waybar/default.nix index 83aa5b7..f168144 100644 --- a/home/system/waybar/default.nix +++ b/home/system/waybar/default.nix @@ -1,10 +1,10 @@ -{ pkgs, config, ... }: +{ pkgs, config, lib, ... }: let colors = config.lib.stylix.colors; - rgb = base: "${colors."${base}-rgb-r"}, ${colors."${base}-rgb-g"}, ${colors."${base}-rgb-b"}"; + terminal = cmd: "uwsm app -- ${lib.getExe pkgs.ghostty} -e ${cmd}"; radius = toString config.theme.bar-rounding; in @@ -29,6 +29,7 @@ in "modules-left" = [ "hyprland/workspaces" + "tray" ]; "modules-center" = [ @@ -36,8 +37,9 @@ in ]; "modules-right" = [ - "tray" + "custom/bluetooth" "network" + "battery" "pulseaudio" "clock" ]; @@ -73,6 +75,28 @@ in "format-disconnected" = "󰖪"; "tooltip-format" = "{essid}\n{ipaddr}"; + "on-click" = terminal "wifitui"; + }; + + battery = { + interval = 30; + states = { + warning = 30; + critical = 15; + }; + + format = "󰁹 {capacity}%"; + "format-charging" = "󰂄 {capacity}%"; + "format-plugged" = "󰂄 {capacity}%"; + "format-full" = "󰁹 {capacity}%"; + "tooltip-format" = "Battery {capacity}%\n{timeTo} remaining"; + }; + + "custom/bluetooth" = { + exec = "echo 󰂯"; + interval = 3600; + tooltip = false; + "on-click" = "uwsm app -- blueman-manager"; }; pulseaudio = { @@ -82,6 +106,7 @@ in "format-muted" = "󰖁"; tooltip = true; + "on-click" = terminal "wiremix"; }; clock = { @@ -119,10 +144,12 @@ in #workspaces, #window, #tray, + #custom-bluetooth, #network, + #battery, #pulseaudio, #clock { - background: rgba(${rgb "base01"}, 0.82); + background: rgba(${rgb "base01"}, 0.76); border: 1px solid rgba(${rgb "base03"}, 0.45); @@ -187,6 +214,10 @@ in padding-right: 10px; } + #custom-bluetooth { + color: #${colors.base0E}; + } + #network { color: #${colors.base0C}; } @@ -195,6 +226,23 @@ in color: #${colors.base08}; } + #battery { + color: #${colors.base0A}; + } + + #battery.charging, + #battery.plugged { + color: #${colors.base0B}; + } + + #battery.warning { + color: #${colors.base0A}; + } + + #battery.critical { + color: #${colors.base08}; + } + #pulseaudio { color: #${colors.base0B}; } @@ -209,7 +257,7 @@ in } tooltip { - background: rgba(${rgb "base00"}, 0.95); + background: rgba(${rgb "base00"}, 0.90); border: 1px solid rgba(${rgb "base03"}, 0.70); @@ -226,4 +274,4 @@ in "waybar" ]; }; -} \ No newline at end of file +} diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index c17e10e..32d3403 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -26,6 +26,7 @@ ../../home/programs/group/basic-apps.nix ../../home/programs/group/dev.nix ../../home/programs/group/misc.nix + ../../home/programs/group/gaming-apps.nix # ───────────────────────────────────────────────────────────── # System