keyboard-layout-indicator
所属分类:编程语言基础
开发工具:Lua
文件大小:3KB
下载次数:0
上传日期:2021-10-29 15:41:05
上 传 者:
sh-1993
说明: 键盘布局指示器切换器小工具,用于很棒的wm
(Keyboard layout indicator switcher widget for awesome-wm)
文件列表:
UNLICENSE (1211, 2023-08-29)
init.lua (29, 2023-08-29)
keyboard-layout-indicator.lua (4838, 2023-08-29)
## awesome.keyboard-layout-indicator
### Description
Keyboard layout indicator+switcher widget for awesome window manager.
### Installation
Drop the script into your awesome config folder. Suggestion:
```bash
cd ~/.config/awesome
git clone https://github.com/deficient/keyboard-layout-indicator.git
```
### Usage
In your `rc.lua`:
```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
* [awesome 4.0](http://awesome.naquadah.org/)
近期下载者:
相关文件:
收藏者: