Change to gammastep

This commit is contained in:
Hadi 2024-09-04 01:40:24 +02:00
parent e9a20f49e2
commit 659509e613
3 changed files with 17 additions and 12 deletions

View File

@ -8,7 +8,7 @@ let
[[ $(pidof "hypridle") ]] && echo "󰾪" || echo "󰅶" [[ $(pidof "hypridle") ]] && echo "󰾪" || echo "󰅶"
''; '';
caffeine = pkgs.writeShellScriptBin "caffeine-toggle" '' caffeine = pkgs.writeShellScriptBin "caffeine" ''
if [[ $(pidof "hypridle") ]]; then if [[ $(pidof "hypridle") ]]; then
pkill hypridle pkill hypridle
title="󰅶 Caffeine Activated" title="󰅶 Caffeine Activated"

View File

@ -4,19 +4,23 @@ let
default = "4000"; default = "4000";
night-shift-on = pkgs.writeShellScriptBin "night-shift-on" '' night-shift-on = pkgs.writeShellScriptBin "night-shift-on" ''
${pkgs.hyprland}/bin/hyprctl dispatch exec "${pkgs.wlsunset}/bin/wlsunset -t ${default}" ${pkgs.hyprland}/bin/hyprctl dispatch exec "${pkgs.gammastep}/bin/gammastep -O ${default}"
message="󰖔 Night-Shift Activated" title="󰖔 Night-Shift Activated"
notif "night-shift" "$message" 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" '' night-shift-off = pkgs.writeShellScriptBin "night-shift-off" ''
pkill wlsunset pkill gammastep
message="󰖔 Night-Shift Deactivated" title="󰖕 Night-Shift Deactivated"
notif "night-shift" "$message" description="Night-Shift is now deactivated! Your screen will return to normal."
notif "night-shift" "$title" "$description"
''; '';
night-shift = pkgs.writeShellScriptBin "night-shift" '' night-shift = pkgs.writeShellScriptBin "night-shift" ''
if pgrep wlsunset; then if pgrep gammastep; then
night-shift-off night-shift-off
else else
night-shift-on night-shift-on
@ -24,7 +28,7 @@ let
''; '';
night-shift-status = pkgs.writeShellScriptBin "night-shift-status" '' night-shift-status = pkgs.writeShellScriptBin "night-shift-status" ''
if [[ $(pgrep wlsunset) ]]; then if [[ $(pgrep gammastep) ]]; then
echo "1" echo "1"
else else
echo "0" echo "0"
@ -33,7 +37,7 @@ let
night-shift-status-icon = night-shift-status-icon =
pkgs.writeShellScriptBin "night-shift-status-icon" '' pkgs.writeShellScriptBin "night-shift-status-icon" ''
if [[ $(pgrep wlsunset) ]]; then if [[ $(pgrep gammastep) ]]; then
echo "󰖔" echo "󰖔"
else else
echo "󰖕" echo "󰖕"
@ -41,7 +45,7 @@ let
''; '';
in { in {
home.packages = [ home.packages = [
pkgs.wlsunset pkgs.gammastep
night-shift-on night-shift-on
night-shift-off night-shift-off
night-shift night-shift

View File

@ -10,9 +10,10 @@ let
description=$3 description=$3
[[ -d "$NOTIF_FOLDER" ]] || mkdir $NOTIF_FOLDER [[ -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") old_notification_id=$(cat "$NOTIF_FOLDER/$sender_id")
[[ -z "$old_notification_id" ]] && old_notification_id=0
${pkgs.libnotify}/bin/notify-send \ ${pkgs.libnotify}/bin/notify-send \
--replace-id="$old_notification_id" --print-id \ --replace-id="$old_notification_id" --print-id \