75 lines
2.3 KiB
Fennel
75 lines
2.3 KiB
Fennel
;;; module/sidebar.fnl --- Informational sidebar
|
|
|
|
;;; Code:
|
|
|
|
(local awful (require :awful))
|
|
(local beautiful (require :beautiful))
|
|
(local wibox (require :wibox))
|
|
|
|
(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 (awful.widget.taglist
|
|
{:screen s
|
|
:filter awful.widget.taglist.filter.selected
|
|
:style {:font (.. beautiful.font " Bold 10")}
|
|
;; :widget_template
|
|
;; {1
|
|
;; {:id "index_role"
|
|
;; :widget wibox.widget.textbox}
|
|
;; :widget wibox.container.margin
|
|
;; :margins 5
|
|
;; :create_callback
|
|
;; (lambda [self, c3, index, objects])}
|
|
:layout wibox.layout.fixed.vertical
|
|
}
|
|
))
|
|
(set s.sb-tasks (awful.widget.tasklist
|
|
{:screen s
|
|
:filter awful.widget.tasklist.filter.currenttags
|
|
:style {:disable_task_name true}
|
|
}))
|
|
|
|
(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
|