@dobey's solution works if you want to have only one keyboard shortcut for increasing / decreasing the volume.
If instead you want to have multiple key bindings controlling the volume (like to keep the default volume buttons on your laptop working, while adding additional keyboard shortcuts to use when you connect an external keyboard that does not have volume controls), then:
Go to System Settings → Keyboard → Shortcuts → Custom Shortcuts.
Click +
to add a new keyboard shortcut. Set the "Name" to Volume up
, "Command" to
amixer -D pulse sset Master 5%+
and click Apply
.
Click Disabled
next to your new key and choose the desired binding on your keyboard.
Add another shortcut with name Volume down
and command
amixer -D pulse sset Master 5%-
Preface: I am new, and having similar problems. In the absence of an answer by someone with a functional knowledge of these things, this is how I am approaching solving this.
'man gnome-terminal' offers some interesting options for starting new windows, or tabs using a specific profile. An alias to start an instance of gnome-terminal in a new tab using profile "X" seems like a reasonable quasi-kluge, and allows for existing keyboard shortcuts to switch between, and close tabs.
It would look something close to this:
alias gtvim='gnome-terminal --tab-with-profile=X -t Vim -x vim >&1'
gtvim filename
For alias permanency, it has to be added to bottom of ~/.bashrc
I need to work on other things now, but that was my first foray into it. It still seems to open the command in a new terminal window, but still easily accessible from keyboard shortcuts.
Just as a side note, I am attempting to have all terminals with ssh connections to remote terminals open with a different color profile to help prevent commands being issued to the wrong machine.
Best Answer
You can use
bind -x
to bind a command to a shortcut in Bash. For example, to bindgit status
command to Crtl+p shortcut you can use:Put it into
~/.bashrc
file to remember it. From man page: