Question: On my Xubuntu 13.04 installation, when the sound is turned up to high levels (>50%), it begins to (randomly?) fluctuate between loud and quiet. In pavucontrol, the port setting is fluctuating between "Analogue output" and "Headphones" (I'm using desktop speakers plugged into the integrated audio line out).

Any ideas?

Answer: 
View existing key binding
=========================

For GTK3 applications, you can view the bindings of the Emacs GTK key theme
 - either locally, probably at `/usr/share/themes/Emacs/gtk-3.0/gtk-keys.css`)
 - or on the GTK git repository on [GitHub](https://github.com/GNOME/gtk/blob/master/gtk/gtk-keys.css.emacs) (which doesn't necessarily equal your local file, as your distro might have modified it).

While reading this file, you have to be aware of the meaning of the widgets

* [GtkTreeView](https://developer.gnome.org/gtk3/stable/GtkTreeView.html),
* GtkTextView,
* GtkEntry and
* GtkMenu.

(Look at the image at the top of each linked site.)

Adding key binding for selecting all
====================================

`select-all` for `GtkTreeView` and `GtkTextView`
------------------------------------------------

For `GtkTreeView` and `GtkTextView` widgets, there is a signal called `select-all`. You need to pass it the argument `1` so that it selects all rather than deselecting.

So, edit `~/.config/gtk-3.0/gtk.css` and add something like this:

```
@binding-set my-text-and-tree-view-bindings
{
    bind "<alt>a"
    {
    "select-all" (1)
    };
}

textview {
  -gtk-key-bindings: my-text-and-tree-view-bindings;
}

treeview {
  -gtk-key-bindings: my-text-and-tree-view-bindings;
}

```

`GtkEntry`
----------

For `GtkEntry` there is no `select-all` signal. Instead you can use a sequence of two `move-cursor` signals marking the text.

Again, edit `~/.config/gtk-3.0/gtk.css` and add something like this:

```
@binding-set my-entry-bindings
{
    bind "<alt>a"
    {
    "move-cursor" (paragraph-ends, -1, 0)
    "move-cursor" (paragraph-ends,  1, 1)
    };
}

entry {
  -gtk-key-bindings: my-entry-bindings;
}

```

Firefox
=======

By the way, in Firefox `Alt`-`a` selects all for me by default without configuration (using the Emacs GTK key theme).
If you want to select all text in a region, I prefer defining a simple Macro for that.
Press **F3** for starting to write a Macro. Then type

```
Esc - <          // goes to beginning of document
Ctrl - spacebar  // set mark
Esc - >          // selects all till end of document

```

Then use **M -w** for copying (which is what I normally do for copying from remote unix systems to local Windows) and then press **F4** to finish defining the macro.

Now you are done defining the Macro, just hit **F4** as many times you want to repeat the action.