grafik: verwende libxkbcommon statt xorg tools

Dies  erlaubt, auch Layouts aus ~/.config/xkb zu lesen.
Auch shell.nix hinzugefügt.
This commit is contained in:
Ulli Kehrle 2021-07-27 20:31:20 +02:00
parent 0e866f92d0
commit 2be7fcb469
No known key found for this signature in database
GPG Key ID: 06E88726998AB3C7
3 changed files with 27 additions and 3 deletions

View File

@ -20,8 +20,8 @@ Um alle Bilder erzeugen können, benötigt man eine Vielzahl an Abhängigkeiten:
- libreoffice
- sed
- ed
- setxkbmap und xkbcomp
- python mit numpy, pandas, matplotlib und seaborn
- libxkbcommon (xkbcli)
- python mit jinja2, more-itertools, numpy, pandas, matplotlib und seaborn
- perl mit XML::Writer
- php
- Linux Libertine

View File

@ -17,7 +17,8 @@ swap_m3r_ä = True if layout == "vou" or layout == "mine" else False
vou = True if layout == "vou" else False
mine = True if layout == "mine" else False
os.system("setxkbmap de " + layout + " -print | xkbcomp -xkb - /tmp/keymaptmp 2>/dev/null")
#os.system("setxkbmap de " + layout + " -print | xkbcomp -I ~/.config/xkb -xkb - /tmp/keymaptmp 2>/dev/null")
os.system("xkbcli compile-keymap --layout de --variant " + layout + " >/tmp/keymaptmp")
# TODO: actually write/generate a proper parser for xkbmaps
os.system(r'''sed -n '/xkb_symbols/,/xkb_geometry/p' /tmp/keymaptmp | tail -n +2 | grep -e 'key' -e symbols -e '}' | sed 's/symbols\[Group1]=//' | paste -sd "" - | sed 's/\;/&\n/g' | grep -v 'modifier_map' | sed -r 's/\s//g' | sed -r 's/key<(.*)>\{\[/\1=/g' | sed -r 's/\]?,?\}\;//' | grep -v '^$' > /tmp/keymap''')

23
grafik/shell.nix Normal file
View File

@ -0,0 +1,23 @@
{ pkgs ? import <nixpkgs> { } }:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
inkscape
optipng
imagemagick
libicns
libreoffice
ed
libxkbcommon
python3
python3Packages.pandas
python3Packages.matplotlib
python3Packages.seaborn
python3Packages.more-itertools
python3Packages.jinja2
perl
perlPackages.XMLWriter
php
];
# You also need to install the fonts (libertine gentium dejavu ... )
}