Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Startup applications
New Posts  All Forums:Forum Nav:

Startup applications

post #1 of 10
Thread Starter 
I know there is the Startup Applications tab in System, but it doesn't account for things you want to execute with arguments. Using ubuntu 10.04 btw.

All I am trying to run is this...

gladevcp -u /home/somewhere/example.py /home/somewhere.glade

...from startup.

Everything I am finding online either doesn't account for arguments, or seems overly complicated(like going into the kernel).

This gladevcp is an interface program for EMC2, but it isn't exactly executable like firefox or emacs is(no blue diamond in /usr/bin). So that means if you go into the icon's properties, there are no Launcher Properties, nor is there an option for the context menu, as described in the middle of this guide.

Any help would greatly be appreciated.
Edited by Thereoncewasamaninparis - 4/7/12 at 9:30pm
Croissant
(15 items)
 
  
CPUMotherboardGraphicsRAM
2600k Asus Sabertooth Z77 GTX 680 2x4 gigs G-SKill 
Hard DriveOptical DriveCoolingOS
Crucial C300 2x Asus DVD-RW Silver Arrow Win 7 
MonitorPowerCaseAudio
Dual ASUS 24" Rosewill 750 Capstone Corsair Carbide Air 540 The Basic sound blaster Z-Series 
  hide details  
Reply
Croissant
(15 items)
 
  
CPUMotherboardGraphicsRAM
2600k Asus Sabertooth Z77 GTX 680 2x4 gigs G-SKill 
Hard DriveOptical DriveCoolingOS
Crucial C300 2x Asus DVD-RW Silver Arrow Win 7 
MonitorPowerCaseAudio
Dual ASUS 24" Rosewill 750 Capstone Corsair Carbide Air 540 The Basic sound blaster Z-Series 
  hide details  
Reply
post #2 of 10
Not familar with ubuntu, but searching for trying to run a command on "login to the GUI" try this...

System->Preferences->Session add the command

gladevcp -u /home/somewhere/example.py /home/somewhere.glade

Should launch any command setup in there..
post #3 of 10
Thread Starter 
Hmm, I don't have a session option in System->Preferences.
Croissant
(15 items)
 
  
CPUMotherboardGraphicsRAM
2600k Asus Sabertooth Z77 GTX 680 2x4 gigs G-SKill 
Hard DriveOptical DriveCoolingOS
Crucial C300 2x Asus DVD-RW Silver Arrow Win 7 
MonitorPowerCaseAudio
Dual ASUS 24" Rosewill 750 Capstone Corsair Carbide Air 540 The Basic sound blaster Z-Series 
  hide details  
Reply
Croissant
(15 items)
 
  
CPUMotherboardGraphicsRAM
2600k Asus Sabertooth Z77 GTX 680 2x4 gigs G-SKill 
Hard DriveOptical DriveCoolingOS
Crucial C300 2x Asus DVD-RW Silver Arrow Win 7 
MonitorPowerCaseAudio
Dual ASUS 24" Rosewill 750 Capstone Corsair Carbide Air 540 The Basic sound blaster Z-Series 
  hide details  
Reply
post #4 of 10
Quote:
Originally Posted by Thereoncewasamaninparis View Post

I know there is the Startup Applications tab in System, but it doesn't account for things you want to execute with arguments. Using ubuntu 10.04 btw.
All I am trying to run is this...
gladevcp -u /home/somewhere/example.py /home/somewhere.glade
...from startup.
Everything I am finding online either doesn't account for arguments, or seems overly complicated(like going into the kernel).
This gladevcp is an interface program for EMC2, but it isn't exactly executable like firefox or emacs is(no blue diamond in /usr/bin). So that means if you go into the icon's properties, there are no Launcher Properties, nor is there an option for the context menu, as described in the middle of this guide.
Any help would greatly be appreciated.

I very much doubt any guides you find will take you into the kernel. If you're going that low level, then you couldn't run Python scripts (such as your example above) let alone pass arguments to it.

As for setting stuff in start up, I don't use ubuntu, but if you can add your own apps (without the command parameters) then just create your own shell script (Linux equivalent of a Batch (.BAT) file).

To do this, create a new text file (named in this example as "startup.sh" in your home directory and add the following stuff to it:
Code:
#!/bin/sh
# the above line is essential!!
gladevcp -u /home/somewhere/example.py /home/somewhere.glade &
#make sure you include a space character and then an ampersand at the end of each line
#add any other commands you want to start up - also with space ampersand (like above)

Now save this file, and navigate to the file properties (possibly by your file manager -> right click -> properties?? I don't use Ubuntu so you'll have to work this bit out) and in there you should see an "execute" permission that is unticked - tick that.

If you cant workout how to do the above step, then open a terminal window and paste the following command into it:
Code:
chmod +x ~/startup.sh
(where startup.sh is the name of your script you just saved).


Now go add that to your start up manager smile.gif

If at any point you want to add or remove items from it, just edit the text file. You will not need to change the permissions / chmod in terminal again - you only need to edit the text file. Just make sure you right click -> edit the file rather than double clicking though as the system will default to running your script as it will see it as an executable.
post #5 of 10
Thread Starter 
Wow, so simple and yet I couldn't find anything like that searching the internet, thank you.
Croissant
(15 items)
 
  
CPUMotherboardGraphicsRAM
2600k Asus Sabertooth Z77 GTX 680 2x4 gigs G-SKill 
Hard DriveOptical DriveCoolingOS
Crucial C300 2x Asus DVD-RW Silver Arrow Win 7 
MonitorPowerCaseAudio
Dual ASUS 24" Rosewill 750 Capstone Corsair Carbide Air 540 The Basic sound blaster Z-Series 
  hide details  
Reply
Croissant
(15 items)
 
  
CPUMotherboardGraphicsRAM
2600k Asus Sabertooth Z77 GTX 680 2x4 gigs G-SKill 
Hard DriveOptical DriveCoolingOS
Crucial C300 2x Asus DVD-RW Silver Arrow Win 7 
MonitorPowerCaseAudio
Dual ASUS 24" Rosewill 750 Capstone Corsair Carbide Air 540 The Basic sound blaster Z-Series 
  hide details  
Reply
post #6 of 10
You can also do it as a init startup script, or cron job. You can even set system scrips to run at login. There are multiple ways you want to do this, each one just as easy (once learned) as the other. I like using the .xinitrc file in ~/ and then use that to call custom scripts.

http://en.gentoo-wiki.com/wiki/X.Org/xsession

When you login .xinitrc is always ran, at least for a graphical login (correct?). I know there are other startup scripts ran at login, don't know off the top of my head but that's cool. I use graphical anyways, so .xinitrc works fine.
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
post #7 of 10
Quote:
Originally Posted by mushroomboy View Post

You can also do it as a init startup script, or cron job. You can even set system scrips to run at login. There are multiple ways you want to do this, each one just as easy (once learned) as the other. I like using the .xinitrc file in ~/ and then use that to call custom scripts.
http://en.gentoo-wiki.com/wiki/X.Org/xsession
When you login .xinitrc is always ran, at least for a graphical login (correct?). I know there are other startup scripts ran at login, don't know off the top of my head but that's cool. I use graphical anyways, so .xinitrc works fine.

Most of the time if you use GDM or KDM they don't read .xinitrc, Slim and some others use it though AFAIK. Unless it's changed in the last 2 years since I last messed with GDM.
post #8 of 10
Quote:
Originally Posted by Shrak View Post

Most of the time if you use GDM or KDM they don't read .xinitrc, Slim and some others use it though AFAIK. Unless it's changed in the last 2 years since I last messed with GDM.

it's been reading it just fine here, I've always had both KDM/GDM read it fine for me. So I don't know, it should work fine. I know there is another startup file like xinitrc that runs at login (no matter what) but I can't remember the name of it. Though I generally do everything under init if I can, just because I like everything I need ran before I even login. I like it to be system wide, otherwise I don't have it startup and I'll manually start it.
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
Current Rig
(14 items)
 
  
CPUMotherboardGraphicsRAM
FX-8350 4.6GHz@1.44v GA-990FXA-UD3 R4.0 HD 7950 (1100/1450) 8G Muskin DDR3 1866@8CLS 
Hard DriveOptical DriveOSMonitor
1TB WD LiteOn DVD-RW DL Linux/Windows 19" Phillips TV 1080p 
PowerCaseMouseMouse Pad
OCZ 600W Generic Junk Logitech MX400 Generic Junk 
Audio
SBL 5.1 
  hide details  
Reply
post #9 of 10
Quote:
Originally Posted by mushroomboy View Post

it's been reading it just fine here, I've always had both KDM/GDM read it fine for me. So I don't know, it should work fine. I know there is another startup file like xinitrc that runs at login (no matter what) but I can't remember the name of it. Though I generally do everything under init if I can, just because I like everything I need ran before I even login. I like it to be system wide, otherwise I don't have it startup and I'll manually start it.

Hmm weird. I could never get .xinitrc to work when I was still using Gnome 2. Oh well, I use startx/.xinitrc now anyways, not a fan of GUI logins anymore frown.gif
post #10 of 10
Quote:
Originally Posted by Thereoncewasamaninparis View Post

Wow, so simple and yet I couldn't find anything like that searching the internet, thank you.

Yeah you wont find a guide suggesting that as, in all honesty, it's a bit of a kludge.
Make sure you have the space ampersand though - as what that does is tell Linux to execute the next line straight away - ie do not to wait for that program to exit before moving onto the next program.
Quote:
Originally Posted by mushroomboy View Post

it's been reading it just fine here, I've always had both KDM/GDM read it fine for me. So I don't know, it should work fine. I know there is another startup file like xinitrc that runs at login (no matter what) but I can't remember the name of it. Though I generally do everything under init if I can, just because I like everything I need ran before I even login. I like it to be system wide, otherwise I don't have it startup and I'll manually start it.

The only danger of that is, unless you're suexec'ing thing properly, you'll have potentially insecure apps running as root.

Also - and this is specifically aimed at the OP - using the init scripts wouldn't work for graphical applications. Which is where xinitrc (also described above) comes into its own.
Edited by Plan9 - 4/9/12 at 2:39am
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Startup applications