< GNOME

GNOME/Tips and tricks

Keyboard

Turn on NumLock on login

See Activating numlock on bootup#GNOME

Hotkey alternatives

A lot of hotkeys can be changed via GNOME Settings. For example, to re-enable the show desktop keybinding:

Settings > Keyboard > Customize Shortcuts > Navigation > Hide all normal windows

However, certain hotkeys cannot be changed directly via Settings. In order to change these keys, use dconf-editor or gsettings. An example of particular note is the hotkey Alt+` (the key above Tab on US keyboard layouts). In GNOME Shell it is pre-configured to cycle through windows of an application, however it is also a hotkey often used in the Emacs editor. It can be changed by using one of the aforementioned tools to modify the switch-group key found in org.gnome.desktop.wm.keybindings.

XkbOptions keyboard options

Using the dconf-editor, navigate to the xkb-options key under the org.gnome.desktop.input-sources schema and add desired XkbOptions (e.g. caps:swapescape) to the list.

See /usr/share/X11/xkb/rules/xorg for all XkbOptions and /usr/share/X11/xkb/symbols/* for the respective descriptions.

De-bind the Super key

By default, the Super key will open the GNOME Shell overview mode. You can unbind this key by running the command below:

$ gsettings set org.gnome.mutter overlay-key ''

Modify Nautilus hotkeys

Since 3.15 it is not possible to use the accel file anymore, but it is possible to rebind keys by utilizing python-nautilus. Install the package and add the following file:

~/.local/share/nautilus-python/extensions/modify_keybindings.py
import os, gi
gi.require_version('Nautilus', '3.0')
from gi.repository import GObject, Nautilus, Gtk, Gio, GLib

def rebind():
    app = Gtk.Application.get_default()
    # Search for open_accels and nautilus_application_set_accelerators in:
    #   https://github.com/GNOME/nautilus/blob/master/src/nautilus-files-view.c
    app.set_accels_for_action( "win.back", ["<alt>Left", "BackSpace"] )

    # if you want to figure out which hotkey belongs to which action try this:
    # print(f'Alt+Left is: {app.get_actions_for_accel("<alt>Left")}')

class BackspaceBack(GObject.GObject, Nautilus.LocationWidgetProvider):
    def __init__(self):
        pass

    def get_widget(self, uri, window):
        rebind()
        return None

Restart Nautilus:

$ nautilus -q; nautilus

Disks

GNOME provides a disk utility to manipulate storage drive settings. These are some of its features:

  • Enable write cache is a feature that most hard drives provide. Data is cached and allocated at chosen times to improve system performance. You most likely have this feature already enabled by default (not through disk utility). To check, use hdparm -W /dev/sdX.
Settings > Drive Settings > Write Cache > On
  • User Session Defaults Enable to use your own options in , and disable to automatically add default and recommended mount options to drives and partitions that are GPT-based.
Partition Settings > Edit Mount Options > Automatic Mount Options > On

Hiding applications from the menu

Use the Main Menu application (provided by the alacarte package) to hide any applications you do not wish to show in the menu.

Screencast recording

GNOME features built-in screencast recording with the Ctrl+Shift+Alt+r key combination. A red circle is displayed in the right side of the top bar near the system status area, while the recording is in progress. After the recording is finished, a file named is saved in the directory.

In order to use the screencast feature, some gst-plugin packages need to be installed. For example, the screencast pipeline depends on the vp8enc and webmmux elements from . If you get an error about missing "pipewiresrc" module when trying to record, install .

The maximum screencast length is 30 seconds by default. This can be changed as follows:

$ gsettings set org.gnome.settings-daemon.plugins.media-keys max-screencast-length length_in_seconds

Set to for unlimited length (per the description of max-screencast-length).

Screenshot

by default saves the image in the directory of the last save, which you can query:
$ gsettings get org.gnome.gnome-screenshot last-save-directory

Instead of using the above directory, you can set an auto save directory. e.g. for automatically saving screenshots to the 's desktop directory:

$ gsettings set org.gnome.gnome-screenshot auto-save-directory file:///home/user/Desktop

Check the man page for more options.

Log out delay

To eliminate the default 60 second delay when logging out:

$ gsettings set org.gnome.SessionManager logout-prompt false

Disable animations

To disable Shell animations (such as "Show Applications" and the wave animation in the top left activities hot corner), run:

$ gsettings set org.gnome.desktop.interface enable-animations false

or via gnome-tweaks, in General tab, switch Animations to off.

Retina (HiDPI) display support

GNOME introduced HiDPI support in version 3.10. If your display does not provide the correct screen size through EDID, this can lead to incorrectly scaled UI elements. As a workaround you can open dconf-editor and find the key in . Set it to to get the standard scale.

Also see HiDPI.

Passwords and keys (PGP Keys)

You can use the Passwords and Keys program to create a PGP key as it is a front end for GnuPG and installs it as dependency. This may be useful in the future (for instance if to encrypt a file). Create a key as shown below (the process may take about 10 minutes):

File > New > PGP Key > Name > Email > Defaults > Passphrase.

Terminal

Change default terminal size

The default size of a new terminal can be adjusted in your profile's preferences. Select Preferences from the menu and select your profile under Profiles to access the settings to change the initial terminal size.

New terminals adopt current directory

New terminals open in the directory by default. You can configure the terminal to adopt the current working directory by adding to your shell configuration file.

Pad the terminal

To pad the terminal (create a small, invisible border between the window edges and the terminal contents) create the file below:

~/.config/gtk-3.0/gtk.css
vte-terminal,
terminal-window {
    padding: 10px 10px 10px 10px;
    -vte-terminal-inner-border: 10px 10px 10px 10px;
}

Disable blinking cursor

To disable the blinking cursor in GNOME 3.8 and above use:

$ gsettings set org.gnome.desktop.interface cursor-blink false

To disable the blinking cursor in Terminal only use:

$ gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \')/ cursor-blink-mode off

Note that , from the package of the same name, must be running for this and other settings changes to take effect in GNOME applications - see GNOME#Configuration.

Disable confirmation window when closing Terminal

The Terminal will always display a confirmation window when trying to close the window while one is logged in as root. To avoid this, execute the following:

$ gsettings set org.gnome.Terminal.Legacy.Settings confirm-close false

Color palette

The Terminal has support to change its color palette to your liking. Simply, go to Preferences, select your profile and finally edit the color palette.

Terminal color scheme

Install the package, which provides a set of custom schemes made for the GNOME Terminal. After you choose a scheme (or more than one), run and input the number(s) of the scheme(s) that you chose.

After installation, go to Preferences of the Terminal, go to the Colors tab and select the name of the color scheme you installed from the left side of the window. You will see a small arrow next to the name, click it and select Set as default.

From here, further configuration can be taken. You may easily change certain colors you do not like.

To remove a scheme, make another one your default if you had that scheme as your default. Then select its name and click Delete.

Middle mouse button

By default, GNOME 3 disables middle mouse button emulation regardless of Xorg settings (Emulate3Buttons). To enable middle mouse button emulation use:

$ gsettings set org.gnome.settings-daemon.peripherals.mouse middle-button-enabled true

Enable button and menu icons

Since GTK 3.10, the GSettings key 'menus-have-icons' has been deprecated. Icons in buttons and menus can still be enabled by setting the following overrides:

$ gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/ButtonImages': <1>, 'Gtk/MenuImages': <1>}"

Use custom colours and gradients for desktop background

To use custom colours and gradients for your desktop background, you will first need to set either a transparent picture or else a non-existent picture as your desktop background. For instance, the command below will set a non-existent picture as the background.

$ gsettings set org.gnome.desktop.background picture-uri none

At this point, the desktop background should be a flat colour - the default colour setting is for a deep blue.

For a different flat colour you need only change the primary colour setting:

$ gsettings set org.gnome.desktop.background primary-color <my color>

where <my color> is a hex value (such as ffffff for white).

For a colour gradient, you will also need to change secondary colour setting org.gnome.desktop.background secondary-color and select a shading type. For instance, if you want a horizontal gradient, execute the following:

$ gsettings set org.gnome.desktop.background color-shading-type horizontal

If you are using a transparent picture as your background, you can set the opacity by executing the following:

$ gsettings set org.gnome.desktop.background picture-opacity <value>

where value is a number between 1 and 100 (100 for maximum opacity).

Transitioning backgrounds

GNOME can transition between different wallpapers at specific time intervals. This is done by creating an XML file specifying the pictures to be used and the time interval. For more information on creating such files, see the following article.

Alternatively, a number of tools are available to automate the process:

    For setting the XML file as the default background, see GNOME#Lock screen and background.

    Custom GNOME sessions

    It is possible to create custom GNOME sessions which use the GNOME session manager but start different sets of components (Openbox with tint2 instead of GNOME Shell for example).

    Two files are required for a custom GNOME session: a session file in which defines the components to be started and a desktop entry in which is read by the display manager. An example session file is provided below:

    /usr/share/gnome-session/sessions/gnome-openbox.session
    [GNOME Session]
    Name=GNOME Openbox
    RequiredComponents=openbox;tint2;gnome-settings-daemon;

    And an example desktop file:

    Redirect certain URLs to specific web browsers

    This shows how to use Chromium for certain types of URLs while maintaining Firefox as default browser for all other tasks.

    Make sure is installed, to use pcregrep.

    Setup custom xdg-open:

    Configure domains for redirect to Chromium:

    Setup xdg-open web as desktop application:

    $ update-desktop-database $HOME/.local/share/applications/

    Set xdg-open web as default Web application in GNOME settings: Go to GNOME Settings > Default Applications and set Web to xdg-open web.

    Removing film holes/film strip from video thumbnails in Nautilus

    Nautilus (Files) overlays the film holes/film strip effect on video thumbnails since Gnome 3.12. To remove or override this effect, the environment variable can be used to reference the path of a compiled resource (in this instance filmholes.png) and specify the path for the relevant overlay. This environment variable has only been available since GLib 2.50 and will have no effect on versions before this.

    Extract filmholes.png from Nautilus:

    $ gresource extract /usr/bin/nautilus /org/gnome/nautilus/icons/filmholes.png > filmholes.png

    Edit filmholes.png using your preferred editor and remove the film effect from the image, leaving the transparency and dimensions intact, then overwriting the extracted image.

    Copy or move the extracted image where desired, such as and edit , adding the following export, changing as needed to the location you placed the file:

    export G_RESOURCE_OVERLAYS=/org/gnome/nautilus/icons/filmholes.png=/usr/share/icons/filmholes.png

    If ffmpegthumbnailer has been installed as a dependency for another file manager that may generate thumbnails, the line in should be modified removing the flag.

    To ensure that no thumbnails remain that may already have the film effect embedded, remove the thumbnail cache:

    $ rm -r ~/.cache/thumbnails

    Log out and back in to your session and you should no longer have the film holes/film strip effect on your thumbnails in Nautilus.

    Prevent GNOME Software from downloading updates

    By default will download updated packages from the Arch Linux repositories. This forces GNOME Software to refresh the package lists for pacman automatically. This is the equivalent to . If the user ignores the GNOME software update prompt, but does install a new package, that will result in partial upgrades, which are unsupported. To prevent GNOME Software from refreshing the package lists set the following dconf setting:

    $ gsettings set org.gnome.software download-updates false

    Increase volume above and beyond 100%

    Install the extension volume mixer. Then use the mouse to scroll above the volume icon in the top panel to increase the volume above and beyond 100%.

    Alternatively, open GNOME Tweaks and toggle General > Over-Amplification.

    Adjust volume in smaller steps

    By default, pressing the keyboard's volume keys adjusts the volume by 6%. If smaller steps are desired, holding while pressing the volume keys adjusts the volume in 2% steps.

    Also, as of GNOME 3.36, it is now possible to directly adjust the volume step via a dconf setting. For example, to set the volume step to 2% execute the following:

    $ gsettings set org.gnome.settings-daemon.plugins.media-keys volume-step 2

    Show volume sound percentage next to top panel icon

    Install the extension sound percentage to display the current output volume level next to the sound icon in the top panel.

    Launch on discrete GPU

    Install switcheroo-controlAUR or and start/enable .

    Window list

    If you like having a tasks list on the bottom but dislike the default black color of this extension, first copy its directory:

    $ cp -r /usr/share/gnome-shell/extensions/window-list@gnome-shell-extensions.gcampax.github.com/ ~/.local/share/gnome-shell/extensions/

    Then edit the CSS to your liking. For example, to make the window list transparent, edit stylesheet.css as follows:

    .bottom-panel {
      background: transparent;
    }
    ...
    .window-button > StWidget,
    .window-picker-toggle > StWidget {
      color: #bbb;
      background-color: transparent;
      ...

    To mimic the behavior of Windows when switching between windows, first disable the default which restricts the window switching to those in the current workspace:

    $ gsettings set org.gnome.shell.app-switcher current-workspace-only false

    then, bind and to switch between windows, and not applications:

    $ gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Alt>Tab']"
    $ gsettings set org.gnome.desktop.wm.keybindings switch-windows-backward "['<Shift><Alt>Tab']"

    additionally, one can rebind the switching between applications (this example uses Super instead of the default ):

    $ gsettings set org.gnome.desktop.wm.keybindings switch-applications "['<Super>Tab']"
    $ gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward "['<Shift><Super>Tab']"
    gollark: SOMEHOW the autoquarantine is not detecting all bots, sorry.
    gollark: It also causes moderation.
    gollark: <@509849474647064576> has now taken over quarantine duty from <@398575402865393665>. Do not resist.
    gollark: Yes.
    gollark: ... did that not *actually* create role space?
    This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.