Gnome Shell

Gnome Tweak Tool

Gnome tweak tool allows you to do a load of common configuration easily.

Install

1
dnf -y install gnome-tweak-tool

Common Settings

Workspaces

Set a fixed number of workspaces so that you can adopt a "workspaces for work types" approach to organising your desktop

Go to Workspaces and then set Workspace Creation to Static and then define your number of workspaces (I like 7)

Typing

You can disable your caps lock key and map it to Ctrl under the "Ctrl Position" heading, tick "Caps Lock as Ctrl"

Startup Applications

Here you can easily configure startup apps

Top Bar

Generally here I will tick "Show Date"

Extensions

Installing Gnome Shell Extensions via Chrome/Chromium/Firefox

  1. sudo dnf install chrome-gnome-shell
  2. Install the browser plugin for Chrome or Firefox
  3. Visit https://extensions.gnome.org to browse and install extensions

(Source)

Gnome Shell Extensions used by EC people

Multi Monitors

(Used by Joseph)

Gives a preview of each monitor on overview. Also does a bunch of other stuff but I turn all of that off

Activities Configurator

(Used by Joseph)

This one allows me to remove cruft from the top bar.

I totally disabled the activities button and hot corner as I only use mapped mouse buttons or the start button for getting into overview

It also allows me to set the top bar as transparent which I think is nice as it just lets the desktop colours shine through

Pixel Saver

(Used by Joseph)

Essential on laptops but also fine on bigger desktop screens. Simply removes some useless chrome around windows so you get more pixels

Top Icons

(Used by Joseph)

This gets rid of the slide out icons draw which is awful on multi monitors and puts them back on the top bar. Defaults to display them in the middle but I configure them to show on the right

Workspace Labels

(Used by Simon)

A simple extension that allows you to name your Workspaces. Good for when you are jumping between tasks.

Workspace Isolated Dash

(Used by Joseph)

This one makes working with multiple desktops a lot saner, the dash only shows the windows on the current workspace

ShellTile

(Used by Joseph)

Really nice mouse based window tiling. Just drag windows to screen edge areas for easy tiling

Keyboard Shortcuts

Managing Gnome's Keyboard Shortcuts

  1. Open Gnome's Settings (start > search "settings")
  2. Click Keyboard
  3. Choose an action and click the keyboard shortcut (or "Disabled") to set a new one
  4. New actions can be added with the + icon

Screenshots

  • Prt Scrn to take a screenshot of the entire desktop
  • Alt + Prt Scrn takes a screenshot of the active window
  • Shift + Prt Scrn takes a screenshot of a selected area

These are saved to the ~/Pictures folder.

The gnome-screenshot application allows for a GUI-driven approach.

Gnome help page for screenshots

Switching between applications in current workspace

To switch focus from one application to another within your active workspace hit Alt + Esc.

Other tweaks

Reduce Size of Window Borders

Strongly suggest using the Pixel Saver extension to save screen space on maximised windows

For unmaximised windows, especially if using a tiling extension such as ShellTile, you can make the following change to adjust the size of the window borders:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
echo "

# --------------------------------------------------


# Gnome 3.20+ - based on https://blog.samalik.com/make-your-gnome-title-bar-smaller-fedora-24-update/
window.ssd headerbar.titlebar {
    padding: 1px;
    min-height: 0;
}
window.ssd headerbar.titlebar button.titlebutton {
    padding: 0px;
    min-height: 0;
    min-width: 0;
}


# --------------------------------------------------------------

# And another - http://securitronlinux.com/bejiitaswrath/how-to-make-the-title-bars-in-gnome-shell-much-thinner-than-the-default/

headerbar {
    min-height: 0px;
    padding-top: 0px;
    padding-bottom: 0px;
    padding-right: 2px;
    padding-left: 2px;
    font-size: 0.5em;
}

headerbar entry,
headerbar spinbutton,
headerbar button,
headerbar separator {
    margin-top: 0px;
    margin-bottom: 0px;
}

.titlebar {
    min-height: 0px;
    font-size: 0.5em;
}

.titlebar .titlebutton {
    padding: 0px 0px 0px 0px;
}

.titlebar.default-decoration {
    padding-top: 0px;
    padding-bottom: 1px;
}

.maximized .titlebar,
.tiled .titlebar {
    padding-top: 0px;
    padding-bottom: 0px;
}
" > ~/.config/gtk-3.0/gtk.css

And then log out and in again and you should see much thinner window borders

Disable Numlock

If you only ever accidently disable numlock, you can make the numeric keys always be numeric regardless of numlock using Gnome Tweak Tool

tweak tool

Customise Nightlight Colour Hue

1
2
sudo dnf -y install dconf-editor
dconf-editor

Note

You need to run dconf-editor as yourself, not root

Either, search for night-light-temperature, or you can navigate to org/gnome/settings-daemon/plugins/color/night-light-temperature. Enter a custom value - default is 4000 - I suggest 4700

Random Wallpapers

I like to have random photos as wallpapers. I have a folder in my home folder called Wallpapers. Inside there is a bash script called CHANGE.bash

The script will rotate the gnome shell wallpaper and also set the background in PHPStorm, however due to caching that will generally only happen once per day

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
psline=$(ps waux | grep [g]nome-session-binary | grep -v gdm)
PID=$(echo $psline | cut -d ' ' -f 2)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ | cut -d= -f2-)
GSETTINGS_BACKEND=dconf
wallpaperImage="$(ls /home/joseph/Wallpapers/ \
   | grep -P '\.(jpg|jpeg|png)' \
   | shuf -n 1
)"

#Set Gnome Shell Wallpaper
gsettings set org.gnome.desktop.background picture-uri "file:///home/joseph/Wallpapers/$wallpaperImage"

#Set PHPStorm Background Image
for f in $(find ~ -wholename '*PhpStorm*/config/options/options.xml')
do
    sed -i "s%<property name=\"org.intellij.images.editor.actions.SetBackgroundImageDialog#recent\"[^>]*>%<property name=\"org.intellij.images.editor.actions.SetBackgroundImageDialog#recent\" value=\"\$USER_HOME\$/Wallpapers/$wallpaperImage\" />%" $f
    sed -i "s%<property name=\"idea.background.editor\"[^>]*>%<property name=\"idea.background.editor\" value=\"\$USER_HOME\$/Wallpapers/$wallpaperImage,10,scale,center\" />%" $f
    sed -i "s%<property name=\"file.chooser.recent.file[^>]*>%<property name=\"file.chooser.recent.files\" value=\"\$USER_HOME\$/Wallpapers/$wallpaperImage\" />%" $f


done

And then I set up a 5 minute cron job:

1
*/5 * * * * ~/Wallpapers/CHANGE.bash

I also have a script to rotate the current wallpaper as I find some images render upside down.

1
2
3
4
5
6
7
8
9
#!/usr/bin/env bash
psline=$(ps waux | grep [g]nome-session-binary | grep -v gdm)
PID=$(echo $psline | cut -d ' ' -f 2)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ | cut -d= -f2-)
GSETTINGS_BACKEND=dconf
currentImage=$(realpath $(gsettings get org.gnome.desktop.background picture-uri | cut -d ':' -f 2))
currentImage=${currentImage/\'/}
#requires ImageMagick
convert "$currentImage" -rotate 180 "$currentImage"

Overview on Custom Mouse Button

With the switch to Wayland this is a bit more tricky to figure out than it was the X which has the very handy xdotool and xbindkeys

Anyway, this is the solution I have found:

Install Dependencies
1
dnf -y install evemu

Then once that is done you need to create this bash script:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
cat << EOF > ~/bin/mouse-overview.bash
#/usr/bin/env bash

function superKey(){
    evemu-event /dev/input/event3 --sync --type EV_KEY --code KEY_LEFTMETA --value 1;
    evemu-event /dev/input/event3 --sync --type EV_KEY --code KEY_LEFTMETA --value 0;
    sleep 1
}


if [[ "${BASH_SOURCE[0]}" == "${0}" ]]
then

    while read line
    do
        if [[ "$line" =~ BTN_EXTRA.*released ]]
        then
            superKey
        fi
    done < <(stdbuf -oL libinput debug-events & )
fi


EOF

And then finally, to run this in the background, you run:

1
bash ./mouse-overview.bash &

I did try to get this working as a systemd service but was not able to so far.

Inspiration for this solution came from:

The BASH while loop using stdbuf

https://github.com/shrugal/libinput-gestures

Using evemu to trigger key presses

https://unix.stackexchange.com/a/395820

Debugging

Restarting from a tty

If running X, find which X Display is in use

1
w

This will give you the list of displays in the FROM column.

Restart Gnome Shell using the display number from the above:

1
DISPLAY=:0 gnome-shell --replace