diff options
author | xero <x@xero.nu> | 2014-03-08 22:14:34 -0500 |
---|---|---|
committer | xero <x@xero.nu> | 2014-03-08 22:14:34 -0500 |
commit | aedf4ef0ec9712789310b5b6d7d06af90f4f6261 (patch) | |
tree | ae25f438d4942195892dd9c311badcccf00dd4d8 /.config/awesome/lain/widgets/borderbox.lua | |
parent | 02dd2db6564b9e3fd1e1582724bbd188f5de7db6 (diff) | |
download | dotfiles_ascii-aedf4ef0ec9712789310b5b6d7d06af90f4f6261.tar.xz dotfiles_ascii-aedf4ef0ec9712789310b5b6d7d06af90f4f6261.zip |
add awesome wm config files and v0.1.0 of ghost theme.
Diffstat (limited to '')
-rw-r--r-- | .config/awesome/lain/widgets/borderbox.lua | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/.config/awesome/lain/widgets/borderbox.lua b/.config/awesome/lain/widgets/borderbox.lua new file mode 100644 index 0000000..c251ea8 --- /dev/null +++ b/.config/awesome/lain/widgets/borderbox.lua @@ -0,0 +1,61 @@ + +--[[ + + Licensed under GNU General Public License v2 + * (c) 2013, Luke Bonham + * (c) 2010-2012, Peter Hofmann + +--]] + +local wibox = require("awful.wibox") +local setmetatable = setmetatable + +-- Creates a thin wibox at a position relative to another wibox +-- lain.widgets.borderbox +local borderbox = {} + +local function worker(relbox, s, args) + local where = args.position or 'top' + local color = args.color or '#FFFFFF' + local size = args.size or 1 + local box = nil + local wiboxarg = { + position = nil, + bg = color + } + + if where == 'top' + then + wiboxarg.width = relbox.width + wiboxarg.height = size + box = wibox(wiboxarg) + box.x = relbox.x + box.y = relbox.y - size + elseif where == 'bottom' + then + wiboxarg.width = relbox.width + wiboxarg.height = size + box = wibox(wiboxarg) + box.x = relbox.x + box.y = relbox.y + relbox.height + elseif where == 'left' + then + wiboxarg.width = size + wiboxarg.height = relbox.height + box = wibox(wiboxarg) + box.x = relbox.x - size + box.y = relbox.y + elseif where == 'right' + then + wiboxarg.width = size + wiboxarg.height = relbox.height + box = wibox(wiboxarg) + box.x = relbox.x + relbox.width + box.y = relbox.y + end + + box.screen = s + return box +end + +return setmetatable(borderbox, { __call = function(_, ...) return worker(...) end }) |