You are not logged in.
I use redshift to change the color of my screen at night. When I change from a tty back to tty7 (where X is), the screen usually reverts back to its normal color.
I tried looking into acpid, but it seems that switching ttys isn't an acpi event.
My DE is cinnamon.
Is there a way to execute a command when switching ttys? Or is there a way not to have the gamma reset?
Offline
Redshift can also be applied to the Linux console by explicitly selecting the DRM driver.
Looks like you can use redshift on both console and X, try it.
------------------------
Is there a way to execute a command when switching ttys?
Check your xorg log after a switch to tty, you'll see something like this :
(II) AIGLX: Suspending AIGLX clients for VT switchThat suggests AIGLX handles/responds to the switch, someone with aiglx programming knowledge may be able to help.
Last edited by Lone_Wolf (2019-02-27 11:33:15)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Thanks for the pointers.
As far as I can tell, there's no easy way to hook into the VT switch. In the meantime, I wrote a stupid little script that'll work until I find a proper solution:
#!/bin/sh
#Get the seat number to know which Xorg log to look at
NUM=$(who | grep `whoami` | sed 's/.*(:\([[:digit:]]\+\))/\1/')
FILE=/var/log/Xorg.$NUM.log
while inotifywait -e modify $FILE
do
if tail -n 60 $FILE | grep "VT" | tail -n 1 | grep -q "\(NVEnterVT\|Resuming\)"
then
redshift -PO $(cat ~/.cache/colortemp)
fi
doneThis doesn't work on the console or if you're logged in multiple times.
I've also wrapped redshift in a little script that'll update ~/.cache/colortemp
Offline