Install brightnessctl https://www.archlinux.org/packages/community/x86_64/brightnessctl/
Add this script to ~/.config/i3/config
bindsym XF86MonBrightnessUp exec brightnessctl s +10% > /dev/null && notify-send Brightness $(($(brightnessctl get) * 10 / 937 * 10))% -h string:x-canonical-private-synchronous:brightness_percentage --app-name System
bindsym XF86MonBrightnessDown exec brightnessctl s 10%- > /dev/null && notify-send Brightness $(($(brightnessctl get) * 10 / 937 * 10))% -h string:x-canonical-private-synchronous:brightness_percentage --app-name System
explanation:
bindsym
: i3 script to bind keyXF86MonBrightnessUp
brightness up buttonXF86MonBrightnessDown
brightness down buttonexec
i3 script to execute commandbrightnessctl
program that can change brightness by changing the backlight not the brightness of the images
argument that stands for set, that can accept + and ->
forward the output to/dev/null
&&
execute another command in same eventnotify-send
send notifyBrightness
title of the notification$(($(brightnessctl get) * 10 / 937 * 10))%
the brightness percentage, i can't make it work to cast the number to decimal using dots, so i multiply the number with 10 instead-h string:x-canonical-private-synchronous:brightness_percentage
bring tag to the notification so if user change brightness multiple times will not stack the notification but replace the old one instead.--app-name System
name of the notification