Skip to content

Instantly share code, notes, and snippets.

@sakhmatd
Created May 24, 2021 09:59
Show Gist options
  • Save sakhmatd/eeb709746b50f0ff822558473dff1eda to your computer and use it in GitHub Desktop.
Save sakhmatd/eeb709746b50f0ff822558473dff1eda to your computer and use it in GitHub Desktop.
Use brightnessctl and dunst to create a brightness indicator for DE-less setups
#!/bin/bash
# dunstBright
msgId="3378455"
brightnessctl "$@" > /dev/null
brightnow="$(brightnessctl g)"
brightmax="$(brightnessctl m)"
brightpercent=$(awk "BEGIN {print ${brightnow}/${brightmax}*100}")
dunstify -a "changeBrightness" -u low -r "$msgId" \
-h int:value:"$brightpercent" "Brightness: ${brightpercent}%"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment