You can try this other user’s solution, which uses xorg-xbacklight instead of brightnessctl.
xorg-xbacklight
brightnessctl