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
:keys (. keys :client)
:buttons buttons
:size_hints_honor false ;; fuck you terminals I know what I want
:placement awful.placement.no_offscreen}}
:placement (+ awful.placement.no_overlap
awful.placement.no_offscreen)}}
{:rule {:floating true}
:properties {:keys (. keys :floating)}}
;; Floating clients.
{:rule_any {:class ["Gpick"
"Orage"
"Pavucontrol"]
{:rule_any {:class ["Gpick"]
:name ["Event Tester"] ;; xev
:role ["pop-up"
"xfce4-terminal-dropdown"]}

View File

@ -8,12 +8,13 @@
;;;
;; Configuration
(local layouts [awful.layout.suit.tile])
(local layouts [awful.layout.suit.tile
awful.layout.suit.floating])
(set awful.layout.layouts layouts)
;; 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/")]
(awful.screen.connect_for_each_screen
@ -21,6 +22,7 @@
(each [n tag (ipairs tags)]
(awful.tag.add
n {:icon (.. icon-path tag)
:icon_only true
:layout (. layouts 1)
:gap_single_client false
:gap beautiful.useless_gap

View File

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

View File

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

View File

@ -4,16 +4,12 @@
(local awful (require :awful))
(local beautiful (require :beautiful))
(local gears (require :gears))
(local dpi beautiful.xresources.apply_dpi)
(local lain (require :lain))
(local wibox (require :wibox))
(local std (require :lib.std))
(local button (. (require :lib.keys) :button))
(local tag-list (require :widget.tag-list))
(local tag-number (require :widget.tag-number))
(local task-list (require :widget.task-list))
(local textclock (require :widget.textclock))
@ -37,14 +33,6 @@
:align "center"
: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 systray (doto (wibox.widget.systray)
(: :set_base_size 24)
@ -53,26 +41,6 @@
(local battery (require :widget.bat))
(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]
(set s.sb (awful.wibar {:position beautiful.sidebar_position
:width beautiful.sidebar_width
@ -80,27 +48,20 @@
(: s.sb :setup
{:layout wibox.layout.align.vertical
1 {1 (border
{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))
1 {1 (border (tag-list s))
:layout wibox.layout.fixed.vertical}
2 {1 (border (center (task-list s)) 4)
:layout wibox.layout.flex.vertical}
3 {1 (center systray)
2 (center battery.widget)
3 (border
{1 {1 (center clock)
:top 3
:bottom 3
:widget wibox.container.margin}
:buttons clock-buttons
:bg beautiful.sidebar_bg_info
:widget wibox.container.background})
3 {1 (border
{1 {1 (center clock)
: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}}))
;;;

View File

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

View File

@ -3,107 +3,77 @@ local dpi = require("beautiful").xresources.apply_dpi
local wibox = require("wibox")
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)
-- update the widgets, creating them if needed
w:reset()
for i, o in ipairs(objects) do
local cache = data[o]
local ib, tb, bgb, tbm, ibm, l
if cache then
ib = cache.ib
tb = cache.tb
bgb = cache.bgb
tbm = cache.tbm
ibm = cache.ibm
else
ib = wibox.widget.imagebox()
tb = wibox.widget.textbox()
bgb = wibox.container.background()
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(4))
l = wibox.layout.fixed.horizontal()
bg_clickable = clickable_container()
-- update the widgets, creating them if needed
w:reset()
for i, o in ipairs(objects) do
local cache = data[o]
local ib, tb, bgb, tbm, ibm, l
if cache then
ib = cache.ib
tb = cache.tb
bgb = cache.bgb
tbm = cache.tbm
ibm = cache.ibm
else
ib = wibox.widget.imagebox()
tb = wibox.widget.textbox()
bgb = wibox.container.background()
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(4))
l = wibox.layout.fixed.horizontal()
bg_clickable = clickable_container()
-- All of this is added in a fixed widget
l:fill_space(true)
l:add(ibm)
-- l:add(tbm)
bg_clickable:set_widget(l)
-- All of this is added in a fixed widget
l:fill_space(true)
l:add(ibm)
-- l:add(tbm)
bg_clickable:set_widget(l)
-- And all of this gets a background
-- bgb:set_widget(l)
bgb:set_widget(bg_clickable)
-- And all of this gets a background
-- bgb:set_widget(l)
bgb:set_widget(bg_clickable)
bgb:buttons(create_buttons(buttons, o))
bgb:buttons(common.create_buttons(buttons, o))
data[o] = {
ib = ib,
tb = tb,
bgb = bgb,
tbm = tbm,
ibm = ibm,
}
end
data[o] = {
ib = ib,
tb = tb,
bgb = bgb,
tbm = tbm,
ibm = ibm,
}
end
local text, bg, bg_image, icon, args = label(o, tb)
args = args or {}
local text, bg, bg_image, icon, args = label(o, tb)
args = args or {}
-- The text might be invalid, so use pcall.
if text == nil or text == "" then
tbm:set_margins(0)
else
if not tb:set_markup_silently(text) then
tb:set_markup("<i>&lt;Invalid text&gt;</i>")
end
end
bgb:set_bg(bg)
if type(bg_image) == "function" then
-- TODO: Why does this pass nil as an argument?
bg_image = bg_image(tb,o,nil,objects,i)
end
bgb:set_bgimage(bg_image)
if icon then
ib:set_image(icon)
else
ibm:set_margins(0)
end
-- The text might be invalid, so use pcall.
if text == nil or text == "" then
tbm:set_margins(0)
else
if not tb:set_markup_silently(text) then
tb:set_markup("<i>&lt;Invalid text&gt;</i>")
end
end
bgb:set_bg(bg)
if type(bg_image) == "function" then
-- TODO: Why does this pass nil as an argument?
bg_image = bg_image(tb,o,nil,objects,i)
end
bgb:set_bgimage(bg_image)
if icon then
ib:set_image(icon)
else
ibm:set_margins(0)
end
bgb.shape = args.shape
bgb.shape_border_width = args.shape_border_width
bgb.shape_border_color = args.shape_border_color
bgb.shape = args.shape
bgb.shape_border_width = args.shape_border_width
bgb.shape_border_color = args.shape_border_color
w:add(bgb)
w:add(bgb)
end
end

View File

@ -4,12 +4,10 @@
(local awful (require :awful))
(local beautiful (require :beautiful))
(local gears (require :gears))
(local wibox (require :wibox))
(local common (require :awful.widget.common))
(local dpi (. (require :beautiful) :xresources :apply_dpi))
(local button (. (require :lib.keys) :button))
(local std (require :lib.std))
;;;
@ -95,11 +93,7 @@
(awful.widget.taglist
s
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")
:spacing 2}
;; 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