Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: Script for starting xmms2 when logging in

  1. #1
    Join Date
    Feb 2011
    Location
    127.0.0.1
    Posts
    472

    Default Script for starting xmms2 when logging in

    I was wondering if the following bash script is ok, I don't want to test before asking

    Code:
     if [ -x /usr/bin/xmms ]; then /usr/bin/xmms; fi
    to be put in
    Code:
    ~/.profiles
    .
    Reliable + rider = RiDeR PlUs
    ...if you find this helpful, click on the star below...
    +-+ +-+
    |r| |+|
    +-+ +-+

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,851

    Default Re: Script for starting xmms2 when logging in

    1) It is not a script,but just a statement (a script is one of more statements where the first line is a "shebang", put into a file and the file made executable).

    2) The statement looks fine to me. The precaution taken by first testing if it exists and is executable for you might look a bit superfluous, but OTOH when you allways program that cautious I applaud this attitude.

    3) I gues you mean .profile and not .profiles.

    4) Just put it there and see what happens when testing. I think it is pretty harmless as it is, even when it should not work to your complete satisfaction. Extra precaution: Do not log out from the session where you edited .profile, but start a second GUI session. When it is hanging (could happen with these sorts of .profile editing), you will still have the first session open to edit back.

    Edit: BTW when it works to satisfaction, I can show you a shorter one.
    Last edited by hcvv; 15-Oct-2011 at 12:28.
    Henk van Velden

  3. #3
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Script for starting xmms2 when logging in

    On 2011-10-15 20:26, riderplus wrote:
    >
    > I was wondering if the following bash script is ok, I don't want to test
    > before asking


    Ha! So we do the hard work, eh? :-)

    I'll answer with a question: what will happen if you start a text console?

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  4. #4
    Join Date
    Feb 2011
    Location
    127.0.0.1
    Posts
    472

    Default Re: Script for starting xmms2 when logging in

    Thanks for replies. Yes, I was wrong, it's not a script.

    Robin, I don't know

    And by the way, is
    Code:
    bash -l
    equivalent to ctrl+alt+f1?
    Reliable + rider = RiDeR PlUs
    ...if you find this helpful, click on the star below...
    +-+ +-+
    |r| |+|
    +-+ +-+

  5. #5
    Join Date
    Feb 2011
    Location
    127.0.0.1
    Posts
    472

    Default Re: Script for starting xmms2 when logging in

    I did start a new session with ctrl+alt+f1 after modifying the ~/.profile file as to include the statement (and placed /usr/bin/amarok instead of xmms) and I was prompted with this:

    Code:
    unnamed application(4776):KUniqueApplication Cannot find the D-Bus Session Server: /bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization fail
    unnamed application (4775): Pipe closed unexpectedly
    Reliable + rider = RiDeR PlUs
    ...if you find this helpful, click on the star below...
    +-+ +-+
    |r| |+|
    +-+ +-+

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,851

    Default Re: Script for starting xmms2 when logging in

    Quote Originally Posted by riderplus View Post
    Thanks for replies. Yes, I was wrong, it's not a script.

    Robin, I don't know

    And by the way, is
    Code:
    bash -l
    equivalent to ctrl+alt+f1?
    I am not quite following you here, but bash -l, when given in a shell (terminal) session, starts a new shell (bash) as a daughter in that terminal session and it is started as a login shell, thus indeed including your .profile. But I guess that you want to test this when you start a GUI session, not a bash session.

    Ctrl-Alt-F1 is a key combination given to your running X-server, to show you the first logical screen of your monitor. That one is normaly showing the system console. Again not a graphical session.

    I guess that my suggestion to use one session for editing the .profile and another session to test what happens should have been a bit more explanatory.

    The session where you change .profile can be in a terminal in aGUI (KDE) session you are running. The second session can then be started using the "leave/logout/shutdown" button in the Kmenu (not a similar button in your panel), which offers you something like "change user" I do not have the English language in my system here, thus the wording could be different). Following the instructions there will give you a login screen (at Ctrl-Alt-F8, when you original GUI session is at Ctrl-Alt-F7). Use that new login for the test.

    Alternative, do not login in the GUI t all, but do Ctrl-Alt-F1 and login in the console. Do your .profile editing, and switch with Ctrl-Alt-F7 back to your GUI login. Switch back and foeward and logout/login in the GUI for testing.
    Henk van Velden

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,851

    Default Re: Script for starting xmms2 when logging in

    Quote Originally Posted by riderplus View Post
    I did start a new session with ctrl+alt+f1 after modifying the ~/.profile file as to include the statement (and placed /usr/bin/amarok instead of xmms) and I was prompted with this:

    Code:
    unnamed application(4776):KUniqueApplication Cannot find the D-Bus Session Server: /bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization fail
    unnamed application (4775): Pipe closed unexpectedly
    As I understand what you say here, you edited from the console (which I give as a possibility above and is OK), but you fail to tell in which environment you test the .profile. Making a GUI login? When you test doing a CLI login, Amarok (and any X bases program) will give problems because no graphical X screen is assoiciated which that session.
    Henk van Velden

  8. #8
    Join Date
    Feb 2011
    Location
    127.0.0.1
    Posts
    472

    Default Re: Script for starting xmms2 when logging in

    I've started a new GUI session with "Switch User". The result is that I see only the Amarok icon, nothing else (which disappears after 1 minute and...black screen). So I guess it's not working, as it stops X's normal activity.
    Reliable + rider = RiDeR PlUs
    ...if you find this helpful, click on the star below...
    +-+ +-+
    |r| |+|
    +-+ +-+

  9. #9
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Script for starting xmms2 when logging in

    On 2011-10-16 13:56, hcvv wrote:

    > As I understand what you say here, you edited from the console (which I
    > give as a possibility above and is OK), but you fail to tell in which
    > environment you test the- .profile-. Making a GUI login? When you test
    > doing a CLI login, Amarok (and any X bases program) will give problems
    > because no graphical X screen is assoiciated which that session.


    Which is the answer to my question I asked of him ;-)
    Or one of the answers.


    riderplus: You should rather put the app in the autostart directory of the
    desktop you use.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  10. #10
    Join Date
    Feb 2011
    Location
    127.0.0.1
    Posts
    472

    Default Re: Script for starting xmms2 when logging in

    Robin, you mean creating a symbolic link to the application, as in Linux desktop auto start or launch programs
    Reliable + rider = RiDeR PlUs
    ...if you find this helpful, click on the star below...
    +-+ +-+
    |r| |+|
    +-+ +-+

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •