chore: migrate to unique git repo

This commit is contained in:
2019-01-15 11:20:10 +11:00
commit 492c91a204
19 changed files with 3583 additions and 0 deletions

74
module/decorate.fnl Normal file
View File

@@ -0,0 +1,74 @@
;;; decorate.fnl --- Client decorations
;;; Commentary:
;; Comments
;;; Code:
(local awful (require :awful))
(local beautiful (require :beautiful))
(local gears (require :gears))
(local wibox (require :wibox))
(local std (require :lib.std))
;; TODO Properly abstract these into a library
(local fun (require :lib.fun))
(local modifiers
{:mod "Mod4"
:alt "Mod1"
:super "Mod4"
:shift "Shift"
:ctrl "Control"})
(fn map-mods [mods]
(->> mods
(fun.map (partial . modifiers))
(fun.totable)))
(fn button [mods bc fun]
(awful.button (map-mods mods) bc fun))
;;;
;; Functions
(fn mouse-button [c bc cmd]
(button [] bc (lambda []
(: c :emit_signal
:request::activate :titlebar {:raise true})
((. awful.mouse.client cmd) c))))
(fn make-titlebar [c side -size]
(let [size (or -size beautiful.titlebar_size 10)]
(awful.titlebar c {:size size :position side})))
(fn setup-empty-titlebar [bar buttons]
;; Placeholder layouts
(: bar :setup
{1 {:layout wibox.layout.fixed.vertical}
2 {:buttons buttons
:layout wibox.layout.flex.vertical}
3 {:layout (wibox.layout.fixed.vertical)}
:layout wibox.layout.align.vertical}))
(fn titlebar-hook [c]
(let [buttons (gears.table.join
(mouse-button c 1 :move)
(mouse-button c 3 :resize))
mainbar (make-titlebar c beautiful.titlebar_position)]
(setup-empty-titlebar mainbar buttons)
(when (and (not (std.zero? beautiful.titlebar_border_width))
beautiful.use_titlebars_for_borders)
(let [size beautiful.titlebar_border_width]
(each [_ side (ipairs [:top :right :bottom])]
(setup-empty-titlebar (make-titlebar c side size) buttons))))))
;;;
;; Processing
(_G.client.connect_signal :request::titlebars titlebar-hook)
{}
;;; decorate.fnl ends here

74
module/sidebar.fnl Normal file
View File

@@ -0,0 +1,74 @@
;;; 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