Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Latest commit

 

History

History
64 lines (46 loc) · 1.54 KB

README.md

File metadata and controls

64 lines (46 loc) · 1.54 KB

This repository has been assimilated into https://github.com/deficient/deficient

awesome.keyboard-layout-indicator

Description

Keyboard layout indicator+switcher widget for awesome window manager.

Installation

Drop the script into your awesome config folder. Suggestion:

cd ~/.config/awesome
git clone https://github.com/deficient/keyboard-layout-indicator.git

Usage

In your rc.lua:

-- load the widget code
local layout_indicator = require("keyboard-layout-indicator")

-- define your layouts
kbdcfg = layout_indicator({
    layouts = {
        {name="dv",  layout="de",  variant="dvorak"},
        {name="de",  layout="de",  variant=nil},
        {name="us",  layout="us",  variant=nil}
    },
    -- optionally, specify commands to be executed after changing layout:
    post_set_hooks = {
        "xmodmap ~/.Xmodmap",
        "setxkbmap -option caps:escape"
    }
})

-- add the widget to your wibox
    ...
    right_layout:add(kbdcfg.widget)
    ...


-- Add bindings
local globalkeys = awful.util.table.join(
    ...
    awful.key({ "Shift"         }, "Shift_R", function() kbdcfg:next() end ),
    awful.key({ "Mod4", "Shift" }, "Shift_R", function() kbdcfg:prev() end ),
    ...
)

NOTE: middle click on the widget executes a prompt which lets you set a custom keyboard layout. However, this will work only if you assign s.mypromptbox as in the awesome 4.0 default rc.lua. Otherwise, you have to rebind the behaviour manually, see the source code.

Requirements