This repository has been archived on 2023-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/.local/bin/backlight_notify
David JULIEN 28dfdd5ae5 feat: change shebang to /usr/bin/env sh
this setting is more user-config compliant
2021-02-12 23:20:57 +01:00

20 lines
624 B
Bash
Executable File

#!/usr/bin/env sh
######################################################################
# @author : swytch
# @file : backlight_notify
# @license : MIT
# @created : Wednesday May 20, 2020 17:53:36 CEST
#
# @description : send a notification with xbacklight value
######################################################################
current=$(cat /sys/class/backlight/intel_backlight/brightness)
max=$(cat /sys/class/backlight/intel_backlight/max_brightness)
step=$(expr $max / 20)
level=$(expr $(expr $current / $step) \* 5)
dunstify -r 100001 -u "low" "Current xBacklight value :" "$level%"