Announcement

Collapse
No announcement yet.

Kubuntu 18.04 Need Command Line Script to set up Keyboard Shortcut to open Konsole

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

    [Settings] Kubuntu 18.04 Need Command Line Script to set up Keyboard Shortcut to open Konsole

    I need a script that I can copy and paste into command line that will make a shortcut for ctr+alt+t or ctr +shift +t to open
    Konsole.

    I have been on the forums even posted on Reddit and tried everything, I guarantee everything that can be done in settings to enable the shortcut.
    I have spent more than 12 hours on this and did a clean install 2x.

    On my machine it simply is not possible without a command line script. Please don't bother with troubleshooting instructions unless
    it involves the command line.

    Thank You in advance.

    #2
    Ctrl+k doesn't work?

    A script? It will have to be a bash (dash) script with "#!/bin/bash" as the first line. It will have to be saved and execute permission added. Then, since you supposedly can't open a Konsole you will have to install a menu item in KMenu. But, there is already a Konsole menu item in KMenu, so a script would be redundant.

    So, open Settings. Select "shortcuts" From there Select "Global Shortcuts". In the middle panel click on "KDE Demon". In the right panel click on "Konsole". Notice that "Ctrl+k" is already set. Click on the right arrow in "GLobal Alternate" column for Konsole. Add "Ctrl+Alt+T" and click the apply button. Do yourself a favor and leave "Ctrl+K" alone.

    Hint: as someone asking for help you are not doing yourself any favors by dictating what those who freely give of their time helping people what they can and cannot do. Not many will take up your problem.
    Last edited by GreyGeek; Jun 26, 2018, 11:59 AM.
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    Comment


      #3
      If I am not mistaken (based on other threads in other fora), I think the OP is looking to use a script to do this across multiple machines, so the manual way is not feasible. I can understand the frustration from getting the same replies that are well-intentioned, but repeated over and over
      What we are missing is what you have tried (in terms of command line use) that hasn't worked, perhaps? might be a good starting place.

      Key bindings are saved in different places depending on the DE - Gnome sets it in a different place than Plasma does, for this action.
      I will assume it is Plasma we are talking about , so using Dolphin's search function I find that the file that has this setting config is ~/.config/khotkeysrc

      The exact portion is this:
      I have set the likely line to edit in red

      Code:
      [Data_3_3]
      Comment=This action runs Konsole, after pressing Ctrl+Alt+T.
      [COLOR="#FF0000"][B]Enabled=false[/B][/COLOR]
      Name=Run Konsole
      Type=SIMPLE_ACTION_DATA
      
      [Data_3_3Actions]
      ActionsCount=1
      
      [Data_3_3Actions0]
      CommandURL=konsole
      Type=COMMAND_URL
      
      [Data_3_3Conditions]
      Comment=
      ConditionsCount=0
      
      [Data_3_3Triggers]
      Comment=Simple_action
      TriggersCount=1
      
      [Data_3_3Triggers0]
      Key=Ctrl+Alt+T
      Type=SHORTCUT
      Uuid={22730821-0edb-4975-8be6-b0af585342a5}
      So all that needs figuring out is how to edit that line using sed to make a simple one-liner command to insert into a script.
      Not sure if a logout is required or if there is a way to reload the bindings
      As many years as i have used Linux, scripting is thing I have seldom tackled, other than copypasta and edit, and never using sed/regex or similar things to find and replace text. Hopefully one of us with good kowledge will jump in , if they see this post.

      My next question is why this standard keybinding is disabled by default in Plasma? I use Yakuake, so seldom if ever open Konsole, and would have thought that ctrl-alt-t would do this, as it does everywhere
      Last edited by claydoh; Jun 26, 2018, 09:20 PM. Reason: biiiig oopsie

      Comment


        #4
        That's a mighty powerful crystal ball you have there Claydoh!
        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
        – John F. Kennedy, February 26, 1962.

        Comment


          #5
          Oops I did not mention that if this is just for one machine, just edit the file and log out. Do NOT edit the file with sudo/admin privileges, that will mess up permissions on the config files, preventing any settings contained in that file from being saved.

          Comment


            #6
            Originally posted by GreyGeek View Post
            That's a mighty powerful crystal ball you have there Claydoh!
            Heh, no my cloudy, cracked, and poor quality crystal ball was used for my last post above.....

            Comment


              #7

              It's better than the one I have!
              "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
              – John F. Kennedy, February 26, 1962.

              Comment


                #8
                Originally posted by GreyGeek View Post
                Ctrl+k doesn't work?

                A script? It will have to be a bash (dash) script with "#!/bin/bash" as the first line. It will have to be saved and execute permission added. Then, since you supposedly can't open a Konsole you will have to install a menu item in KMenu. But, there is already a Konsole menu item in KMenu, so a script would be redundant.

                So, open Settings. Select "shortcuts" From there Select "Global Shortcuts". In the middle panel click on "KDE Demon". In the right panel click on "Konsole". Notice that "Ctrl+k" is already set. Click on the right arrow in "GLobal Alternate" column for Konsole. Add "Ctrl+Alt+T" and click the apply button. Do yourself a favor and leave "Ctrl+K" alone.

                Hint: as someone asking for help you are not doing yourself any favors by dictating what those who freely give of their time helping people what they can and cannot do. Not many will take up your problem.
                I can open Konsole, that's not the problem. I want to open with a shortkey ctr + Alt +Del

                Okay if you have suggestions above and beyond this post I'm all ears.

                https://www.reddit.com/r/Kubuntu/com...t_to/?sort=new

                Comment


                  #9
                  Claydoh you get it!
                  I've spent more than 12 hours trying different things with manual settings. Finally I posted in Reddit
                  https://www.reddit.com/r/Kubuntu/com...t_to/?sort=new
                  and have followed every suggestion. Nothing works!

                  Looks like you are on the right track. Maybe someone can tell me the exact code to put in to change it.
                  Your crystal ball is just a tad off but close.
                  Actually I only have 1 machine
                  Yes The manual way isn't working
                  All over the forums, same suggestions over and over very frustrating

                  Yes I think the command line is the way to go. But I don't have the expertise or knowledge.
                  Yes I'm on Kubuntu 18.04 so posting on the Ubuntu forum and finding solutions for Gnome isn't going to help me.
                  Yes Kubuntu runs on Plasma

                  I went to
                  cd ~/.config/
                  dir
                  and found konsolerc

                  but that's as much code as I know.

                  HEEELP!

                  Comment


                    #10
                    Tried it but didn't work.
                    ctr + Alt+T still doesn't Launch Konsole

                    Thanks anyway.

                    Comment


                      #11
                      Tried your suggestion
                      didn't work.

                      Comment


                        #12
                        Nothing in your original post mentions wanting to do this between machines, or remotely.
                        I can open Konsole, that's not the problem. I want to open with a shortkey ctr + Alt +Del
                        What do you mean by "shortkey"? Shortkeys, to me, are like aliases.
                        Code:
                        $ alias
                        alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
                        alias aptfi='sudo apt -f install'
                        alias aptlist='sudo apt list'
                        alias aptsearch='sudo apt search'
                        alias aptshow='sudo apt show'
                        alias aremove='sudo apt autoremove'
                        alias dconfig='sudo dpkg --configure -s'
                        alias egrep='egrep --color=auto'
                        alias fgrep='fgrep --color=auto'
                        alias grep='grep --color=auto'
                        alias instal='sudo apt install'
                        alias l='ls -CF'
                        alias la='ls -A'
                        alias ll='ls -alF'
                        alias ls='ls --color=auto'
                        alias purge='sudo apt purge'
                        alias remove='sudo apt remove'
                        alias update='sudo apt update; sudo apt list --upgradable'
                        alias upgrade='sudo apt full-upgrade'
                        I usually put them in ~/.bashrc

                        The shortkey apps are available commercially: https://www.shortkeys.com/help/Index.htm?context=350

                        However, I still do not understand what it is you are trying to do, even after reading your "Claydoh, you get it!". Do you want to use a global key combo on your computer to open a Konsole remotely on another computer?
                        Last edited by GreyGeek; Jun 26, 2018, 08:21 PM.
                        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                        – John F. Kennedy, February 26, 1962.

                        Comment


                          #13
                          Originally posted by twothumber View Post
                          Tried your suggestion
                          didn't work.
                          Did you catch my boo-boo? the file is khotkeysrc

                          Also edit the section [Data_3] which corresponds to the "examples" section in the custom shortcuts area - this needs to be set to 'true' as well, as this has to be enabled before you can enable the Konsole option.

                          I dunno. If it is not working, then there is a deeper problem. I just enabled the shortcut in System Settings >> Shortcuts >> Custom Shortcuts , enabled the Examples, applied, then enabled the konsole option, applied, and it worked -- on 3 machines. Then I went , set things back to default on my main PC (no Konsole shortcut), and redid it by editing the config, and logging out. It worked.

                          Comment


                            #14
                            this does not work for you?

                            before
                            Click image for larger version

Name:	Screenshot_20180626_235911.jpg
Views:	1
Size:	53.6 KB
ID:	643909

                            After
                            Click image for larger version

Name:	Screenshot_20180626_235600.jpg
Views:	1
Size:	53.3 KB
ID:	643908

                            Comment


                              #15
                              Originally posted by twothumber View Post
                              Tried it but didn't work.
                              ctr + Alt+T still doesn't Launch Konsole

                              Thanks anyway.
                              If you do it right it does work:

                              If doing it right doesn't work then you have keyboard issues, like the wrong layout, or other related problems.
                              Attached Files
                              Last edited by GreyGeek; Jun 27, 2018, 10:32 AM.
                              "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                              – John F. Kennedy, February 26, 1962.

                              Comment

                              Working...
                              X