From 413c12c3786ba414608cd293c36cfa9ea33b5c8b Mon Sep 17 00:00:00 2001 From: Quentin Duchemin Date: Sun, 19 Feb 2023 19:20:05 +0100 Subject: [PATCH] Add support for HW brightness control on desktop --- .config/bootstrap/conf.d/desk | 4 +++- .config/bootstrap/config | 1 + .config/i3/config.d/desk | 2 ++ .config/i3/scripts/brightness.sh | 9 +++++++++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 .config/i3/scripts/brightness.sh diff --git a/.config/bootstrap/conf.d/desk b/.config/bootstrap/conf.d/desk index 263e23f..37686ec 100644 --- a/.config/bootstrap/conf.d/desk +++ b/.config/bootstrap/conf.d/desk @@ -1,4 +1,6 @@ +gddccontrol hamster-time-tracker musescore realtime-privileges -zita-ajbridge \ No newline at end of file +zita-ajbridge +zenity \ No newline at end of file diff --git a/.config/bootstrap/config b/.config/bootstrap/config index b6dee2c..1a66def 100644 --- a/.config/bootstrap/config +++ b/.config/bootstrap/config @@ -30,6 +30,7 @@ polybar powerline-fonts python-pip python-pygments +python-pyperclip python-requests redshift rofi diff --git a/.config/i3/config.d/desk b/.config/i3/config.d/desk index 97ee135..f6f96e8 100644 --- a/.config/i3/config.d/desk +++ b/.config/i3/config.d/desk @@ -48,6 +48,8 @@ exec --no-startup-id amixer -D hw:PCH -M sset Headphone 100% # BINDINGS FOR STARTING PROGRAMS ################################## +bindsym $mod+b exec --no-startup-id ~/.config/i3/scripts/brightness.sh + ################################## # BINDINGS FOR STANDARD OPERATIONS ################################## diff --git a/.config/i3/scripts/brightness.sh b/.config/i3/scripts/brightness.sh new file mode 100755 index 0000000..83b29fd --- /dev/null +++ b/.config/i3/scripts/brightness.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +MONITORS='0 9' +BRIGHT=`zenity --entry --width 40 --text="Brightness:"` + +for m in ${MONITORS}; do + ddccontrol dev:/dev/i2c-${m} -r 0x10 -w ${BRIGHT} +done +