What makes lxrandr not hold its settings?

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
User avatar
JASpup
Posts: 1653
Joined: Sun Oct 04, 2020 10:52 am
Location: U.S.A.
Has thanked: 70 times
Been thanked: 89 times

What makes lxrandr not hold its settings?

Post by JASpup »

The old version without an "Advanced" tab or panning capabilities permits on/off monitors without a fuss.

New I have to wrestle with it to keep settings, in this case turn off my external. It goes off for a few seconds before turning back on again.

Distro makes no difference, it's the app.

I think it might work if I save the settings and restart X. Is this necessary?

On the Whiz-Neophyte Bridge
Linux Über Alles
Disclaimer: You may not be reading my words as posted.

williams2
Posts: 1023
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 288 times

Re: What makes lxrandr not hold its settings?

Post by williams2 »

In BionicPup64, the lxrandr window has a Save button.

The Save button creates a file named /root/.config/autostart/xrandr-autostart.desktop

The configuration options are saved as parameters to the Exec= line.

For example:

Exec=sh -c 'xrandr --output HDMI-0 --mode 1920x1080 --rate 60.00 --same-as LVDS --output LVDS --off'

which is run every time that X starts.

New I have to wrestle with it to keep settings, in this case turn off my external. It goes off for a few seconds before turning back on again.

lxrandr uses the xrandr executable.
If xrandr does not support your hardware (older hardware works better with older software drivers)
then it will try to use the xrandr command line options,
but if xrandr returns with an error code, then the previous xrandr options will be used.

I think it might work if I save the settings and restart X. Is this necessary?

That's how it is supposed to work.
If something else is changing the xrandr setting,
then if it executes after lxrandr, that is what the video mode will be set to.

You do not need to restart X to execute
/root/.config/autostart/xrandr-autostart.desktop
You can just click it in a rox window.
Or you can run
rox /root/.config/autostart/xrandr-autostart.desktop
in a terminal or in a script.

User avatar
JASpup
Posts: 1653
Joined: Sun Oct 04, 2020 10:52 am
Location: U.S.A.
Has thanked: 70 times
Been thanked: 89 times

Re: What makes lxrandr not hold its settings?

Post by JASpup »

williams2 wrote: Sat Apr 02, 2022 6:05 am

You do not need to restart X to execute
/root/.config/autostart/xrandr-autostart.desktop
You can just click it in a rox window.
Or you can run
rox /root/.config/autostart/xrandr-autostart.desktop
in a terminal or in a script.

I will try this.

Someone will start a new thread just to get panning capabilities so obviously the newer versions of lxrandr matter (presently I only turn monitors on/off, but if I were working I would use them all).

Here 21.04 32-bit the issue goes back (Tahr runs the old version).

The bigger issue is without adjustment novices and newbies will be lost/frustrated. I do not suspect this is just my setup.

A monitor setting does not hold just by clicking Apply.

On the Whiz-Neophyte Bridge
Linux Über Alles
Disclaimer: You may not be reading my words as posted.

User avatar
JASpup
Posts: 1653
Joined: Sun Oct 04, 2020 10:52 am
Location: U.S.A.
Has thanked: 70 times
Been thanked: 89 times

Re: What makes lxrandr not hold its settings?

Post by JASpup »

lxrandr is the same in Ubuntu so I would guess this is not a Puppy issue.

My normal hack fix is to apply the Advanced settings & save them. Then I run it again, re-choose the settings, and Apply them.

There are three typical solutions:

  • It works normally

  • My hack works

  • Executing the .config launcher works

The only questions remaining w/respect to the original post are: Why does this glitch occur? How is it avoided?

I put the .config launcher on the desktop for seamless transition, but I still need lxrandr to save the settings before I take the time to create individual setting launchers.

On the Whiz-Neophyte Bridge
Linux Über Alles
Disclaimer: You may not be reading my words as posted.

williams2
Posts: 1023
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 288 times

Re: What makes lxrandr not hold its settings?

Post by williams2 »

Does this do what you want?

I compiled it using BionicPup64, so it is 64 bit.

I changed this:

Code: Select all

    gtk_widget_show_all( dlg );

    gtk_dialog_run((GtkDialog*)dlg);

to this:

Code: Select all

    gtk_widget_show_all( dlg );

    gtk_dialog_run((GtkDialog*)dlg);

    gtk_widget_show_all( dlg );

    gtk_dialog_run((GtkDialog*)dlg);

It should be in a loop, but what i did seems work, sort of.

Attachment is gzipped, click it to unzip it.

Attachments
lxrandr.gz
download then click it to unzip
(10.37 KiB) Downloaded 29 times
User avatar
JASpup
Posts: 1653
Joined: Sun Oct 04, 2020 10:52 am
Location: U.S.A.
Has thanked: 70 times
Been thanked: 89 times

Re: What makes lxrandr not hold its settings?

Post by JASpup »

@williams2 the issue is inconsistency. Sometimes changing lxrandr settings works by design, sometimes it doesn't. When it doesn't, I apply my hack fix, and when that doesn't work, yours seems foolproof.

