Assign multiple keyboard shortcuts for one action











up vote
12
down vote

favorite
4












I've been wondering how can I assign to multiple keyboard shortcuts to do the same action?
More specifically, I want to be able to change my volume with both my headset buttons and my keyboard.



I'm able to change the volume with just one at the time: with the one I define in the 'Keyboard shortcuts' application.
Is there any way?










share|improve this question
























  • Related: askubuntu.com/questions/292494/…
    – AlikElzin-kilaka
    Mar 20 at 8:42















up vote
12
down vote

favorite
4












I've been wondering how can I assign to multiple keyboard shortcuts to do the same action?
More specifically, I want to be able to change my volume with both my headset buttons and my keyboard.



I'm able to change the volume with just one at the time: with the one I define in the 'Keyboard shortcuts' application.
Is there any way?










share|improve this question
























  • Related: askubuntu.com/questions/292494/…
    – AlikElzin-kilaka
    Mar 20 at 8:42













up vote
12
down vote

favorite
4









up vote
12
down vote

favorite
4






4





I've been wondering how can I assign to multiple keyboard shortcuts to do the same action?
More specifically, I want to be able to change my volume with both my headset buttons and my keyboard.



I'm able to change the volume with just one at the time: with the one I define in the 'Keyboard shortcuts' application.
Is there any way?










share|improve this question















I've been wondering how can I assign to multiple keyboard shortcuts to do the same action?
More specifically, I want to be able to change my volume with both my headset buttons and my keyboard.



I'm able to change the volume with just one at the time: with the one I define in the 'Keyboard shortcuts' application.
Is there any way?







keyboard shortcuts






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 29 '12 at 9:21









Bruno Pereira

59.3k26179206




59.3k26179206










asked Aug 30 '11 at 7:19









ksemeks

1715




1715












  • Related: askubuntu.com/questions/292494/…
    – AlikElzin-kilaka
    Mar 20 at 8:42


















  • Related: askubuntu.com/questions/292494/…
    – AlikElzin-kilaka
    Mar 20 at 8:42
















Related: askubuntu.com/questions/292494/…
– AlikElzin-kilaka
Mar 20 at 8:42




Related: askubuntu.com/questions/292494/…
– AlikElzin-kilaka
Mar 20 at 8:42










3 Answers
3






active

oldest

votes

















up vote
4
down vote













I do just that with Custom Shortcuts:



screenshot of keyboard shortcuts settings



I use xdotool key --clearmodifiers XF86AudioLowerVolume (and XF86AudioRaiseVolume) command instead of amixer set 'Master' 10%+. The only difference/downside I notice is that even Repeat Keys on Typing tab is set this doesn't apply to this custom shortcut.



However, I wasn't able to do same things like use Fn+F7 to turn off my screen (xset dpms force standby). It doesn't detect it as a shortcut event.






