diff options
author | André Kugland | 2021-12-31 00:54:02 -0300 |
---|---|---|
committer | André Kugland | 2021-12-31 00:54:02 -0300 |
commit | e4cd36f49f0a33971ca76839ae28e8c5e11bbdc3 (patch) | |
tree | 2d5215f56006093fc5bd380c3f2ed1e6ce3bd385 | |
parent | 5f90e6e582e4afa52701d0e2a755bf0e65b8f9a2 (diff) | |
download | aur-e4cd36f49f0a33971ca76839ae28e8c5e11bbdc3.tar.gz |
v3.0.0
-rw-r--r-- | .SRCINFO | 13 | ||||
-rw-r--r-- | PKGBUILD | 23 | ||||
-rw-r--r-- | abnt2-ext.install | 15 | ||||
-rw-r--r-- | abnt2-patch-evdev.hook | 12 | ||||
-rw-r--r-- | abnt2_ext | 59 | ||||
-rw-r--r-- | patch_evdev.py | 34 |
6 files changed, 130 insertions, 26 deletions
@@ -1,14 +1,17 @@ pkgbase = abnt2-ext pkgdesc = ABNT2 extended keyboard - pkgver = 2.1.1 + pkgver = 3.0.0 pkgrel = 1 url = https://github.com/kugland/abnt2-ext-arch - install = abnt2-ext.install arch = any license = GPL depends = xkeyboard-config - source = https://github.com/kugland/abnt2-ext-arch/archive/refs/tags/v2.1.1.tar.gz - sha256sums = 2bec38fb75b7750fd8388e814b6e99d47d029cbcdb7d6025e0b809ce2f73f574 + depends = python-lxml + source = abnt2_ext + source = patch_evdev.py + source = abnt2-patch-evdev.hook + sha256sums = c5f1cfe3cabb17c0912409fa9c283a360a7d1ae9407751b484b5c2b7f8f48c01 + sha256sums = 74194d63c9bde72e8cd9a4c05d2711cda99a2208bc0ce43b0d6973aaae5edee3 + sha256sums = cc2b039de1cf0f6e179a3fdb9c6c9959626e9378343388aadf63e05a3f2fc93a pkgname = abnt2-ext - @@ -1,16 +1,27 @@ pkgname=abnt2-ext -pkgver=2.1.1 +pkgver=3.0.0 pkgrel=1 pkgdesc="ABNT2 extended keyboard" arch=(any) url="https://github.com/kugland/abnt2-ext-arch" license=('GPL') -depends=(xkeyboard-config) -source=("https://github.com/kugland/$pkgname-arch/archive/refs/tags/v$pkgver.tar.gz") -install="$pkgname.install" -sha256sums=('2bec38fb75b7750fd8388e814b6e99d47d029cbcdb7d6025e0b809ce2f73f574') +depends=( + 'xkeyboard-config' + 'python-lxml' +) +source=( + 'abnt2_ext' + 'patch_evdev.py' + 'abnt2-patch-evdev.hook' +) +sha256sums=('c5f1cfe3cabb17c0912409fa9c283a360a7d1ae9407751b484b5c2b7f8f48c01' + '74194d63c9bde72e8cd9a4c05d2711cda99a2208bc0ce43b0d6973aaae5edee3' + 'cc2b039de1cf0f6e179a3fdb9c6c9959626e9378343388aadf63e05a3f2fc93a') package() { - cd "$srcdir/$pkgname-arch-$pkgver" + cd "$srcdir/" + install -D -m 644 -o root -g root abnt2_ext "$pkgdir/usr/share/X11/xkb/symbols/abnt2_ext" + install -D -m 644 -o root -g root patch_evdev.py "$pkgdir/usr/share/abnt2-ext/patch_evdev.py" + install -D -m 644 -o root -g root abnt2-patch-evdev.hook "$pkgdir/usr/share/libalpm/hooks/abnt2-patch-evdev.hook" } diff --git a/abnt2-ext.install b/abnt2-ext.install deleted file mode 100644 index 3b3a0b31f4ea..000000000000 --- a/abnt2-ext.install +++ /dev/null @@ -1,15 +0,0 @@ -post_install() { - echo "" - echo " To enable this layout globally, run as root:" - echo "" - echo " localectl set-x11-keymap --no-convert abnt2_ext" - echo "" - echo " Also don't forget to disable your desktop environment's" - echo " automatic managing of keyboard layouts. (For plasma you" - echo " may have to manually edit ~/.config/kxkbrc." - echo "" -} - -post_upgrade() { - post_install $1 -} diff --git a/abnt2-patch-evdev.hook b/abnt2-patch-evdev.hook new file mode 100644 index 000000000000..3f397591a90e --- /dev/null +++ b/abnt2-patch-evdev.hook @@ -0,0 +1,12 @@ +[Trigger] +Operation = Install +Operation = Upgrade +Type = Package +Target = xkeyboard-config +Target = abnt2-ext + +[Action] +Description = Patch evdev.xml to add abnt2-ext keymap... +Depends = python-lxml +When = PostTransaction +Exec = /bin/sh -c 'python /usr/share/abnt2-ext/patch_evdev.py' diff --git a/abnt2_ext b/abnt2_ext new file mode 100644 index 000000000000..414f65f97724 --- /dev/null +++ b/abnt2_ext @@ -0,0 +1,59 @@ +default partial alphanumeric_keys + +xkb_symbols "abnt2" { + include "latin" + name[group1]="Portuguese (ABNT2 Extended)"; + + key <AE01> { [ 1, exclam, onesuperior, exclamdown ] }; + key <AE02> { [ 2, at, twosuperior, onehalf ] }; + key <AE03> { [ 3, numbersign, threesuperior, threequarters ] }; + key <AE04> { [ 4, dollar, dead_currency, onequarter ] }; + key <AE05> { [ 5, percent, permille, NoSymbol ] }; + key <AE06> { [ 6, dead_diaeresis, notsign, dead_doubleacute ] }; + key <AE07> { [ 7, ampersand, enfilledcircbullet, plusminus ] }; + key <AE08> { [ 8, asterisk, multiply, division ] }; + key <AE09> { [ 9, parenleft, leftsinglequotemark, leftdoublequotemark ] }; + key <AE10> { [ 0, parenright, rightsinglequotemark, rightdoublequotemark ] }; + key <AE11> { [ minus, underscore, endash, emdash ] }; + key <AE12> { [ equal, plus, section, notequal ] }; + key <AD01> { [ q, Q, slash, backslash ] }; + key <AD02> { [ w, W, question, questiondown ] }; + key <AD03> { [ e, E, EuroSign, U212F ] }; + key <AD04> { [ r, R, NoSymbol, registered ] }; + key <AD05> { [ t, T, thorn, THORN ] }; + key <AD06> { [ y, Y, NoSymbol, NoSymbol ] }; + key <AD07> { [ u, U, udiaeresis, Udiaeresis ] }; + key <AD08> { [ i, I, infinity, NoSymbol ] }; + key <AD09> { [ o, O, oe, OE ] }; + key <AD10> { [ p, P, oslash, Oslash ] }; + key <AD11> { [ dead_acute, dead_grave, dead_breve, dead_macron ] }; + key <AD12> { [ bracketleft, braceleft, ordfeminine, guillemotleft ] }; + key <AC01> { [ a, A, ae, AE ] }; + key <AC02> { [ s, S, ssharp, musicalsharp ] }; + key <AC03> { [ d, D, eth, ETH ] }; + key <AC04> { [ f, F, function, NoSymbol ] }; + key <AC05> { [ g, G, dead_greek, NoSymbol ] }; + key <AC06> { [ h, H, U02BE, U02BF ] }; + key <AC07> { [ j, J, NoSymbol, NoSymbol ] }; + key <AC08> { [ k, K, kra, checkmark ] }; + key <AC09> { [ l, L, lstroke, Lstroke ] }; + key <AC10> { [ ccedilla, Ccedilla, dead_cedilla, dead_ogonek ] }; + key <AC11> { [ dead_tilde, dead_circumflex, dead_caron, dead_belowmacron ] }; + key <TLDE> { [ apostrophe, quotedbl, minutes, seconds ] }; + key <BKSL> { [ bracketright, braceright, masculine, guillemotright ] }; + key <AB01> { [ z, Z, leftarrow, U27F7 ] }; + key <AB02> { [ x, X, uparrow, U2715 ] }; + key <AB03> { [ c, C, downarrow, copyright ] }; + key <AB04> { [ v, V, rightarrow, NoSymbol ] }; + key <AB05> { [ b, B, U20BF, musicalflat ] }; + key <AB06> { [ n, N, NoSymbol, U266E ] }; + key <AB07> { [ m, M, mu, trademark ] }; + key <AB08> { [ comma, less, ellipsis, lessthanequal ] }; + key <AB09> { [ period, greater, NoSymbol, greaterthanequal ] }; + key <AB10> { [ semicolon, colon, dead_belowdot, dead_abovedot ] }; + key <LSGT> { [ backslash, bar, dead_stroke, dead_abovering ] }; + key <AB11> { [ slash, question, degree, questiondown ] }; + + include "kpdl(comma)" + include "level3(ralt_switch)" +}; diff --git a/patch_evdev.py b/patch_evdev.py new file mode 100644 index 000000000000..1eea64985fa5 --- /dev/null +++ b/patch_evdev.py @@ -0,0 +1,34 @@ +import os +from lxml import etree + +doc = etree.parse('/usr/share/X11/xkb/rules/evdev.xml') + +layout = doc.xpath('//layout[configItem/name/text()="abnt2ext"]') +if len(layout) > 0: + layout = layout[0] + layout.getparent().remove(layout) + +layoutlist = doc.xpath('//layoutList') +elm = etree.Element('layout') +elm_configItem = etree.SubElement(elm, 'configItem') +elm_name = etree.SubElement(elm_configItem, 'name') +elm_name.text = 'abnt2ext' +elm_shortDescription = etree.SubElement(elm_configItem, 'shortDescription') +elm_shortDescription.text = 'abnt2-ext' +elm_description = etree.SubElement(elm_configItem, 'description') +elm_description.text = 'ABNT2 Extended' +elm_countryList = etree.SubElement(elm_configItem, 'countryList') +elm_iso3166Id = etree.SubElement(elm_countryList, 'iso3166Id') +elm_iso3166Id.text = 'BR' +elm_languageList = etree.SubElement(elm_configItem, 'languageList') +elm_iso639Id = etree.SubElement(elm_languageList, 'iso639Id') +elm_iso639Id.text = 'por' +elm = etree.ElementTree(elm) + +layoutlist[0].append(elm.getroot()) + + +doc.write('/usr/share/X11/xkb/rules/evdev.xml.new', pretty_print=True, xml_declaration=True, encoding='utf-8') + +os.rename('/usr/share/X11/xkb/rules/evdev.xml', '/usr/share/X11/xkb/rules/evdev.xml.old') +os.rename('/usr/share/X11/xkb/rules/evdev.xml.new', '/usr/share/X11/xkb/rules/evdev.xml') |