Skip to content
Code Inside Out

Customize Linux Mint

Tags: linux

Apply personal settings. Install useful applications. Make Linux Mint run faster.

System Settings


Open the Settings app and change below options:

  • Effects

    • Animation: OFF
  • Accessibility

    • Large text: ON
  • Date and Time

    • Region: Asia, City: Ho Chi Minh
    • First day of week: Monday
  • Desktop

    • Desktop Icons: All icons are ON
  • General

    • Disable compositing for full-screen windows: ON
  • Notifications

    • Remove notification after their timeout: ON
  • Preferred applications

    • Removable media
      • Prompt of start program on media insertion: OFF
  • Privacy

    • Remember recently accessed files: OFF
  • Screen saver

    • Customize
      • General: All items are OFF
  • Startup Apps

    • Mint Welcome: OFF
    • Print Queue: OFF
    • System Reports: OFF
    • Update Manager: OFF
  • Window Titling

    • Maximize, instead of tile, when dragging a window to the top edge: ON
  • Bluetooth:

    • Device: OFF
  • Display

    • Refresh rate: 60 Hz for the main monitor
    • Refresh rate: 30 Hz for the plugged-in monitor
  • Power Manager

    • Turn off screen when inactive for: 5 mins
    • Suspend when inactive for: 30 mins (on Battery)
    • Brightness when inactive: 5%
    • Dim screen after inactive for: 30 secs
  • Sound

    • Output: Muted (when no Headset)
    • Input: Muted (when no Headset)
  • Users and Groups

    • Groups: add to dailout, plugdev, tty

System Tweaks


For better performance and daily convenient.

Filesystem Table

Apply options: No Access Timestamp, Delayed Disk Commit, Temporary File System:

sudo nano /etc/fstab
UUID=xxxx / ext4 errors=remount-ro,noatime,commit=600 0 1
UUID=xxxx /boot/efi vfat umask=0077 0 1
tmpfs /tmp tmpfs noatime 0 0
/swapfile none swap sw 0 0

System Control

Keep cache in memory, and delay disk write:

sudo nano /etc/sysctl.conf
vm.swappiness = 1
vm.vfs_cache_pressure = 10
vm.dirty_writeback_centisecs = 60000

Start-up

Do not wait for network connection:

sudo systemctl disable NetworkManager-wait-online.service

APT

No need to download translation:

sudo nano /etc/apt/apt.conf.d/00aptitude
Acquire::Languages "none";

SSD TRIM

Run TRIM daily:

sudo mkdir -pv /etc/systemd/system/fstrim.timer.d
sudo nano /etc/systemd/system/fstrim.timer.d/override.conf
[Timer]
OnCalendar=
OnCalendar=daily

Performance mode

Get current mode:

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

Set Performance mode:

sudo echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

Permanent set:

/lib/systemd/set-cpufreq
case $governors in
*performance*)
GOVERNOR="performance"
break
;;
sudo echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

NTFS3

Linux Mint 22 comes with Kernel 6.8 which is known with NTFS issue. To fix it, disable NTFS3 module:

echo 'blacklist ntfs3' | sudo tee /etc/modprobe.d/disable-ntfs3.conf

Restart, then open DiskRepair Filesystem. NTFS Disks will be mounted using fuseblk type.

Scripts

In $HOME, add below scripts:

set_performance.sh
#!/usr/bin/bash
sudo echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
drop_caches.sh
#!/usr/bin/bash
sudo sync
sudo bash -c "echo 1 > /proc/sys/vm/drop_caches"
mouse_wiggle.sh
#!/usr/bin/bash
while [ true ]; do
xdotool mousemove_relative --sync -- 0 50
sleep 10s
xdotool mousemove_relative --sync -- 0 -50
sleep 10s
done
remove_recent_files.sh
#!/usr/bin/bash
sudo rm /root/.local/share/recently-used.xbel
sudo rm ~/.local/share/recently-used.xbel

Software Sources

System Packages

  • Multimedia Codecs: mint-meta-codecs
  • Nvidia GPU: nvidia-driver-550 (550.120-0ubuntu0.24.04.1)

Applications


Add feature, tools, and applications.

Packages

Build tools:

sudo apt install wget curl git build-essential make cmake gawk
git config --global user.name "vuquangtrong"
git config --global user.email "vuquangtrong@gmail.com"

Python:

sudo apt install python3-dev python3-pip python3-setuptools python3-wheel python3-venv

Utilities:

sudo apt install nvtop htop
sudo apt install tmux
echo "set -g mouse on" > ~/.tmux.conf
sudo apt install fonts-firacode

Some packages or applications depend on old libncurses5, but it is not available on new linux releases, so download below packages and install them manually:

wget http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.4-2_amd64.deb && sudo dpkg -i libtinfo5_6.4-2_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.4-2_amd64.deb && sudo dpkg -i libncurses5_6.4-2_amd64.deb

Terminal

Change General options:

  • Show menu bar: No
  • Enable mnemonics: No
  • Enable F10: No
  • Background color: #121212

Starship

Informative shell prompt:

