jonls / redshift

Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night.
http://jonls.dk/redshift
GNU General Public License v3.0
5.92k stars 429 forks source link

Option to toggle Redshift on/off with reading-mode button keypress #186

Open da2x opened 9 years ago

da2x commented 9 years ago

My Lenovo Yoga 3 Pro has a special key intended to toggle redshifting/reading mode on and off. Works out of the box on Windows, but not in Linux. Redshift should have an option to respond to this or another configurable key to toggle on/off. The key identifies as 0xbf/e03f.

jonls commented 9 years ago

I think this might be appropriate as a feature in redshift-gtk. Is there a unified way of registering for these keyboard events through Gtk or does it depend on the desktop environment?

maandree commented 9 years ago

pkill -USR1 '^redshift$' toggles redshift on and off. You should be able to set up xbindkeys to run that command when the key is pressed.

josephrocca commented 6 years ago

The pkill command above didn't work for me. I ended up assigning two different keyword shortcuts (Using All Settings --> Keyboard --> Shorcuts on Ubuntu 16):

I'm a linux noob though - maybe there's an easier way.

patrickmcnamara commented 6 years ago

I'd also be interested in this. Specifically some sort of command line argument to toggle between day and night. Something like redshift -T.

Implemented like this, you could bind a key to execute that command in various environments, such as i3wm.

robinpaulson commented 4 years ago

Yep, this would be really good. Sometimes I'm watching a film, when a darker scene comes up. I can't make out what's going on so turn off redshift for the scene. Pausing the film, then using the mouse to activate the menu and click the button distracts from the plot/action/suspense somewhat.

A keyboard shortcut would be ideal in this situation.

Cheers!

liuch commented 3 years ago

Hello! Is there a way to know the current redshift status? I want to teach my WM to turn it off automatically when I use specific applications and turn it on back when I close/hide them.

$ redshift -V
redshift 1.12
$ cat /etc/issue
Debian GNU/Linux bullseye/sid \n \l

Thank you in advance!

RavikanthDodda commented 2 years ago

(pgrep redshift && pkill redshift ) || redshift &. Just bind this to keys or create an alias.

MoonSweep commented 2 years ago

Hello! Is there a way to know the current redshift status? I want to teach my WM to turn it off automatically when I use specific applications and turn it on back when I close/hide them.

I would also be interested in such a feature. I need a command-line tool to get the state of Redshift (if it's toggled on or off).

N00BM4573R commented 1 year ago

pkill -USR1 '^redshift$' toggles redshift on and off. You should be able to set up xbindkeys to run that command when the key is pressed.

Works for me in Zorin 16.2 (debian based distro). Thank you very much!

dougmccasland commented 1 year ago

pkill -USR1 '^redshift$'

Had no idea redshift process responded to signals. Didn't see that in redshift manpage. The pkill suggested above works great! I assigned the Pause key to it.