diff --git a/home/scripts/caffeine/default.nix b/home/scripts/caffeine/default.nix index df4c6e3..8acd571 100644 --- a/home/scripts/caffeine/default.nix +++ b/home/scripts/caffeine/default.nix @@ -8,7 +8,7 @@ let [[ $(pidof "hypridle") ]] && echo "󰾪" || echo "󰅶" ''; - caffeine = pkgs.writeShellScriptBin "caffeine-toggle" '' + caffeine = pkgs.writeShellScriptBin "caffeine" '' if [[ $(pidof "hypridle") ]]; then pkill hypridle title="󰅶 Caffeine Activated" diff --git a/home/scripts/night-shift/default.nix b/home/scripts/night-shift/default.nix index 2adea15..7462854 100644 --- a/home/scripts/night-shift/default.nix +++ b/home/scripts/night-shift/default.nix @@ -4,19 +4,23 @@ let 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" - notif "night-shift" "$message" + ${pkgs.hyprland}/bin/hyprctl dispatch exec "${pkgs.gammastep}/bin/gammastep -O ${default}" + title="󰖔 Night-Shift Activated" + description="Night-Shift is now activated! Your screen will be warmer and easier on the eyes." + + notif "night-shift" "$title" "$description" ''; night-shift-off = pkgs.writeShellScriptBin "night-shift-off" '' - pkill wlsunset - message="󰖔 Night-Shift Deactivated" - notif "night-shift" "$message" + pkill gammastep + title="󰖕 Night-Shift Deactivated" + description="Night-Shift is now deactivated! Your screen will return to normal." + + notif "night-shift" "$title" "$description" ''; night-shift = pkgs.writeShellScriptBin "night-shift" '' - if pgrep wlsunset; then + if pgrep gammastep; then night-shift-off else night-shift-on @@ -24,7 +28,7 @@ let ''; night-shift-status = pkgs.writeShellScriptBin "night-shift-status" '' - if [[ $(pgrep wlsunset) ]]; then + if [[ $(pgrep gammastep) ]]; then echo "1" else echo "0" @@ -33,7 +37,7 @@ let night-shift-status-icon = pkgs.writeShellScriptBin "night-shift-status-icon" '' - if [[ $(pgrep wlsunset) ]]; then + if [[ $(pgrep gammastep) ]]; then echo "󰖔" else echo "󰖕" @@ -41,7 +45,7 @@ let ''; in { home.packages = [ - pkgs.wlsunset + pkgs.gammastep night-shift-on night-shift-off night-shift diff --git a/home/scripts/notification/default.nix b/home/scripts/notification/default.nix index c56d258..3fc08cf 100644 --- a/home/scripts/notification/default.nix +++ b/home/scripts/notification/default.nix @@ -10,9 +10,10 @@ let description=$3 [[ -d "$NOTIF_FOLDER" ]] || mkdir $NOTIF_FOLDER - [[ -f "$NOTIF_FOLDER/$sender_id" ]] || echo "0" > "$NOTIF_FOLDER/$sender_id" + [[ -f "$NOTIF_FOLDER/$sender_id" ]] || (echo "0" > "$NOTIF_FOLDER/$sender_id") old_notification_id=$(cat "$NOTIF_FOLDER/$sender_id") + [[ -z "$old_notification_id" ]] && old_notification_id=0 ${pkgs.libnotify}/bin/notify-send \ --replace-id="$old_notification_id" --print-id \