Custom xrandr settings are reset on wake up (resume) [SOLVED]

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
xpro2004

Custom xrandr settings are reset on wake up (resume) [SOLVED]

Post by xpro2004 »

I need a monitor frequency rate of exactly 59.99Hz, while the system default is 60.04

I did this by adding the following command to cinnamon autoload
xrandr --output eDP-1 --mode 1600x900 --rate 59.99

This works fine, but after resuming from the standby mode, the frequency is reset again to 60.04.

I tried to run the script from
/lib/systemd/system-sleep/
the command is executed, but for some reason the frequency remains as before 60.04.

I found out that the setting is reset by the service named 'csd-xrandr' which is also added to the cinnamon autoload.
But i did not found how to fight it. And i can't turn it off, because without it, the dynamic connection of the external monitor does not work properly.

I also try add settings 'VertRefresh 59.99' int /etc/X11/xorg.conf 'Monitor' section. Does not work.

So, how can i save needed refresh rate permanently?

Laptop is:
HP pavillion 17
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Custom xrandr settings are reset on wake up (resume)

Post by roblm »

Use this command to create a file named xrandr in /lib/systemd/system-sleep:
sudo touch /lib/systemd/system-sleep/xrandr

Open the file for editing: xed admin:////lib/systemd/system-sleep/xrandr

Add these lines, replacing XXX with your user name:

Code: Select all

#!/bin/sh
   case $1 in
   post) 
   su XXX -c "DISPLAY=:0 xrandr --output eDP-1 --mode 1600x900 --rate 59.99"
;;
esac
Make the script executable: sudo chmod +x /lib/systemd/system-sleep/xrandr

xpro2004 wrote:And i can't turn it off, because without it, the dynamic connection of the external monitor does not work properly.
What do you mean by that.
xpro2004

Re: Custom xrandr settings are reset on wake up (resume)

Post by xpro2004 »

Solved!

The magic is "su XXX -c", where XXX is logged in username.

Thank you!
What do you mean by that.
I mean that if i turn off csd-xrandr autoload, than, if i plug external HDMI monitor to laptop, it does not work automatically.
Locked

Return to “Cinnamon”