This commit is contained in:
Hadi
2024-10-07 20:27:07 +02:00
parent d37504de7c
commit d11cf580f9
16 changed files with 135 additions and 144 deletions

View File

@@ -10,10 +10,9 @@
{ pkgs, ... }:
let
default = "4000";
night-shift-on = pkgs.writeShellScriptBin "night-shift-on" ''
${pkgs.hyprland}/bin/hyprctl dispatch exec "${pkgs.gammastep}/bin/gammastep -O ${default}"
${pkgs.hyprshade}/bin/hyprshade on blue-light-filter
title="󰖔 Night-Shift Activated"
description="Night-Shift is now activated! Your screen will be warmer and easier on the eyes."
@@ -21,7 +20,7 @@ let
'';
night-shift-off = pkgs.writeShellScriptBin "night-shift-off" ''
pkill gammastep
${pkgs.hyprshade}/bin/hyprshade off
title="󰖕 Night-Shift Deactivated"
description="Night-Shift is now deactivated! Your screen will return to normal."
@@ -29,7 +28,7 @@ let
'';
night-shift = pkgs.writeShellScriptBin "night-shift" ''
if pgrep gammastep; then
if [[ $(${pkgs.hyprshade}/bin/hyprshade current) ]]; then
night-shift-off
else
night-shift-on
@@ -37,7 +36,7 @@ let
'';
night-shift-status = pkgs.writeShellScriptBin "night-shift-status" ''
if [[ $(pgrep gammastep) ]]; then
if [[ $(${pkgs.hyprshade}/bin/hyprshade current) ]]; then
echo "1"
else
echo "0"
@@ -46,15 +45,14 @@ let
night-shift-status-icon =
pkgs.writeShellScriptBin "night-shift-status-icon" ''
if [[ $(pgrep gammastep) ]]; then
echo "󰖔"
else
echo "󰖕"
fi
if [[ $(hyprshade current) ]]; then
echo "󰖔"
else
echo "󰖕"
fi
'';
in {
home.packages = [
pkgs.gammastep
night-shift-on
night-shift-off
night-shift