Jump to content

User:Misterhaan/Mint 22.3

From auWiki

i use linux mint (formerly ubuntu cinnamon) as my main operating system on my laptop. since the laptop came with windows 10 (which i upgraded to windows 11), i keep that around so i can choose windows on startup when i need one of the manufacturer’s utilities. these instructions are what i did when i installed linux mint 22.3 on my laptop westinghouse.

choose language and keyboard, connect to wifi, and choose to install multimedia codecs. since this version is when i switched from ubuntu to mint, i had to chose "something else" for installation type because i don't want to keep ubuntu but i do want to keep windows (sort of). it shows a list of partitions, so i select the one already ext4 (everything else is windows and windows recovery) and click change. set to use as ext4, check to format, and mount point / (root). leave all the windows partitions untouched and double check the boot loader is sent to install to the drive itself not a partition, then click install now.

connections to other systems

most of what i use my laptop for is connecting to other systems, including my home file shares. i set those up first so i have access to my files and the ability to connect to my home desktop and work computer right away.

home server nfs shares

i have command-line ubuntu installed on a different computer at home that stores my files, so my laptop should mount its shares when i’m on my home network. i can’t just do a normal mount because if i travel with my laptop, my home server isn’t available and i have to wait for those connections to time out before it will finish booting. still, the first couple steps are the same as mounting the shares from a desktop:

  1. edit /etc/hosts as root with sudo xed /etc/hosts and add a line mapping the lan ip of the server to its name. follow the format of the line that has 127.0.0.1 localhost. saving this change makes sure the laptop can resolve the name of the server, which usually doesn’t work without this step.
  2. install nfs support with sudo apt install nfs-common
  3. edit /etc/fstab as root with sudo xed /etc/fstab and add a line for each nfs share to mount, in this format: server:/nfs_share /local/mount/point nfs noexec,noauto 0 0
  4. create the local mount points for each share (the second column in fstab) with a command like sudo mkdir /local/mount/point
  5. create a new file as root in /etc/NetworkManager/dispatcher.d/ and enter the following code (make sure to put in your ssid and your actual mount points), then set its permissions to rwxr-xr-x with chmod 755 /etc/NetworkManager/dispatcher.d/nfs-mount:
#!/bin/bash
SSID="your-wifi-ssid"
INTERFACE=$1
ACTION=$2
ESSID=`nmcli -t -f active,ssid dev wifi | egrep '^yes' | cut -d: -f2`

if [ "$SSID" == "$ESSID" ] && [ "$ACTION" == "up" ]; then
	mount /local/mount/point/one
	mount /local/mount/point/two
fi

the network shares should be mounted whenever connecting to the wifi SSID. the noauto in fstab tells the system not to attempt to mount those shares on startup, so it doesn’t have to wait for that to fail when they’re not available. the NetworkManager script makes sure to mount them once connected to the correct wifi, but if you’re going to connect to your network with a cable it won’t see the ssid and you’ll need to issue the mount commands manually.

change user id

mint uses 1000 as the id for the user it creates, but i have a different id on my server and they need to match up for nfs to know who i am. you can’t change your user id while you’re logged in, so i’ll create another admin account temporarily and use that. do that and set a password with the following:

sudo useradd -G adm,sudo -m -s /bin/bash tempadmin
sudo passwd tempadmin

now log out and you should be able to log back in as tempadmin with the password you just set, though it may be necessary to restart if it tells you your original user is in use by a process (which it’s been doing to me with this process for a few years now). run the following command to change your user id and update automounting:

sudo usermod -u [new_ID] [username]
sudo setfacl -m "u:[username]:r-x" /media/
sudo setfacl -x "u:1000" /media/

now we just need to get rid of tempadmin, so log out and log back in as your actual user. run sudo userdel tempadmin to go back to just one user. again, restart seems to be necessary as logging out doesn’t end all processes for the user.

remote control

mint doesn’t include a vnc or rdp client in the default install, so i install remmina to connect to my home desktop using vnc (i use x11vnc server on linux and tightvnc on windows 11 there) and connect to my work computer over rdp (which has windows 11 remote desktop connections enabled):

sudo apt install remmina

i create two connections for my home desktop — one that uses my lan ip and another that uses the subdomain i keep mapped to my internet ip. both use remmina vnc plugin for the protocol and specify [ip]:[port] or [subdomain]:[port] since i use a custom vnc port. username can be left blank, and user password can save my connection password. setting the password means if someone else got access to my laptop they could also access my desktop, so be sure to weigh the convenience against security for your situation.

