You are not logged in.

#1 2025-06-02 20:24

bogdanb
Member
Registered: 2025-06-02
Posts: 4

Run command when suspend and wake up

Hi All! So I'm running Q4OS on cheap netbook with 2GB RAM, it runs nice for basic stuff. But because it is Intel GMA 500 video hardware, I have issue when waking up from suspend. Colors are disorted. What helps is to temporary switch resolution and back:
xrandr --output LVDS-1 --mode 1024x576
xrandr --output LVDS-1 --mode 1024x600

But how to implement this when suspend/wake up?
I've tried to implement this solution and put script in /etc/pm/sleep.d/ but it seems doesn't work.
https hmm/wiki.ubuntu.com/HardwareSupportComponentsVideoCardsPoulsbo#Fix_suspend

Any ideas?

Offline

#2 2025-06-02 20:33

crosscourt
Member
From: Wash DC
Registered: 2017-05-07
Posts: 2,372

Re: Run command when suspend and wake up

The link you posted is from quite awhile ago and this issue really doesnt have a reliable stable fix to my knowledge. The hardware's age and limited driver support makes it a tough go.  Most users Ive run into do not allow suspend/wake to avoid the issue, given the lack of success with various fixes.


Q4OS KDE 5.xx  Lenovo M73 Thinkcentre Tiny/Dell Inspiron 3670

Offline

#3 2025-06-02 21:05

bogdanb
Member
Registered: 2025-06-02
Posts: 4

Re: Run command when suspend and wake up

That's why I'm using xrandr commands as dirty solution. However it seems that I cannot trigger them during suspend/wake up.

Offline

#4 2025-06-02 21:10

crosscourt
Member
From: Wash DC
Registered: 2017-05-07
Posts: 2,372

Re: Run command when suspend and wake up

I understand that but  at least from what I can see thru some research and my own experience with this hardware, there is no long term solution due to the age and driver situation with this hardware.

The Intel GMA 500 used the PowerVR SGX5 graphics architecture which today isnt supported very well and no additional drivers are coming anytime soon.

Last edited by crosscourt (2025-06-02 21:12)


Q4OS KDE 5.xx  Lenovo M73 Thinkcentre Tiny/Dell Inspiron 3670

Offline

#5 2025-06-02 21:18

bogdanb
Member
Registered: 2025-06-02
Posts: 4

Re: Run command when suspend and wake up

Thank you for your replies, but lets forget about GMA 500 now. I'm looking for solution how to run command when suspend/wake up happened.

Offline

#6 2025-06-02 21:23

crosscourt
Member
From: Wash DC
Registered: 2017-05-07
Posts: 2,372

Re: Run command when suspend and wake up

We cant forget about the GMA 500 as the reason youre having to do the command is because the driver for the GMA500 has issues and should be doing it itself.

Youre doing manually what the driver should be doing and there is no fix for that with no recent drivers to fix it.  Its a known issue and there isnt any workaround Im aware of, sorry to say. Thats why most people dont use suspend/wake with this hardware. System has to be awake to run the command.


Q4OS KDE 5.xx  Lenovo M73 Thinkcentre Tiny/Dell Inspiron 3670

Offline

#7 2025-06-02 21:57

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 5,013
Website

Re: Run command when suspend and wake up

Welcome to the forum @bogdanb smile
What desktop do you use, Plasma, Trinity or other ?

Offline

#8 2025-06-02 22:30

crosscourt
Member
From: Wash DC
Registered: 2017-05-07
Posts: 2,372

Re: Run command when suspend and wake up

The three drivers that are needed for PowerVR sgx5 graphics/Intel GMA 500 are these,

mesa-amber         legacy driver
xf86-video-intel     2d accel
psb_gfx

Thats it, that Im aware of and no actual dedicated open source drivers have been released recently. What little support there is, is thru Mesa.


Q4OS KDE 5.xx  Lenovo M73 Thinkcentre Tiny/Dell Inspiron 3670

Offline

#9 2025-06-03 17:01

bogdanb
Member
Registered: 2025-06-02
Posts: 4

Re: Run command when suspend and wake up

q4osteam wrote:

Welcome to the forum @bogdanb smile
What desktop do you use, Plasma, Trinity or other ?

Hello Team! Thanks for Q4OS! I'm using Trinity

but I managed to do this workaround.

I'm putting this:

#!/bin/sh

PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "$1" in
    pre)
#code execution BEFORE sleeping/hibernating/suspending
    su -c "DISPLAY=:0 xrandr --output LVDS-1 --mode 1024x576" <user>

    ;;
    post)
#code execution AFTER resuming
    su -c "DISPLAY=:0 xrandr --output LVDS-1 --mode 1024x600" <user>
    ;;
esac

exit 0

as script in this location:
/usr/lib/systemd/system-sleep/
and it is working as I wanted.

Last edited by bogdanb (2025-06-03 17:08)

Offline

#10 2025-06-03 18:21

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 5,013
Website

Re: Run command when suspend and wake up

@bogdanb Thanks for sharing the solution.

Offline

#11 2025-06-03 19:11

crosscourt
Member
From: Wash DC
Registered: 2017-05-07
Posts: 2,372

Re: Run command when suspend and wake up

Nice work!


Q4OS KDE 5.xx  Lenovo M73 Thinkcentre Tiny/Dell Inspiron 3670

Offline

Board footer

Powered by FluxBB