Little hacks I found useful and may need to refer to again later, cos it’s all so easy to forget. Raspberry Pi stuff is in its own page.
Invert Screen Colors
(to overcome dark mode madness)
sudo apt-get install xcalib then use
xcalib -i -a
Add keyboard shortcut:
Menu: open keyboard > shortcuts > custom shortcuts. Add a new shortcut (with the “+” button). The command should be “xcalib -i -a” or “/usr/bin/xcalib -i -a
DigitalOcean has a good description of why.
Set the automatic TRIM job to daily
sudo mkdir -v /etc/systemd/system/fstrim.timer.d sudo touch /etc/systemd/system/fstrim.timer.d/override.conf nano admin:///etc/systemd/system/fstrim.timer.d/override.conf
Then reboot, and to check, use
systemctl cat fstrim.timer
Confirm that you’ve successfully edited trim’s configuration by executing this terminal command:
systemctl cat fstrim.timer
Your output should look approximately like this:
# /lib/systemd/system/fstrim.timer [Unit] Description=Discard unused blocks once a week Documentation=man:fstrim ConditionVirtualization=!container [Timer] OnCalendar=weekly AccuracySec=1h Persistent=true [Install] WantedBy=timers.target # /etc/systemd/system/fstrim.timer.d/override.conf [Timer] OnCalendar= OnCalendar=daily
Let’s take a closer look at this output. The first part shows the default setting (weekly), the second part shows the overriding setting that you’ve applied. That overriding setting contains two elements: first the existing OnCalendar setting (weekly) is being deleted by specifying nothing after the = sign, and then a new OnCalendar setting is being applied (daily).
If you ever want to check whether fstrim has actually happened, and when it happened, you can use this terminal command:
journalctl | grep fstrim.service
Want to undo? Remove the last 4 lines (the override.conf bit)
Limit swappiness to reduce writes
Decreasing the swappiness to a more reasonable level, namely 25:
check your current swappiness setting.
The result will probably be 60.
sudo nano /etc/sysctl.conf
At the very end of the existing text:
Save the file and close, then reboot.
To reduce th enumber of writes. Has its own page.
Linux Mint change notifications duration
The hard-coded values are near the start of the file and look like this. Time is in seconds.
var NOTIFICATION_TIMEOUT = 4; var NOTIFICATION_CRITICAL_TIMEOUT_WITH_APPLET = 10;
NOTIFICATION_TIMEOUT is the default timeout
NOTIFICATION_CRITICAL_TIMEOUT_WITH_APPLET is used if the notification is flagged by the sending app as CRITICAL and the notification applet is present. If the applet is absent critical notifications won’t timeout.
So if you wanted to tweak
Make a back up
sudo cp /usr/share/cinnamon/js/ui/messageTray.js /usr/share/cinnamon/js/ui/messageTray.js.original
Open the file with elevated privileges
Once tweaked and saved restart Cinnamon with Ctrl-Alt-Esc
Remove lock screen and logout from Cinnamon menu
- Make a local copy of the menu applet:
cp -r /firstname.lastname@example.org ~/.local/share/cinnamon/applets
- open the original:
- // comment out everything in
//Logout buttonall the way down to the next //
- Save the file and close the text editor.
- Restart Cinnamon with Ctrl-Alt-Esc.
Disable window snapping
gsettings get org.cinnamon.muffin edge-tiling
- this lists the current setting, which stubbornly stayed stuck on “true”. But type:
gsettings set org.cinnamon.muffin edge-tiling false
and the accursed tiling and snapping is gone !
Without the flatpak crap.
Instructions for linux here.
Flush DNS cache
andy@HP3:~$ sudo resolvectl flush-caches
should work. If not try
sudo systemd-resolve --flush-caches
$ sudo systemd-resolve --statistics or $ sudo resolvectl statistics
use statistics before and after to compare, shoul be zeroed after flush.