To your question: If your edit works consistently, that is a solution.

Then how do we know if my experience is anomalous? And if it is not anomalous, presuming it works, how does your fix become standard, like my williams2-presuspend.sh, without which this computer will not suspend? (which appears also to be an issue for the Mainline 64 maker).

Since inconsistent your edit is a test project. I'm still using both 32/64 (happen to be in 32 LXDE now).

Part of the reason I use XFCE is gui richness, while LXDE is a middle ground (I do not know how to explain DE interfaces in technical terms), but any LxPup peebea makes offers PCManFM with mounting partitions unlike Mainline JWM and with the visual customization options are main reason I am booting Lx.

This adds another point: XFCE has it own monitor utility that does not have this problem. LXDE is still sharing the JWM app.

If a lot of users have this problem and there is a test environment for it, it is definitely worth a fix.

Thanks for taking a look.

Attachments
lxrandr-lx.png
lxrandr-lx.png (40.61 KiB) Viewed 1301 times

On the Whiz-Neophyte Bridge
Linux Über Alles
Disclaimer: You may not be reading my words as posted.

User avatar
JASpup
Posts: 1653
Joined: Sun Oct 04, 2020 10:52 am
Location: U.S.A.
Has thanked: 70 times
Been thanked: 89 times

Re: What makes lxrandr not hold its settings?

Post by JASpup »

More testing:

In Xenial 32 (I would expect LxXenial and some other distros to be same), one scenario where the non-function occurs is when both monitors are ON and I try to turn the external OFF.

It appears to work, the new setting holds for a few seconds, then it reverts to both monitors ON.

The other difference when a setting change works is a fairly quick dialog after the settings are applied to OK or Abort. If you see that, you know it worked.

If you do not see the dialog, you probably don't have to wait to realize it didn't.

still:

It is also the case when only the external is on and I try to switch, or when I try to switch back to external.

My settings hack is not working. The williams2 hack works, a similar result to restarting X.

In sum I would surmise there is a 'state' where lxrandr stops functioning normally but it is not permanent.

:?:

On the Whiz-Neophyte Bridge
Linux Über Alles
Disclaimer: You may not be reading my words as posted.

williams2
Posts: 1023
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 288 times

Re: What makes lxrandr not hold its settings?

Post by williams2 »

I took a quick look at lxrandr.

lxrandr seems to be written so that it works like this

1) select various options in the lxrandr window.
2) then click apply
3) repeat 1 and 2 until you are finished, then clicksave, or click cancel if you do not want to save.

If you start lxrand again, it does not seem to read the configuration that you saved. It seems to be written that way.

wgxrandr is a fork of lxrandr. it seems to work the same way as lxrand, it has some more configuration choices, and an extra button.
I compiled it in BionicPup64. I did not disable support for gtk3 as a ./configure option.

Or you can download the source and compile it yourself. The source is all in one file.
https://github.com/WdesktopX/wgxrandr

Attached: wgxrandr.gz (64 bit), download and click it to unzip.

Attachments
wgxrandr.gz
download, then click it to unzip.
(12.25 KiB) Downloaded 32 times
Last edited by williams2 on Wed May 25, 2022 1:28 am, edited 1 time in total.
User avatar
JASpup
Posts: 1653
Joined: Sun Oct 04, 2020 10:52 am
Location: U.S.A.
Has thanked: 70 times
Been thanked: 89 times

Re: What makes lxrandr not hold its settings?

Post by JASpup »

@williams2 perhaps versions function differently.

It's normal in lxrandr for the app to close after Apply. Save retains the app window.

You are correct that it does not read the config you saved, but repeating the config you saved works sometimes after the initial attempt fails (my hack).

I would be interested in a foolproof utility that works the way lxrandr is supposed to, if there's a forum post version or it's available in a repository.

I don't compile code but this could be useful to someone with a similar issue.

I have your .config launcher override and XFCE, and this would be solved if we simply knew why sometimes lxrandr settings do not hold.

On the Whiz-Neophyte Bridge
Linux Über Alles
Disclaimer: You may not be reading my words as posted.

williams2
Posts: 1023
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 288 times

Re: What makes lxrandr not hold its settings?

Post by williams2 »

From a (very) brief look at the source,
wgxrandr seems to get the initial configuration information from xrandr
the same information you would get from typing xrandr in a terminal.
It only gets config info for the right hand tab,
because the left hand tab is various presets,
as opposed to, for example, values like resolution=1920x1080

If something else configures X,
after wgxrandr configures X,
then the wgxrandr configuration won't be used.

If X can't use your video card's driver,
it may fall back to the vesa driver,
I don't think xrandr works well with the vesa driver.
Someimes disabling a driver or preloading a driver or even a sleep instruction can make a difference.
If xrandr is sometimes inconsistent, it might be a hardware problem.

There are 2 occurences of desktop in the source.
One is to save the .desktop file,
and the other is to delete the .desktop file.

lxrandr is about the same as wgxrandr

Post Reply

Return to “Users”