# Ubuntu Setup Here's my personal Ubuntu 22.04 setup. (Make sure to enable Wayland on Nvidia!) - Set font size in Terminal to 15 and initial column count to 85 - Must haves: - `sudo apt install curl earlyoom ffmpeg flatpak git gnome-clocks \ gnome-shell-pomodoro gnome-software-plugin-flatpak gnome-sound-recorder \ gnome-todo gnome-weather goldendict gparted keepassxc mosh obs-studio \ shadowsocks-libev sshfs synaptic tmux trash-cli vim-gtk3 vlc \ gnome-boxes wl-clipboard needrestart deja-dup ufw ddcutil` - Optional: - `sudo apt install openjdk-17-jdk gthumb gnome-usage ranger gnome-firmware gnome-games gnome-nettool qpdf pulseeffects gnome-packagekit gnome-passwordsafe mkvtoolnix-gui virtualbox-qt syncplay` - Remove all snaps: - ``` sudo apt autoremove --purge snapd sudo apt-mark hold snapd trash ~/snap ``` - FlatHub: - `flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo` - Allocate 8GiB for swap ``` sudo swapoff /swapfile sudo fallocate -l 8GiB /swapfile sudo mkswap /swapfile sudo swapon /swapfile ``` - Early OOM config: edit `/etc/default/earlyoom` and add: - `--avoid '(^|/)(systemd|sshd|mosh-server|ssh|vim|sudo|sudoedit|gnome-shell|gnome-terminal-)$' --prefer '(^|/)(Web Content|Isolated Web Co)$'` - Firefox - Change default zoom to 110% - Enable HTTPS only - Proxy DNS when using SOCKS v5 - Enable DNS over HTTPS - In `about:config` set `browser.sessionstore.max_windows_undo` to 10. - Go to settings -> `Region & Language` and install `Chinese (simplified)`. ## Optional packages - `clangd` for VSCodium C language server with `llvm-vs-code-extensions.vscode-clangd` (?) - `imagemagick` for `convert`, comment out with `` PDF policy in `/etc/ImageMagick-6/policy.xml` (?) - Cross compiling (?) - `gcc-aarch64-linux-gnu` - `gcc-arm-linux-gnueabihf` ## UFW `$ sudo ufw enable` ## Wayland (?) - `sudoedit /usr/lib/udev/rules.d/61-gdm.rules` and comment the two uncommented lines - Reboot or restart gdm3 (didn't try) ## Apps - gnome-tweaks - `sudo apt install gnome-tweaks` - Swap capslock and ESC in `Keyboard & Mouse` -> `Additional Layout Options` -> `Caps Lock behavior` - Change `Mouse Click Emulation` to `Area` - Turn on weekdays and battery percentage in `Top Bar` - Flat mouse acceleration profile - Turn off suspend when closing lid - Extensions - `sudo apt install gnome-shell-extensions` - Turn on: - `Applications menu` - `Places status indicator` - `Windownavigator` - `Workspace Indicator` - Note: to manually install Gnome extensions, unzip it and copy the `uuid` field in `metadata.json` and rename the directory to this name, then move to `~/.local/share/gnome-shell/extensions` and logout and login. - GSConnect - `sudo apt install gnome-shell-extension-gsconnect` - Uncheck SFTP auto mount - Add commands: - `Lock`: `loginctl lock-session` - `Quack`: `ffplay -v quiet -nodisp -autoexit ~/Music/'.Not Music'/Ringtones/Quack.mp3` - UFW: - `sudo ufw allow 1716:1764/tcp` - `sudo ufw allow 1716:1764/udp` - Flatseal - `flatpak install flathub com.github.tchx84.Flatseal` - VSCodium - `flatpak install flathub com.vscodium.codium` - OBS Studio - `$ sudo apt install qtwayland5` - In `/usr/share/applications/com.obsproject.Studio.desktop`, replace `Exec=obs` with `Exec=sh -c '[ "$XDG_SESSION_TYPE" = "wayland" ] && obs -platform wayland || obs'` - Birdtray - `$ sudo apt install birdtray` - Configure it by running `birdtray` and clicking on the tray icon - In Startup Applications Preference: - Name: `Birdtray` - Command: `sh -c "sleep 20 && /usr/bin/birdtray"` - Comment: `Minimize to tray for Thunderbird` - Wait for bugs to be fixed before removing sleep: - - - Hiding: check all except hide/show by clicking icon - Gnome Calendar - Add Google accounts in online accounts - On older versions of Ubuntu < 22.04, not tested for 22.04: - Wait for a bit, it's kinda buggy but it will work at the end (wait for ~2 days) - Golden Dict - Import dictionaries in `~/.software/goldendict/stardict-cc-cedict` - Don't search in dictionaries contains more then 10000 articles - - Xournal++ - `sudo apt install xournalpp texlive-latex-extra` - < Ubuntu 22.04 - `flatpak install flathub com.github.xournalpp.xournalpp` - `flatpak install flathub org.freedesktop.Sdk.Extension.texlive` and choose newest (21.08 at time of writing) for LaTeX support. - cameractrls - `flatpak install hu.irl.cameractrls` - Minecraft - TODO: PolyMC just had some problems - To host servers: `sudo ufw allow 25565/tcp` - Bottles - `flatpak install flathub com.usebottles.bottles` - Discord - `flatpak install flathub com.discordapp.Discord` - Slack - `flatpak install flathub com.slack.Slack` - Zoom - `flatpak install flathub us.zoom.Zoom` ## Optional Apps - Impatience (adjust Gnome animation speed) - `sudo apt install gnome-shell-extension-impatience` - Enable in extensions and set speed to 0.7 - Wobbly Windows (?) - From - Turn off maximize effect - Increase restore factor to 5 - System monitor - `$ sudo apt install gnome-shell-extension-system-monitor` - Show only CPU (digit and graph) and memory (digit). - OpenWeatherMap - `$ sudo apt install gnome-shell-extension-weather` - On older systems (< 21.04), download and install from `https://extensions.gnome.org/extension/750/openweather/` - Set location to La Jolla - Switch to metric units - VSCodium - `flatpak install flathub com.vscodium.codium` - Birdtray - `$ sudo apt install birdtray` - Configure it by running `birdtray` and clicking on the tray icon - In Startup Applications Preference: - Name: `Birdtray` - Command: `sh -c "sleep 20 && /usr/bin/birdtray"` - Comment: `Minimize to tray for Thunderbird` - Wait for bugs to be fixed before removing sleep: - - - Hiding: check all except hide/show by clicking icon - Broken on Wayland - Android Studio - Move `Ctrl+S` from IdeaVim to IDE - Enabled `Mark modified (*)` - Disable both `Save files on frame deactivation` and `Save files automatically if application is idle` ## Grub background ### Tool - `$ sudo apt install grub-customizer` - Put in background manually ### Manual Script ``` sudo mkdir /opt/grub sudo cp -r background/ /boot/grub/ sudo chown -R root:root /opt/grub sudo chmod -R 700 /opt/grub ``` - Add the following lines to `/opt/grub/cycle-backgrounds.sh`: ``` #!/bin/sh cd /boot/grub/background mv background.png tmp.png mv background-1.png background.png mv tmp.png background-1.png ``` - `$ sudo chown root:root /opt/grub/cycle-backgrounds.sh` - `$ sudo chmod 700 /opt/grub/cycle-backgrounds.sh` - Add `@reboot /opt/grub/cycle-backgrounds.sh` to root crontab. - In `/etc/default/grub`: - Add `GRUB_BACKGROUND=/boot/grub/background/background.png` - Change `GRUB_TIMEOUT=10` to `GRUB_TIMEOUT=3` - `$ sudo update-grub` ## OpenSSH Server & Mosh ``` sudo apt install -y openssh-server mosh sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak sudo cp ../system/sshd_config /etc/ssh/sshd_config sudo groupadd --system ssh-users sudo usermod -aG ssh-users $(whoami) mkdir -p ~/.ssh chmod 700 ~/.ssh touch ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys # insert your SSH public keys into the file sudo ufw limit 22/tcp sudo ufw allow 60001:60999/udp sudo systemctl restart ssh ``` ## See logs as admin `sudo usermod -aG adm $(whoami)` ## Proton black screen fix (?) Source: ``` sudo mv /usr/share/vulkan/icd.d/intel_icd.x86_64.json \ /usr/share/vulkan/icd.d/intel_icd.x86_64.json.disabled ``` ## Proprietary encodings (?) - `$ sudo apt install ubuntu-restricted-extras` ## Dual boot ### Dislocker ``` $ sudo apt install dislocker $ sudo mkdir /media/"$(whoami)" /mnt/dislocker /opt/dislocker $ sudo chmod 700 /media/"$(whoami)" /mnt/dislocker /opt/dislocker $ sudo chown $user:$user /media/"$(whoami)" $ sudo chown root:root /mnt/dislocker /opt/dislocker ``` Copy the `.BEK` file to `/opt/dislocker/"$(whoami)".bek`. ``` $ sudo chown root:root /opt/dislocker/"$(whoami)".bek $ sudo chmod 700 /opt/dislocker/"$(whoami)".bek ``` Add the following lines to `/etc/fstab` with `` replaced: ``` /dev/nvme0n1p6 /mnt/dislocker fuse.dislocker nofail,nouser,umask=0077,bekfile=/opt/dislocker/.bek 0 0 /mnt/dislocker/dislocker-file /media/ auto nofail,umask=0077,gid=,uid= 0 0 ``` Mount manually with: ``` $ sudo dislocker /dev/nvmen1p6 -p -- /mnt/dislocker $ sudo mount -o loop /mnt/dislocker/dislocker-file /media/"$(whoami)" ``` ## Hardware specific ### Nvidia proprietary driver screen tearing fix For Ubuntu < 22.04: `echo 'options nvidia-drm modeset=1' | sudo tee /etc/modprobe.d/nvidia-drm-nomodeset.conf > /dev/null` ### Digimend for Huion tablet (works with H640p) - = 20.10 & using wayland: no longer necessary - = 21.04: - `$ sudo apt install digimend-dkms` - Reboot. - < 21.04: - Download and install from `https://github.com/DIGImend/digimend-kernel-drivers`. ### Razer mouse ``` sudo add-apt-repository ppa:polychromatic/stable sudo apt install openrazer-meta polychromatic ``` ## Workarounds - [Blanked screen doesn't wake up after locking \[drmModeAtomicCommit: Argument invalide\] \[drmModeAtomicCommit: Invalid argument\]](https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1968040) - Put `MUTTER_DEBUG_ENABLE_ATOMIC_KMS=0` in `/etc/environment`