WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: startup applications  (Read 9142 times)

Offline blue horse

  • Newbie
  • *
  • Posts: 31
startup applications
« on: January 26, 2012, 03:19:04 PM »
--------------------------------------------------------------------------------------------------------
How do I start X apps on boot?

Add them to files in /home/tc/.X.d, one per file, backgrounded. Here's how to start Opera at boot:
opera &
--------------------------------------------------------------------------------------------------------

forgive my ignorance, can someone give an example of two entries? I am confused with the meaning of X, is it same as app name or is it a serial number?  can't be literally X for more than one entry.

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: startup applications
« Reply #1 on: January 26, 2012, 03:36:12 PM »
"X apps" refers to those applications that use the X-windows graphical system, as opposed to "console apps" which are text based and run independently of the graphical user interface (in "terminal mode" either on the console or in a terminal window).

X apps are started after the Xwindows system starts up, since they depend upon it.  They can be autostarted from scripts in directory /home/tc/.X.d/

Non-X apps (console apps) can be autostarted by invoking them from within /opt/bootsync.sh

To autostart emelfm2 (an X application) you  would simply place a script containing the following in /home/tc/.X.d
Code: [Select]
#!/bin/sh
emelfm2 &
It doesn't matter what you name the script, but it will need to have the execute permission set using the chmod command.

I don't actually use the the autostart functionality myself, so someone please correct me if I've missed anything.
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline blue horse

  • Newbie
  • *
  • Posts: 31
Re: startup applications
« Reply #2 on: January 26, 2012, 07:06:56 PM »
thanks for the tips.
i was able to start X apps on start-up, particularly flit to show clock and speaker status.

there's more...
i installed printer driver through CUPS and gutenprint, see http://forum.tinycorelinux.net/index.php/topic,12399.0.html
however, every time i reboot, the printer disappears and i will have to go through CUPS to set it up.  how can i make the printer persistent?

if someone suggests using extension, please be specific, like step-by step instructions, my understanding goes: build an extension to save information you want to restore when boot-up, but i do not know what to save and how to restore.

thanks.
« Last Edit: January 26, 2012, 07:17:42 PM by blue horse »

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: startup applications
« Reply #3 on: January 26, 2012, 07:40:35 PM »
try to read final part of cups.tcz comments

Offline blue horse

  • Newbie
  • *
  • Posts: 31
Re: startup applications
« Reply #4 on: January 26, 2012, 08:06:39 PM »
i do not use backup, the following link solved my problem.

http://wiki.tinycorelinux.net/wiki:printer_setup_using_cups

basically, it says to save two files as extension
/usr/local/etc/cups/printers.conf
/usr/local/etc/cups/ppd/printer_specific.ppd

the trick is: without properly installing the printer first, you wouldn't even see these files.

thanks for the reply.

Offline SamK

  • Hero Member
  • *****
  • Posts: 713
Re: startup applications
« Reply #5 on: January 27, 2012, 05:01:07 AM »
Hi Lee,

I don't actually use the the autostart functionality myself, so someone please correct me if I've missed anything.
Not so much corrections, more observations based on my experience of autostarting via .X.d.  I have used this to start various apps on a range of systems running TC 3.x and 4.x.


To autostart emelfm2 (an X application) you  would simply place a script containing the following in /home/tc/.X.d
Code: [Select]
#!/bin/sh
emelfm2 &
 
It doesn't matter what you name the script, but it will need to have the execute permission set using the chmod command.
Not sure this is required.  The files that autostart my apps are owned by an unprivileged user and have permissions rw_r__r.


Non-X apps (console apps) can be autostarted by invoking them from within /opt/bootsync.sh
This is indeed the case.  They can also be run via .X.d.  By way of example, the 4.x series introduced the pcspkr module.  I use this on headless units to indicate when the boot process has ended.  .X.d is at the end of the boot up sequence and is a suitable point at which to generate an audible notification.


Additionally, I am not certain that starting apps on a "...one per file..." basis is a strict requirement.  I have certainly used it in this way, but have also successfully used a single file to start multiple apps.  I never fully understood the reason for starting each app via its own file and simply assumed that it was perceived to be a simpler way of managing the process.

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: startup applications
« Reply #6 on: January 27, 2012, 05:52:33 AM »
...basically, it says to save two files as extension
/usr/local/etc/cups/printers.conf
/usr/local/etc/cups/ppd/printer_specific.ppd

yes, perhaps you may read .Info  of cups is more implicit, however, more or less the files are the same

"To persist across boots, add the following to your backup:
                /usr/local/etc/cups/ppd/HP_OfficeJet_G85.ppd [for example]
                /usr/local/etc/cups/printers.conf
                /usr/local/etc/cups/cupsd.conf (only if you changed it)
                /etc/shadow (if you want to save to root password"

You can create an extension of any file on your filesystem, compared to the backup file simply change the format and functionality.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: startup applications
« Reply #7 on: January 27, 2012, 06:37:55 AM »
Additionally, I am not certain that starting apps on a "...one per file..." basis is a strict requirement.  I have certainly used it in this way, but have also successfully used a single file to start multiple apps.  I never fully understood the reason for starting each app via its own file and simply assumed that it was perceived to be a simpler way of managing the process.

Yes, that one is just a style question.
The only barriers that can stop you are the ones you create yourself.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: startup applications
« Reply #8 on: January 27, 2012, 07:56:57 AM »
Didn't know this but yes you can start many apps from the same file, and the file name is unimportant.

I followed the guide and have one file per each app in .X.d.

Also find that the startup files can be set tc:staff and 644 
« Last Edit: January 27, 2012, 08:25:53 AM by coreplayer2 »