12th April 2017, updated:1st Dec 2024

My own setup for Ubuntu

These are the steps I normally use to setup a Ubuntu desktop distribution, currently up to Noble Numbat (24.04). For previous Ubuntu distributions, see this previous version.

My focus is to have all my linux boxes having a similar configuration and packages installed. And that the configuration matches as well my MacOS configurations, using same shortcuts and workflows. For example, I use workspaces, which I define statically in MacOS and in Linux, and define the same shortcuts, when possible, to use them (it is possible to switch workspaces using the same keyboard shortcuts, but the movement of windows between workspaces cannot be equally defined). On the other side, I do not switch the Alt-Cmd keys, somehow I keep good enough muscle memory to key the correct combinations.

This setup only defines the initial installations and basic system configuration, not all the programs that I eventually install.

Installation

  • Choose minimal installation, without games, etc. Select the checkboxes to download updates during the installation and to install 3rd party software.
  • Install basic applications from the command line:
    sudo apt install -y gnome-tweaks git gettext make dconf-editor guake vim curl exfat-fuse
  • Install additional applications from the command line: JDK, virtualbox, mono:
    sudo apt install virtualbox default-jdk mono-runtime
    sudo apt install virtualbox-ext-pack
  • Install applications using the AppCenter (most are snap versions):
    • Brave
    • Gimp
    • Intellij Idea Ultimate
    • KeePassXC
    • onedrive-cli
    • Thunderbird
    • Transmission
    • Vivaldi
    • VLC
    • XSane
  • Install applications using their own installers / instructions:
    • Dropbox
    • Sublime text 3. Once opened, it will ask to download a new version: answer no, then enter the licence for Sublime 3, go to preferences / settings and enter {"update_check": false} in the user settings
    • Truecrypt : no link offered, I have my own debian package download from safer times...

Configuration

  • Desktop configuration: open Tweaks application
    • Keyboard:
      • Overview Shortcut: Right Super. The original, Left Super, I use it better for switching workspaces, as it is done on Mac
      • Additional layout options: Compatibility options: Numeric Keypad always enter digits
  • Disable usage of Super + Numpad as dock favourites shortcut: open dconf-editor application:
    • Navigate to org / gnome / shell / extensions / dash-to-dock, scroll down and find out line says hot-keys, and turn it off.
    • Navigate to org / gnome / shell / keybindings, remove switch-to-application 1...4: Use default value: off, custom value: [''].
  • Disable edges tiling (windows snapping / resizing when brought to the edges):
    • gsettings set org.gnome.mutter edge-tiling false
    • gsettings set org.gnome.shell.overrides edge-tiling false
  • Open Settings application.
  • Keyboard/Keyboard shortcuts
    • Launchers
      • Home Folder: Command + E
    • Navigation
      • Move window to monitor xxxx : Remove it (4 shortcuts)
      • Move window one worspace to the left: Remove it
      • Move window one worspace to the right: Remove it
      • Move window to last workspace: Remove it
      • Move window to workspace 1: Alt Command 1
      • Move window to workspace 2: Alt Command 2
      • Move window to workspace 3: Alt Command 3
      • Move window to workspace 4: Alt Command 4
      • Switch to last workspace: Remove it
      • Switch to workspace on the left: Remove it
      • Switch to workspace on the right: Remove it
      • Switch to workspace 1: Command 1
      • Switch to workspace 2: Command 2
      • Switch to workspace 3: Command 3
      • Switch to workspace 4: Command 4
    • System
      • Lock Screen: Remove it
      • Restore the keyboard shortcuts: Remove it
    • Typing
      • Switch to next input source: Remove it
      • Switch to previous input source: Remove it
  • Ubuntu Desktop
    • Multitasking / Active Screen Edges OFF
  • Multitasking
    • Active Screen Edges OFF
    • Workspaces: Fixed number of workspaces (set it to default, 4)
  • Search: enable only Files and Calculator
  • Power:
    • Power button actionL Suspend
  • Privacy & Security
    • Automatic Screen Lock Delay: 30 minutes
  • Cleanup dock: remove any applications not required, like Ubuntu software, help, etc, and add any new ones
  • Configure Nautilus
    • Remove from Nautilus entries to Documents, Music, Pictures, Videos and Desktop: Open the file ~/.config/user-dirs.dirs, and modify all entries that should not appear. For example, to have only a DOWNLOAD folder, this file should have the following content (note that XDG_DESKTOP_DIR keeps its original value):
      XDG_DOWNLOAD_DIR="$HOME/Downloads"
      XDG_DESKTOP_DIR="$HOME/Desktop"
      XDG_TEMPLATES_DIR="$HOME/"
      XDG_PUBLICSHARE_DIR="$HOME/"
      XDG_DOCUMENTS_DIR="$HOME/"
      XDG_MUSIC_DIR="$HOME/"
      XDG_PICTURES_DIR="$HOME/"
      XDG_VIDEOS_DIR="$HOME/"
    • Show files as list in nautilus, in small size:
      gsettings set org.gnome.nautilus.preferences default-folder-viewer list-view
      gsettings set org.gnome.nautilus.list-view default-zoom-level small
    • It is needed to reset nautilus:
      killall nautilus
    • Now, when Nautilus is open again, there will be entries for Documents, Music, etc, but right clicking on them shows the Remove option
  • Start guake at login: The usual way of launching 'Startup Applications' and adding Guake is not useful: guake removes itself! What is needed is to start guake (usr/bin/guake), open preferences, and, in General / General, select the checkbox 'Start Guake at login'
  • On a Mac keyboard, avoid having to press Fn to key F1 to F12:
        sudo -s
        echo options hid_apple fnmode=2 > /etc/modprobe.d/hid_apple.conf
        update-initramfs -u

SSH settings

Basically, follow these instructions

ssh-keygen -t rsa -b 4096

Then copy the public id in the ~/.ssh/authorized_keys files of the reachable hosts.

I use different keys for other services, like git. To generate any additional key with a comment

ssh-keygen -t rsa -b 4096 -f hg_id_rsa -C coderazzi@summer-git,hg

Using onedrive

  • Execute onedrive-cli: This will require the credentials via the browser
  • The onedrive folder is restricted, due to snap confinment, to an internal folder (~/snap/onedrive-cli/14/OneDrive)
    mv ~/snap/onedrive-cli/14/OneDrive ~
    echo sync_dir=/home/coderazzi/OneDrive >> /home/coderazzi/snap/onedrive-cli/current/.config/onedrive/config
  • Perform an initial synchronization
    monedrive-cli --monitor --verbose
  • Use onedrive as a service
    • Create a file ~/.config/systemd/user/onedrive.service as
      [Unit]
      Description=OneDrive Free Client
      After=network-online.target
      Wants=network-online.target
      
      [Service]
      ExecStart=/snap/bin/onedrive-cli --monitor
      Restart=on-failure
      RestartSec=3
      RestartPreventExitStatus=3
      
      [Install]
      WantedBy=default.target
      
    • Then:
      systemctl --user start onedrive
      systemctl --user enable onedrive
    • To check the status:
      journalctl --user-unit onedrive -f