User Tools

Site Tools


distros:ubuntu_desktop

This is an old revision of the document!


Information

  • Ubuntu 1)
  • Desktop 2)
  • 23.04

Download

HOSTS

Initial

  • :!: Only run this once as it overwrites /etc/hosts-bak on subsequential runs
wget -O '/tmp/hosts-tmp' 'https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling/hosts' && sudo cp '/etc/hosts' '/etc/hosts-bak' && sudo mv '/tmp/hosts-tmp' '/etc/hosts' && sync

Update

wget -O '/tmp/hosts-tmp' 'https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling/hosts' && sudo mv '/tmp/hosts-tmp' '/etc/hosts' && sync

Verify

cat '/etc/hosts' | grep 'Date:'
sudo -e '/etc/hosts'

Restore

sudo cp '/etc/hosts-bak' '/etc/hosts' && sync

Repositories

Liquorix Kernel

sudo add-apt-repository 'ppa:damentz/liquorix'

Keybase

wget -O '/tmp/code_signing_key.asc' 'https://keybase.io/docs/server_security/code_signing_key.asc' && sudo mv '/tmp/code_signing_key.asc' '/etc/apt/trusted.gpg.d/keybase.asc' && sync

WineHQ

sudo dpkg --add-architecture 'i386'
wget -O '/tmp/winehq.key' 'https://dl.winehq.org/wine-builds/winehq.key' && sudo mv '/tmp/winehq.key' '/etc/apt/trusted.gpg.d/winehq.asc' && echo 'deb https://dl.winehq.org/wine-builds/ubuntu/ lunar main' | sudo tee '/etc/apt/sources.list.d/winehq.list' > '/dev/null' && sync

oibaf/graphics-drivers

sudo add-apt-repository 'ppa:oibaf/graphics-drivers'

Software

Update

System

sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt clean && sync

Firmware

sudo fwupdmgr refresh --force && sudo fwupdmgr update --verbose && sync

Snaps

sudo snap refresh && sync

General

sudo apt install --install-recommends 7zip aria2 chrome-gnome-shell evolution filezilla gimp keepassxc libreoffice libsecret-tools lm-sensors mesa-utils mpv rhythmbox transmission-gtk unar wmctrl youtube-dl 

Wine

winehq-staging winbind winetricks libgl1-mesa-dri:i386 mesa-vulkan-drivers mesa-vulkan-drivers:i386 libgl1:i386

Liquorix Kernel

linux-image-liquorix-amd64 linux-headers-liquorix-amd64

Intel Media Driver for VAAPI

Keybase

  • :!: This needs ran as a separate command and not combined with the above package installations
rm -Rf '/tmp/keybase_amd64.deb' && wget -O '/tmp/keybase_amd64.deb' 'https://prerelease.keybase.io/keybase_amd64.deb' && sudo apt install '/tmp/keybase_amd64.deb' && rm '/tmp/keybase_amd64.deb' && sync && run_keybase

Tor Browser

torbrowser-launcher

Google Chrome

wget -O '/tmp/google-chrome-stable_current_amd64.deb' 'https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb' && sudo apt install '/tmp/google-chrome-stable_current_amd64.deb' && rm '/tmp/google-chrome-stable_current_amd64.deb' && sync

Steam

wget -O '/tmp/steam.deb' 'https://cdn.cloudflare.steamstatic.com/client/installer/steam.deb' && sudo apt install '/tmp/steam.deb' && rm -f '/tmp/steam.deb' && sync

Settings

Keyboard Shortcuts

  • wmctrl is useful for Old School RuneScape and toggling between windowed and fullscreen modes
bash -c "secret-tool lookup 'keepass' 'default' | keepassxc --pw-stdin ~/'Documents/keepass.kdbx'"
gnome-terminal --command "sudo sh -c 'apt update && apt full-upgrade -y && apt clean && apt autoremove -y && sync && snap refresh && wget -O '/etc/hosts' 'https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling/hosts' && sync && fstrim --all --verbose && sync && sleep '5''"
wmctrl -r 'jagexappletviewer.jagexappletviewer' 'net-runelite-client-RuneLite.net-runelite-client-RuneLite' -x -b 'toggle,fullscreen'

KeePassXC Auto-Type Fix

  • :!: 2023/04/29: keepassxc has QT_QPA_PLATFORM=xcb in order to work for OSRS on GNOME on Wayland on Ubuntu 23.04
bash -c "secret-tool lookup 'keepass' 'default' | QT_QPA_PLATFORM='xcb' keepassxc --pw-stdin ~/'Documents/keepass.kdbx'"

Keys

  • Listed respectively to above
  • Ctrl + Alt + Z
  • Menu
  • F6

Printer

  • Internet Printing Protocol (ipps) → HP → IPP Everywhere ™
  • Color Mode: Device Gray
  • Administration → Set As Server Default
ipps://192.168.1.164/ipp/print

Network

Google Public DNS

Wraeclast
8.8.8.8,8.8.4.4
2001:4860:4860::8888,2001:4860:4860::8844
https://dns.google/dns-query

