Skip to content

Instantly share code, notes, and snippets.

View odkr's full-sized avatar

Odin Kroeger odkr

View GitHub Profile
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
set $term exec ghostty
set $menu exec fuzzel
00:00:00.000 [INFO] [sway/main.c:321] swayfx version 0.5.2 (based on sway version 1.10.1)
00:00:00.000 [INFO] [sway/main.c:322] wlroots version 0.19.0
00:00:00.000 [INFO] [sway/main.c:323] scenefx version 0.4.1
00:00:00.001 [INFO] [sway/main.c:78] Linux nb 6.12.34_1 #1 SMP PREEMPT_DYNAMIC Sat Jun 21 02:19:00 UTC 2025 x86_64 GNU/Linux
00:00:00.001 [INFO] [sway/main.c:94] Contents of /etc/os-release:
00:00:00.001 [INFO] [sway/main.c:78] NAME="Void"
00:00:00.001 [INFO] [sway/main.c:78] ID="void"
00:00:00.001 [INFO] [sway/main.c:78] PRETTY_NAME="Void Linux"
00:00:00.001 [INFO] [sway/main.c:78] HOME_URL="https://voidlinux.org/"
00:00:00.001 [INFO] [sway/main.c:78] DOCUMENTATION_URL="https://docs.voidlinux.org/"
@odkr
odkr / path_normalise.c
Last active November 11, 2022 16:38
Remove dots (".") and supernumerary slashes ("/"s) from paths
int
path_normalise(size_t n, const char *const fname, const norm[n])
{
char *lim; /* Limit of normalised filename. */
char *end; /* Current end of normalised filename. */
assert(*fname != '\0');
lim = norm + n - 1U;
end = norm;