Results 1 to 7 of 7

Thread: Point & Click

  1. #1
    Join Date
    Feb 2009
    Location
    Scotland
    Posts
    25

    Default Point & Click

    I am trying to create a script or link that I can point to & click using the mouse, I would like the it to open konsole and run a command (in my case "./teeworlds_svr -f config.cfg"). So far I have learnt to create a text file (in my case "startsvr.sh"), and place in there the following;

    #!/bin/bash
    ./teeworlds_srv -f config.cfg

    At first I found that pointing & clicking at this file opened it in KWrite, so I have changed it's properties by checking "is executable", now though when I click on it I get nothing at all.

    Thanks in advance for all help. I am running Suse 11.1 with KDE 4.1.3

    Kind Regards
    Michael

  2. #2
    Join Date
    Nov 2008
    Location
    N. Wales
    Posts
    1,028

    Default Re: Point & Click

    miclac adjusted his/her tinfoil beanie to write:

    >
    > I am trying to create a script or link that I can point to & click
    > using the mouse, I would like the it to open konsole and run a command
    > (in my case "./teeworlds_svr -f config.cfg"). So far I have learnt to
    > create a text file (in my case "startsvr.sh"), and place in there the
    > following;
    >
    > #!/bin/bash
    > ./teeworlds_srv -f config.cfg
    >
    > At first I found that pointing & clicking at this file opened it in
    > KWrite, so I have changed it's properties by checking "is executable",
    > now though when I click on it I get nothing at all.
    >
    > Thanks in advance for all help. I am running Suse 11.1 with KDE 4.1.3
    >
    > Kind Regards
    > Michael
    >
    >


    where have you got the script that you want to run placed?

    your command is trying to execute it from the current dir ( ./ ), if it
    is not there then you probably need an absolute path to the executable:


    #!/bin/bash
    /some/dir/where/teeworlds_srv -f config cfg


    HTH


    --
    Mark

    Nil illegitimi carborundum


  3. #3
    Join Date
    Feb 2009
    Location
    Scotland
    Posts
    25

    Default Re: Point & Click

    Hi Mark,
    The script is in the same directory as the executable. I have also tried using an absolute path.

    Michael

  4. #4
    Join Date
    Feb 2009
    Location
    Scotland
    Posts
    25

    Default Re: Point & Click

    Further information; I have just noticed when I click the script the process teeworlds_srv is indeed launching (I see it in system monitor). However there is no Konsole window opening, and the process is not working.
    Kind Regards
    Michael

  5. #5
    Join Date
    Nov 2008
    Location
    N. Wales
    Posts
    1,028

    Default Re: Point & Click

    miclac adjusted his/her tinfoil beanie to write:

    >
    > Further information; I have just noticed when I click the script the
    > process teeworlds_srv is indeed launching (I see it in system
    > monitor). However there is no Konsole window opening, and the process
    > is not working.
    > Kind Regards
    > Michael
    >
    >


    Maybe you need an absolute path for the config or even.

    You can also specify the working dir and the option to open in terminal
    in the properties of the icon the ¨open in terminal¨ is in the advanced
    settings button IIRC.

    Or have a look at the cwd command manual

    man cwd

    and use that in your script?

    HTH
    --
    Mark

    Nil illegitimi carborundum


  6. #6
    Join Date
    Feb 2009
    Location
    Scotland
    Posts
    25

    Default Re: Point & Click

    Hi Mark,
    I tried using the absolute path for the config, and at first this didn't work. Then I realised that the path is case sensitive, I tried again and the server is now launching. The only thing being that it is still running in the background.

    I can't find 'advanced settings' in the icon properties; Nor can I find an 'open in terminal' setting, though in the context menu (right click), if I select 'open with'-'other' I can select "open in terminal" and "Do not close when command exits", though when trying these in conjunction with selecting Konsole from 'known applications' nothing happens.

    I tried man cwd and this returns "No manual entry for cwd". Also cwd returns "command not found".

    Kind Regards
    Michael

  7. #7
    assistant NNTP User

    Default Re: Point & Click

    > I can't find 'advanced settings' in the icon properties; Nor can I find
    > an 'open in terminal' setting,


    ok...it seems you are right clicking on the icon for startsvr.sh in
    Konqueror (or similar)..

    [there are other ways to get this done, but this should make you
    happy] what you need to do is get away from that script and create an
    "application launcher" for teeworlds_srv

    i don't have KDE4.x here, but these instructions from KDE3.x _should_
    work for you, but some of the wording may be a little different:

    - right click on an empty spot on the taskbar and up will pop a menu
    with "Add Applet to panel", "Add Application to panel" and other
    options..

    - left click on "Add Application to panel", then in the fly-out

    - left click on "Add non-KDE Application", then in the new window

    - give your button a title (say) TeeWorld

    - and a Description (say) Server

    - in the executable block type in the fully qualified path and
    executable, like:

    /some/folder/somewhere/teeworlds_srv

    - then, in the "Command line arguments" add those, like:

    -f config.cfg

    - now, see that little box labeled "Run in a terminal window", click
    to X it..

    - now, click ok

    and, you should have a button on taskbar that you can click to launch
    a terminal in which should run the server..

    Linux is SO simple, no?

    --
    assistant

Posting Permissions

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