Script to toggle brightness of a screen to 0 or 1 to be focused on work
- xrandr
You can modify one variable in focus.sh
# Screen to be toggled
# Run `xrandr -q` to get output name
readonly SCREEN="DisplayPort-1"
The script expects parameters :
--toggle
: Toggle brightness of the screen to 0 or 1--get-current
: Get current brightness and display an icon
Example module for polybar
[module/focus]
type = custom/script
interval = 1
exec = ~/.config/polybar/scripts/focus.sh --get-current
click-left = ~/.config/polybar/scripts/focus.sh --toggle