diff options
author | 135e2 <[email protected]> | 2022-02-01 23:37:44 +0800 |
---|---|---|
committer | 135e2 <[email protected]> | 2022-02-01 23:38:10 +0800 |
commit | 6594a21ac12b8644882923644dfccc246f4af29c (patch) | |
tree | d36e06c18828f02be62aa0bff270cdd41fe5d58a | |
parent | 25f350ac7de7b7cc2069f51eff7eb9671e76cf47 (diff) | |
download | dotfiles-6594a21ac12b8644882923644dfccc246f4af29c.tar.gz dotfiles-6594a21ac12b8644882923644dfccc246f4af29c.tar.bz2 dotfiles-6594a21ac12b8644882923644dfccc246f4af29c.zip |
config/i3: update to 20220201
- Support brightness control (for crouton)
- ShortKey: $mod+Shift+u Brightness Up
$mod+Shift+d Brightness Down
-rw-r--r-- | config/i3/brightness | 14 | ||||
-rw-r--r-- | config/i3/config | 6 |
2 files changed, 20 insertions, 0 deletions
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 |