Compare commits

..

No commits in common. "c02b6ef68d5659c0cebcc14e36d7840888385f67" and "3a51bab1c8178b5b12fddd44dd4c20062ef6a955" have entirely different histories.

9 changed files with 103 additions and 184 deletions

View File

@ -19,16 +19,14 @@
:focus true :focus true
:keys (. keys :client) :keys (. keys :client)
:buttons buttons :buttons buttons
:size_hints_honor false ;; fuck you terminals I know what I want :placement (+ awful.placement.no_overlap
:placement awful.placement.no_offscreen}} awful.placement.no_offscreen)}}
{:rule {:floating true} {:rule {:floating true}
:properties {:keys (. keys :floating)}} :properties {:keys (. keys :floating)}}
;; Floating clients. ;; Floating clients.
{:rule_any {:class ["Gpick" {:rule_any {:class ["Gpick"]
"Orage"
"Pavucontrol"]
:name ["Event Tester"] ;; xev :name ["Event Tester"] ;; xev
:role ["pop-up" :role ["pop-up"
"xfce4-terminal-dropdown"]} "xfce4-terminal-dropdown"]}

View File

@ -8,12 +8,13 @@
;;; ;;;
;; Configuration ;; Configuration
(local layouts [awful.layout.suit.tile]) (local layouts [awful.layout.suit.tile
awful.layout.suit.floating])
(set awful.layout.layouts layouts) (set awful.layout.layouts layouts)
;; TODO Rasterize? ;; TODO Rasterize?
(local tags [:firefox.png :code.png :code.png :code.png :code.png :code.png]) (local tags [:firefox.png :code.png :code.svg])
(let [icon-path (.. (os.getenv "HOME") "/.config/awesome/theme/icons/tag/")] (let [icon-path (.. (os.getenv "HOME") "/.config/awesome/theme/icons/tag/")]
(awful.screen.connect_for_each_screen (awful.screen.connect_for_each_screen
@ -21,6 +22,7 @@
(each [n tag (ipairs tags)] (each [n tag (ipairs tags)]
(awful.tag.add (awful.tag.add
n {:icon (.. icon-path tag) n {:icon (.. icon-path tag)
:icon_only true
:layout (. layouts 1) :layout (. layouts 1)
:gap_single_client false :gap_single_client false
:gap beautiful.useless_gap :gap beautiful.useless_gap

View File

@ -36,7 +36,6 @@
(async "tpset \"Natural Scrolling\" 1" (cb "tpset")) (async "tpset \"Natural Scrolling\" 1" (cb "tpset"))
(async "tpset \"Tapping\" 1" (cb "tpset")) (async "tpset \"Tapping\" 1" (cb "tpset"))
(spawn "setxkbmap -option caps:ctrl_modifier") (spawn "setxkbmap -option caps:ctrl_modifier")
(spawn "numlockx on")
(async (.. "feh --bg-fill " beautiful.wallpaper) (cb "feh")) (async (.. "feh --bg-fill " beautiful.wallpaper) (cb "feh"))

View File

@ -10,9 +10,25 @@
(local gears (require :gears)) (local gears (require :gears))
(local wibox (require :wibox)) (local wibox (require :wibox))
(local fun (require :lib.fun))
(local std (require :lib.std)) (local std (require :lib.std))
(local button (. (require :lib.keys) :button))
;; 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 ;; Functions

View File

@ -4,16 +4,12 @@
(local awful (require :awful)) (local awful (require :awful))
(local beautiful (require :beautiful)) (local beautiful (require :beautiful))
(local gears (require :gears))
(local dpi beautiful.xresources.apply_dpi)
(local lain (require :lain)) (local lain (require :lain))
(local wibox (require :wibox)) (local wibox (require :wibox))
(local std (require :lib.std)) (local std (require :lib.std))
(local button (. (require :lib.keys) :button))
(local tag-list (require :widget.tag-list)) (local tag-list (require :widget.tag-list))
(local tag-number (require :widget.tag-number))
(local task-list (require :widget.task-list)) (local task-list (require :widget.task-list))
(local textclock (require :widget.textclock)) (local textclock (require :widget.textclock))
@ -37,14 +33,6 @@
:align "center" :align "center"
:widget wibox.container.place}) :widget wibox.container.place})
(fn deftooltip [obj callback]
(awful.tooltip
{:objects [obj]
:timer_function callback
:delay_show 0.5
:margin_leftright (dpi 10)
:margin_topbottom (dpi 8)}))
(local clock (textclock "%H\n%M")) (local clock (textclock "%H\n%M"))
(local systray (doto (wibox.widget.systray) (local systray (doto (wibox.widget.systray)
(: :set_base_size 24) (: :set_base_size 24)
@ -53,26 +41,6 @@
(local battery (require :widget.bat)) (local battery (require :widget.bat))
(local pulse (require :widget.pulse)) (local pulse (require :widget.pulse))
(local clock-buttons
(gears.table.join
(button [] 1 (lambda [] (awful.spawn "orage")))))
(fn bat-detail []
(let [status _G.bat_now.status
statustxt (if (= status "Full") "charged"
(= status "Charging") "charging"
(= status "Discharging") "discharging"
"N/A")]
(..
"Level: " _G.bat_now.perc "%\n"
"Status: " statustxt "\n"
(if (or (= status "Charging")
(= status "Discharging"))
(.. "Time left: " _G.bat_now.time " hours") ""))))
(deftooltip clock (lambda [] (os.date "%A %d %B %Y")))
(deftooltip battery.widget bat-detail)
(fn draw-sidebar [s] (fn draw-sidebar [s]
(set s.sb (awful.wibar {:position beautiful.sidebar_position (set s.sb (awful.wibar {:position beautiful.sidebar_position
:width beautiful.sidebar_width :width beautiful.sidebar_width
@ -80,27 +48,20 @@
(: s.sb :setup (: s.sb :setup
{:layout wibox.layout.align.vertical {:layout wibox.layout.align.vertical
1 {1 (border 1 {1 (border (tag-list s))
{1 {1 (tag-number s)
:forced_height 32
:align :center
:widget wibox.container.place}
:bg beautiful.sidebar_bg_info
:widget wibox.container.background})
2 (border (tag-list s))
:layout wibox.layout.fixed.vertical} :layout wibox.layout.fixed.vertical}
2 {1 (border (center (task-list s)) 4) 2 {1 (border (center (task-list s)) 4)
:layout wibox.layout.flex.vertical} :layout wibox.layout.flex.vertical}
3 {1 (center systray) 3 {1 (center systray)
2 (center battery.widget) 2 (center battery.widget)
3 (border 3 {1 (border
{1 {1 (center clock) {1 {1 (center clock)
:top 3 :top 2
:bottom 3 :bottom 2
:widget wibox.container.margin} :widget wibox.container.margin}
:buttons clock-buttons :widget wibox.container.background
:bg beautiful.sidebar_bg_info :bg beautiful.sidebar_bg_info})
:widget wibox.container.background}) :layout wibox.layout.fixed.vertical}
:layout wibox.layout.fixed.vertical}})) :layout wibox.layout.fixed.vertical}}))
;;; ;;;

View File

@ -3,10 +3,9 @@
(let [theme-dir (.. (os.getenv "HOME") "/.config/awesome/theme") (let [theme-dir (.. (os.getenv "HOME") "/.config/awesome/theme")
icon-dir (.. theme-dir "/icons/")] icon-dir (.. theme-dir "/icons/")]
{ {
:font "Sarasa UI J 10" :font "Sarasa Mono J"
:font_mono "Sarasa Mono J Bold 10" :variable_font "Sarasa UI J"
:textclock_font "Sarasa UI J"
:wallpaper (.. (os.getenv "HOME") "/pics/wp/sgIcOup.jpg")
:sidebar_position :left ;; * :sidebar_position :left ;; *
:sidebar_width 36 ;; * :sidebar_width 36 ;; *
@ -17,7 +16,7 @@
:fg_focus "#cfcfcf" :fg_focus "#cfcfcf"
:fg_normal "#cfcfcf" :fg_normal "#cfcfcf"
:useless_gap 2 :useless_gap 0
:border_width 0 :border_width 0
:border_focus "#5bb3b4" :border_focus "#5bb3b4"
:border_normal "#1a1e24" :border_normal "#1a1e24"
@ -26,7 +25,7 @@
:titlebar_position :left ;; * :titlebar_position :left ;; *
:titlebar_size 15 ;; * :titlebar_size 15 ;; *
:titlebar_bg_focus "#5bb3b4" :titlebar_bg_focus "#926b3e"
:titlebar_bg_normal "#252b33" :titlebar_bg_normal "#252b33"
:titlebar_fg_focus "#1a1e24" :titlebar_fg_focus "#1a1e24"
:titlebar_fg_normal "#cfcfcf" :titlebar_fg_normal "#cfcfcf"
@ -38,6 +37,6 @@
:taglist_bg_empty (.. "png:" icon-dir "tag-list/unselected.png") :taglist_bg_empty (.. "png:" icon-dir "tag-list/unselected.png")
:taglist_bg_focus (.. "png:" icon-dir "tag-list/selected.png") :taglist_bg_focus (.. "png:" icon-dir "tag-list/selected.png")
:taglist_bg_occupied (.. "png:" icon-dir "tag-list/occupied-border.png") :taglist_bg_occupied (.. "png:" icon-dir "tag-list/occupied.png")
:taglist_bg_urgent (.. "png:" icon-dir "tag-list/urgent.png") :taglist_bg_urgent (.. "png:" icon-dir "tag-list/urgent.png")
}) })

View File

@ -3,107 +3,77 @@ local dpi = require("beautiful").xresources.apply_dpi
local wibox = require("wibox") local wibox = require("wibox")
local clickable_container = require("widget.clickable-container") local clickable_container = require("widget.clickable-container")
local capi = {button = _G.button}
function create_buttons(buttons, object)
if buttons then
local btns = {}
for _, b in ipairs(buttons) do
-- Create a proxy button object: it will receive the real
-- press and release events, and will propagate them to the
-- button object the user provided, but with the object as
-- argument.
local btn = capi.button {modifiers = b.modifiers, button = b.button}
btn:connect_signal(
'press',
function()
b:emit_signal('press', object)
end
)
btn:connect_signal(
'release',
function()
b:emit_signal('release', object)
end
)
btns[#btns + 1] = btn
end
return btns
end
end
function list_update(w, buttons, label, data, objects) function list_update(w, buttons, label, data, objects)
-- update the widgets, creating them if needed -- update the widgets, creating them if needed
w:reset() w:reset()
for i, o in ipairs(objects) do for i, o in ipairs(objects) do
local cache = data[o] local cache = data[o]
local ib, tb, bgb, tbm, ibm, l local ib, tb, bgb, tbm, ibm, l
if cache then if cache then
ib = cache.ib ib = cache.ib
tb = cache.tb tb = cache.tb
bgb = cache.bgb bgb = cache.bgb
tbm = cache.tbm tbm = cache.tbm
ibm = cache.ibm ibm = cache.ibm
else else
ib = wibox.widget.imagebox() ib = wibox.widget.imagebox()
tb = wibox.widget.textbox() tb = wibox.widget.textbox()
bgb = wibox.container.background() bgb = wibox.container.background()
tbm = wibox.container.margin(tb, dpi(4), dpi(4)) tbm = wibox.container.margin(tb, dpi(4), dpi(4))
ibm = wibox.container.margin(ib, dpi(10), dpi(8), dpi(8), dpi(8)) ibm = wibox.container.margin(ib, dpi(10), dpi(8), dpi(8), dpi(8))
-- ibm = wibox.container.margin(ib, dpi(4)) -- ibm = wibox.container.margin(ib, dpi(4))
l = wibox.layout.fixed.horizontal() l = wibox.layout.fixed.horizontal()
bg_clickable = clickable_container() bg_clickable = clickable_container()
-- All of this is added in a fixed widget -- All of this is added in a fixed widget
l:fill_space(true) l:fill_space(true)
l:add(ibm) l:add(ibm)
-- l:add(tbm) -- l:add(tbm)
bg_clickable:set_widget(l) bg_clickable:set_widget(l)
-- And all of this gets a background -- And all of this gets a background
-- bgb:set_widget(l) -- bgb:set_widget(l)
bgb:set_widget(bg_clickable) bgb:set_widget(bg_clickable)
bgb:buttons(create_buttons(buttons, o)) bgb:buttons(common.create_buttons(buttons, o))
data[o] = { data[o] = {
ib = ib, ib = ib,
tb = tb, tb = tb,
bgb = bgb, bgb = bgb,
tbm = tbm, tbm = tbm,
ibm = ibm, ibm = ibm,
} }
end end
local text, bg, bg_image, icon, args = label(o, tb) local text, bg, bg_image, icon, args = label(o, tb)
args = args or {} args = args or {}
-- The text might be invalid, so use pcall. -- The text might be invalid, so use pcall.
if text == nil or text == "" then if text == nil or text == "" then
tbm:set_margins(0) tbm:set_margins(0)
else else
if not tb:set_markup_silently(text) then if not tb:set_markup_silently(text) then
tb:set_markup("<i>&lt;Invalid text&gt;</i>") tb:set_markup("<i>&lt;Invalid text&gt;</i>")
end end
end end
bgb:set_bg(bg) bgb:set_bg(bg)
if type(bg_image) == "function" then if type(bg_image) == "function" then
-- TODO: Why does this pass nil as an argument? -- TODO: Why does this pass nil as an argument?
bg_image = bg_image(tb,o,nil,objects,i) bg_image = bg_image(tb,o,nil,objects,i)
end end
bgb:set_bgimage(bg_image) bgb:set_bgimage(bg_image)
if icon then if icon then
ib:set_image(icon) ib:set_image(icon)
else else
ibm:set_margins(0) ibm:set_margins(0)
end end
bgb.shape = args.shape bgb.shape = args.shape
bgb.shape_border_width = args.shape_border_width bgb.shape_border_width = args.shape_border_width
bgb.shape_border_color = args.shape_border_color bgb.shape_border_color = args.shape_border_color
w:add(bgb) w:add(bgb)
end end
end end

View File

@ -4,12 +4,10 @@
(local awful (require :awful)) (local awful (require :awful))
(local beautiful (require :beautiful)) (local beautiful (require :beautiful))
(local gears (require :gears))
(local wibox (require :wibox)) (local wibox (require :wibox))
(local common (require :awful.widget.common)) (local common (require :awful.widget.common))
(local dpi (. (require :beautiful) :xresources :apply_dpi)) (local dpi (. (require :beautiful) :xresources :apply_dpi))
(local button (. (require :lib.keys) :button))
(local std (require :lib.std)) (local std (require :lib.std))
;;; ;;;
@ -95,11 +93,7 @@
(awful.widget.taglist (awful.widget.taglist
s s
awful.widget.taglist.filter.all awful.widget.taglist.filter.all
(gears.table.join {}
(button [] 1 (lambda [t] (: t :view_only)))
(button [] 3 (lambda [t] (when _G.client.focus (: _G.client.focus :move_to_tag t))))
(button [] 4 (lambda [t] (awful.tag.viewnext t.screen)))
(button [] 5 (lambda [t] (awful.tag.viewprev t.screen))))
{:font (.. beautiful.font " Bold 10") {:font (.. beautiful.font " Bold 10")
:spacing 2} :spacing 2}
;; update-tag-list ;; update-tag-list

View File

@ -1,20 +0,0 @@
(local awful (require :awful))
(local beautiful (require :beautiful))
(local wibox (require :wibox))
(fn tag-number [s]
(awful.widget.taglist
s
awful.widget.taglist.filter.selected
{}
{:taglist_disable_icon true
:bg_empty beautiful.bg_normal
:bg_focus beautiful.bg_focus
:bg_occupied beautiful.bg_normal
:bg_urgent beautiful.bg_normal
:font beautiful.font_mono}
awful.widget.common.list_update
;; (require :widget.list_update)
(wibox.layout.fixed.vertical)))
tag-number