Skip to content

Instantly share code, notes, and snippets.

laineantti /
Last active Sep 16, 2021
Disable trackpoint horizontal scrolling in Linux (Modify for your specific purposes! This is for my Lenovo Thinkpad t470s with Arch, KDE Plasma, Xorg and libinput).

Disable mouses horizontal scrolling

  • in KDE you can do that for touchpad
  • for trackpoint you must add this to file /usr/share/X11/xorg.conf.d/40-libinput.conf
Section "InputClass"
        Identifier      "Trackpoint Wheel Emulation"
        MatchProduct    "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard wit>
        MatchDevicePath "/dev/input/event*"
        Option "HorizontalScrolling" "False"
laineantti /
Last active Sep 16, 2021
Auto shutdown with KDE Plasma + Arch

Auto shutdown with KDE Plasma + Arch.

This way of shutdown will properly end GUI applications (NOT wrongly HUPs or TERMs them) and will save the KDE session.

  1. sudo pacman -S kcron && sudo nano ~/ && sudo chmod +x ~/
  2. Add it to KDE's Task Scheduler (or cron) as new task
laineantti / noip2.service
Last active Jun 16, 2021 — forked from NathanGiesbrecht/noip2.service
Systemd Service file for dynamic ip updater (changed ExecStart location for ArchLinux)
View noip2.service
# Simple Dynamic DNS Updater
# By Nathan Giesbrecht (
# 1) Install binary as described in's source file (assuming results in /usr/local/bin)
# 2) Run sudo /usr/local/bin/noip2 -C to generate configuration file
# 3) Copy this file noip2.service to /etc/systemd/system/
# 4) Execute `sudo systemctl daemon-reload`
# 5) Execute `sudo systemctl enable noip2`
# 6) Execute `sudo systemctl start noip2`
laineantti /
Last active May 28, 2021
Script to bulk rename multiple files in import folder to randomized name to export folder.
# Create this script and two folders "import" and "export"
# at the same location. Copy files that you want to rename
# to "import" folder. Then run the script in main folder.
cd import
for f in *; do
cp $f ../export/$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)."${f##*.}"
laineantti /
Last active Sep 16, 2021
One Netbook One Mix 2s Yoga - Arch installation

Boot Arch ISO

Rotate screen (this has been fixed for latest systemd version)

echo 1 > /sys/class/graphics/fbcon/rotate_all

Add permanent rotating and font size

fbcon=rotate:1 fbcon=font:TER16x32 as kernel parameters to systemd-boot or grub

Install auto rotate stuff

yay -S iio-sensor-proxy-git kded-rotation-git detect-tablet-mode-git

Touch gestures

yay -S touchegg && sudo systemctl enable touchegg.service

laineantti /
Last active Dec 2, 2019
Linux - Associate file or URL with application
  1. Find the name of the desktop file of the program you want to associate file or URL. Let's suppose the program is qBittorrent. It (like usual) has its desktop file in /usr/share/applications/ and in fact, by perusing the listing of the directory.
  2. It's possible the desktop file is messed up. So you can check that /usr/share/applications/org.qbittorrent.qBittorrent.desktop contains the lines:
Exec=qbittorrent %U
[some lines omitted]

Note the %U in the Exec line. It's absolutely necessary. The MimeType line should look as above.



Pulseaudio keeps changing default output device

Edit /etc/pulse/ and comment out these lines:

load-module module-switch-on-port-available
load-module module-switch-on-connect
laineantti /
Last active Nov 11, 2019
Instantaneous wakeups from suspend / sleep
View create_new_efi_partition
- Boot the computer using the Windows 7/8/8.1/10 installation media.
- On the first screen, press SHIFT+F10 to bring up the command prompt.
- Run the following commands at the command prompt.
list disk
select disk # Note: Select the disk where you want to add the EFI System partition.
list partition
select partition # Note: Select the Windows OS partition (# number) or your data partition.
shrink desired=100