Hierbij een door mij gebruikte oplossing om softwarematig kleur en helderheid te beïnvloeden.
Linker Ctrl + pijltje omlaag/omhoog = helderheid
Linker Ctrl + pijltje links/rechts = roder/groener
Voorbereiding:
Installeer xbindkeys, optioneel xbindkeys-config
Terminal:
sudo apt install xbindkeys xbindkeys-config
Check de naam van je Beeldscherm, in mijn config is dat DVI-I-1, kan bijv. ook HDMI-0 zijn of VGA-0
Je kunt toetsen toewijzen via xbindkeys-config of maak een bestand .xbindkeysrc , DVI-I-1 vervangen door jouw monitornaam, met de inhoud:
# For the benefit of emacs users: -*- shell-script -*-
###########################
# xbindkeys configuration #
###########################
#
# Version: 1.8.6
#
# If you edit this file, do not forget to uncomment any lines
# that you change.
# The pound(#) symbol may be used anywhere for comments.
#
# To specify a key, you can use 'xbindkeys --key' or
# 'xbindkeys --multikey' and put one of the two lines in this file.
#
# The format of a command line is:
# "command to start"
# associated key
#
#
# A list of keys is in /usr/include/X11/keysym.h and in
# /usr/include/X11/keysymdef.h
# The XK_ is not needed.
#
# List of modifier:
# Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock),
# Mod3 (CapsLock), Mod4, Mod5 (Scroll).
#
# The release modifier is not a standard X modifier, but you can
# use it if you want to catch release events instead of press events
# By defaults, xbindkeys does not pay attention with the modifiers
# NumLock, CapsLock and ScrollLock.
# Uncomment the lines above if you want to pay attention to them.
#keystate_numlock = enable
#keystate_capslock = enable
#keystate_scrolllock= enable
# Examples of commands:
"xbindkeys_show"
control+shift + q
# set directly keycode (here control + f with my keyboard)
#"xterm"
# c:41 + m:0x4
# specify a mouse button
#"xterm"
# control + b:2
#"xterm -geom 50x20+20+20"
# Shift+Mod2+alt + s
#
## set directly keycode (here control+alt+mod2 + f with my keyboard)
#"xterm"
# alt + c:0x29 + m:4 + mod2
#
## Control+Shift+a release event starts rxvt
#"rxvt"
# release+control+shift + a
#
## Control + mouse button 2 release event starts rxvt
#"rxvt"
# Control + b:2 + Release
##################################
# End of xbindkeys configuration #
##################################
"./brightness.sh - DVI-I-1"
Control + Down
"./brightness.sh + DVI-I-1"
Control + Up
"./brightness.sh - DVI-I-1 --temp"
Control + Left
"./brightness.sh + DVI-I-1 --temp"
Control + Right
en plaats deze in je /home/[user] map.
.xbindkeysrc is een verborgen file, zichtbaar te maken in bestandsbeheer met Ctrl+H
Dan het "uitvoerende" script, maak een bestand brightness.sh met de inhoud:
#!/usr/bin/env bash
set -e
get_display_info() {
xrandr --verbose | grep -m 1 -w "$1 connected" -A8 | grep "$2" | cut -f2- -d: | tr -d ' '
}
# cribbed from redshift, https://github.com/jonls/redshift/blob/master/README-colorramp
GAMMA_VALS=('1.0:0.7:0.4' # 3000K
'1.0:0.7:0.5' # 3500K
'1.0:0.8:0.6' # 4000K
'1.0:0.8:0.7' # 4500K
'1.0:0.9:0.8' # 5000K
'1.0:0.9:0.9' # 6000K
'1.0:1.0:1.0' # 6500K
'0.9:0.9:1.0' # 7000K
'0.8:0.9:1.0' # 8000K
'0.8:0.8:1.0' # 9000K
'0.7:0.8:1.0') # 10000K
get_gamma_index() {
for i in "${!GAMMA_VALS[@]}"; do
[[ "${GAMMA_VALS[$i]}" = "$1" ]] && echo "$i" && break
done
}
get_temp_for_gamma() {
idx=$(get_gamma_index "$1")
awk '{printf "%.1f", $1 / 10}' <<< "$idx"
}
get_gamma_for_temp() {
idx=$(awk '{printf "%d", $1 * 10}' <<< "$1")
echo "${GAMMA_VALS[$idx]}"
}
# gamma values returned by xrandr --verbose are somehow inverted
# https://gitlab.freedesktop.org/xorg/app/xrandr/issues/33
# this function corrects this bug by reverting the calculation
invert_gamma() {
inv_r=$(cut -d: -f1 <<< "$1")
inv_g=$(cut -d: -f2 <<< "$1")
inv_b=$(cut -d: -f3 <<< "$1")
r=$(awk '{printf "%.1f", 1/$1}' <<< "$inv_r" 2>/dev/null)
g=$(awk '{printf "%.1f", 1/$1}' <<< "$inv_g" 2>/dev/null)
b=$(awk '{printf "%.1f", 1/$1}' <<< "$inv_b" 2>/dev/null)
echo "$r:$g:$b"
}
get_gamma() {
invert_gamma "$(get_display_info "$1" 'Gamma: ')"
}
get_brightness() {
get_display_info "$1" 'Brightness: '
}
list_displays() {
echo 'displays:'
displist=''
connected=$(xrandr | grep -w connected | cut -f1 -d' ')
for display in $connected; do
brightness=$(get_brightness "$display")
gamma=$(get_gamma "$display")
temp=$(get_temp_for_gamma "$gamma")
displist+="$display brightness: $brightness gamma: $gamma temp: $temp"
displist+=$'\n'
done
echo "$displist" | column -t | sed 's/^/ /'
}
display_usage() {
script_name=$(basename "$0")
echo "Usage: $script_name op display [stepsize|value] [--temp]"
echo
echo 'arguments:'
echo ' op: '-' to decrease or '+' to increase brightness'
echo ' '=' to set brightness to a specific value'
echo ' display: name of a connected display to adjust'
echo ' stepsize: size of adjustment step (default 0.1)'
echo ' value: value to set (default 1.0 for brightness, 0.6 for color temperature)'
echo ' --temp: adjusts color temperature instead of brightness'
echo
list_displays
}
exec_op() {
if [ "$1" = '+' ]; then
NEWVAL=$(echo "$3 + $2" | bc)
elif [ "$1" = '-' ]; then
NEWVAL=$(echo "$3 - $2" | bc)
elif [ "$1" = '=' ]; then
NEWVAL=$2
fi
if [ "$(echo "$NEWVAL < 0.0" | bc)" -eq 1 ]; then
NEWVAL='0.0'
fi
if [ "$(echo "$NEWVAL > 1.0" | bc)" -eq 1 ]; then
NEWVAL='1.0'
fi
echo "$NEWVAL"
}
if [[ "$1" = '+' || "$1" = '-' || "$1" = '=' ]] && [[ -n "$2" ]]; then
OP=$1; DISP=$2; shift; shift
else
display_usage; exit 1
fi
if [[ "$1" =~ ^[0-9]+(.[0-9]+)?$ ]]; then
OPVAL=$1; shift
else
if [[ "$OP" = '=' ]]; then
if [[ "$1" = '--temp' ]]; then
OPVAL='0.6'
else
OPVAL='1.0'
fi
else
OPVAL='0.1'
fi
fi
CURRBRIGHT=$(get_brightness "$DISP")
if [[ ! "$CURRBRIGHT" =~ ^[0-9]+.[0-9]+$ ]]; then
echo "Error: Selected display $DISP has no brightness value!"
echo; list_displays; exit 1
fi
CURRGAMMA=$(get_gamma "$DISP")
if [[ ! "$CURRGAMMA" =~ ^[0-9].[0-9]:[0-9].[0-9]:[0-9].[0-9]$ ]]; then
echo "Error: Selected display $DISP has no gamma value!"
echo; list_displays; exit 1
fi
NEWBRIGHT="$CURRBRIGHT"
NEWGAMMA="$CURRGAMMA"
if [ "$1" = '--temp' ]; then
CURRTEMP=$(get_temp_for_gamma "$CURRGAMMA")
NEWTEMP=$(exec_op "$OP" "$OPVAL" "$CURRTEMP")
NEWGAMMA=$(get_gamma_for_temp "$NEWTEMP")
else
NEWBRIGHT=$(exec_op "$OP" "$OPVAL" "$CURRBRIGHT")
fi
xrandr --output "$DISP" --brightness "$NEWBRIGHT" --gamma "$NEWGAMMA"
en plaats deze in je /home/[user] map.
In bestandsbeheer rechtermuisklik op het bestand en onder eigenschappen > rechten vink uitvoerbaar/executable aan.
Herstart de machine, nu zou je met Linker Ctrl + pijltjestoetsen e.e.a. moeten kunnen aanpassen.
En nee is niet van mij, maar bijeengesprokkeld op het net.
Verdere info in uw zoekmachines
