From 6594a21ac12b8644882923644dfccc246f4af29c Mon Sep 17 00:00:00 2001 From: 135e2 <135e2@135e2.tk> Date: Tue, 1 Feb 2022 23:37:44 +0800 Subject: config/i3: update to 20220201 - Support brightness control (for crouton) - ShortKey: $mod+Shift+u Brightness Up $mod+Shift+d Brightness Down --- config/i3/brightness | 14 ++++++++++++++ config/i3/config | 6 ++++++ 2 files changed, 20 insertions(+) create mode 100644 config/i3/brightness (limited to 'config') diff --git a/config/i3/brightness b/config/i3/brightness new file mode 100644 index 0000000..ecd34ee --- /dev/null +++ b/config/i3/brightness @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +cur_brightness=$(brightness) + +case "$1" in +u*) arg='up' ;; +d*) arg='down' ;; +esac + +if [[ $((cur_brightness)) -le 6 && ${arg} == 'down' ]]; then + echo 'Brightness too low, skipping now...' +else + brightness b ${arg} +fi diff --git a/config/i3/config b/config/i3/config index 0211afc..ebbd962 100644 --- a/config/i3/config +++ b/config/i3/config @@ -13,6 +13,12 @@ set $mod Mod4 # Set delete key bindsym $mod+BackSpace exec xdotool key Delete + +# Brightness control +bindsym $mod+Shift+u exec --no-startup-id bash ~/.config/i3/brightness up +bindsym $mod+Shift+d exec --no-startup-id bash ~/.config/i3/brightness down + + bindsym --release $mod+Prior exec --no-startup-id xdotool key --clearmodifiers Home bindsym --release $mod+Next exec --no-startup-id xdotool key --clearmodifiers End # Font for window titles. Will also be used by the bar unless a different font -- cgit v1.2.3