awesome/module/sidebar.fnl

63 lines
1.6 KiB
Plaintext
Raw Normal View History

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))
(local tag-list (require :widget.tag-list))
(local task-list (require :widget.task-list))
(local textclock (require :widget.textclock))
2019-01-15 11:20:10 +11:00
;;;
;; Functions
(fn border [t margin]
(let [side (or margin 2)
end (+ side 1)]
{1 t
:bottom end
:left side
:right side
:top end
:widget wibox.container.margin} ))
(local sb-clock (textclock "%H\n%M"))
(local sb-systray (doto (wibox.widget.systray)
(: :set_base_size 24)))
2019-01-15 11:20:10 +11:00
(fn draw-sidebar [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 {1 (border (tag-list s))
;; 2 (task-list s)
:layout wibox.layout.fixed.vertical}
2019-01-15 11:20:10 +11:00
2 {:layout wibox.layout.fixed.vertical}
3 {1 sb-systray
2 {1 (border
{1 {1 {1 sb-clock
:valign "center"
:halign "center"
:widget wibox.container.place}
:top 2
:bottom 2
:widget wibox.container.margin}
:widget wibox.container.background
:bg beautiful.sidebar_bg_info})
:layout wibox.layout.fixed.vertical}
:layout wibox.layout.fixed.vertical}}))
2019-01-15 11:20:10 +11:00
;;;
;; Configuration
(awful.screen.connect_for_each_screen
draw-sidebar)
2019-01-15 11:20:10 +11:00
{}
;;; module/sidebar.fnl ends here