cd ~
sudo apt install curl
curl -sS https://starship.rs/install.sh | sh
echo '[ "$STARSHIP_DISABLE" = "true" ] || eval "$(starship init bash)"' >> ~/.bashrc
starship preset plain-text-symbols -o ~/.config/starship.toml

To temporary disable Starship:

STARSHIP_DISABLE=true bash

Ble.sh

Bash line autocompletion:

cd ~
sudo apt install git make gawk
git clone --recursive --depth 1 --shallow-submodules https://github.com/akinomyoga/ble.sh.git
make -C ble.sh install PREFIX=~/.local
echo 'source ~/.local/share/blesh/ble.sh' >> ~/.bashrc

Configuration:

~/.blerc
ble-face -s command_builtin_dot bold,fg=red
ble-face -s command_builtin bold,fg=red
ble-face -s command_alias bold,fg=teal
ble-face -s command_function bold,fg=99 # bold,fg=133
ble-face -s command_file bold,fg=green
ble-face -s command_keyword bold,fg=blue
ble-face -s command_jobs bold,fg=red
ble-face -s command_directory bold,fg=63
ble-face -s command_suffix bold,fg=231,bg=28
ble-face -s command_suffix_new bold,fg=231,bg=124

XDoTool

Manipulate Mouse and Keys:

sudo apt install xdotool

Tree

Show the tree of a directory:

sudo apt install tree

IBus Input Method Engine

IME for Vietnamese:

sudo apt install ibus ibus-unikey

IBus Preference:

  • Keyboard shortcut: Ctrl+Shift+Space
  • Options:
    • Embed pre-edit text in application window: Unchecked (Zalo Web is incompatible with embedded text input)

Nemo

File Explorer.

  • Bookmarks:

    • /tmp
    • /home/trongvq/workspace
  • Actions in .local/share/nemo/actions:

    mdx.nemo_action
    [Nemo Action]
    Name=Open in Text Editor
    Comment=Open in Text Editor
    Exec=xed %F
    Icon-Name=text-editor
    Selection=mdx
    Extensions=mdx;
    vscode.nemo_action
    [Nemo Action]
    Name=Open in VS Code
    Comment=Open in VS Code
    Exec=code %F
    Icon-Name=visual-studio-code
    Selection=Any
    Extensions=dir;

Themes

Remove some heavy themes:

sudo apt remove papirus-icon-theme
sudo apt remove yaru-theme-icon

Firefox

  • Goto about:config, then:

    • Disable Session Store:
      • change browser.sessionstore.interval to 1800000
      • change browser.sessionstore.interval.idle to 1800000
    • Move Network cache to RAM:
      • change browser.cache.memory.enable to true
      • change browser.cache.memory.capacity to 1048576 (for 1 GB)
      • change browser.cache.memory.max_entry_size to 1048576 ( for 1 KB)
    • Others:
      • change browser.urlbar.suggest.trending to false
      • change browser.search.region to US
  • Goto about:preferences, then:

    • Privacy:
      • DNS over HTTPS: Max Protection
    • Google search language: English
  • Extensions:

    • uBlock Origin
      • Allow in Private mode

Visual Studio Code

Download and install .deb file:

sudo dpkg -i code_*_amd64.deb

Sync with GitHub account.

  • Settings:

    ~/.config/Code/User/settings.json
    {
    "security.workspace.trust.enabled": false,
    "window.restoreWindows": "none",
    "workbench.startupEditor": "none",
    "editor.minimap.enabled": false,
    "editor.minimap.autohide": true,
    "editor.mouseWheelZoom": true,
    "editor.fontFamily": "'Fira Code', 'Droid Sans Mono', 'monospace', monospace",
    "editor.fontLigatures": true,
    "editor.rulers": [
    80,
    ],
    "editor.tabSize": 4,
    "diffEditor.ignoreTrimWhitespace": false,
    "files.associations": {
    "*.mdx": "markdown"
    },
    "files.trimTrailingWhitespace": true,
    "diffEditor.hideUnchangedRegions.enabled": true,
    "C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }",
    "hediet.vscode-drawio.simpleLabels": true,
    "hediet.vscode-drawio.theme": "Kennedy",
    }
  • Key bindings:

    ~/.config/Code/User/keybindings.json
    [
    {
    "key": "ctrl+j",
    "command": "-workbench.action.togglePanel"
    },
    {
    "key": "ctrl+k 1",
    "command": "editor.action.insertSnippet"
    }
    ]
  • Snippets:

    ~/.config/Code/User/snippets/markdown.json
    {
    "bash command" : {
    "prefix": "bash",
    "body": [
    "``` bash frame=\"none\"",
    "$0",
    "```"
    ]
    }
    }
  • Tips:

    • Quickly remove all extensions:

      code --list-extensions | while read extension;
      do
      code --uninstall-extension $extension --force
      done

      or

      code --list-extensions | xargs -L 1 code --uninstall-extension

ImHex

A HEX editor with structural parser:

sudo apt install libglfw3 libmbedtls14t64 libmbedx509-1t64
sudo dpkg -i imhex-*-x86_64.deb

