2019-01-15 11:20:10 +11:00
|
|
|
;;; module/sidebar.fnl --- Informational sidebar
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
(local awful (require :awful))
|
|
|
|
(local beautiful (require :beautiful))
|
|
|
|
(local wibox (require :wibox))
|
|
|
|
|
2019-01-15 11:37:47 +11:00
|
|
|
(local tag-list (require :widget.tag-list))
|
|
|
|
(local task-list (require :widget.task-list))
|
|
|
|
|
2019-01-15 11:20:10 +11:00
|
|
|
(local sb-clock (wibox.widget.textclock "%H\n%M"))
|
|
|
|
(local sb-systray (doto (wibox.widget.systray)
|
|
|
|
(: :set_base_size 24)))
|
|
|
|
(local fill-width (doto (wibox.layout.fixed.horizontal)
|
|
|
|
(: :fill_space true)
|
|
|
|
(: :set_spacing 10)))
|
|
|
|
|
|
|
|
(local bounding (wibox.container.margin
|
|
|
|
(wibox.container.place
|
|
|
|
(wibox.container.margin
|
|
|
|
nil
|
|
|
|
10 10 10 10 beautiful.sidebar_subbox))
|
|
|
|
1 1 1 1 beautiful.sidebar_bg))
|
|
|
|
|
|
|
|
;;;
|
|
|
|
;; Functions
|
|
|
|
|
|
|
|
(fn draw-sidebar [s]
|
2019-01-15 11:37:47 +11:00
|
|
|
(set s.sb-tag (tag-list s))
|
|
|
|
(set s.sb-tasks (task-list s))
|
2019-01-15 11:20:10 +11:00
|
|
|
|
|
|
|
(set s.sb (awful.wibar {:position beautiful.sidebar_position
|
|
|
|
:width beautiful.sidebar_width
|
|
|
|
:screen s}))
|
|
|
|
|
|
|
|
(: s.sb :setup
|
|
|
|
{:layout wibox.layout.align.vertical
|
|
|
|
1 {:layout wibox.layout.fixed.vertical
|
|
|
|
1 {1 s.sb-tag
|
|
|
|
:halign "center"
|
|
|
|
:layout (wibox.container.margin nil 10 10 10 10)}
|
|
|
|
2 s.sb-tasks}
|
|
|
|
2 {:layout wibox.layout.fixed.vertical}
|
|
|
|
3 {:layout wibox.layout.fixed.vertical
|
|
|
|
1 sb-systray
|
|
|
|
2 {1 sb-clock
|
|
|
|
:valign "center"
|
|
|
|
:halign "center"
|
|
|
|
:layout bounding}}}))
|
|
|
|
|
|
|
|
;;;
|
|
|
|
;; Configuration
|
|
|
|
|
2019-01-15 11:37:47 +11:00
|
|
|
(awful.screen.connect_for_each_screen
|
|
|
|
draw-sidebar)
|
2019-01-15 11:20:10 +11:00
|
|
|
|
|
|
|
{}
|
|
|
|
;;; module/sidebar.fnl ends here
|