share|improve this answer






























    up vote
    2
    down vote













    You could probably use xmodmap to reassign the buttons on your headset to the same as you use for your keyboard.






    share|improve this answer





















    • Yes, but now I need to know what is the default action of 'Audio raise/lower volume', from the Keyboard shortcuts application. Because, when I use my own command 'amixer channel set opt', it raises/lowers the MBO sound card, while I'm listening with my headset.
      – ksemeks
      Aug 30 '11 at 7:50












    • @ksemeks : the actions are : amixer set Master 10%+ to raise the volume amixer set Master 10%- to decrease the volume. To get the gauge notification, you could use notify-send, but I am not sure how to set the gauge
      – danjjl
      Aug 30 '11 at 9:05












    • @danjjl: well, that's why I'm trying to find the exact action of the Volume up/down, from Setting->Keyboard->Shortcuts
      – ksemeks
      Aug 30 '11 at 9:10


















    up vote
    0
    down vote













    You can assign multiple keyboard shortcuts (keybindings) for the same command using gsettings command line.



    One important thing to know is that Ubuntu 18.04 Settings GUI only shows the first keybinding for a command, so if you have multiple keybindings for a command, the others won't appear in Settings. You can use gsettings to all the keybindings.



    Let's say I want to add another keybinding for "Switch to Workspace 1". The default for me was Super+Home, but I want to add a second keybinding Ctrl+1.



    # list all keybindings
    gsettings list-recursively | grep -e org.gnome.desktop.wm.keybindings -e org.gnome.settings-daemon.plugins.media-keys -e org.gnome.settings-daemon.plugins.power | sort

    # confirm no other keybinding conflicts
    gsettings list-recursively | grep '<Control>1'

    # set multiple keybindings for "Switch to Workspace 1"
    gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['<Super>Home', '<Control>1']"

    # confirm value is set correctly
    gsettings get org.gnome.desktop.wm.keybindings switch-to-workspace-1


    Now you can use either Super+Home or Control+1 to Switch to Workspace 1. Remember, you will only see the first one Super+Home in the Settings GUI, but it will work!






    share|improve this answer





















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f59250%2fassign-multiple-keyboard-shortcuts-for-one-action%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      4
      down vote













      I do just that with Custom Shortcuts:



      screenshot of keyboard shortcuts settings



      I use xdotool key --clearmodifiers XF86AudioLowerVolume (and XF86AudioRaiseVolume) command instead of amixer set 'Master' 10%+. The only difference/downside I notice is that even Repeat Keys on Typing tab is set this doesn't apply to this custom shortcut.



      However, I wasn't able to do same things like use Fn+F7 to turn off my screen (xset dpms force standby). It doesn't detect it as a shortcut event.






      share|improve this answer



























        up vote
        4
        down vote













        I do just that with Custom Shortcuts:



        screenshot of keyboard shortcuts settings



        I use xdotool key --clearmodifiers XF86AudioLowerVolume (and XF86AudioRaiseVolume) command instead of amixer set 'Master' 10%+. The only difference/downside I notice is that even Repeat Keys on Typing tab is set this doesn't apply to this custom shortcut.



        However, I wasn't able to do same things like use Fn+F7 to turn off my screen (xset dpms force standby). It doesn't detect it as a shortcut event.






        share|improve this answer

























          up vote
          4
          down vote










          up vote
          4
          down vote









          I do just that with Custom Shortcuts:



          screenshot of keyboard shortcuts settings



          I use xdotool key --clearmodifiers XF86AudioLowerVolume (and XF86AudioRaiseVolume) command instead of amixer set 'Master' 10%+. The only difference/downside I notice is that even Repeat Keys on Typing tab is set this doesn't apply to this custom shortcut.



          However, I wasn't able to do same things like use Fn+F7 to turn off my screen (xset dpms force standby). It doesn't detect it as a shortcut event.






          share|improve this answer














          I do just that with Custom Shortcuts:



          screenshot of keyboard shortcuts settings



          I use xdotool key --clearmodifiers XF86AudioLowerVolume (and XF86AudioRaiseVolume) command instead of amixer set 'Master' 10%+. The only difference/downside I notice is that even Repeat Keys on Typing tab is set this doesn't apply to this custom shortcut.



          However, I wasn't able to do same things like use Fn+F7 to turn off my screen (xset dpms force standby). It doesn't detect it as a shortcut event.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 19 at 17:44

























          answered Jan 17 '17 at 23:30









          Pablo Bianchi

          2,2531528




          2,2531528
























              up vote
              2
              down vote













              You could probably use xmodmap to reassign the buttons on your headset to the same as you use for your keyboard.






              share|improve this answer





















              • Yes, but now I need to know what is the default action of 'Audio raise/lower volume', from the Keyboard shortcuts application. Because, when I use my own command 'amixer channel set opt', it raises/lowers the MBO sound card, while I'm listening with my headset.
                – ksemeks
                Aug 30 '11 at 7:50












              • @ksemeks : the actions are : amixer set Master 10%+ to raise the volume amixer set Master 10%- to decrease the volume. To get the gauge notification, you could use notify-send, but I am not sure how to set the gauge
                – danjjl
                Aug 30 '11 at 9:05












              • @danjjl: well, that's why I'm trying to find the exact action of the Volume up/down, from Setting->Keyboard->Shortcuts
                – ksemeks
                Aug 30 '11 at 9:10















              up vote
              2
              down vote













              You could probably use xmodmap to reassign the buttons on your headset to the same as you use for your keyboard.






              share|improve this answer





















              • Yes, but now I need to know what is the default action of 'Audio raise/lower volume', from the Keyboard shortcuts application. Because, when I use my own command 'amixer channel set opt', it raises/lowers the MBO sound card, while I'm listening with my headset.
                – ksemeks
                Aug 30 '11 at 7:50












              • @ksemeks : the actions are : amixer set Master 10%+ to raise the volume amixer set Master 10%- to decrease the volume. To get the gauge notification, you could use notify-send, but I am not sure how to set the gauge
                – danjjl
                Aug 30 '11 at 9:05












              • @danjjl: well, that's why I'm trying to find the exact action of the Volume up/down, from Setting->Keyboard->Shortcuts
                – ksemeks
                Aug 30 '11 at 9:10













              up vote
              2
              down vote










              up vote
              2
              down vote









              You could probably use xmodmap to reassign the buttons on your headset to the same as you use for your keyboard.






              share|improve this answer












              You could probably use xmodmap to reassign the buttons on your headset to the same as you use for your keyboard.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Aug 30 '11 at 7:29









              Jo-Erlend Schinstad

              26.3k556108




              26.3k556108












              • Yes, but now I need to know what is the default action of 'Audio raise/lower volume', from the Keyboard shortcuts application. Because, when I use my own command 'amixer channel set opt', it raises/lowers the MBO sound card, while I'm listening with my headset.
                – ksemeks
                Aug 30 '11 at 7:50












              • @ksemeks : the actions are : amixer set Master 10%+ to raise the volume amixer set Master 10%- to decrease the volume. To get the gauge notification, you could use notify-send, but I am not sure how to set the gauge
                – danjjl
                Aug 30 '11 at 9:05












              • @danjjl: well, that's why I'm trying to find the exact action of the Volume up/down, from Setting->Keyboard->Shortcuts
                – ksemeks
                Aug 30 '11 at 9:10


















              • Yes, but now I need to know what is the default action of 'Audio raise/lower volume', from the Keyboard shortcuts application. Because, when I use my own command 'amixer channel set opt', it raises/lowers the MBO sound card, while I'm listening with my headset.
                – ksemeks
                Aug 30 '11 at 7:50












              • @ksemeks : the actions are : amixer set Master 10%+ to raise the volume amixer set Master 10%- to decrease the volume. To get the gauge notification, you could use notify-send, but I am not sure how to set the gauge
                – danjjl
                Aug 30 '11 at 9:05












              • @danjjl: well, that's why I'm trying to find the exact action of the Volume up/down, from Setting->Keyboard->Shortcuts
                – ksemeks
                Aug 30 '11 at 9:10
















              Yes, but now I need to know what is the default action of 'Audio raise/lower volume', from the Keyboard shortcuts application. Because, when I use my own command 'amixer channel set opt', it raises/lowers the MBO sound card, while I'm listening with my headset.
              – ksemeks
              Aug 30 '11 at 7:50






              Yes, but now I need to know what is the default action of 'Audio raise/lower volume', from the Keyboard shortcuts application. Because, when I use my own command 'amixer channel set opt', it raises/lowers the MBO sound card, while I'm listening with my headset.
              – ksemeks
              Aug 30 '11 at 7:50














              @ksemeks : the actions are : amixer set Master 10%+ to raise the volume amixer set Master 10%- to decrease the volume. To get the gauge notification, you could use notify-send, but I am not sure how to set the gauge
              – danjjl
              Aug 30 '11 at 9:05






              @ksemeks : the actions are : amixer set Master 10%+ to raise the volume amixer set Master 10%- to decrease the volume. To get the gauge notification, you could use notify-send, but I am not sure how to set the gauge
              – danjjl
              Aug 30 '11 at 9:05














              @danjjl: well, that's why I'm trying to find the exact action of the Volume up/down, from Setting->Keyboard->Shortcuts
              – ksemeks
              Aug 30 '11 at 9:10




              @danjjl: well, that's why I'm trying to find the exact action of the Volume up/down, from Setting->Keyboard->Shortcuts
              – ksemeks
              Aug 30 '11 at 9:10










              up vote
              0
              down vote













              You can assign multiple keyboard shortcuts (keybindings) for the same command using gsettings command line.



              One important thing to know is that Ubuntu 18.04 Settings GUI only shows the first keybinding for a command, so if you have multiple keybindings for a command, the others won't appear in Settings. You can use gsettings to all the keybindings.



              Let's say I want to add another keybinding for "Switch to Workspace 1". The default for me was Super+Home, but I want to add a second keybinding Ctrl+1.



              # list all keybindings
              gsettings list-recursively | grep -e org.gnome.desktop.wm.keybindings -e org.gnome.settings-daemon.plugins.media-keys -e org.gnome.settings-daemon.plugins.power | sort

              # confirm no other keybinding conflicts
              gsettings list-recursively | grep '<Control>1'

              # set multiple keybindings for "Switch to Workspace 1"
              gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['<Super>Home', '<Control>1']"

              # confirm value is set correctly
              gsettings get org.gnome.desktop.wm.keybindings switch-to-workspace-1


              Now you can use either Super+Home or Control+1 to Switch to Workspace 1. Remember, you will only see the first one Super+Home in the Settings GUI, but it will work!






              share|improve this answer

























                up vote
                0
                down vote













                You can assign multiple keyboard shortcuts (keybindings) for the same command using gsettings command line.



                One important thing to know is that Ubuntu 18.04 Settings GUI only shows the first keybinding for a command, so if you have multiple keybindings for a command, the others won't appear in Settings. You can use gsettings to all the keybindings.



                Let's say I want to add another keybinding for "Switch to Workspace 1". The default for me was Super+Home, but I want to add a second keybinding Ctrl+1.



                # list all keybindings
                gsettings list-recursively | grep -e org.gnome.desktop.wm.keybindings -e org.gnome.settings-daemon.plugins.media-keys -e org.gnome.settings-daemon.plugins.power | sort

                # confirm no other keybinding conflicts
                gsettings list-recursively | grep '<Control>1'

                # set multiple keybindings for "Switch to Workspace 1"
                gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['<Super>Home', '<Control>1']"

                # confirm value is set correctly
                gsettings get org.gnome.desktop.wm.keybindings switch-to-workspace-1


                Now you can use either Super+Home or Control+1 to Switch to Workspace 1. Remember, you will only see the first one Super+Home in the Settings GUI, but it will work!






                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  You can assign multiple keyboard shortcuts (keybindings) for the same command using gsettings command line.



                  One important thing to know is that Ubuntu 18.04 Settings GUI only shows the first keybinding for a command, so if you have multiple keybindings for a command, the others won't appear in Settings. You can use gsettings to all the keybindings.



                  Let's say I want to add another keybinding for "Switch to Workspace 1". The default for me was Super+Home, but I want to add a second keybinding Ctrl+1.



                  # list all keybindings
                  gsettings list-recursively | grep -e org.gnome.desktop.wm.keybindings -e org.gnome.settings-daemon.plugins.media-keys -e org.gnome.settings-daemon.plugins.power | sort

                  # confirm no other keybinding conflicts
                  gsettings list-recursively | grep '<Control>1'

                  # set multiple keybindings for "Switch to Workspace 1"
                  gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['<Super>Home', '<Control>1']"

                  # confirm value is set correctly
                  gsettings get org.gnome.desktop.wm.keybindings switch-to-workspace-1


                  Now you can use either Super+Home or Control+1 to Switch to Workspace 1. Remember, you will only see the first one Super+Home in the Settings GUI, but it will work!






                  share|improve this answer












                  You can assign multiple keyboard shortcuts (keybindings) for the same command using gsettings command line.



                  One important thing to know is that Ubuntu 18.04 Settings GUI only shows the first keybinding for a command, so if you have multiple keybindings for a command, the others won't appear in Settings. You can use gsettings to all the keybindings.



                  Let's say I want to add another keybinding for "Switch to Workspace 1". The default for me was Super+Home, but I want to add a second keybinding Ctrl+1.



                  # list all keybindings
                  gsettings list-recursively | grep -e org.gnome.desktop.wm.keybindings -e org.gnome.settings-daemon.plugins.media-keys -e org.gnome.settings-daemon.plugins.power | sort

                  # confirm no other keybinding conflicts
                  gsettings list-recursively | grep '<Control>1'

                  # set multiple keybindings for "Switch to Workspace 1"
                  gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['<Super>Home', '<Control>1']"

                  # confirm value is set correctly
                  gsettings get org.gnome.desktop.wm.keybindings switch-to-workspace-1


                  Now you can use either Super+Home or Control+1 to Switch to Workspace 1. Remember, you will only see the first one Super+Home in the Settings GUI, but it will work!







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 4 at 21:36









                  wisbucky

                  73488




                  73488






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f59250%2fassign-multiple-keyboard-shortcuts-for-one-action%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                      Mangá

                      Eduardo VII do Reino Unido