From 6e476c459ba6ce4cc5782392bb0505fcb4c5eb66 Mon Sep 17 00:00:00 2001 From: BertramMiller <45958058+BertramMiller@users.noreply.github.com> Date: Fri, 15 May 2020 21:48:44 -0400 Subject: [PATCH] langselect (works with dwmblocks "language" module) This script uses dmenu and xorg-setxkbmap to switch between keyboard layouts --- .local/bin/langselect | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .local/bin/langselect diff --git a/.local/bin/langselect b/.local/bin/langselect new file mode 100644 index 00000000..b3a5bdb7 --- /dev/null +++ b/.local/bin/langselect @@ -0,0 +1,7 @@ +#!/bin/sh +# requirements: dmenu, xorg-setxkbmap +choices="us\\nfr\\nua\\nru" +chosen=$(echo -e "$choices" | dmenu -i ) +s=$(echo "$chosen" | sed "s/.*; //") +setxkbmap $s +notify-send "Keyboard layout:" "$(setxkbmap -query | grep "layout" | awk '{print $2}')"