Xfce Forum

Sub domains
 

You are not logged in.

#1 2017-02-01 09:15:36

adamovic
Member
Registered: 2017-02-01
Posts: 13

Application Autostart - problem with my custom script

I have a xrandr script which disables one of the monitors.
That script is working if I invoke it on the command line, or using a configuired shortcut.

But it is not working as intented if added to "Application Autostart" in "Sessions and Startup".
(I see 2nd monitor still turned on after the autostart).

What could be the underlying reason?

I'm using xfce4-about 4.12.1 (Xfce 4.12) (Manjaro - based on Arch linux).

Thanks

Offline

#2 2017-02-01 14:18:27

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Application Autostart - problem with my custom script

There may be a few reasons that this is happening:

1. The script is not executing properly
2. The script is executing quickly on startup and something in the xserver is changing it.

To fix #1, try the following in your autostart entry:

bash -c "/path/to/script"

For #2, try adding a sleep command:

bash -c "sleep 20; /path/to/script"

...if this one works, then adjust the sleep timeout lower to suit.

If you always want the second monitor to start disabled, look at configuring xorg to do so. See this post for more info on how to do so.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2017-02-01 15:14:02

adamovic
Member
Registered: 2017-02-01
Posts: 13

Re: Application Autostart - problem with my custom script

Thanks,

bash -c "sleep 0.5s; /path/to/script"

seems to work without flickering, while sleep 2s brings one flicker.

Do you know, If I start xorg with disabled display, with xrandr I can reenable it?

Last edited by adamovic (2017-02-03 10:27:10)

Offline

#4 2017-02-01 15:32:42

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Application Autostart - problem with my custom script

adamovic wrote:

Do you know, If I start xorg with disabled display, with xrandr I can reenable it?

Ignore won't do this for you, but there is another option:

Option "Enable" "bool"
              This optional entry specifies whether the monitor should be turned on at startup.  By default, the server will attempt to enable all connected monitors.  (RandR 1.2-supporting drivers only)

From the "man xorg.conf" page.



Off-topic: this is a funny entry in that man page:

VIDEOADAPTOR SECTION
       Nobody wants to say how this works.  Maybe nobody knows ...


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Board footer

Powered by FluxBB