ImHex Options:

  • constantly 60 fps refresh rate → change to 15 fps
  • Change Font to DejaVu Sans Mono, Size to 20

Serial Terminal

To work with Serial ports:

Minicom

Small but having enough features:

sudo apt install minicom

Tio

More cool features:

Download source code:

sudo apt install meson libglib2.0-dev liblua5.2-dev
git https://github.com/tio/tio
cd tio

Compile and install:

meson setup build
meson compile -C build
meson install -C build

Meld

Directory and File Comparison

sudo apt install meld

Image Tools

Install imagemagick package:

sudo apt install imagemagick

Trim blank border with -fuzz option:

for f in *.png; do convert $f -fuzz 10% -trim ${f%.*}.png; done

Resize image, prefer width and keep ratio:

convert <input> -resize <width>x<height> <output>

Install webp package which contain dwebp and cwebp tool:

sudo apt install webp

Convert all png to webp:

for f in *.png; do cwebp -q 85 -mt $f -o ${f%.*}.webp; done

Convert all webp to png:

for f in *.webp; do dwebp $f -o ${f%.*}.png; done

System Backup


Backup system to image for later restore.

Prepare

Clean up unused packages and cache:

sudo apt autoremove
sudo apt autoclean
sudo apt autopurge
sudo apt clean

Clean VS Code’s cache:

sudo rm -rf /home/trongvq/.config/Code/Cache*/

Timeshift

Options:

  • RSYNC
  • Weekly
  • Include/Exclude:
    "/etc/timeshift/timeshift.json
    "exclude" : [
    "/var/lib/apt/lists",
    "/var/log/journal",
    "/home/*/.platformio/.cache",
    "/home/*/.nvm/.cache",
    "/home/*/.npm",
    "/home/*/.mozilla/firefox/Crash Reports",
    "/home/*/.config/Code/Cache",
    "/home/*/.config/Code/CachedData",
    "/home/*/.config/Code/CachedExtensionVSIXs",
    "/home/*/.config/Code/Crashpad",
    "/home/*/.config/Code/logs",
    "/home/*/.bash_history",
    "/home/*/.xsession-errors",
    "/home/*/.xsession-errors.old",
    "+ /home/trongvq/.**",
    "/root/.bash_history",
    "/root/**"
    ],

Advanced Tweaks


Add User to Sudoers

Add current user to sudoers group, and do not ask for password:

sudo bash -c "echo '$USER ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/$USER"

Use Compressed Swap

The kernel feature called zswap provides a compressed RAM cache for swap pages. By default, zswap is switched off, and if enabled, it uses up to 20 percent of the RAM memory.

Turning on zswap causes CPU to take effort to compress/ decompress the data blocks, and a chunk of RAM is sacrificed for compressed data.

To turn on zswap, follow the below steps:

  1. Include z3fold to initramfs:

    /etc/initramfs-tools/modules
    z3fold
  2. Add zswap params to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub:

    /etc/default/grub
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash zswap.enabled=1 zswap.zpool=z3fold zswap.compressor=lz4"
  3. Update GRUB:

    sudo update-grub
  4. Update InitRamFs:

    sudo update-initramfs -u

Disable WiFi Power Management

A way to speed up wireless internet connection by disabling power management for the WiFi chipset.

Run iwconfig to see if Power Management is on.

Then change the wifi.powersave value to 2 (off).

sudo sed -i 's/3/2/' /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
/etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
[connection]
wifi.powersave = 2

Speed up Intel Wireless chipset

Modern Intel wireless chipset runs on the iwlwifi driver. By turning on Tx AMPDU, transmission speed is increased.

Run lsmod | grep iwlwifi to see if iwlwifi is actually in use.

Then change the setting for 11n_disable value to 8 (it is bitmap options, not totally disabling 11n):

echo "options iwlwifi 11n_disable=8" | sudo tee /etc/modprobe.d/iwlwifi-speed.conf

Disable Journal feature of Disk

A journaling file system is a file system that keeps track of changes not yet committed to the file system. In the event of a system crash or power failure, such file systems can be brought back online more quickly with a lower likelihood of becoming corrupted.

Only disable journal feature on a separated disk which contains only build source code and data. The commit option of mount points in /etc/fstab will not work when journal feature is disabled.

To disable journal feature:

  1. Boot into Recovery Mode from GRUB menu

  2. Access to root command line session.

  3. Trigger the emergency event, make system partition is re-mounted as Ready-Only:

    echo "u" > /proc/sysrq-trigger
  4. Turn off the journal feature on the target disk:

    tune2fs -O ^has_journal /dev/<partition>
  5. Verify the change:

    debugfs -R features /dev/<partition>

If working on a data storage, do not need to go to Recovery mode. Just unmount the disk and use above tools with sudo.

Turn Off CPU Mitigation

Patching CPU vulnerabilities had the side effect of a huge performance impact. These CPU mitigations are enabled by default on all Linux distributions. Run lscpu to see details.

This Linux parameter allows booting the system with software-controlled CPU security mitigations by adding mitigations=off to the option GRUB_CMDLINE_LINUX in /etc/default/grub.