sway: add control-brightness.sh script

it allows to change external monitor's brightness
This commit is contained in:
2022-10-09 14:43:32 +03:00
parent 2e0b3169bf
commit 305533d854
2 changed files with 21 additions and 2 deletions

19
bin/control-brightness.sh Executable file
View File

@@ -0,0 +1,19 @@
#! /bin/bash
active_output=$(swaymsg -p -t get_outputs | grep '(focused)' | awk '{ printf $2 }')
device=""
if [[ "$active_output" == "HDMI-A-1" ]]; then
device="ddcci5"
else
device="amdgpu_bl0"
fi
param=""
if [[ "$1" == "up" ]]; then
param="+"
else
param="-"
fi
brightnessctl -d "$device" set 5%$param