#!/bin/bash

[[ $(id -u) -eq 0 ]] &&
{
	cat /sys/class/backlight/amdgpu_bl0/max_brightness |
	tee /sys/class/backlight/amdgpu_bl0/brightness

	sed -ri 's/set timeout=10/set timeout=4/' /boot/grub/grub.cfg || true

	exit 0
}


which pkexec >/dev/null 2>/dev/null &&
which xfpm-power-backlight-helper >/dev/null 2>/dev/null &&
{
	pkexec xfpm-power-backlight-helper --set-brightness $(
	pkexec xfpm-power-backlight-helper --get-max-brightness)

	exit 0
}
