Announcement

Collapse
No announcement yet.

Help with bash script

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with bash script

    Hello,

    I need help with creating a bash script that executes keyboard shortcut.

    Basicly I have asigned keyboard shortcut to switch displays with " meta+P " in KDE Daemon. Now I want create bash script that executes that shortcut. After that my plan is to create desktop icon for that bash script in Kmenuedit and put the icon in my desktop. This way anybody who uses computer can click the switch display icon on desktop when using dual monitori.

    Is it possible to create script like that?

    Thank you in advance!


    #2
    See if this post is of any help to you:
    https://askubuntu.com/questions/7561...nation-of-keys

    Comment


      #3
      Look at kscreen-doctor --help
      I was looking at qdbus commands, which is way over my head.

      Comment


        #4
        I think you want a command to switch displays. This may or may not be put in a bash script, which at a simple level is a list of commands.

        kscreen-doctor looks like it does the sort of thing you want. I suggest experimenting in a konsole. (I'm reluctant to try it out for fear of messing up my monitors, sorry.)

        When you have a command that does something you want, I suggest using the menu editor (right-click the menu button, usually at the bottom right, and choose "Edit Applications", or run kmenuedit in a konsole) to set up a menu item that runs the command. Then, you can drag it from the menu to a panel, or to a desktop, or right-click it and click "Add to desktop". I suggest this because it's easy to lose widgets, or mappings, and if that happens your carefully contrived command lives on in the menu, and you can recreate the widget quickly.

        Note also the (IMO not obvious) "magic secret" of desktop widgets; that's the long press, left click and hold for a second or two.
        Regards, John Little

        Comment

        Working...
        X