aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAsger Hautop Drewsen2017-06-17 17:05:56 +0200
committerAsger Hautop Drewsen2017-06-17 17:05:56 +0200
commitdd70dad41f8890060b7b345ba31895a94e227635 (patch)
tree765236ac6b05dbdb2739aced9594b77190d1a48e
parent863a61d2f91029271a25d84c25f341aa10d13104 (diff)
downloadaur-dd70dad41f8890060b7b345ba31895a94e227635.tar.gz
Add keyboard layout to evdev.xml
This allows you to change the keyboard layout to us_da using a GUI
-rw-r--r--PKGBUILD5
-rw-r--r--us_da-layout.install38
2 files changed, 41 insertions, 2 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 2bef9a1085a3..604ed45ffc74 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,14 +1,15 @@
# Maintainer: Asger Hautop Drewsen <asgerdrewsen@gmail.com>
pkgname=us_da-layout
pkgver=r1.85115d7
-pkgrel=1
+pkgrel=2
pkgdesc="US keyboard layout with level 3-4 æøå"
arch=('any')
url="https://gist.githubusercontent.com/Tyilo/d329020017ca37bf0d23264230637120"
license=('GPL')
-depends=()
+depends=('kbd' 'moreutils')
source=("us_da::git+https://gist.githubusercontent.com/Tyilo/d329020017ca37bf0d23264230637120")
md5sums=('SKIP')
+install=us_da-layout.install
pkgver() {
cd "${srcdir}/us_da"
diff --git a/us_da-layout.install b/us_da-layout.install
new file mode 100644
index 000000000000..5b2dc23ca7b8
--- /dev/null
+++ b/us_da-layout.install
@@ -0,0 +1,38 @@
+cd /usr/share/X11/xkb/rules
+
+post_install() {
+ if grep us_da evdev.xml > /dev/null; then
+ return
+ fi
+
+ read -r -d '' layout <<EOF || true
+<!-- BEGIN us_da -->
+ <layout>
+ <configItem>
+ <name>us_da</name>
+
+ <shortDescription>us_da</shortDescription>
+ <description>English (US, with Danish letters)</description>
+ <languageList>
+ <iso639Id>eng</iso639Id>
+ <iso639Id>dan</iso639Id>
+ </languageList>
+ </configItem>
+ </layout>
+<!-- END us_da -->
+EOF
+
+ awk -v layout="$layout" '{ print } /<layoutList>/ { print layout }' evdev.xml | sponge evdev.xml
+}
+
+pre_remove() {
+ awk 'BEGIN { f=1 } /BEGIN us_da/ { f=0 } /END us_da/ { f=1; next } f' evdev.xml | sponge evdev.xml
+}
+
+pre_upgrade() {
+ pre_remove
+}
+
+post_upgrade() {
+ post_install
+}