Choose style:

Author Topic: Struggling to get Unity program to autostart (SOLVED)  (Read 221 times)

0 Members and 1 Guest are viewing this topic.

Offline MNFrozenfish

  • Jr. Member
  • **
  • Posts: 60
  • Karma: 13
  • Smile! --- Why not?
    • View Profile
  • Peppermint version(s): Peppermint 9 Respin-64 bit
Struggling to get Unity program to autostart (SOLVED)
« on: January 08, 2019, 03:19:42 pm »
I am trying to auto start a Unity program that was built by one of our in house programmers. The program runs well from the desktop when started manually but when I copy the executable to the autostart folder I get nothing. I have seen posts related to autostarting installed programs like Conky but I don't think those steps will work with this app. The folder with everything needed lives on the desktop currently. I should probably, if possible, add a delay before the program launches to allow networking to finish connecting.
Thanks
« Last Edit: January 09, 2019, 12:03:40 pm by MNFrozenfish »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 22924
  • Karma: 2556
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Struggling to get Unity program to autostart
« Reply #1 on: January 08, 2019, 04:09:09 pm »
What's the contents of the .desktop launcher now ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline MNFrozenfish

  • Jr. Member
  • **
  • Posts: 60
  • Karma: 13
  • Smile! --- Why not?
    • View Profile
  • Peppermint version(s): Peppermint 9 Respin-64 bit
