Skip to content

Instantly share code, notes, and snippets.

View lheimbs's full-sized avatar

Lennart Heimbs lheimbs

  • Nürnberg
View GitHub Profile
@lheimbs
lheimbs / kitty-touch-scroll
Created April 3, 2026 08:57
Quick and dirty python script to translate touch scroll events from a touchscreen into kitty mouse-wheel scrolling
#!/usr/bin/env -S uv run --script
#
# /// script
# requires-python = ">=3.12"
# dependencies = ["evdev"]
# ///
import evdev
import evdev.uinput
import subprocess
@lheimbs
lheimbs / i3wsmove.py
Last active February 16, 2021 14:46
Script to ease workspace switching in i3 (used in my case together with touchegg to control my tablet)
#!/usr/bin/env python3
import re
import sys
import time
import argparse
import i3ipc
i3 = i3ipc.Connection()
def arguments():
@lheimbs
lheimbs / moving-rpi-harddrives.md
Last active February 26, 2020 14:17
Move from one Raspberry Pi Harddrive (or USB Stick) to another (possibly smaller) drive

While using a Raspberry Pi (3 in this case) with Raspbian on a Harddrive (using a dedicated SATA expansioncard) I recently needed to downgrade to a smaller SSD. Here are my steps:

  1. Make a backup of the original harddrive
  2. Using gparted or sth. similar to resize the root partition as small as possibe; at least to the size of the smaller drive
  3. Write a VANILLA Raspbian on the new drive. This creates a usable boot partition.
  4. Add program_usb_boot_mode=1 parameter to config.txt on boot partition more here
  5. Boot the RPi with the new drive connected and an SD-Card inserted.
  6. Boot the RPi only with the new drive.
  7. Write the root partition from the old drive on the new drive, overwriting the previously created root partition on the new drive.