[Solved] Auto control of redshift & screen brightness

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
User avatar
WiltshireJon
Level 2
Level 2
Posts: 54
Joined: Wed Nov 15, 2017 1:14 pm

[Solved] Auto control of redshift & screen brightness

Post by WiltshireJon » Tue Jan 01, 2019 4:43 am

Hi all. I use redshift while web browsing in the evenings, and also turn the screen brightness down to 50%. I also use the excellent Darktable for developing photographs. The problem is that I often forget to turn off redshift and/or max the screen brightness before a DT session, which then results in odd colour casts in developed pictures. Can I tweak the DT launcher to as to disable redshift and max the screen brightness before launching DT? On my laptop the screen brightness can be adjusted with Fn-F5 (decr) and Fn-F6 (incr).

Thanks.

The Darktable launcher command is as it was installed:

Code: Select all

/usr/bin/darktable %U
and some hardware details which probably don't help much:

Code: Select all

jon@jon-zenbook:~$ inxi -Fxz
System:
  Host: jon-zenbook Kernel: 4.15.0-43-generic x86_64 bits: 64 compiler: gcc 
  v: 7.3.0 Desktop: Cinnamon 4.0.8 Distro: Linux Mint 19.1 Tessa 
  base: Ubuntu 18.04 bionic 
Machine:
  Type: Laptop System: ASUSTeK product: UX360UA v: 1.0 serial: <filter> 
  Mobo: ASUSTeK model: UX360UA v: 1.0 serial: <filter> 
  UEFI: American Megatrends v: UX360UA.300 date: 06/17/2016 
Battery:
  ID-1: BAT0 charge: 42.3 Wh condition: 45.6/57.1 Wh (80%) 
  model: ASUSTeK ASUS Battery status: Discharging 
CPU:
  Topology: Dual Core model: Intel Core i5-6200U bits: 64 type: MT MCP 
  arch: Skylake rev: 3 L2 cache: 3072 KiB 
  flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 19200 
  Speed: 500 MHz min/max: 400/2800 MHz Core speeds (MHz): 1: 500 2: 500 
  3: 500 4: 500 
Graphics:
  Device-1: Intel HD Graphics 520 vendor: ASUSTeK Skylake GT2 driver: i915 
  v: kernel bus ID: 00:02.0 
  Display: x11 server: X.Org 1.19.6 driver: modesetting unloaded: fbdev,vesa 
  resolution: 3200x1800~60Hz 
  OpenGL: renderer: Mesa DRI Intel HD Graphics 520 (Skylake GT2) 
  v: 4.5 Mesa 18.0.5 direct render: Yes 
Audio:
  Device-1: Intel Sunrise Point-LP HD Audio vendor: ASUSTeK 
  driver: snd_hda_intel v: kernel bus ID: 00:1f.3 
  Sound Server: ALSA v: k4.15.0-43-generic 
Network:
  Device-1: Intel Wireless 7265 driver: iwlwifi v: kernel port: f040 
  bus ID: 01:00.0 
  IF: wlp1s0 state: up mac: <filter> 
Drives:
  Local Storage: total: 476.94 GiB used: 114.14 GiB (23.9%) 
  ID-1: /dev/sda vendor: SK Hynix model: HFS512G39MND-3510A size: 476.94 GiB 
Partition:
  ID-1: / size: 211.14 GiB used: 21.98 GiB (10.4%) fs: ext4 dev: /dev/sda5 
  ID-2: swap-1 size: 7.90 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda6 
Sensors:
  System Temperatures: cpu: 31.0 C mobo: N/A 
  Fan Speeds (RPM): cpu: 3800 
Info:
  Processes: 211 Uptime: 1d 15h 37m Memory: 7.69 GiB used: 1.41 GiB (18.3%) 
  Init: systemd runlevel: 5 Compilers: gcc: 7.3.0 Shell: bash v: 4.4.19 
  inxi: 3.0.27 
jon@jon-zenbook:~$ 
Last edited by WiltshireJon on Wed Jan 02, 2019 12:46 pm, edited 1 time in total.

rene
Level 11
Level 11
Posts: 3602
Joined: Sun Mar 27, 2016 6:58 pm

Re: Auto control of redshift & screen brightness

Post by rene » Tue Jan 01, 2019 11:11 am

Yes, seems you can send the SIGUSR1 signal to redshift to have it toggle its enable state. That is, have the launcher command be

Code: Select all

/bin/sh -c "/usr/bin/killall -USR1 redshift && /usr/bin/darktable %U && /usr/bin/killall -USR1 redshift"
Latter one of course only if you want to auto-reenable at exit.

User avatar
WiltshireJon
Level 2
Level 2
Posts: 54
Joined: Wed Nov 15, 2017 1:14 pm

Re: Auto control of redshift & screen brightness

Post by WiltshireJon » Wed Jan 02, 2019 11:24 am

Brilliant, thankyou. You, Sir, are a Scholar and a Gentleman.

Post Reply

Return to “Software & Applications”