i connect to my work computer over rdp, which i also do through remmina. create a new connection leaving the protocol on the default of RDP - Remote Desktop Protocol and set the server, username, password, and domain for the connection. switch to the advanced tab and change audio output mode to local to get both the speakers and microphone to work. toward the bottom, you might need to check the box to ignore certificate because when i installed this version it still wouldn’t trust my work computer’s certificate after it asked me about it and i said to trust it. save the connection. on the first connection (we’ll need to set up and connect to vpn first), it asks to accept a certificate for the machine.

in remmina preferences i turn off the setting that prevents screenshots from entering clipboard. then under applet, check the box to start in tray upon user login (if it’s not already checked). under keyboard i remove the host key since i commonly use the right control key for normal keyboard shortcuts, and i don’t really need to give up another key for remmina shortcuts i don’t remember anyway. under rdp, map the caps lock key to insert by entering 0x3a=0x52 for keyboard scancode remapping (needs to be done separately from mapping it locally because rdp doesn’t care about local mappings even when i check the box to use client keyboard mapping).

work vpn

my job provides cisco anyconnect vpn for me to connect remotely, but thankfully it’s compatible with openconnect which is *much* easier to use and integrates with the network manager built into mint. install openconnect with its network manager integration and its editor (cinnamon is the name of the desktop environment mint uses, and it’s based on gnome):

sudo apt install network-manager-openconnect-gnome

now go to the network icon in the panel (lower right, probably looks like wifi), click it, and choose "Network Connections." add a new connection using the plus button in the lower left of that window, and choose "Cisco AnyConnect or OpenConnect (OpenConnect)" from under the VPN heading. give it a name (i use the company name) and enter the vpn server as the gateway (something like vpn.example.com). the vpn protocol should already be set to "cisco anyconnect or openconnect" from the earlier choice. set user agent to "AnyConnect" so it won't give a 404 error trying to connect. i also needed to go to the ipv6 settings tab and disable it because otherwise my remote desktop connection fails. save the connection.

now, just under the list of available SSIDs in the network menu it will show "VPN Connections" with a toggle next to it. select this to connect. i have to click the login button in the window that pops up, then enter my work email, then my work password, then go to my phone and enter the number that shows on my laptop into the authenticator app, then verify my fingerprint. there was a time openconnect would save my username and password even while anyconnect didn’t, but unfortunately that time has passed. once it finishes connecting you should see the lock icon on your wifi. disconnect either by deselecting the vpn the same way you selected it to connect or by shutting down the laptop.

configuration

map caps lock key as insert

to remap capslock to insert for the entire machine, edit /usr/share/X11/xkb/symbols/pc as root, and set the key <CAPS> line to:

key <CAPS> {[  Insert  ]};

this takes effect on your next login. it doesn’t apply to rdp connections in remmina though, so be sure to also follow the instructions from earlier for mapping it there too.

disable malfunctioning touchscreen stylus

my laptop's touchscreen stylus input gets confused when my bluetooth mouse is in range, causing it to move the mouse and even click, making everything difficult. i don't even use the stylus, so simply disabling that input solves the issue. create /etc/X11/xorg.conf.d/99-disable-stylus.conf as root, and give it the following contents:

Section "InputClass"
    Identifier "Disable stylus"
    MatchProduct "PNP0C50:03 04F3:2BC9 Stylus"
    Option "Ignore" "true"
EndSection

it should be resolved after the next boot, or maybe login.

system settings

access system settings from the panel menu. they’re grouped into sections so i’m using those same groupings here. if i don’t list a settings option it’s because i don’t actually change anything in that one.

appearance

background

default background files are /usr/share/backgrounds/, so that’s where i put my own backgrounds. make a subdirectory if you want to rotate through backgrounds. this isn’t enough to make them automatically show in settings > background though, so use the add button (bottom left) to get that directory added, then select it and a background. you can enable background slideshow by going to settings, which will rotate through everything in the directory.

effects

i have all the effects turned on, and set new windows and close windows to fly while leaving minimize traditional.

themes

click the advanced settings button, then choose Mint-Y-Dark for applications, or pick a different color if you prefer. i keep icons at Mint-Y-Sand and set desktop to Mint-Y-Dark-Sand for the color of file folders i'm used to. under settings i set dark mode to prefer dark mode and turn on icons for menus and buttons.

