Xfce - Autostart

Discussion in 'Linux' started by qbic2005, Aug 3, 2008.

  1. qbic2005

    qbic2005

    Joined:
    Jul 24, 2008
    Messages:
    42
    Likes Received:
    0
    I could be wrong, but it seems like the scripts I put in .config/autostart don't get executed at startup??
    (however they end with .sh and are executable)

    anybody an idea how acer/linpus screwed this up and how we can fix it again ;)
     
    qbic2005, Aug 3, 2008
    #1
  2. qbic2005

    shihan

    Joined:
    Jul 22, 2008
    Messages:
    12
    Likes Received:
    0
    best to use the autostart editor (alt-f2 and type 'xfce4-autostart-editor')

    At least, this is the only way i've found to do it reliably.. like kde (from memory) it expects to find application descriptions (rather than shell scripts) in the .config/autostart. From memory, xfce also has something similar to kde's session state manager (though i cant find it) so you can just snapshot whats currently running and make it start it up everytime the gui starts.
     
    shihan, Aug 3, 2008
    #2
  3. qbic2005

    within

    Joined:
    Jul 30, 2008
    Messages:
    32
    Likes Received:
    0
    both tips did no work for starting python base software: Gmail Notifier.

    any tips how to launch at startup this nice tool?
     
    within, Aug 3, 2008
    #3
  4. qbic2005

    qbic2005

    Joined:
    Jul 24, 2008
    Messages:
    42
    Likes Received:
    0
    There must be a difference between the linpus system's if you get the app's started this way. I configured the xfce4-autostrart-editor to have an extra entry.
    I also checked that my .config/autostart/compiz-fus.desktop is generated, I have it pointed to my script that is executable and starts compiz-fusion without problems ...

    I also found this : (in /etc/xdg/xfce4/xinitrc_later)
    Which clearly says (uehm) that only ".desktop" files in the given dir will be executed....

    Code:
    f test -d "$XDG_CONFIG_HOME/autostart"; then
      for i in ${XDG_CONFIG_HOME}/autostart/*.desktop; do
        grep -q -E "^Hidden=true" "$i" && continue
        if grep -q -E "^OnlyShowIn=" "$i"; then
          # need to test twice, as lack of the line entirely means we still run it
          grep -E "^OnlyShowIn=" "$i" | grep -q 'XFCE;' || continue
        fi
        grep -E "^NotShowIn=" "$i" | grep -q 'XFCE;' && continue
    
        # check for TryExec
        trycmd=`grep -E "^TryExec=" "$i" | cut -d'=' -f2`
        if test "$trycmd"; then
          type "$trycmd" >/dev/null 2>&1 || continue
        fi
    
        cmd=`grep -E "^Exec=" "$i" | cut -d'=' -f2`
        if test "$cmd" && type "$cmd" >/dev/null 2>&1; then
          $cmd &
        fi
      done
    elif test -d "$HOME/Desktop/Autostart"; then
      for i in `ls -1 -L ${HOME}/Desktop/Autostart/ 2>/dev/null`; do
        if test -x $HOME/Desktop/Autostart/$i; then
          $HOME/Desktop/Autostart/$i &
        fi
      done
    fi 
     
    qbic2005, Aug 3, 2008
    #4
  5. qbic2005

    within

    Joined:
    Jul 30, 2008
    Messages:
    32
    Likes Received:
    0
    @ qbic2005:

    I'm not sure to follow you on this...

    I've found a gentoo wiki page that deals with autostart and different Desktop Environnement, such as Xfce:
    http://gentoo-wiki.com/HOWTO_Autostart_Programs#Xfce4

    Not sure if this can help in every situation, but it should be a good start :)
     
    within, Aug 3, 2008
    #5
  6. qbic2005

    qbic2005

    Joined:
    Jul 24, 2008
    Messages:
    42
    Likes Received:
    0
    @within

    Thank you for the info, I'm a gentoo addict for some years already and it's wiki is often a good source... however they clearly say in the example that you can put in any script type you like, this is probably an addaptation made by gentoo.

    I say this because on the official http://wiki.xfce.org (down at the moment) they say you can only autostart ".desktop" files.
    The script part I included in my previous post is part of the boot sequence from Xfce and only searches for ".desktop" file in the .config/autostart dir.
    This concludes that the xfce4-autostart-editor is actually the way to do it apperantly. (because it creates these ".desktop" files)

    Even with this editor autostart still doesn't work on mine, the question is why ;)

    Can somebody from who it works do an "ls -l" from the ".config/autostart/" and make a copy (or compare) this file "/etc/xdg/xfce4/xinitrc_later". I only understand the first two lines of the script :mrgreen: but I think it is clearly the script that makes your autostart programs do their thing ;)

    thanks
     
    qbic2005, Aug 4, 2008
    #6
  7. qbic2005

    qbic2005

    Joined:
    Jul 24, 2008
    Messages:
    42
    Likes Received:
    0
    hi again .... :roll:

    ...seems I'll have to correct myself on this topic, doesn't happen to often ....

    QUESTION : does autostart work for you on linpus? say so please! (and make me happy, say what you did to make it work)

    Well then it seems the /etc/xdg/xfce4/xinitrc_later doesn't get executed when xfce4-session is running ... and on linpus it is active. :(
    now what :?: :!:
     
    qbic2005, Aug 4, 2008
    #7
  8. qbic2005

    within

    Joined:
    Jul 30, 2008
    Messages:
    32
    Likes Received:
    0
    @ qbic2005:

    I haven't added anything excpt the py script (which does not start). I'll try to add one link to check if it works.

    stay tuned :)
     
    within, Aug 5, 2008
    #8
  9. qbic2005

    within

    Joined:
    Jul 30, 2008
    Messages:
    32
    Likes Received:
    0
    I can add using terminal some applications to start at boot; I did follow 'backward' the idea given on XFCE wiki page:
    http://wiki.xfce.org/faq?s[]=autostart

    here we go:

    1/ launch terminal (you will be in your home bt default, you even don't need to be root to do that) and check if you have Autostart dir in your Desktop directory
    Code:
    ls ~/Desktop
    if it says 'nothing' means it is empty, then create the Autostart directory there:
    Code:
    mkdir Autostart
    if no error returned, you made a new dir :)

    2) get the application you want to start: for that, you need to add a .desktop file (I beleive only this kind of file can be added). Thus you need to know what application you have, so you will list them
    Code:
    ls /usr/share/applications/*.desktop
    you will get a full list of your desktop file from which you are able to launch associated application (you can edit with mouepad a .desktop file to see how it is made).

    3/ copy your .desktop file (I did it with Skype) into the dir you created above:
    Code:
    cp /usr/share/applications/skype.desktop /home/user/Desktop/Autostart/
    now, you have a copy of tis skype.desktop in your 'own' autostart dir.
    You can check that this command updated the autostart info in launching the xfce4-autostart-editor (to check, use the search bar on your desktop, type autostart, and double click on 'xfce4-autostart-editor'; you will see the Skype application listed with its original comment.

    Remark about the check above: I did it after I rebooted my AA1, you might do the same too if you wish to check everything is ok.

    hope it helps,
    within

    PS: I am NOT a linux guru, closer to a n00b, but I enjoy playing with commands when I can find some good explanations around, and when I get the result I wish... and sometimes it takes looooong time to get a working result :)
     
    within, Aug 5, 2008
    #9
  10. qbic2005

    dandesigns

    Joined:
    Jul 19, 2008
    Messages:
    103
    Likes Received:
    0
    not sure if i get you correctly but here's a quick and dirty one:

    1. terminal
    2. sudo mousepad /usr/share/search-bar/start-search_bar.sh
    3. add whatever you want to start after the "fi"


    as you noticed, it is the script file for the search bar. :) i have commented everything in it since i don't want the search bar to come out. might as well use it for something more important. :)

    if you want to run scripts on root level, just put sudo before the command. I used this "hack" to run apache and mysql since /sbin/chkconfig is useless.

    here's what i added:
    sudo /sbin/service httpd start
    sudo /sbin/service mysqld start
     
    dandesigns, Aug 5, 2008
    #10
  11. qbic2005

    qbic2005

    Joined:
    Jul 24, 2008
    Messages:
    42
    Likes Received:
    0
    @dandesigns
    very nice, however not directly what I was searching for. I want to be sure that the windowmanager is fully started before I start any app.
    But thanks for the info, maybe someone else can use it ;)

    Further (I should have tried this earlier....) but indeed an app starts as long as its .desktop shortcut also resides in "/usr/share/applications/" and then you may copy it in .config/autostart or Desktop/Autostart, all the same ....

    and if you want to create a "xxxx.desktop" launcher of your own just make sure you put a copy in /usr/share/applications/ and it will work

    short:
    $xfce4-autostart-editor -> create your item
    $sudo cp .config/autostart/*.desktop /usr/share/applications/
     
    qbic2005, Aug 5, 2008
    #11
  12. qbic2005

    quindo

    Joined:
    Aug 5, 2008
    Messages:
    29
    Likes Received:
    0
    Those services should be started in the /etc/rc5.d (default runlevel of linpus).
    But....
    I've already noticed that not all (or even none) of the services in /etc/rc5.d are started!
    Anybody got any idea why that is?
     
    quindo, Aug 8, 2008
    #12
  13. qbic2005

    dandesigns

    Joined:
    Jul 19, 2008
    Messages:
    103
    Likes Received:
    0
    i tried doing chkconfig which is the proper way to do it but it didn't work so i guess acer did something. i hope the ubuntu guys come up with a more easier way to install it so i can switch OS. linpus is just right without acer's system modifications.
     
    dandesigns, Aug 8, 2008
    #13
  14. qbic2005

    qbic2005

    Joined:
    Jul 24, 2008
    Messages:
    42
    Likes Received:
    0
    I'm very curious about finding out the little bits, but now i'm to tiered to get it done, but I'll try to figure it out on monday evening.
    Check this for decent background info
    http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4

    I got +/- this far:
    /etc/rc : is the script that normally calls the startup services and it seams intact
    /etc/inittab : in runlevel 5 calls /etc/rc.d/rc.5
    /etc/rc.d/rc.5 : heavely altered, needs to be checked against an normal fedora one

    .....
     
    qbic2005, Aug 8, 2008
    #14
  15. qbic2005

    retsaw

    Joined:
    Aug 1, 2008
    Messages:
    133
    Likes Received:
    0
    The init scripts will bare very little resemblance to the Fedora ones, since they seem to be taken from SLAX, the comments in rc.last and rc.5 say as much. This kinda makes sense to me since the fastest boot time I achieved was running Slackware which SLAX is based on, they're easier to understand, modify and optimize than the SysV style ones Fedora uses.

    It is quite possible the rc5.d is completely ignored since I didn't see anything in the init scripts that would run anything the scripts linked there, although I've only had a casual look over them, so I could have missed it.
     
    retsaw, Aug 8, 2008
    #15
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.