Skip to content

Instantly share code, notes, and snippets.

@Ram-Z
Created January 31, 2017 00:08
Show Gist options
  • Save Ram-Z/dd00cfb7bacaa270c42367e3ab1ee6a8 to your computer and use it in GitHub Desktop.
Save Ram-Z/dd00cfb7bacaa270c42367e3ab1ee6a8 to your computer and use it in GitHub Desktop.
awesome_declarative.lua
local battery = wibox.widget.base.make_widget()
if utils.has_battery() then
table.insert(battery, separator)
table.insert(battery, require("widgets/battery_widget"))
end
awful.screen.connect_for_each_screen(function(s)
[..snip..]
s.mywibox:setup {
layout = wibox.layout.align.horizontal,
{ -- Left widgets
layout = wibox.layout.fixed.horizontal,
-- mylauncher,
s.mytaglist,
s.mypromptbox,
},
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
mykeyboardlayout,
wibox.widget.systray(),
separator,
require("widgets/pomodoro"),
separator,
require("widgets/awesompd"),
require("widgets/volume_widget"),
battery,
separator,
require("widgets/network_widget"),
separator,
require("widgets/calendar"),
s.mylayoutbox,
},
}
awful.screen.connect_for_each_screen(function(s)
[..snip..]
-- Widgets that are aligned to the left
local left_layout = wibox.layout.fixed.horizontal()
-- left_layout:add(mylauncher)
left_layout:add(s.mytaglist)
left_layout:add(s.mypromptbox)
-- Widgets that are aligned to the right
local right_layout = wibox.layout.fixed.horizontal()
right_layout:add(wibox.widget.systray())
right_layout:add(separator)
right_layout:add(require("widgets/pomodoro"))
right_layout:add(separator)
right_layout:add(require("widgets/awesompd"))
right_layout:add(require("widgets/volume_widget"))
if utils.has_battery() then
right_layout:add(separator)
right_layout:add(require("widgets/battery_widget"))
end
right_layout:add(separator)
right_layout:add(require("widgets/network_widget"))
right_layout:add(separator)
right_layout:add(require("widgets/calendar"))
right_layout:add(s.mylayoutbox)
-- Now bring it all together (with the tasklist in the middle)
local layout = wibox.layout.align.horizontal()
layout:set_left(left_layout)
layout:set_middle(s.mytasklist)
layout:set_right(right_layout)
s.mywibox:set_widget(layout)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment