diff options
author | Justine Smithies <justine@smithies.me.uk> | 2024-05-26 13:30:12 +0100 |
---|---|---|
committer | Justine Smithies <justine@smithies.me.uk> | 2024-05-26 13:30:12 +0100 |
commit | c71cff0253067d1309fc8d0034b975618a43d541 (patch) | |
tree | e7b121f7b45cba26795ea67c36c58082d05fdea5 | |
parent | f2b5a6616688fe9264ee0d019f275b66e42dc668 (diff) |
Added facility to save and restore brightness using brightnessctl
-rwxr-xr-x | .config/river/autostart.sh | 8 | ||||
-rwxr-xr-x | .config/river/init | 4 | ||||
-rwxr-xr-x | .config/yambar/scripts/brightnesscontrol | 4 |
3 files changed, 7 insertions, 9 deletions
diff --git a/.config/river/autostart.sh b/.config/river/autostart.sh index eab8506..8cc130f 100755 --- a/.config/river/autostart.sh +++ b/.config/river/autostart.sh @@ -5,11 +5,6 @@ pkill -f /usr/libexec/polkit-gnome-authentication-agent-1 /usr/libexec/polkit-mate-authentication-agent-1 & -# Kill any existing pipewire / wireplumber daemons and only then try to start a new set. - -#pkill -u "${USER}" -x pipewire\|wireplumber 1>/dev/null 2>&1 -#dbus-run-session pipewire &> /dev/null & - # Start xdg-desktop-portal-wlr pkill -f /usr/libexec/xdg-desktop-portal-wlr @@ -29,6 +24,9 @@ mako & pkill -f wlsunset wlsunset -l 57.4 -L -1.9 & +# Restore previous brightness +brightnessctl s $(grep 'Current brightness:' ~/.cache/brightness | awk '{print $3}') + export wallpaper=$( echo $wallpaper) pkill -f swayidle diff --git a/.config/river/init b/.config/river/init index f290ce6..f53d494 100755 --- a/.config/river/init +++ b/.config/river/init @@ -191,8 +191,8 @@ do riverctl map $mode None XF86AudioNext spawn 'playerctl next' # Control screen backlight brightness with light (https://github.com/haikarainen/light) - riverctl map $mode None XF86MonBrightnessUp spawn 'brightnessctl s +5' - riverctl map $mode None XF86MonBrightnessDown spawn 'brightnessctl s 5-' + riverctl map $mode None XF86MonBrightnessUp spawn 'brightnessctl -s > ~/.cache/brightness s +5' + riverctl map $mode None XF86MonBrightnessDown spawn 'brightnessctl -s > ~/.cache/brightness s 5-' done # auto starting apps diff --git a/.config/yambar/scripts/brightnesscontrol b/.config/yambar/scripts/brightnesscontrol index 797a1db..1be6c9c 100755 --- a/.config/yambar/scripts/brightnesscontrol +++ b/.config/yambar/scripts/brightnesscontrol @@ -23,13 +23,13 @@ function send_notification { case $1 in up) # increase the backlight by 5% - brightnessctl s +5 + brightnessctl -s > ~/.cache/brightness s +5 send_notification #canberra-gtk-play -i audio-volume-change ;; down) # decrease the backlight by 5% - brightnessctl s 5- + brightnessctl -s > ~/.cache/brightness s 5- send_notification #canberra-gtk-play -i audio-volume-change ;; |