Choose style:

Author Topic: (Resolved)2 monitors, installed ARandR, cannot get the monitor.sh to "autostart"  (Read 1175 times)

0 Members and 1 Guest are viewing this topic.

Offline gone belham

  • nOOb
  • *
  • Posts: 16
  • Karma: -7
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 6
Hi all,

Peppermint 6, 64-bit, AMD here.   Still luvin it  :)   

Trying to figure out what I am doing wrong on this: installed ARandR, opened it, and set my monitors up as primary left screen and 2nd screen to the right.  ARandR did it perfectly, and then it saved the configuration as an executable----which I named monitor.sh.    This "monitor.sh" is in my Home Directory inside the ".screenlayout" folder.  I then have tried placing symlinks to this monitor.sh executable in both the home directory's ".config/autostart" and "etc/xdg/autostart", making sure the permissions were set correctly.  That didn't work, the executable still wouldn't autostart after booting up.   Heck, I even tried placing the full actual "monitor.sh" executable in both autostart locations mentioned earlier.    What am I missing here??   Do i need to set up a .desktop file so this script then gets executed??  Or should I set up a delay of 5 or 10 sec inside the "monitor.sh" executable, as possibly the executable is being executed before the actual desktop window manager is loaded by Peppermint 6 upon booting up?  Or is it something else??   Here's a pic of where I installed the "monitor.sh" to both autostart locations mentioned above:




Thanks for any help and/or tips.   The "monitor.sh" file contents are this: 

#!/bin/sh
xrandr --output VGA-0 --mode 1280x1024 --pos 1280x0 --rotate normal --output HDMI-0 --mode 1280x1024 --pos 0x0 --rotate normal


I know this scirpt is good because if you click on & run it, it instantly sets my two monitors up as shown in the pic.    What exactly would I add to this script to get it to autostart if it actually is the problem of it being started before the Pep6 desktop window manager gets up & running (and thus overrides the monitor.sh script)?    This assumes that this is my problem, which may not be the case.


Thanks for any help and/or tips!
« Last Edit: June 12, 2016, 02:13:48 pm by belham »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25725
  • Karma: 2822
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Symlinks won't cut it I'm afraid .. they need to be .desktop launcher files.

So run:.
Code: [Select]
sudo gedit ~/.config/autostart/my-monitor-script.desktop
and make it read
Code: [Select]
[Desktop Entry]
Type=Application
Name=ARandR Settings AutoApply
Comment=Start with ARandR settings auto-applied
Exec=bash -c '/home/$USER/.screenlayout/monitor.sh'
SAVE the file .. log off/on to test.
« Last Edit: June 12, 2016, 07:21:44 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline gone belham

  • nOOb
  • *
  • Posts: 16
  • Karma: -7
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 6
Symlinks won't cut it I'm afraid .. they need to be .desktop launcher files.

So run:.
Code: [Select]
sudo gedit ~/.config/autostart/my-monitor-script.desktop
and make it read
Code: [Select]
[Desktop Entry]
Type=Application
Name=ARandR Settings AutoApply
Comment=Start with ARandR settings auto-applied
Exec=bash -c '/home/$USER/.screenlayout/monitor.sh'
SAVE the file .. log off/on to test.


Dang, I am really struggling this weekend with Linux, nearly a decade with it, using it exclusively, lol, and the more I think I know or learn, the less I realize I actually know.   Where's the dam# jack I can plug into the base of my skull?  You screwed us Neo!!!!  >:(    Anyhow, here's a photo opened with everything I could think you might want to look at, PCNeTSpec.  I still cannot get Pep6 to bootup and have the monitors.sh activate and thus set the monitors correctly (without me having to manually do it by clicking on the monitor.sh script).     I think I followed everything in your previous post.   Heck, after that didn't work, I even experimented by placing the my-monitor-script.desktop actually in /etc/xdg/autostart), checking its permissions, then giving that a go.  Nada.   Nothing works so far  ???




Thanks so much for the help.
« Last Edit: June 12, 2016, 08:34:09 am by belham »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25725
  • Karma: 2822
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
It might be that the script is being run too early (before the desktop is fully loaded), so lets add a 5 second delay

run:
Code: [Select]
sudo gedit ~/.config/autostart/my-monitor-script.desktop
and make the "Exec=" line read:
Code: [Select]
Exec=bash -c 'sleep 5 ; /home/luc/.screenlayout/monitor.sh'



If that still doesn't work, we can run the command that's inside your monitors.sh file directly from the autostart file instead .. so try
Code: [Select]
sudo gedit ~/.config/autostart/my-monitor-script.desktop
and make the "Exec=" line read:
Code: [Select]
Exec=bash -c "xrandr --output VGA-0 --mode 1280x1024 --pos 1280x0 --rotate normal --output HDMI-0 --mode 1280x1024 --pos 0x0 --rotate normal"
or with a 5 second delay
Code: [Select]
Exec=bash -c "sleep 5 ; xrandr --output VGA-0 --mode 1280x1024 --pos 1280x0 --rotate normal --output HDMI-0 --mode 1280x1024 --pos 0x0 --rotate normal"
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline gone belham

  • nOOb
  • *
  • Posts: 16
  • Karma: -7
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 6
It might be that the script is being run too early (before the desktop is fully loaded), so lets add a 5 second delay

run:
Code: [Select]
sudo gedit ~/.config/autostart/my-monitor-script.desktop
and make the "Exec=" line read:
Code: [Select]
Exec=bash -c 'sleep 5 ; /home/luc/.screenlayout/monitor.sh'



If that still doesn't work, we can run the command that's inside your monitors.sh file directly from the autostart file instead .. so try
Code: [Select]
sudo gedit ~/.config/autostart/my-monitor-script.desktop
and make the "Exec=" line read:
Code: [Select]
Exec=bash -c "xrandr --output VGA-0 --mode 1280x1024 --pos 1280x0 --rotate normal --output HDMI-0 --mode 1280x1024 --pos 0x0 --rotate normal"
or with a 5 second delay
Code: [Select]
Exec=bash -c "sleep 5 ; xrandr --output VGA-0 --mode 1280x1024 --pos 1280x0 --rotate normal --output HDMI-0 --mode 1280x1024 --pos 0x0 --rotate normal"


Hi again, PCNetSpec.    No luck  :(   I tried every variation you posted, even tried first increasing the sleep to 10, then to 15, then to 20, then 30, and none of those variations worked (even with putting the command directly inside the monitor.sh file).    I guess I am resigned to having to manually, on every bottup, go into nemo, then the .screenlayout folder, click on the monitor.sh, hit "run" when the window pops up, and everything is good to go.  Maybe later, I will try to create a desktop shortcut to this 4-step process, so maybe I can get into the 'application launch' bar so it only becomes a one-click process.    Weirdly, I had to do that with Conky, creating a .desktop file, setting it up, as I could not get Conky to startup either.  I don't have this problem on KDE, Ubuntu, Debian-Jessie or ElementaryOS that I run on the other house computers.   It almost seems like the Pep6 install went wonky, but that can't be the case, as I've installed Peppermint64-bit twice now, to two different machines (with two separate downloads, verified by .sig and md5), only choosing everything default in the installs, and still this behavior displaying itself with ARandR (along with the previous Chromium/Gmail Ice App problem) occurs.   It's almost seems like the PepOS has permission issues, and such., and various points.

Thank you for all your help.  I need to go do some things before this afternoon runs out, and the family axes my head off.  Thanks again.  I'll post back later or tomorrow if I can figure anything out what is going on.     
« Last Edit: June 12, 2016, 09:25:31 am by belham »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25725
  • Karma: 2822
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
For some reason your autostart directory seems broken

Maybe try going to

menu > Preferences > Default Applications for LXSession > Autostart

and make sure there's a tick next to "ARandR Settings AutoApply"



Or in the same place, use the "Add" button, and point it at your monitor.sh script.
« Last Edit: June 12, 2016, 09:50:02 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 1964
  • Karma: 341
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8, 9
You can normally run an arandr command in your .profile script on login. OK, if you're typing in your password you'll have to do it on one screen only, but after that it should set up your dual monitor desktop.

Offline gone belham

  • nOOb
  • *
  • Posts: 16
  • Karma: -7
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 6
For some reason your autostart directory seems broken

Maybe try going to

menu > Preferences > Default Applications for LXSession > Autostart

and make sure there's a tick next to "ARandR Settings AutoApply"



Or in the same place, use the "Add" button, and point it at your monitor.sh script.


Success!!  My PepOS6 upon bootup now:




Hi PCNetSpec,

Decided to delete the .screenlayout folder (and the monitor.sh inside), thought about while out this afternoon and figured I must have messed something up when setting it up in ARandR.  Figured it couldn't hurt.   So, I opened ARandR again, re-set the monitors to the same thing,  had ARandR save it.  This time named the .sh script "dualmonitors.sh" for no other reason than good luck...haha...then did what you said  when you wrote:  use the "Add" button, and point it to the new dualmonitors.sh in .screenlayout in my home folder.  Worked like a charm!  I even used the "Add" button to point it to my conky.config file, and it too now starts at bootup. 

Once again, thank you , PCNetSpec!!  I couldn't have done it in any reasonable time frame without you pointing me to stuff.  Sometmes when I get away from working inside Linux, I forget how to tie my shoes.   Anyhow,  I'm working on something else now....haha....I think this one is a bit tougher and not even sure if it is possible---but if I can't get it by tomorrow night,  I am coming back here to your wellspring of knowledge and taking some gulps  8)


PS Thanks murraymint, will remember the tip about commands in my .profile script.  I'm one of those people where the less clicks there are the better it is all around  ;D
« Last Edit: June 12, 2016, 01:32:11 pm by belham »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25725
  • Karma: 2822
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
You're most welcome my mate, happy we could help :)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec