"Scratching an itch... by patching kmscon" or "How OpenGL can lead to systems-programming" -= 0/12 =- overview * what is kmscon? * who am I? * motivation * patch 1: output rotation * patch 2: mouse selection & 'clipboard' * patch 3: gyro support * patch 4: messing around... * upstream, future work * sourcecode, blog-posts, screencasts * q/a -= 1/12 =- what is kmscon? * KMS-based system-console for Linux * plugin-infrastructure for features * Unicode-capable, e.g. cyrillic, japanese, farsi... no emojis yet * feature/plugin: Freetype fonts (mod-pango.so) * feature/plugin: OpenGL|ES render backend (mod-gltex.so) * libtsm: state machine for terminal-emulation (VT100..VT520) * 'old', ca. 2012, initial developer David Herrmann (https://dvdhrm.wordpress.com) * maintenance moved 'organically'? into other hands (https://github.com/aetf/kmscon) -= 2/12 =- who am I? * homepage: macslow.org * blog: blog.macslow.org * eMail: macslow@gmail.com * mastodon: @MacSlow@floss.social * twitter: @MacSlow -= 3/12 =- motivation * zen-moments 'in the zone' * non-typical (aka uncommon) monitor-setup * no system-console on Linux can rotate output a la xrandr * convenient: kmscon is OpenSource * even more convenient: knowing your way around OpenGL * peak-convenience: being a graphics-nerd with a tiny bit of spare-time * famous last words: "Ah, that's a piece of cake... it'll take an evening!" * start january/february 2023 -= 4/12 =- patch 1: output rotation (my main itch to scratch) * kmscon/src/text_gltex.c * kmscon_text_gltex_ops * gltex_rotate * gltex_render_pointer (also see patch 2) * GL-transformation-matrix * height, width for number of characters has to be calculated * demo: UTF8-text, tmux, btop, cmatrix -= 5/12 =- patch 2: mouse selection & 'clipboard' (kind of TODO-item from David Herrmann) * kmscon structs: eloop, ev_timer * device-/kernel-interface: /dev/input/mice * kmscon/src/kmscon_mouse.h * my added structs: kmscon_mouse_info, kmscon_selection_info * mouse, trackpoint, Apple Magic Mouse Pad... all at the same time * update-rate for device-query (busy polling at the moment still) * libtsm, https://blog.macslow.org/?p=407, wlterm * demo: tmux, cut&paste of filenames -= 6/12 =- patch 3: gyro support (DBus service) * "It would be so cool, if the rotation happens automatically!" * laptop with gyro-sensor * DBus service "/net/hadess/SensorProxy" (Bastien 'hadess' Nocera) * #include low-level, DBus-maintainer discourage its use :) * kmscon/src/kmscon_terminal.c * live-demo on separate laptop (with gyro) after the talk for interested folks * -> screencasts -= 7/12 =- patch 4: messing around... shader backgrounds (kind of TODO-item from David Herrmann) * since we are using OpenGL already, one could also... * ASCII-art vs real GLSL-shader :) * -> screencasts -= 8/12 =- upstream * initial maintainer 'lost' somewhere within RedHat ;) * a debian-dev replied once, hinting me towards aetf's kmscon repo on github * new/current de-facto maintainer "aetf" does not seem to be very active * PRs against aetf's repo created on github... a few months ago * feedback really slow... or this is just too niche-specific of a patch * even planned a talk at FOSDEM in Bruessel 2024 * future idea: use KMS' info of connected displays for real multi-head -= 9/12 =- sourcecode, blog-posts, screencasts * https://github.com/MacSlow/kmscon * https://blog.macslow.org/?p=365 * https://blog.macslow.org/?p=399 * https://blog.macslow.org/?p=407 * https://blog.macslow.org/?p=460 * https://www.youtube.com/embed/ybjmUFIXfUU * https://www.youtube.com/embed/j21k9cbhDNQ * https://www.youtube.com/embed/b2F_jsfWvFY * https://www.youtube.com/embed/pRyEnU1hMXo -= 10/12 =- Questions? -= 11/12 =- Thanks for your interest and attention everyone! -= 12/12 =-