You are not logged in.


Mageia 10/panel ver 4.21.1/Sony VGN-P588E
Should all software issues be this small, but max brightness is always the default when resuming from a lid-close suspend (time-out suspends do not have this issue).
So I was wondering where I'm going wrong with this script in /lib/systemd/system-sleep/xfce-resume-script.sh:
#!/bin/bash
if [ "$1" = "post" ]; then
sleep 8 && xrandr --output LVDS-1 --brightness 0.6
echo "System Woke Up" >> /tmp/resume.log
fiIt runs in terminal complaint-free but won't use the /tmp directory and it won't execute the xrandr command. Just to see if I've somehow blocked /tmp, I ran a ToZ weather script:
#!/bin/sh
sleep 20
wxcache=${HOME}/tmp/wxdata-cached
curl -o ${wxcache} -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$1
sed -n '/Currently:/ s/.*: \(.*\): \([0-9]*\)\([CF]\).*/\2°\3 \1/p' ${wxcache}which does create /tmp/wxdata-cached. So the directory works.
Edit: one more variable--because of crashes, I use s2idle in grub.
Any pointers?
Last edited by jakfish (2026-07-11 15:52:57)
Offline


A couple of problems there. First, your first if command should use the comparison "==" symbol instead of the assignment "=" symbol. But more importantly, scripts that run in systemd/system-sleep are run by a privileged account and not your user account, meaning it won't have access to your x display or authority to act upon it. Try something like this which is more standard:
#!/usr/bin/env sh
case "$1/$2" in
post/*)
# Add a short delay
sleep 8
# Export required X11 graphical session environment variables
export DISPLAY=:0
export XAUTHORITY=/home/USERNAME/.Xauthority
# adjust brightness
xrandr --output LVDS-1 --brightness 0.6
;;
esac...replace USERNAME with your actual account username.
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline


Many thanks, ToZ, for weighing in, and with a much different approach than AI can generate.
The script does execute itself but it does not employ the xrandr command. Just to test, I put another 8 seconds of sleep after
export XAUTHORITY=/home/jake/.Xauthoritybut no joy.
I wonder if this is a Sony GMA500 video driver issue. The Poulsbo stuff has always been a pain. I'm assuming the xfce-power-manager uses
systemctl suspendupon sensing a lid close, and I'm using the same command in my own timed suspend without problem.
Thanks again for your assistance.
Edit: FWIW, I had to create /home/jake/.Xauthority and ran
ls -l ~/.Xauthorityand
echo $XAUTHORITYand the file is rw and in its proper place. But it is always empty.
Last edited by jakfish (2026-07-11 18:03:34)
Offline


Actually, xfce4-power-manager doesn't use systemd/logind by default, but you can allow it to do so. See: https://docs.xfce.org/xfce/xfce4-power- … er-manager.
How did you create the .Xauthority file? What are its permissions?
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline


I simply created a file called .Xauthority in /home/jake
ls -l ~/.Xauthority-rw-rw-r-- 1 jake jake 0 Jul 11 13:41 /home/jake/.XauthorityIs that what we're looking for?
Edit: just to experiment: I removed /lib/systemd/system-sleep/xfce-resume-script.sh and ran
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/logind-handle-suspend-key -n -t bool -s truethen
HandleLidSwitch=suspendand
sudo systemctl restart systemd-logindUpon resume, the initial brightness is the correct one, but after a second, it goes to maximum.
Last edited by jakfish (2026-07-12 15:56:01)
Offline


I simply created a file called .Xauthority in /home/jake
The .Xauthority file should be created automatically. Do you have the xauth or xorg-xauth package installed?
To manually create the file, you should:
touch .Xauthority
chmod 0600 .Xauthority
xauth generate :0 . trusted...from your home directory.
If that completes successfully, try the new system-sleep script again.
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline


Hi, ToZ. I did track down those steps earlier today--I deleted my original .Xauthority and created one properly. No dice, though. Script will execute the sleep command but not the xrandr.
It is interesting that my original install did not have ~/.Xauthority. Might be a Mageia thing, but not sure. I'm using Mageia 10 b/c it's one of the few 32-bit OSs that has a current xfce, etc. Until now, the Os has not missed the absence of .Xauthority, so perhaps it's lurking in another directory outside of /home.
Offline


It looks like Mageia might save the file somewhere in /var/run - the live system shows /var/run/lightdm/live and its called "xauthority". If you run "xauth" on its own it will show the location (Ctrl-C to break out afterwards).
Use the path and location of this file in the script.
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline


export XAUTHORITY=/var/run/lightdm/jake/xauthorityonly executes the sleep, not the xrandr command after reboot/suspend/resume.
Really appreciate you sticking with this, Toz, but please feel free to lose interest 
Last edited by jakfish (2026-07-13 14:22:55)
Offline
[ Generated in 0.019 seconds, 8 queries executed - Memory usage: 567.48 KiB (Peak: 584.46 KiB) ]