summaryrefslogtreecommitdiff
path: root/pkgs/astal/src/widget/bar/init.lua
blob: 038ac9085a5d83cfb9269efa112f77c1bf17fede (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
local astal = require("astal")
local Widget = require("astal.gtk3.widget")

local Workspaces = require("widget.bar.workspaces")
local FocusedClient = require("widget.bar.focusedClient")
local Date = require("widget.bar.date")
local WiFi = require("widget.bar.wifi")
local Audio = require("widget.bar.audio")
local Battery = require("widget.bar.battery")
local Tray = require("widget.bar.tray")

return function(gdkmonitor)
	local Anchor = astal.require('Astal').WindowAnchor

	return Widget.Window({
		class_name = "bar",
		gdkmonitor = gdkmonitor,
		anchor = Anchor.TOP + Anchor.LEFT + Anchor.RIGHT,
		exclusivity = "EXCLUSIVE",
		Widget.CenterBox({
			Widget.Box({
				class_name = "left",
				halign = "START",
				hexpand = true,
				Workspaces(),
				FocusedClient(),
			}),
			Widget.Box({
				class_name = "center",
				hexpand = true,
				Date(),
			}),
			Widget.Box({
				class_name = "right",
				halign = "END",
				hexpand = true,
				WiFi(),
				Audio(),
				Battery(),
				Tray(),
			}),
		})
	})
end