Add custom wm-ready systemd target, and run wl-gammarelay on it

This commit is contained in:
ItsDrike 2023-01-25 02:30:17 +01:00
parent 109d0d630b
commit 7ae0ced2c0
No known key found for this signature in database
GPG key ID: B014E761034AF742
5 changed files with 12 additions and 2 deletions

View file

@ -14,6 +14,7 @@
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = systemctl --user start xdg-desktop-portal-hyprland exec-once = systemctl --user start xdg-desktop-portal-hyprland
exec-once = systemctl --user start wm-ready.target
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec-once = setbg exec-once = setbg

View file

@ -1,9 +1,10 @@
[Unit] [Unit]
Description="Redshift and brightness control for Wayland " Description="Redshift and brightness control for Wayland"
BindsTo=graphical-session.target
[Service] [Service]
ExecStart=/usr/bin/wl-gammarelay-rs run ExecStart=/usr/bin/wl-gammarelay-rs run
Restart=on-failure Restart=on-failure
[Install] [Install]
WantedBy=graphical-session.target WantedBy=wm-ready.target

View file

@ -0,0 +1,3 @@
[Unit]
Description=Window Manager loaded and ready
BindsTo=graphical-session.target

View file

@ -0,0 +1 @@
/home/itsdrike/.config/systemd/user/wl-gammarelay.service

View file

@ -11,3 +11,7 @@ HYPRLAND_LOG="${XDG_CACHE_HOME:-$HOME/.cache}/hyprlog.txt"
echo "---------- NEW RUN $(date) ----------" >> "$HYPRLAND_LOG" echo "---------- NEW RUN $(date) ----------" >> "$HYPRLAND_LOG"
Hyprland 2>&1 | awk '{ print strftime("%s: "), $0, fflush(); }' | tee -a "$HYPRLAND_LOG" Hyprland 2>&1 | awk '{ print strftime("%s: "), $0, fflush(); }' | tee -a "$HYPRLAND_LOG"
echo "---------- ENDED $(date) ----------" >> "$HYPRLAND_LOG" echo "---------- ENDED $(date) ----------" >> "$HYPRLAND_LOG"
if systemctl --user is-active wm-ready.target &>/dev/null; then
systemctl --user stop wm-ready.target
fi