-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path04_widgetstop.lua
More file actions
30 lines (27 loc) · 864 Bytes
/
04_widgetstop.lua
File metadata and controls
30 lines (27 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
mylauncher = awful.widget.launcher({
image = image(beautiful.awesome_icon),
menu = mymainmenu
})
-- Keyboard map indicator and changer
kbdcfg = {}
kbdcfg.cmd = "setxkbmap"
kbdcfg.layout = { "us", "ru", "ge" }
kbdcfg.current = 1 -- us is our default layout
kbdcfg.widget = widget({ type = "textbox", align = "right" })
kbdcfg.widget.text = " " .. kbdcfg.layout[kbdcfg.current] .. " "
kbdcfg.switch = function()
kbdcfg.current = kbdcfg.current % #(kbdcfg.layout) + 1
local t = " " .. kbdcfg.layout[kbdcfg.current] .. " "
kbdcfg.widget.text = t
os.execute(kbdcfg.cmd .. t)
end
-- Mouse bindings
kbdcfg.widget:buttons(
awful.util.table.join(
awful.button({}, 1, function() kbdcfg.switch() end)
)
)
-- Create a textclock widget
mytextclock = awful.widget.textclock({ align = "right" })
-- Create a systray
mysystray = widget({ type = "systray" })