Skip to content

Instantly share code, notes, and snippets.

@Nervengift
Nervengift / 50-wacom.conf
Last active May 1, 2019 17:03
Enable native libinput gestures for wacom displays (tested with Thinkpad X230t). Copy to /etc/X11/xorg.conf.d/50-wacom.conf
Section "InputClass"
Identifier "Wacom touch options"
MatchDriver "wacom"
MatchProduct "Finger"
Option "Gesture" "off"
EndSection
@Nervengift
Nervengift / 30-touchpad.conf
Created May 1, 2019 17:09
/etc/X11/xorg.conf.d/30-touchpad.conf
Section "InputClass"
Identifier "touchpad"
Driver "libinput"
MatchIsTouchpad "on"
Option "NaturalScrolling" "true"
Option "ClickMethod" "clickfinger"
Option "Tapping" "on"
EndSection
@Nervengift
Nervengift / ice-status.sh
Last active December 5, 2021 20:16
statusline for German high speed trains (ICE)
#!/bin/bash
set -e
tripInfo=$(curl -s https://iceportal.de/api1/rs/tripInfo/trip|jq '.trip')
status=$(curl -s https://iceportal.de/api1/rs/status)
next=$(echo $tripInfo|jq '.stopInfo.actualNext as $next|.stops[]|select(.station.evaNr == $next)')
if [ -z "$next" ]; then
echo "Endstation"
exit 0
fi
@Nervengift
Nervengift / rofi-pulse-sink.sh
Last active August 10, 2022 08:30
Choose pulseaudio sink via rofi/dmenu
#!/usr/bin/bash
# choose pulseaudio sink via rofi or dmenu
# changes default sink and moves all streams to that sink
sink=$(ponymix -t sink list|awk '/^sink/ {s=$1" "$2;getline;gsub(/^ +/,"",$0);print s" "$0}'|rofi -dmenu -p 'pulseaudio sink:' -location 6 -width 100|grep -Po '[0-9]+(?=:)') &&
# alternate version using dmenu:
# sink=$(ponymix -t sink list|awk '/^sink/ {s=$1" "$2;getline;gsub(/^ +/,"",$0);print s" "$0}'|dmenu -p 'pulseaudio sink:'|grep -Po '[0-9]+(?=:)') &&
ponymix set-default -d $sink &&
for input in $(ponymix list -t sink-input|grep -Po '[0-9]+(?=:)');do
@Nervengift
Nervengift / i3_focus_next
Last active January 20, 2023 19:05
focus next window in i3 (like Alt+Tab in other WMs)
#!/bin/bash
# ================================================================================== #
# Focus the next window on the current workspace in i3, e.g. for binding to Alt+Tab #
# Depends: jq, awk, i3wm (obviously) #
# Author: Nervengift <dev@nerven.gift> #
# License: Don't think this deserves a license, Public Domain #
# Known bugs: doesn't work with non-window container focused #
# ================================================================================== #
ws=$(i3-msg -t get_workspaces|jq "map(select(.focused))[]|.name")
@Nervengift
Nervengift / pandoc-md
Last active March 9, 2023 14:20
Automatically build markdown file on change using pandoc
function pandoc-md {
while true ;do
inotifywait -e modify $1 2>/dev/null
date
pandoc $1 -V geometry:margin=2cm -o $1.pdf
done
}