From 4ac405c3278037fbcd33e77fd4bad5b5c65b6459 Mon Sep 17 00:00:00 2001 From: "Richard G. Riley" Date: Mon, 4 Jan 2021 00:24:28 +0100 Subject: [PATCH] added x-backlight-persist get --- README.md | 12 ++++++++++-- directories/bin/x-backlight-persist | 10 +++++++++- dot-config/i3/config | 2 +- linux-init-files.org | 12 ++++++++++-- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ff0d0ff5..7ad5a0a3 100644 --- a/README.md +++ b/README.md @@ -280,13 +280,18 @@ Save and restore backlight values save() { l=$(xbacklight -get); echo $l > ~/.x-backlight-persist + echo $l +} + +get() { + echo $(xbacklight -get); } restore() { b=100 [[ -f ~/.x-backlight-persist ]] && read b < ~/.x-backlight-persist xbacklight -set $b - unset b + echo $b } case "$1" in @@ -297,6 +302,9 @@ case "$1" in restore) restore ;; + get) + get + ;; *) save ;; @@ -1214,7 +1222,7 @@ bindsym $mod+Shift+e exec emacs-same-frame bindsym $mod+Shift+f exec google-chrome bindsym $mod+Control+t exec "notify-send -t 2000 'Opening NEW Terminator instance' && terminator -e tmux" bindsym $mod+Control+l exec (sleep 1 && xset dpms force standby) #triggers xss-lock -bindsym $mod+Control+o exec xmg-neo-rgb-kbd-lights toggle +bindsym $mod+Control+o exec xmg-neo-rgb-kbd-lights toggle && x-backlight-persist restore bindsym $mod+Control+g exec x-lock-utils lock_gpg_clear bindsym $mod+Control+f exec thunar bindsym $mod+g exec "goldendict \\"`xclip -o -selection clipboard`\\"" diff --git a/directories/bin/x-backlight-persist b/directories/bin/x-backlight-persist index 56e3cf87..bd30e8b1 100755 --- a/directories/bin/x-backlight-persist +++ b/directories/bin/x-backlight-persist @@ -4,13 +4,18 @@ save() { l=$(xbacklight -get); echo $l > ~/.x-backlight-persist + echo $l +} + +get() { + echo $(xbacklight -get); } restore() { b=100 [[ -f ~/.x-backlight-persist ]] && read b < ~/.x-backlight-persist xbacklight -set $b - unset b + echo $b } case "$1" in @@ -21,6 +26,9 @@ case "$1" in restore) restore ;; + get) + get + ;; *) save ;; diff --git a/dot-config/i3/config b/dot-config/i3/config index 64024b5a..7704db7f 100644 --- a/dot-config/i3/config +++ b/dot-config/i3/config @@ -199,7 +199,7 @@ bindsym $mod+Shift+e exec emacs-same-frame bindsym $mod+Shift+f exec google-chrome bindsym $mod+Control+t exec "notify-send -t 2000 'Opening NEW Terminator instance' && terminator -e tmux" bindsym $mod+Control+l exec (sleep 1 && xset dpms force standby) #triggers xss-lock -bindsym $mod+Control+o exec xmg-neo-rgb-kbd-lights toggle +bindsym $mod+Control+o exec xmg-neo-rgb-kbd-lights toggle && x-backlight-persist restore bindsym $mod+Control+g exec x-lock-utils lock_gpg_clear bindsym $mod+Control+f exec thunar bindsym $mod+g exec "goldendict \\"`xclip -o -selection clipboard`\\"" diff --git a/linux-init-files.org b/linux-init-files.org index f370b65c..3c851cfe 100644 --- a/linux-init-files.org +++ b/linux-init-files.org @@ -304,13 +304,18 @@ save() { l=$(xbacklight -get); echo $l > ~/.x-backlight-persist + echo $l + } + + get() { + echo $(xbacklight -get); } restore() { b=100 [[ -f ~/.x-backlight-persist ]] && read b < ~/.x-backlight-persist xbacklight -set $b - unset b + echo $b } case "$1" in @@ -321,6 +326,9 @@ restore) restore ;; + get) + get + ;; ,*) save ;; @@ -1175,7 +1183,7 @@ bindsym $mod+Shift+f exec google-chrome bindsym $mod+Control+t exec "notify-send -t 2000 'Opening NEW Terminator instance' && terminator -e tmux" bindsym $mod+Control+l exec (sleep 1 && xset dpms force standby) #triggers xss-lock - bindsym $mod+Control+o exec xmg-neo-rgb-kbd-lights toggle + bindsym $mod+Control+o exec xmg-neo-rgb-kbd-lights toggle && x-backlight-persist restore bindsym $mod+Control+g exec x-lock-utils lock_gpg_clear bindsym $mod+Control+f exec thunar bindsym $mod+g exec "goldendict \\"`xclip -o -selection clipboard`\\""