diff options
Diffstat (limited to 'home/rices/nord-blue/dunst.nix')
| -rw-r--r-- | home/rices/nord-blue/dunst.nix | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/home/rices/nord-blue/dunst.nix b/home/rices/nord-blue/dunst.nix deleted file mode 100644 index 6226cb6..0000000 --- a/home/rices/nord-blue/dunst.nix +++ /dev/null @@ -1,101 +0,0 @@ -{ config, pkgs, lib, ... }: - -let - vars = import ./variables.nix; - - # Battery notification script - batteryNotify = pkgs.writeShellScriptBin "battery-notify" '' - #!/bin/sh - - # Get battery status - BATTERY_PATH="/sys/class/power_supply/BAT0" - - if [ ! -d "$BATTERY_PATH" ]; then - # Try BAT1 if BAT0 doesn't exist - BATTERY_PATH="/sys/class/power_supply/BAT1" - if [ ! -d "$BATTERY_PATH" ]; then - exit 0 - fi - fi - - CAPACITY=$(cat "$BATTERY_PATH/capacity") - STATUS=$(cat "$BATTERY_PATH/status") - - # Critical threshold (5%) - if [ "$CAPACITY" -le 5 ] && [ "$STATUS" != "Charging" ]; then - ${pkgs.libnotify}/bin/notify-send -u critical "Battery Critical" "Battery level: $CAPACITY%\nPlease plug in charger immediately!" - # Low threshold (15%) - elif [ "$CAPACITY" -le 15 ] && [ "$STATUS" != "Charging" ]; then - ${pkgs.libnotify}/bin/notify-send -u normal "Battery Low" "Battery level: $CAPACITY%\nConsider plugging in charger soon." - fi - ''; - -in { - home.packages = [ batteryNotify ]; - - services.dunst = { - enable = true; - - settings = { - global = { - width = "(200,300)"; - height = "(0,150)"; - offset = "(30,50)"; - origin = "bottom-right"; - transparency = 10; - frame_width = 2; - corner_radius = 8; - gap_size = 5; - }; - - # Let stylix handle color styling - # urgency_low = { - # background = vars.colors.background; - # foreground = vars.colors.foreground; - # timeout = 8; - # }; - - # urgency_normal = { - # background = vars.colors.background; - # foreground = vars.colors.foreground; - # frame_color = vars.colors.accent; - # timeout = 10; - # }; - - urgency_critical = { - # background = vars.colors.background; - # foreground = vars.colors.foreground; - # frame_color = vars.colors.alert; - timeout = 0; # Don't auto-dismiss critical notifications - }; - }; - }; - - # Systemd service to check battery periodically - systemd.user.services.battery-notify = { - Unit = { - Description = "Battery level notification service"; - }; - - Service = { - Type = "oneshot"; - ExecStart = "${batteryNotify}/bin/battery-notify"; - }; - }; - - # Timer to run battery check every 2 minutes - systemd.user.timers.battery-notify = { - Unit = { - Description = "Battery level notification timer"; - }; - - Timer = { - OnBootSec = "1min"; - OnUnitActiveSec = "2min"; - }; - - Install = { - WantedBy = [ "timers.target" ]; - }; - }; -} |
