Change notification system

This commit is contained in:
Hadi
2024-06-24 21:13:22 +02:00
parent 1cdfe8e278
commit 3b84f735ee
9 changed files with 50 additions and 38 deletions

View File

@@ -1,21 +1,18 @@
{ pkgs, config, ... }:
{ pkgs, ... }:
let
homedir = config.home.homeDirectory;
default = "4000";
night-shift-on = pkgs.writeShellScriptBin "night-shift-on" ''
${pkgs.hyprland}/bin/hyprctl dispatch exec "${pkgs.wlsunset}/bin/wlsunset -t ${default}"
message="󰖔 Night-Shift Activated"
${pkgs.libnotify}/bin/notify-send "$message" \
--replace-id="$(cat "/tmp/nixy-notification" 2>/dev/null || echo 0)" --print-id > "/tmp/nixy-notification"
notif "night-shift" "$message"
'';
night-shift-off = pkgs.writeShellScriptBin "night-shift-off" ''
pkill wlsunset
message="󰖔 Night-Shift Deactivated"
${pkgs.libnotify}/bin/notify-send "$message" \
--replace-id="$(cat "/tmp/nixy-notification" 2>/dev/null || echo 0)" --print-id > "/tmp/nixy-notification"
notif "night-shift" "$message"
'';
in { home.packages = [ night-shift-on night-shift-off ]; }