Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: [12.1, KDE]] how to start shell script from function key?

Hybrid View

  1. #1

    Default [12.1, KDE]] how to start shell script from function key?

    Hi,

    on 12.1, KDE I want to have a shell script executed in the background when using a keyboard shortcut.
    this should work regardless of the application that is currently running in the foreground.

    I tried the KDE menu editor, ceated a new element, provided it with the shell script and the shortcut, but there was no effect....

    did I miss something?
    any solution to my problem?

    thanx
    paul

  2. #2
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    20,656
    Blog Entries
    14

    Default Re: [12.1, KDE]] how to start shell script from function key?

    First thing that comes to mind: has the script been made executable ?
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  3. #3

    Default Re: [12.1, KDE]] how to start shell script from function key?

    the script itself works fine.
    and I provided the full path in the KDE menu editor.

    ...maybe some environment variable is not properly set when executing via shortcut - I will check

  4. #4
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    20,656
    Blog Entries
    14

    Default Re: [12.1, KDE]] how to start shell script from function key?

    Is it a problem to post the content of the script?
    Does it run when executed from the CLI

    EDIT: sorry, missed that you already tried.
    Last edited by Knurpht; 12-Jan-2013 at 06:40.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  5. #5
    Join Date
    May 2010
    Location
    Space Colony Lagrange Point 22° à, 77° Ƅ, 56° ɤ, 99° ɜ
    Posts
    3,166

    Default Re: [12.1, KDE]] how to start shell script from function key?

    I am on Gnome i create a key board shortcut and assigned it a shortcut ctrl+z and it executes a command {java -jar "~/bin/doThis.jar"}
    Is there a need to create a menu item ?
    One other thought is that is that shortcut you are using already assigned ?
    GNOME Version 3.20.2
    openSUSE Leap 42.3 64-bit

    www.vazhavandan.blogspot.com

  6. #6

    Default Re: [12.1, KDE]] how to start shell script from function key?

    Quote Originally Posted by vazhavandan View Post
    I am on Gnome i create a key board shortcut and assigned it a shortcut ctrl+z and it executes a command {java -jar "~/bin/doThis.jar"}
    Is there a need to create a menu item ?
    KDE menu editor wanted me to create a new menu item.
    If there is a way to define and assign a shortcut any other way I'd be glad to hear about it.

    btw: when called from KDE menu, the script works.
    the menu item with the assigned shortcut appears in system settings -> shortcuts and gestures -> global shortcuts -> khotkeys


    Quote Originally Posted by vazhavandan View Post
    One other thought is that is that shortcut you are using already assigned ?
    at leat KDE didn't complain.
    I tried different shortcuts.

    a terminal window that is open in the foreground seems to catch any shortcut.

  7. #7

    Default Re: [12.1, KDE]] how to start shell script from function key?

    logoff/logon didn' make it

    interestingly, when opening the menu editor after logoff/logon, the shortcut definition was modified ???
    but not so in the khotkeys section under system settings ...

  8. #8
    Join Date
    May 2010
    Location
    Space Colony Lagrange Point 22° à, 77° Ƅ, 56° ɤ, 99° ɜ
    Posts
    3,166

    Default Re: [12.1, KDE]] how to start shell script from function key?

    i must thank you though.
    i run the jar daily after starting my machine. i don't want it to start automatically(in startup)
    your "keyboard shorcut" post made me create one for my purpose :-)
    GNOME Version 3.20.2
    openSUSE Leap 42.3 64-bit

    www.vazhavandan.blogspot.com

  9. #9

    Default Re: [12.1, KDE]] how to start shell script from function key?

    there is something happening now:
    when I enter the shortcut I defined, then the small window appears at the top of the screen in which one can enter commands - the one you also get with ALT+F2

    does that mean that the shortcut is somehow catched by KDE??
    how to overcome that? is that a bug?

  10. #10
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    20,656
    Blog Entries
    14

    Default Re: [12.1, KDE]] how to start shell script from function key?

    There's a couple of things that have come to mind:

    - Place the script in your ~/bin folder
    - Make sure it has
    Code:
    #!/bin/bash
    at the top
    - Check if it does what it should do by Alt-F2 and entering it's name
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

Page 1 of 2 12 LastLast

Posting Permissions

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