Skip to content

Instantly share code, notes, and snippets.

@laineantti
laineantti / README.md
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).
View README.md

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"
EndSection
@laineantti
laineantti / .README.md
Last active Sep 16, 2021
Auto shutdown with KDE Plasma + Arch
View .README.md

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 ~/.shutdown-kde.sh && sudo chmod +x ~/.shutdown-kde.sh
  2. Add it to KDE's Task Scheduler (or cron) as new task
@laineantti
laineantti / noip2.service
Last active Jun 16, 2021 — forked from NathanGiesbrecht/noip2.service
Systemd Service file for no-ip.com dynamic ip updater (changed ExecStart location for ArchLinux)
View noip2.service
# Simple No-ip.com Dynamic DNS Updater
#
# By Nathan Giesbrecht (http://nathangiesbrecht.com)
#
# 1) Install binary as described in no-ip.com'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
laineantti / files2random.sh
Last active May 28, 2021
Script to bulk rename multiple files in import folder to randomized name to export folder.
View files2random.sh
#!/bin/bash
# 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##*.}"
done
@laineantti
laineantti / OneNetbookOneMix2sYogaArchInstallation.md
Last active Sep 16, 2021
One Netbook One Mix 2s Yoga - Arch installation
View OneNetbookOneMix2sYogaArchInstallation.md

Boot Arch ISO

https://archlinux.org/download/

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
laineantti / Associate_file_or_URL_with_application.md
Last active Dec 2, 2019
Linux - Associate file or URL with application
View Associate_file_or_URL_with_application.md
  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]
MimeType=application/x-bittorrent;x-scheme-handler/magnet;

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

View audio.md

Linux

Pulseaudio keeps changing default output device

Edit /etc/pulse/default.pa and comment out these lines:

load-module module-switch-on-port-available
...
load-module module-switch-on-connect
@laineantti
laineantti / suspend.md
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.
diskpart
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