Backlight Control

- Add support for brightness buttons to control screen brightness
- Update readme with link to acpilight
This commit is contained in:
Sravan Balaji
2020-09-04 20:45:21 -04:00
parent fde880858a
commit 10b140adff
2 changed files with 6 additions and 0 deletions

View File

@@ -75,3 +75,5 @@ and (re)compiling the source code.
* Use [light-locker](https://github.com/the-cavalry/light-locker) to lock screen with [LightDM](https://github.com/canonical/lightdm)
* Arch Community Repo: [lightdm](https://www.archlinux.org/packages/extra/x86_64/lightdm/)
* Arch Community Repo: [light-locker](https://www.archlinux.org/packages/community/x86_64/light-locker/)
* Brightness Increase and Decrease Keybindings via [acpilight](https://gitlab.com/wavexx/acpilight)
* Arch Community Repo: [acpilight](https://www.archlinux.org/packages/community/any/acpilight/)

View File

@@ -81,6 +81,8 @@ static const char *termcmd[] = { "alacritty", NULL };
static const char *upvolcmd[] = { "/usr/bin/pactl", "set-sink-volume", "@DEFAULT_SINK@", "+1%", NULL };
static const char *downvolcmd[] = { "/usr/bin/pactl", "set-sink-volume", "@DEFAULT_SINK@", "-1%", NULL };
static const char *mutevolcmd[] = { "/usr/bin/pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL };
static const char *brightness_up[] = { "xbacklight", "-inc", "1", NULL };
static const char *brightness_down[] = { "xbacklight", "-dec", "1", NULL };
static const char *playerplaypausecmd[] = { "playerctl", "--player=playerctld", "play-pause", NULL };
static const char *playernextcmd[] = { "playerctl", "--player=playerctld", "next", NULL };
static const char *playerprevcmd[] = { "playerctl", "--player=playerctld", "previous", NULL };
@@ -129,6 +131,8 @@ static Key keys[] = {
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = downvolcmd} },
{ 0, XF86XK_AudioMute, spawn, {.v = mutevolcmd} },
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvolcmd} },
{ 0, XF86XK_MonBrightnessUp, spawn, {.v = brightness_up} },
{ 0, XF86XK_MonBrightnessDown, spawn, {.v = brightness_down} },
{ 0, XF86XK_AudioPlay, spawn, {.v = playerplaypausecmd} },
{ 0, XF86XK_AudioNext, spawn, {.v = playernextcmd} },
{ 0, XF86XK_AudioPrev, spawn, {.v = playerprevcmd} },