From: Dario Gjorgjevski Date: Sun, 16 Aug 2015 03:42:18 +0000 (+0200) Subject: do not add `us' as secondary if already present X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/5f643320f36d201df94ee56303b0504afd695697?hp=-c do not add `us' as secondary if already present --- 5f643320f36d201df94ee56303b0504afd695697 diff --git a/widgets/contrib/kbdlayout.lua b/widgets/contrib/kbdlayout.lua index 8b15475..f9342a0 100644 --- a/widgets/contrib/kbdlayout.lua +++ b/widgets/contrib/kbdlayout.lua @@ -50,7 +50,7 @@ local function worker (args) idx = ((i - 1) % #layouts) + 1 -- Make sure to wrap around as needed. local to_execute = 'setxkbmap ' .. layouts[idx].layout - if add_us_secondary then + if add_us_secondary and not string.match(layouts[idx].layout, ",?us,?") then to_execute = to_execute .. ",us" end