summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-includes
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2014-05-09 13:44:10 +0000
committerTails developers <amnesia@boum.org>2014-05-09 15:04:42 +0000
commit9f73d4b35fb484403a3edf151bd43a9a8571dcd8 (patch)
tree2eb27ed3ae8d263ad790170a896c85b391693b50 /config/chroot_local-includes
parentf8d6f8aed6ac91d8d133c8dc568ce30ecba408f2 (diff)
Configure the keyboard model and layout used in the GNOME session, accordingly to what the user chose in the Greeter.
This depends on Tails Greeter to save the relevant environment variables to /var/lib/tails-user-session/keyboard. Note that we don't set layouts to [chosen one, US] anymore, as I could not make it work properly: in this case, regardless of the order in which we set it, the US layout wins and is applied by default in the session. Anyway, it's easy enough to either directly choose US in the greeter (when one wants the GUI in their preferred language, and a US keyboard layout), or to add the US layout in the GNOME settings (when using both layouts in the same session). So, this seems like an acceptable regression to me.
Diffstat (limited to 'config/chroot_local-includes')
-rw-r--r--config/chroot_local-includes/etc/xdg/autostart/tails-configure-keyboard.desktop10
-rwxr-xr-xconfig/chroot_local-includes/usr/local/bin/tails-configure-keyboard10
-rw-r--r--config/chroot_local-includes/var/lib/tails-user-session/.placeholder0
3 files changed, 20 insertions, 0 deletions
diff --git a/config/chroot_local-includes/etc/xdg/autostart/tails-configure-keyboard.desktop b/config/chroot_local-includes/etc/xdg/autostart/tails-configure-keyboard.desktop
new file mode 100644
index 0000000..03618a2
--- /dev/null
+++ b/config/chroot_local-includes/etc/xdg/autostart/tails-configure-keyboard.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=tails-configure-keyboard
+GenericName=configure the keyboard layout
+Comment=configure the keyboard layout according to settings chosen in Tails Greeter
+Exec=/usr/local/bin/tails-configure-keyboard
+Terminal=false
+Type=Application
+Categories=GNOME;X-GNOME-PersonalSettings;
+NoDisplay=true
+MimeType=application/x-tails-configure-keyboard;
diff --git a/config/chroot_local-includes/usr/local/bin/tails-configure-keyboard b/config/chroot_local-includes/usr/local/bin/tails-configure-keyboard
new file mode 100755
index 0000000..b384ff3
--- /dev/null
+++ b/config/chroot_local-includes/usr/local/bin/tails-configure-keyboard
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -eu
+
+# Get $TAILS_XKBMODEL, $TAILS_XKBLAYOUT, $TAILS_XKBVARIANT and $TAILS_XKBOPTIONS
+. /var/lib/tails-user-session/keyboard
+
+dconf write /org/gnome/libgnomekbd/keyboard/model "'$XKBMODEL'"
+dconf write /org/gnome/libgnomekbd/keyboard/layouts "['$XKBLAYOUT\\t$XKBVARIANT']"
+dconf write /org/gnome/libgnomekbd/keyboard/options "['$XKBOPTIONS']"
diff --git a/config/chroot_local-includes/var/lib/tails-user-session/.placeholder b/config/chroot_local-includes/var/lib/tails-user-session/.placeholder
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/config/chroot_local-includes/var/lib/tails-user-session/.placeholder