add brightness control for I2C monitors
This commit is contained in:
parent
f351889c30
commit
38ee4f1809
2 changed files with 17 additions and 0 deletions
11
bin/brightness-i2c
Executable file
11
bin/brightness-i2c
Executable file
|
@ -0,0 +1,11 @@
|
|||
#! /bin/zsh
|
||||
|
||||
OPERATOR="${1}"
|
||||
AMOUNT="${2}"
|
||||
|
||||
BUSES=(${(s/:/)OVER_ENV_MONITORS_I2C})
|
||||
|
||||
for BUS in ${BUSES}
|
||||
do
|
||||
ddcutil --skip-ddc-checks --noverify --verbose --bus=${BUS} setvcp 0x10 "${OPERATOR}" "${AMOUNT}"
|
||||
done
|
|
@ -5,6 +5,12 @@ zmodload zsh/datetime
|
|||
OVER_PROMPT_CFG="/etc/over/env/prompt.cfg"
|
||||
OVER_PROMPT_TITLE=""
|
||||
|
||||
which ddcutil > /dev/null
|
||||
if [[ $? -eq 0 ]]; then
|
||||
local I2C_IDS=($(ddcutil detect --terse | grep "I2C bus" | sed "s/^.*-//"))
|
||||
export OVER_ENV_MONITORS_I2C=${(j|:|)I2C_IDS}
|
||||
fi
|
||||
|
||||
if [[ -a "$OVER_PROMPT_CFG" ]]; then
|
||||
source "$OVER_PROMPT_CFG"
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue