-
Notifications
You must be signed in to change notification settings - Fork 1
/
Fn-key.txt
109 lines (78 loc) · 3.66 KB
/
Fn-key.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2016-12-26T20:24:02+01:00
====== Fn-key ======
Created mandag 26 december 2016
**Getting the Function-key to work took a little more work than I anticipated. **
**Out of the box **//monitor-off //**and **//wifi-off//** worked (sort of)**
**I was missing **//keyboard/screen-backlight, audio //**and **//touchpad//** controls.**
**The **//wifi-off//** worked somewhat. **
**It turns off the WIFI, but is unable to re-connect when re-enabled.**
**All of the key-presses was registered, and produced a **[[wiki.linuxquestions.org/wiki/XF86_keyboard_symbols|xf86*-multimedia output]]**.**
**Well.. all except **//keyboard-backlight//** which is caused by a bug (fix below)**
**This article will take help combine the **//xf86*-multimedia//** key-press with a function.**
== Screen Backlight ==
**#** **There is a** **bug causing **//FN+F5/F6//** not to produce any output at all.**
**# This can be resolved by adding **//acpi_osi= //**as a kernel module. **
**# Edit **///etc/default/grub//** and add **//acpi_osi=//** to the end of **//CMDLINE_LINUX_DEFAULT//
**# Ex.**
{{{code: lang="texinfo" linenumbers="True"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=bfq acpi_osi="
}}}
**# Generate new grub.cfg**
$ grub-mkconfig -o /boot/grub/grub.cfg
**# No further configuration is needed for the **//Screen-Backlight//**.**
===== Xbindkeys =====
**# **//Xbindkeys//** can be used to bind a key-press with a function.**
**# **//Xbindkeys//** reads its configuration from **//~/.xbindkeysrc //**(Github)**
**# Install the **//Xbindkeys//** package**
$ pacman -S xbindkeys
**# To autostart **//Xbindkeys//**, add it to your **xinitrc.
xbindkeys &
**# To get valueable information about a key-press**
$ xbindkey -k
**# This will produce 3 lines. Ex.**
"(Scheme function)"
m:0x0 + c:121
XF86AudioMute
**# First line can be replaced with a command to run**
**# Second and Third line can be used as binding parameters.**
**# We just need one of the last two lines, and we'll be using the **//xf86*//** value.**
**# All of these definings will be added to our **//~/.xbindkeysrc//** file.**
== Volume Controls ==
**# Requires PulseAudio and Pulseaudio-ctl**
**# Toggle mute **
{{{code: lang="texinfo" linenumbers="True"
"pulseaudio-ctl mute"
XF86AudioMute
}}}
**# Volume Up**
{{{code: lang="texinfo" linenumbers="True"
"pulseaudio-ctl up"
XF86AudioRaiseVolume
}}}
**# Volume Down**
{{{code: lang="texinfo" linenumbers="True"
"pulseaudio-ctl down"
XF86AudioLowerVolume
}}}
== Keyboard Backlight ==
**# We wont get the full experience with 3 steps backlight strenght - rather a 1 setting on/off**
**# This is still preferable from the lousy **//asus-kbd-backlight//** package from AUR, which works for 5 min.**
**# Install the **//upower //**package (used by all major DE basically) **
$ pacman -S upower
**# Add these two snippets to the **//~/.xbindkeysrc//
{{{code: lang="texinfo" linenumbers="True"
"dbus-send --type=method_call --print-reply=literal --system --dest="org.freedesktop.UPower" /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.SetBrightness int32:2"
XF86KbdBrightnessUp
"dbus-send --type=method_call --print-reply=literal --system --dest="org.freedesktop.UPower" /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.SetBrightness int32:0"
XF86KbdBrightnessDown
}}}
== Toggle Touchpad ==
**# Touchpad Toggle script is found at Github.**
**# My location for this script would be **//~/.dotfiles/.scripts/toggle_touchpad.sh//
**# Link to that script in the **//~/.xbindkeysrc//** file.**
{{{code: lang="texinfo" linenumbers="True"
"~/dotfiles/scripts/toggle_touchpad.sh"
XF86TouchpadToggle
}}}