Nautilus

  • Sort Folders Before Files

Rhythmbox

Terminal

  • 10-notch Transparency

Kernel Options

Intel Perf Counters

i915 Early-load

echo 'i915' | sudo tee --append '/etc/modules' > '/dev/null' && cat '/etc/modules' | grep 'i915'
sudo update-initramfs -k 'all' -c

sysctl

echo 'dev.i915.perf_stream_paranoid=0' | sudo tee '/etc/sysctl.d/99-i915-perf.conf' > '/dev/null' && cat '/etc/sysctl.d/99-i915-perf.conf'
Verify

sysctl 'dev.i915.perf_stream_paranoid' | grep '0'

Swappiness

echo 'vm.swappiness=0' | sudo tee '/etc/sysctl.d/99-swappiness.conf' > '/dev/null' && cat '/etc/sysctl.d/99-swappiness.conf'

Verify

sysctl 'vm.swappiness' | grep '0'
cat '/proc/sys/vm/swappiness'

TCP Fast Open

echo 'net.ipv4.tcp_fastopen=3' | sudo tee '/etc/sysctl.d/99-tcp-fastopen.conf' > '/dev/null' && cat '/etc/sysctl.d/99-tcp-fastopen.conf'

Verify

sysctl 'net.ipv4.tcp_fastopen' | grep '3'
cat '/proc/sys/net/ipv4/tcp_fastopen'

GRUB

Config

sudo -e '/etc/default/grub' && sudo update-grub

Linux OSI

acpi_osi=Linux

PCI

pci=pcie_bus_perf,realloc,pcie_scan_all,big_root_window

Intel Optimization

  • This enables Framebuffer compression, Panel self-refresh, and i915 Fastboot
  • This also enables GuC and HuC firmware loading if supported by the hardware
i915.enable_fbc=1 i915.enable_psr=1 i915.fastboot=1 i915.enable_guc=3

GNOME

Notes

  • :!: Disable color calibration for the monitor in GNOME Settings 3)

Hide Top Bar

  • Install through Firefox, then toggle and configure from Applications → Extensions

External Monitor Settings

  • This copies the configured monitor settings from the current user to gdm and also applies it to the log-in screen
  • Notably useful for setting a laptop's built-in screen as disabled for the log-in screen
sudo cp ~/'.config/monitors.xml' ~gdm/'.config/monitors.xml' && sudo chown 'gdm':'gdm' ~gdm/'.config/monitors.xml'

Undo

sudo rm ~gdm/'.config/monitors.xml' && sync

Wayland

  • :!: ckb-next auto light shutoff requires Xorg
  • :!: GPU scaling for non-native resolutions requires Xorg
  • :!: Steam and various games through Wine work better on Xorg
  • Xorg can be selected at log-in 4)

Tweaks

sudo -e '/etc/profile.d/99-tweaks.sh'
# Mutter
export MUTTER_DEBUG_ENABLE_ATOMIC_KMS='0'
export MUTTER_DEBUG_FORCE_KMS_MODE='simple'

# Clutter
export CLUTTER_PAINT='disable-dynamic-max-render-time'

# Mesa
export MESA_DISK_CACHE_SINGLE_FILE='1'
export MESA_DISK_CACHE_DATABASE='1'
export VAAPI_MPEG4_ENABLED='1'
export mesa_glthread='true'
export MESA_NO_ERROR='1'

# Intel
export ANV_GPL='1'
export ANV_MESH_SHADER='true'
export INTEL_COMPUTE_CLASS='1'
export RUSTICL_ENABLE='iris'
export MESA_GL_VERSION_OVERRIDE='4.6COMPAT'

# End

Settings

All-in-one

  • Last updated: 2022/06/08
gsettings reset 'org.gnome.shell' 'app-picker-layout' && gsettings set 'org.gnome.desktop.interface' 'enable-animations' 'true' && gsettings set 'org.gnome.desktop.peripherals.touchpad' 'send-events' 'disabled-on-external-mouse' && gsettings set 'org.gnome.desktop.peripherals.touchpad' 'natural-scroll' 'false' && gsettings set 'org.gnome.desktop.peripherals.mouse' 'accel-profile' 'flat' && gsettings set 'org.gnome.desktop.peripherals.touchpad' 'tap-to-click' 'false' && gsettings set 'org.gnome.desktop.peripherals.touchpad' 'tap-and-drag' 'false' && gsettings set 'org.gnome.desktop.peripherals.touchpad' 'disable-while-typing' 'false' && gsettings set 'org.gnome.desktop.peripherals.touchpad' 'click-method' 'areas' && gsettings set 'org.gnome.desktop.interface' 'clock-show-date' 'true' && gsettings set 'org.gnome.desktop.interface' 'clock-show-weekday' 'true'

Individual

  • Last updated: 2022/06/08
