Update and rename gammastep-toggle to hyprshade-auto.sh

This commit is contained in:
FURK4NGG
2026-01-09 00:47:23 +03:00
committed by GitHub
parent bdffc4c178
commit 09f4d69d52
2 changed files with 43 additions and 14 deletions
-14
View File
@@ -1,14 +0,0 @@
#!/bin/bash
SERVICE=gammastep-refresh.service
TIMER=gammastep-refresh.timer
if systemctl --user is-active --quiet "$SERVICE"; then
# KAPAT
systemctl --user stop "$TIMER"
systemctl --user stop "$SERVICE"
else
# AÇ
systemctl --user start "$SERVICE"
systemctl --user enable --now "$TIMER"
fi
+43
View File
@@ -0,0 +1,43 @@
#!/bin/bash
STATE_FILE="$HOME/.config/scripts/hyprshade-toggle-state"
SHADER="$HOME/.config/scripts/night_screen.frag"
HOUR=$(date +%H)
ARG="$1"
if [ ! -f "$STATE_FILE" ]; then
echo 0 > "$STATE_FILE" || exit 1
chmod 600 "$STATE_FILE"
fi
STATE=$(cat "$STATE_FILE")
case "$STATE" in
0)
if [ "$ARG" = "time" ]; then
echo "night_mode controlled"
# DEFAULT (AUTO)
if [ "$HOUR" -ge 19 ] || [ "$HOUR" -lt 7 ]; then
hyprshade on "$SHADER"
else
hyprshade off
fi
else
echo "Default (auto) mod"
echo 1 > "$STATE_FILE"
fi
;;
1)
# KAPALI
hyprshade off
echo "Kapalı mod"
echo 2 > "$STATE_FILE"
;;
2)
# HEP AÇIK
hyprshade on "$SHADER"
echo "Hep açık mod"
echo 0 > "$STATE_FILE"
;;
esac