for any applications on qt (such as puddletag), they’re on their own theme. to get a dark theme, edit /etc/environment as root and add the following line (depends on installing adwaita-qt, which is in the install software section):

QT_STYLE_OVERRIDE=adwaita-dark

preferences

account details

similar to background files, avatars go in /usr/share/cinnamon/faces/. adding your own avatars here makes them show in the list, most likely toward the bottom since the defaults mostly start with numbers. click the user picture and select your preferred avatar. choose browse for more pictures if it doesn't show.

applets

configure calendar to set custom date format to %-l:%M %p %a %b %-e to take up less space and use 12-hour time. similarly set date format for tooltip to %A, %B %-e, %-l:%M %p to use 12-hour time. select corner bar and click the minus button at the bottom to remove it. configure menu to use a custom icon and label, then set icon to linuxmint-logo-ring to get the green color. also turn on menu animations.

date & time

turn off 24 hour clock.

desktop

turn off all the desktop icons.

hardware

mouse and touchpad

under touchpad, i turn off reverse scrolling direction so that two-finger touchpad scroll works like moving the scroll bar not moving the content.

power management

change power button behavior to nothing. my laptop's power button is placed where i can very easily hit it by accident when picking it up so i prefer that it ignores when that happens.

sound

one of the reasons i prefer linux on my laptop is the over-amplification setting. turn on overamplification at the bottom of the output tab, which is often handy running off built-in speakers.

administration

login window

i like to use my own background for the login screen. set that here and then turn off draw user background to have a login background all the time. set the themes here the same as the themes i picked in themes. under settings, change clock format to %l:%M %p for 12-hour format.

remove software

sudo apt purge drawing hypnotix mintbackup mintchat mintwelcome rhythmbox simple-scan sticky thunderbird warpinator xreader
sudo apt autoremove --purge

install software

here's some software i find useful to add:

sudo apt install adwaita-qt audacity evince gimp git handbrake jpegoptim libheif-examples pngquant prismlauncher puddletag rsgain steam xsane

firefox

touch scroll zoom

while the touch screen makes most windows scroll, firefox selects text by default. to make a lasting change edit /etc/security/pam_env.conf and add a line (i add it to the end) with MOZ_USE_XINPUT2 DEFAULT=0 OVERRIDE=1. this should take effect on next login.

steam

even though steam was in the list of software to install, it only installs an "install steam" item in the menu, so run that to actually install steam. once you sign in, go to settings. under interface, change startup location to library since ideally you play games more often than you buy games, and turn off notify me about additions or changes to my games, etc. steam play should be enabled for everything by default, meaning steam will try to give you a useful default configuration to run windows-only games on linux.

visual studio code

visual studio code isn’t in the default apt repositories, but downloading and installing the deb actually adds it to apt so it can keep updating. note the filename will probably change to whichever version is current, so for the last two lines press the tab key to autocomplete after you’ve typed “code”:

wget 'https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64' --trust-server-names
sudo dpkg -i code_1.141.1-1791833136_amd64.deb
rm code_1.141.1-1791833136_amd64.deb

most of my code is on github, and while visual studio code comes with git support, it depends on git being available and that's not in the default ubuntu install:

sudo apt install git


the first launch of vs code asks me to sign in, so i sign in with my github account.

zoom

the official way to install zoom is to download the deb and install that, but it won’t auto-update and i end up having to manually update before every time i use it. instead, set up a custom archive that will update itself with everything else. copy this into a script file (run chmod +x install-zoom assuming you’ve saved it as install-zoom) and run it:

#!/usr/bin/env bash

url=https://zoom.us/client/latest/zoom_amd64.deb
debdir=/usr/local/zoomdebs
aptconf=/etc/apt/apt.conf.d/100update_zoom
sourcelist=/etc/apt/sources.list.d/zoomdebs.list

sudo mkdir -p $debdir
( echo 'APT::Update::Pre-Invoke {"cd '$debdir' && wget -qN '$url' && apt-ftparchive packages . > Packages && apt-ftparchive release . > Release";};' | sudo tee $aptconf
  echo 'deb [trusted=yes lang=none] file:'$debdir' ./' | sudo tee $sourcelist
) >/dev/null

sudo apt update
sudo apt install zoom

after running the script you can delete it.

zoom has a couple weird defaults, so launch it and go to settings (bottom left). on the general tab, change color mode from light to system setting, and exit preference to close the window to exit zoom.