♻️ hypr(scripts/night-light): move script to hypr/scripts
This commit is contained in:
+2
-1
@@ -7,7 +7,8 @@
|
|||||||
|
|
||||||
|
|
||||||
# Services/Daemons
|
# Services/Daemons
|
||||||
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
# exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
||||||
|
exec-once = systemctl enable --user --now hyprpolkitagent
|
||||||
exec-once = systemctl enable --user --now hypridle
|
exec-once = systemctl enable --user --now hypridle
|
||||||
exec-once = systemctl enable --user --now gnome-keyring-daemon
|
exec-once = systemctl enable --user --now gnome-keyring-daemon
|
||||||
exec-once = wl-paste --type text --watch cliphist store
|
exec-once = wl-paste --type text --watch cliphist store
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# From https://github.com/retrozinndev/Hyprland-Dots
|
# From https://github.com/retrozinndev/Hyprland-Dots
|
||||||
|
|
||||||
|
|
||||||
if [[ -f "$HOME/.cache/night-light.pid" ]]; then
|
if [[ -f "$XDG_CACHE_HOME/night-light.pid" ]]; then
|
||||||
rm "$HOME/.cache/night-light.pid"
|
rm "$XDG_CACHE_HOME/night-light.pid"
|
||||||
sh $HOME/.config/eww/scripts/night-light.sh
|
sh $XDG_CONFIG_HOME/hypr/scripts/night-light.sh
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
pidfile="$HOME/.cache/night-light.pid"
|
||||||
|
temperature=4500 # in K
|
||||||
|
|
||||||
|
# run only if pid file does not exist
|
||||||
|
if ! [[ -f $pidfile ]]; then
|
||||||
|
touch $pidfile
|
||||||
|
hyprsunset -t $temperature &
|
||||||
|
_pid=$!
|
||||||
|
echo -e $_pid > $pidfile
|
||||||
|
wait $_pid && rm -f $pidfile
|
||||||
|
else
|
||||||
|
echo "There's already an instance running! Mistake? Delete \"~/.cache/night-light.pid\"."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user