add keyboard layout widget
This commit is contained in:
parent
f1e8c2b9e8
commit
9a31da851d
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
battery-widget
|
battery-widget
|
||||||
|
keyboard-layout-indicator
|
||||||
|
|||||||
@ -1,2 +1,3 @@
|
|||||||
git clone https://github.com/deficient/battery-widget.git
|
git clone https://github.com/deficient/battery-widget.git
|
||||||
|
git clone https://github.com/deficient/keyboard-layout-indicator.git
|
||||||
sudo apt-get install acpid
|
sudo apt-get install acpid
|
||||||
|
|||||||
34
rc.lua
34
rc.lua
@ -14,6 +14,7 @@ local hotkeys_popup = require("awful.hotkeys_popup").widget
|
|||||||
-- when client with a matching name is opened:
|
-- when client with a matching name is opened:
|
||||||
require("awful.hotkeys_popup.keys")
|
require("awful.hotkeys_popup.keys")
|
||||||
local battery_widget = require("battery-widget")
|
local battery_widget = require("battery-widget")
|
||||||
|
local keyboard_layout_indicator = require("keyboard-layout-indicator")
|
||||||
|
|
||||||
-- Load Debian menu entries
|
-- Load Debian menu entries
|
||||||
local debian = require("debian.menu")
|
local debian = require("debian.menu")
|
||||||
@ -190,14 +191,30 @@ menubar.utils.terminal = terminal -- Set the terminal for applications that requ
|
|||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
-- Keyboard map indicator and switcher
|
-- Keyboard map indicator and switcher
|
||||||
mykeyboardlayout = awful.widget.keyboardlayout()
|
-- mykeyboardlayout = awful.widget.keyboardlayout()
|
||||||
|
|
||||||
-- {{{ Wibar
|
-- {{{ Wibar
|
||||||
-- Create a textclock widget
|
-- Create a textclock widget
|
||||||
-- mytextclock = wibox.widget.textclock()
|
-- mytextclock = wibox.widget.textclock()
|
||||||
mytextclock = wibox.widget.textclock("%Y-%m-%d, %a, %H:%M:%S",1)
|
mytextclock = wibox.widget.textclock("%y-%m-%d %a %H:%M:%S",1)
|
||||||
|
|
||||||
mybatterywidget = battery_widget { adapter = "BAT0", ac = "AC", widget_font = wibar_font }
|
mybatterywidget = battery_widget { adapter = "BAT0", ac = "AC", widget_font = wibar_font
|
||||||
|
, battery_prefix = "🔋"
|
||||||
|
, ac_prefix = "🔌"
|
||||||
|
}
|
||||||
|
|
||||||
|
mykeyboardindicatorwidget = keyboard_layout_indicator({
|
||||||
|
layouts = {
|
||||||
|
{name="🇭🇺", layout="hu", variant=nil},
|
||||||
|
{name="🇦🇹", layout="de", variant=nil},
|
||||||
|
{name="🇬🇧", layout="us", variant=nil}
|
||||||
|
},
|
||||||
|
-- optionally, specify commands to be executed after changing layout:
|
||||||
|
post_set_hooks = {
|
||||||
|
"xmodmap ~/.Xmodmap",
|
||||||
|
"setxkbmap -option caps:escape"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
-- Create a wibox for each screen and add it
|
-- Create a wibox for each screen and add it
|
||||||
local taglist_buttons = gears.table.join(
|
local taglist_buttons = gears.table.join(
|
||||||
@ -303,14 +320,15 @@ end
|
|||||||
s.mytasklist, -- Middle widget
|
s.mytasklist, -- Middle widget
|
||||||
{ -- Right widgets
|
{ -- Right widgets
|
||||||
layout = wibox.layout.fixed.horizontal,
|
layout = wibox.layout.fixed.horizontal,
|
||||||
mykeyboardlayout,
|
-- mykeyboardlayout,
|
||||||
d_sep,
|
-- d_sep,
|
||||||
wibox.widget.systray(),
|
wibox.widget.systray(),
|
||||||
d_sep,
|
d_sep,
|
||||||
mytextclock,
|
mytextclock,
|
||||||
l_sep,
|
d_sep,
|
||||||
mybatterywidget,
|
mybatterywidget,
|
||||||
r_sep,
|
d_sep,
|
||||||
|
mykeyboardindicatorwidget,
|
||||||
d_sep,
|
d_sep,
|
||||||
s.mylayoutbox,
|
s.mylayoutbox,
|
||||||
},
|
},
|
||||||
@ -767,5 +785,5 @@ client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_n
|
|||||||
-- }}}
|
-- }}}
|
||||||
--
|
--
|
||||||
-- {{{ autostart
|
-- {{{ autostart
|
||||||
awful.spawn.with_shell("~/.config/awesome/autorun.sh")
|
-- awful.spawn.with_shell("~/.config/awesome/autorun.sh")
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user