Results 1 to 6 of 6

Thread: Can't invoke bash script from desktop with KDE4 not any more

  1. #1
    Join Date
    Oct 2008
    Location
    Stuttgart - Germany
    Posts
    163

    Default Can't invoke bash script from desktop with KDE4 not any more

    I wrote a bash script which is used by a lot of Linux beginners. Most of them manage to open a console and call it. Just for their convenience I added some code so they also can invoke the bash script from the desktop with a mouse click. That worked fined with KDE3 - but fails now with KDE4.

    The code I use for KDE3 is
    Code:
    tty -s;
    if [ $? -ne 0 ]; then
      konsole --noclose -T "collectNWData.sh" --vt_sz 132x25 -e "$0";
    fi
    Seems the sysntax has changed for the konsole call. So I used 'konsole --help' and figured out

    Code:
    tty -s;
    if [ $? -ne 0 ]; then
      konsole --nofork -e "$0"
    fi
    which unfortunately doesn't open a konsole and invokes the script :-(

    Any idea how to get this done for KDE4 ? Would be even better to have ONE code for KDE3 and KDE4.
    "Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." Linus Benedict Torvalds, 28.9.2003

  2. #2
    Join Date
    Aug 2008
    Location
    Seattle, WA
    Posts
    1,376

    Default Re: Can't invoke bash script from desktop with KDE4 not any

    Do you have execute permission on the script?

  3. #3
    Join Date
    Oct 2008
    Location
    Stuttgart - Germany
    Posts
    163

    Default Re: Can't invoke bash script from desktop with KDE4 not any

    Yes, that's the first instruction for the Linux beginners - set the executable flag for the script. It worked for KDE3 - but not for KDE4 :-(. It's from my point of view a coding problem because the semantic of the 'konsole' command has changed and I don't get the point of the change.
    "Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." Linus Benedict Torvalds, 28.9.2003

  4. #4
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: Can't invoke bash script from desktop with KDE4 not any more

    To get konsole in KDE4 to open and run a script file the syntax would be:

    konsole -e command

    When the command completes, konsole will then close.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  5. #5
    Join Date
    Oct 2008
    Location
    Stuttgart - Germany
    Posts
    163

    Default Re: Can't invoke bash script from desktop with KDE4 not any more

    Thx for your reply. I just changed the script accordingly and it starts successfully.
    "Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." Linus Benedict Torvalds, 28.9.2003

  6. #6
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: Can't invoke bash script from desktop with KDE4 not any more

    Hey, nothing like just in time help. I happen to run across your question here and knew the answer. Normally it should not take five months to get help unless no one has any idea about the problem, or more likely, it just fell through the cracks. Any way, thanks for hanging in there for so long.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

Posting Permissions

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