You can control the gpg-agent's password caching behavior with ~/.gnupg/gpg-agent.conf
. The relevant gpg-agent options are default-cache-ttl
(max idle time in seconds) and max-cache-ttl
(max time before expiry even if under active use.) The format is simply option_name option_value
. E.g.
# This is a comment
default-cache-ttl 600
max-cache-ttl 7200
Once edited, you can force reload of the configuration with gpgconf --reload gpg-agent
.
Caveat lector: tested on 16.04, not 15.10.
Are keyboard multimedia keys different?
Yes, these keys are a little different. They might report a single key code or multiple key codes when pressed with other keys like Fn for example. Furthermore, it is oftentimes difficult to identify their key codes with utilities like xev
. This depends on the keyboard's manufacture's configuration.
Multimedia keys, usually, have their key codes configured with XF86 key names. These names differ but start with XF86
like XF86MonBrightnessUp
and XF86MonBrightnessDown
and so on.
How to disable/reconfigure keyboard multimedia keys?
XKB
Method
The easiest method is to edit the XKB configuration file like so:
Edit the XKB /usr/share/X11/xkb/symbols/pc
file by running the following command in the terminal:
sudo nano /usr/share/X11/xkb/symbols/pc
Find lines that contain XF86
like so:
key <KEY_CODE> { [ XF86MonBrightnessDown ] };
Comment them out by adding //
before them like so:
//key <KEY_CODE> { [ XF86MonBrightnessDown ] };
Save the file and exit the editor by pressing Ctrl + X then press Y.
Clear the XKB cache by running the following command in the terminal:
sudo rm -rf /var/lib/xkb/*
Reboot your system to activate your new XKB configuration or alternatively you can avoid reboot and try to reload the new XKB configuration by setting an XKB map layout using the following command in the terminal:
setxkbmap -layout us
Test your keys.
If the keyboard multimedia keys are configured by the manufacturer to report a single key code, the above solution might disable them and leave the keys free to be used for other purposes.
If, however, this is not the case, then you will need to deal with xmodmap
.
xmodmap
Method
The xmodmap
method is a little different and you cannot just disable multimedia keys using this method and assign them to nothing like so xmodmap -e 'keycode Number ='
because this, oftentimes, will render them unusable so you will need to reassign them to the desired functions. You will also need to put in action some mechanism to maintain your changes between reboots and logouts/logins.
To implement this method, please follow the steps below:
Show the current keyboard map by running the following command in the terminal:
xmodmap -pke
Inspect the output and identify lines that contain XF68
right after the =
sign like so:
keycode 232 = XF86MonBrightnessDown NoSymbol XF86MonBrightnessDown NoSymbol XF86MonBrightnessDown
The above line, for example, shows that the key with code number 232 is currently configured to trigger XF86MonBrightnessDown
which will decrease the monitor's brightness and you can change this behavior by assigning a different value to it like so xmodmap -e 'keycode 232 = New_Value'
. For example to assign the F11 functionality to this multimedia key, please run the following command in the terminal:
xmodmap -e 'keycode 232 = F11'
The new functionality will be effective immediately. This change in functionality will, however, be lost after reboot or logout/login.
Notice: It might be helpful to run the acpi_listen
command in the terminal and monitor the output as you press the actual physical key then compare it to the output you got from xmodmap -pke
so that you confirm the key code is for the one you want. You can also try the xev
utility but, unfortunately it will not always return a key code when dealing with multimedia or vendor specific keys.
To preserve the change after reboots and logouts/logins, you will need to do the following:
Create and edit a script file in your home directory by running the following command in the terminal:
nano ~/.Modify_Multimedia_Keys.sh
Add this #!/bin/bash
in the first line then add your xmodmap -e 'keycode Number = New_Value'
commands below the first line ( each command in a single new line ) like so:
#!/bin/bash
xmodmap -e 'keycode 232 = F11'
xmodmap -e 'keycode 122 = F2'
Save the script file and exit the editor by pressing Ctrl + X then press Y.
Make the script file executable by running the following command in the terminal:
chmod +x ~/.Modify_Multimedia_Keys.sh
Make the script file execute at each start-up either by adding it to your Startup Applications through the GUI or by placing a Modify_Multimedia_Keys.desktop
file in the ~/.config/autostart/
directory that contains the following content replacing YOUR_USERNAME
with your actual username:
[Desktop Entry]
Type=Application
Exec=/home/YOUR_USERNAME/.Modify_Multimedia_Keys.sh
Hidden=false
X-GNOME-Autostart-enabled=true
Name=Modify Multimedia Keys
Comment=This modifies keyboard multimedia keys
Best Answer
As the author of the software, I don't actually use Ubuntu myself, so I don't provide any packages. However, it's just a simple Python script, so it doesn't need to be compiled at all.
You can either download the script itself directly from Github and copy it to /usr/local/bin (make sure to run
chmod 755
on the file first), or you can use Git to check out the source code repository and follow the installation instructions in the readme. I strongly suggest the second method, as it will allow you to do a simplegit pull
in the repository in the future to update your copy of the script and install it again.