GPD P2 Max 2022 brightness control

Welcome to the Ubuntu-MATE community forum @jimla.

I don't have a GPD-pocket computer, but here is a suggestion that worked on my old HP laptop which had non-functioning brightness control buttons. I created two scripts, one to increase brightness and one to decrease brightness. I assigned each script to the appropriate key by creating a custom keyboard shortcut for each. (Instructions on creating custom keyboard shortcuts are here.) Here are the two scripts. Feel free to copy and customize them as you see fit.

Decrease brightness:

#!/bin/sh
# decrease-brightness script
#
# Decrements LCD backlight brightness by 10%
#

# This is the version for Ubuntu MATE on the HP G60-230US
# ##########################################################
# Larry Bushey
#

maxsetting=100.0
minsetting=0.0
cursetting=$(gsettings get org.mate.power-manager brightness-ac)
newsetting=$(echo $cursetting-10 | bc)
if [ $cursetting = $minsetting ]; 
then 
    gsettings set org.mate.power-manager brightness-ac $minsetting
else  
    gsettings set org.mate.power-manager brightness-ac $newsetting
fi

Increase brightness:

#!/bin/sh
# increase-brightness script
#
# Increments LCD backlight brightness by 10%
#

# This is the version for Ubuntu MATE on the HP G60-230US
# ##########################################################
# Larry Bushey
#

maxsetting=100.0
minsetting=0.0
cursetting=$(gsettings get org.mate.power-manager brightness-ac)
newsetting=$(echo $cursetting+10 | bc)
if [ $cursetting = $maxsetting ]; 
then 
    gsettings set org.mate.power-manager brightness-ac $maxsetting
else  
    gsettings set org.mate.power-manager brightness-ac $newsetting
fi

You might need to make adjustments for your particular situation. Once you have each created the two files, name them "decrease-brightness.sh" and "increase-brightness.sh" then change the permissions on each file to make them executable so that they can be run as program. Use the path and name of the file as the "command" for the custom shortcut.