Hello everyone. I need some assistant.
Here is my cron job:
0 19 * * * ~/.config/waybar/modules/nighttime.sh >> ~/Documents/cronlog 2>&1
And here is my script:
#!/bin/bash
# Checking the time of day
timeofday=$(date +%^P)
# change gamma, brightness and temperature
export DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR
if [ $timeofday != 'am' ]; then
busctl --user -- call rs.wl-gammarelay / rs.wl.gammarelay UpdateBrightness d -0.2
busctl --user -- call rs.wl-gammarelay / rs.wl.gammarelay UpdateGamma d 0.4
busctl --user -- set-property rs.wl-gammarelay / rs.wl.gammarelay Temperature q 4500
else
busctl --user -- set-property rs.wl-gammarelay / rs.wl.gammarelay Brightness d 1
busctl --user -- set-property rs.wl-gammarelay / rs.wl.gammarelay Gamma d 1
busctl --user -- set-property rs.wl-gammarelay / rs.wl.gammarelay Temperature q 6500
fi
If I launch this script from the terminal, it does what I want it to do, but cron gives me errors - failed to connect to bus: connection refused.
I am using Hyprland WM, meaning Wayland. I found a few articles for X11, but they do not work for me. Any help is appreciated, thanks.