60 lines
1.6 KiB
Fennel
60 lines
1.6 KiB
Fennel
;;; module/sidebar.fnl --- Informational sidebar
|
|
|
|
;;; Code:
|
|
|
|
(local awful (require :awful))
|
|
(local beautiful (require :beautiful))
|
|
(local wibox (require :wibox))
|
|
|
|
(local tag-list (require :widget.tag-list))
|
|
(local task-list (require :widget.task-list))
|
|
|
|
(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]
|
|
(set s.sb-tag (tag-list s))
|
|
(set s.sb-tasks (task-list s))
|
|
|
|
(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
|
|
|
|
(awful.screen.connect_for_each_screen
|
|
draw-sidebar)
|
|
|
|
{}
|
|
;;; module/sidebar.fnl ends here
|