Re: Struggling to get Unity program to autostart
« Reply #2 on: January 08, 2019, 04:36:10 pm »
I think this is what you wanted, if not, please point me in the right direction.  :-[
Spoiler (click here to view / hide)
[Desktop Entry]
X-AppInstall-Package=xfdesktop4
X-AppInstall-Popcon=4047
X-AppInstall-Section=universe

Version=1.0
Name=Desktop
Comment=Set desktop background and menu and icon behavior
Exec=xfdesktop-settings
Icon=preferences-desktop-wallpaper
Terminal=false
Type=Application
Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-PersonalSettings;
OnlyShowIn=XFCE;
StartupNotify=true
X-XfcePluggable=true
X-XfceHelpComponent=xfdesktop
X-XfceHelpPage=start
X-XfceHelpVersion=4.12

X-Ubuntu-Gettext-Domain=app-install-data
[close]

Offline MNFrozenfish

  • Jr. Member
  • **
  • Posts: 60
  • Karma: 13
  • Smile! --- Why not?
    • View Profile
  • Peppermint version(s): Peppermint 9 Respin-64 bit
Re: Struggling to get Unity program to autostart
« Reply #3 on: January 08, 2019, 04:40:08 pm »
Or did you mean for the program?
Spoiler (click here to view / hide)
/home/todd/Desktop/linux/Linux_AssignmentSheet2019_Data
/home/todd/Desktop/linux/Linux_AssignmentSheet2019.x86_64
[close]

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 22924
  • Karma: 2556
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Struggling to get Unity program to autostart
« Reply #4 on: January 08, 2019, 06:05:34 pm »
I mean the contents of the file you copied to your autostart directory ?

I mean you say it starts perfectly from the desktop right ? .. I take it that means there's a desktop icon ? .. if not, what did you copy to the autostart folder ?

Can you post the output from:
Code: [Select]
ls -a ~/.config/autostart
and post the full path to whatever you click on that successfully launches your application.
« Last Edit: January 08, 2019, 06:09:28 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline MNFrozenfish

  • Jr. Member
  • **
  • Posts: 60
  • Karma: 13
  • Smile! --- Why not?
    • View Profile
  • Peppermint version(s): Peppermint 9 Respin-64 bit
Re: Struggling to get Unity program to autostart
« Reply #5 on: January 08, 2019, 11:35:03 pm »

Code: [Select]
ls -a ~/.config/autostart
todd@P9-Latitude-E6540 ~ $ ls -a ~/.config/autostart
 .   'Link to Linux_AssignmentSheet2019.x86_64'   xbindkeys.desktop
 ..   peppermint-control-center.desktop
todd@P9-Latitude-E6540 ~ $
path
/home/todd/Desktop/linux/Linux_AssignmentSheet2019.x86_64
« Last Edit: January 09, 2019, 12:18:31 am by zebedeeboss »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 22924
  • Karma: 2556
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Struggling to get Unity program to autostart
« Reply #6 on: January 09, 2019, 10:41:51 am »
Okay, what happens if you open a terminal and run:
Code: [Select]
/home/todd/Desktop/linux/Linux_AssignmentSheet2019.x86_64
does your application start ?

If so, I'll post how to create an autostart launcher.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline MNFrozenfish

  • Jr. Member
  • **
  • Posts: 60
  • Karma: 13
  • Smile! --- Why not?
    • View Profile
  • Peppermint version(s): Peppermint 9 Respin-64 bit
Re: Struggling to get Unity program to autostart
« Reply #7 on: January 09, 2019, 10:50:11 am »
Yes, that works.
Please add a line for a delay start if possible. If it turns out that I it isn't needed I can always edit it out.
Thanks much.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 22924
  • Karma: 2556
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Struggling to get Unity program to autostart
« Reply #8 on: January 09, 2019, 11:10:34 am »
I doubt a delay will be necessary, but...

First get rid of that link
Code: [Select]
rm "/home/todd/.config/autostart/Link to Linux_AssignmentSheet2019.x86_64"
now let's create the autostart launcher .. run:
Code: [Select]
xed /home/todd/.config/autostart/Linux_AssignmentSheet2019.desktop
when a blank file opens, make it read:-
Code: [Select]
[Desktop Entry]
Type=Application
Name=Linux Assignment Sheet 2019
Comment=Linux Assignment Sheet 2019
Exec=bash -c "sleep 5 ; /home/todd/Desktop/linux/Linux_AssignmentSheet2019.x86_64"
Icon=x-office-document
SAVE the file and exit the text editor

Log off/on to test.

If you DON'T need the 5 second delay, make the "Exec=" line instead read
Code: [Select]
Exec=bash -c "/home/todd/Desktop/linux/Linux_AssignmentSheet2019.x86_64"
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline MNFrozenfish

  • Jr. Member
  • **
  • Posts: 60
  • Karma: 13
  • Smile! --- Why not?
    • View Profile
  • Peppermint version(s): Peppermint 9 Respin-64 bit
Re: Struggling to get Unity program to autostart
« Reply #9 on: January 09, 2019, 11:36:09 am »
Works like a charm. Thanks
Would you be so good as to explain the logic behind the script, how does it work? I think I understand but knowledge is power right.  ;D My scripting skills are  elementary at best, but I am trying to learn.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 22924
  • Karma: 2556
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Struggling to get Unity program to autostart
« Reply #10 on: January 09, 2019, 11:56:25 am »
autostart works by starting applications using ".desktop" launchers .. in the same way the main menu or launchers on the desktop would.

ie. you can't have a symlink to an executable, instead you should have a ".desktop" launcher that points to the executable on the "Exec=" line.

This is in accordance with the desktop entry spec standard from freedesktop.org
https://specifications.freedesktop.org/desktop-entry-spec/latest/
that kinda makes sure all applications integrate into menus and DE's in the same way .. so any software that ships with a launcher that follows that standard is sure to integrate into menus irrespective of the DE used.

Autostart entries follow the same standard simply so you can generally just copy the menu entry .desktop file (if one exists) from:-
/usr/share/applications
to one of the autostart directories, and it should just work.

Is that what you were asking ?

If not, and you were asking about the actual syntax of .desktop launchers .. it's all at the above link, but I'll be happy to try answer any questions you may have after reading the spec .. this is not an RTFM, just that it's explained better than I could at source ;)
« Last Edit: January 09, 2019, 12:03:54 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline MNFrozenfish

  • Jr. Member
  • **
  • Posts: 60
  • Karma: 13
  • Smile! --- Why not?
    • View Profile
  • Peppermint version(s): Peppermint 9 Respin-64 bit
Re: Struggling to get Unity program to autostart
« Reply #11 on: January 09, 2019, 12:03:02 pm »
Makes more sense now.
Thanks again. I appreciate the help.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 22924
  • Karma: 2556
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Struggling to get Unity program to autostart (SOLVED)
« Reply #12 on: January 09, 2019, 12:05:46 pm »
You''re most welcome :)

The desktop-entry-spec is worth a read if you wanna know how it all works .. it really helps with this stuff :)

Again, not an RTFM .. I'm more than willing to answer questions but they explain it better than I could, and usually best to get stuff from the horses mouth so to speak :)
« Last Edit: January 09, 2019, 12:08:19 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec