You are not logged in.

#1 2018-10-15 19:10:50

pamir
Member
Registered: 2018-02-02
Posts: 43

how do i set the Fn command shorcuts, screen brightness does not work

i have to manually set the display brightness using the touchpad on the power icon.

I want to use Fn and F5 for dimming and Fn and F6 for brighter, as it is printed on the keyboard.

thank you

Offline

#2 2018-10-15 21:22:03

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: how do i set the Fn command shorcuts, screen brightness does not work

Here is a script to send brightness +/- to an xrandr command, which replicates the functionality you need...

#!/bin/bash
##
## brightness

BRIGHTNESS="$HOME/.config/mon-brightness.rc"

if [[ -f $BRIGHTNESS ]];then
    VAL=$(<$BRIGHTNESS)
else
    VAL=1.0
    echo $VAL > $BRIGHTNESS
fi

if [[ $1 = plus ]];then
    VAL=$(awk -v "VAL=$VAL" 'BEGIN { print VAL + 0.1 }')
elif [[ $1 = minus ]];then
    VAL=$(awk -v "VAL=$VAL" 'BEGIN { print VAL - 0.1 }')
else
    notify-send -t 3000 "Use 'brightness plus/minus'"
    exit 1
fi

echo $VAL > $BRIGHTNESS

xrandr --output DVI-D-0 --brightness $VAL --output HDMI-0 --brightness $VAL

NB: There is no error checking in this script, so make sure to create "$HOME/.config/mon-brightness.rc" first. You would also need to set the --output to whatever your system has (the script is for 2 monitors)

IIRC I used keybinds like Control+F9 to send the command "brightness +" to increase the value, and Control+F8 for "brightness -", because that corresponded to my laptop keys. (No need to use the Fn key)

Last edited by damo (2018-10-15 21:25:03)


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#3 2018-10-16 09:01:51

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: how do i set the Fn command shorcuts, screen brightness does not work

^ This assumes that you cannot map 'XF86BrightnessAdjust' to use those keys. Use xev to see what the keys are mapped to now.

At the time I made that script, the combination of hardware and kernel meant that the brightness keys didn't work in combination with the Fn key.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

Board footer

Powered by FluxBB