gsettings reset 'org.gnome.shell' 'app-picker-layout'
gsettings set 'org.gnome.desktop.interface' 'enable-animations' 'true'
gsettings set 'org.gnome.desktop.peripherals.touchpad' 'send-events' 'disabled-on-external-mouse'
gsettings set 'org.gnome.desktop.peripherals.touchpad' 'natural-scroll' 'false'
gsettings set 'org.gnome.desktop.peripherals.mouse' 'accel-profile' 'flat'
gsettings set 'org.gnome.desktop.peripherals.touchpad' 'tap-to-click' 'false'
gsettings set 'org.gnome.desktop.peripherals.touchpad' 'tap-and-drag' 'false'
gsettings set 'org.gnome.desktop.peripherals.touchpad' 'disable-while-typing' 'false'
gsettings set 'org.gnome.desktop.peripherals.touchpad' 'click-method' 'areas'
gsettings set 'org.gnome.desktop.interface' 'clock-show-date' 'true'
gsettings set 'org.gnome.desktop.interface' 'clock-show-weekday' 'true'

KeePassXC

Settings

  • General → [ ] Load previous databases on startup
  • Security → [x] Use DuckDuckGo service to download website icons

Add Database Password to GNOME Keyring

secret-tool store --label='KeePass' 'keepass' 'default'

lm_sensors

  • --auto can be used here, but if modules need to be added to /etc/modules, not using --auto will allow sensors to do it on-prompt
sudo sensors-detect
sudo -e '/etc/modules'

mpv

mkdir -p ~/'.config/mpv' && nano ~/'.config/mpv/mpv.conf'
profile=gpu-hq
scale=ewa_lanczossharp
cscale=ewa_lanczossharp
video-sync=display-resample
interpolation
tscale=oversample
hwdec=vaapi
hwdec-codecs=all

Laptop Power Management

Secure Shell

  • See Client notes to generate/restore public key

Uncomplicated Firewall

  • See ufw for more notes
sudo ufw reset && sudo ufw default deny && sudo ufw logging off && sudo ufw enable && sudo systemctl enable 'ufw'
sudo ufw allow 'ssh'

Drive Maintenance

Trim

sudo systemctl enable 'fstrim.timer' --now && sudo systemctl start 'fstrim' && sync && sudo systemctl status 'fstrim' -l

XFS Scrub

  • :!: This is only necessary if XFS is being used on any persistent drives such as a NAS, and requires xfsprogs to be installed
sudo apt install 'xfsprogs'
sudo systemctl enable 'xfs_scrub_all.timer' --now && sudo systemctl start 'xfs_scrub_all' && sync && sudo systemctl status 'xfs_scrub_all' -l

UTC

  • Set RTC to UTC
  • :!: Needed if Windows is installed first
  • :!: Windows should also be set to UTC
sudo timedatectl set-local-rtc '0'

Verify

timedatectl | grep local

Wine

Wayland

i915 HDMI

sudo apt install 'libdrm-tests' -y && sync
sudo -e '/etc/gdm3/PostLogin/Default' && sudo chmod +x '/etc/gdm3/PostLogin/Default' && sync
#!/usr/bin/bash
proptest -M 'i915' -D '/dev/dri/card'* '103' 'connector' '99' '1'
proptest -M 'i915' -D '/dev/dri/card'* '103' 'connector' '107' '4'

Xorg

Mozilla Firefox

  • See Firefox if old configuration is needed, otherwise use Firefox Sync

Tweaks

echo 'export MOZ_USE_XINPUT2=1' | sudo tee '/etc/profile.d/99-firefox-xinput2.sh' > '/dev/null' && cat '/etc/profile.d/99-firefox-xinput2.sh'
echo 'export MOZ_ENABLE_WAYLAND=1' | sudo tee '/etc/profile.d/99-firefox-wayland.sh' > '/dev/null' && cat '/etc/profile.d/99-firefox-wayland.sh'
sudo -e '/etc/profile.d/99-firefox-xinput2.sh'
sudo -e '/etc/profile.d/99-firefox-wayland.sh'

DNS over HTTPS

https://dns.google/dns-query

Server

  • For workstations that run servers as a secondary directive
  • For headless servers, use Ubuntu Server

Automatic Updates

Service

sudo -e '/etc/systemd/system/ubuntu-up.service'
[Service]
Type=oneshot
ExecStartPre='/usr/bin/apt' clean
ExecStart='/usr/bin/apt' update
ExecStart='/usr/bin/apt' full-upgrade -y
ExecStart='/usr/bin/apt' autoremove -y
ExecStartPost='/usr/bin/sync'
ExecStartPost='/usr/bin/systemctl' reboot

Timer

  • 03:00 Oak
sudo -e '/etc/systemd/system/ubuntu-up.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'ubuntu-up.timer' --now
[Unit]
Description=Software Package Maintenance and Updater
After=network-online.target
Wants=network-online.target

[Timer]
OnCalendar=*-*-* 03:00:00
Persistent=true

[Install]
WantedBy=timers.target

Notable Folders and Commands

3)
GNOME for several versions now makes the screen color too warm on Xorg
4)
there used to be notes here on disabling Wayland on the log-in screen with GDM config
/var/www/wiki/data/attic/distros/ubuntu_desktop.1685302719.txt.gz · Last modified: 2023/05/28 15:38 by Sean Rhone