Skip to content

Instantly share code, notes, and snippets.

@maltesa
maltesa / CustomImage.tsx
Last active July 18, 2022 16:16
Custom Image component using images.weserv.nl
/* eslint-disable jsx-a11y/alt-text */
/* eslint-disable @next/next/no-img-element */
import type { DetailedHTMLProps, ImgHTMLAttributes } from 'react'
interface OptimizationOptions {
width: number
height?: number
dpr?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8
format?: 'png' | 'jpg' | 'webp'
}
@maltesa
maltesa / set-waybind-kbd.sh
Created March 10, 2021 09:33
Activate last keyboard for waybind
#!/bin/bash
# Grep last keyboard (should be internal if no external is connected, and external if external is connected)
target=`cat /proc/bus/input/devices | grep "kbd leds event" | tail -1 | grep -Eo "event[0-9]+"`
echo "Activating Waybind for keyboard ($target)...";
sed -i -r "s|/dev/input/event[0-9]+|/dev/input/${target}|g" /etc/waybind/config.yml
echo "Reloading waybind..."
if systemctl restart waybind.service; then
echo "Done";