diff --git a/layouts/init.lua b/layouts/init.lua index 7770259..ab8c39d 100644 --- a/layouts/init.lua +++ b/layouts/init.lua @@ -1,3 +1,3 @@ -require("layouts.tile") +require("layouts.tilegaps") module("layouts") diff --git a/layouts/tile.lua b/layouts/tile.lua deleted file mode 100644 index 63bb1b8..0000000 --- a/layouts/tile.lua +++ /dev/null @@ -1,221 +0,0 @@ ---------------------------------------------------------------------------- --- @author Donald Ephraim Curtis <dcurtis@cs.uiowa.edu> --- @author Julien Danjou <julien@danjou.info> --- @copyright 2009 Donald Ephraim Curtis --- @copyright 2008 Julien Danjou --- @release v3.4.11 ---------------------------------------------------------------------------- - --- Grab environment we need -local ipairs = ipairs -local math = math -local tag = require("awful.tag") - ---- Tiled layouts module for awful -module("layouts.tile") - -local function tile_group(cls, wa, orientation, fact, group) - -- get our orientation right - local height = "height" - local width = "width" - local x = "x" - local y = "y" - if orientation == "top" or orientation == "bottom" then - height = "width" - width = "height" - x = "y" - y = "x" - end - - -- make this more generic (not just width) - available = wa[width] - (group.coord - wa[x]) - - -- find our total values - local total_fact = 0 - local min_fact = 1 - local size = group.size - for c = group.first,group.last do - -- determine the width/height based on the size_hint - local i = c - group.first +1 - local size_hints = cls[c].size_hints - local size_hint = size_hints["min_"..width] or size_hints["base_"..width] or 0 - size_hint = size_hint + cls[c].border_width*2 - size = math.max(size_hint, size) - - -- calculate the height - if not fact[i] then - fact[i] = min_fact - else - min_fact = math.min(fact[i],min_fact) - end - total_fact = total_fact + fact[i] - end - size = math.min(size, available) - - local coord = wa[y] - local geom = {} - local used_size = 0 - local unused = wa[height] - local stat_coord = wa[x] - --stat_coord = size - for c = group.first,group.last do - local i = c - group.first +1 - geom[width] = size - geom[height] = math.floor(unused * fact[i] / total_fact) - geom[x] = group.coord - geom[y] = coord - - - coord = coord + geom[height] - unused = unused - geom[height] - total_fact = total_fact - fact[i] - used_size = math.max(used_size, geom[width]) - - - -- Useless gap. - useless_gap = 25 - if useless_gap > 0 - then - -- Top and left clients are shrinked by two steps and - -- get moved away from the border. Other clients just - -- get shrinked in one direction. - - top = false - left = false - - if geom[y] == wa[y] then - top = true - end - - if geom[x] == 0 or geom[x] == wa[x] then - left = true - end - - if top then - geom[height] = geom[height] - 2 * useless_gap - geom[y] = geom[y] + useless_gap - else - geom[height] = geom[height] - useless_gap - end - - if left then - geom[width] = geom[width] - 2 * useless_gap - geom[x] = geom[x] + useless_gap - else - geom[width] = geom[width] - useless_gap - end - end - -- End of useless gap. - - geom = cls[c]:geometry(geom) - end - - return used_size -end - -local function tile(param, orientation) - local t = tag.selected(param.screen) - orientation = orientation or "right" - - -- this handles are different orientations - local height = "height" - local width = "width" - local x = "x" - local y = "y" - if orientation == "top" or orientation == "bottom" then - height = "width" - width = "height" - x = "y" - y = "x" - end - - local cls = param.clients - local nmaster = math.min(tag.getnmaster(t), #cls) - local nother = math.max(#cls - nmaster,0) - - local mwfact = tag.getmwfact(t) - local wa = param.workarea - local ncol = tag.getncol(t) - - local data = tag.getdata(t).windowfact - - if not data then - data = {} - tag.getdata(t).windowfact = data - end - - local coord = wa[x] - local place_master = true - if orientation == "left" or orientation == "top" then - -- if we are on the left or top we need to render the other windows first - place_master = false - end - - -- this was easier than writing functions because there is a lot of data we need - for d = 1,2 do - if place_master and nmaster > 0 then - local size = wa[width] - if nother > 0 then - size = math.min(wa[width] * mwfact, wa[width] - (coord - wa[x])) - end - if not data[0] then - data[0] = {} - end - coord = coord + tile_group(cls, wa, orientation, data[0], {first=1, last=nmaster, coord = coord, size = size}) - end - - if not place_master and nother > 0 then - local last = nmaster - - -- we have to modify the work area size to consider left and top views - local wasize = wa[width] - if nmaster > 0 and (orientation == "left" or orientation == "top") then - wasize = wa[width] - wa[width]*mwfact - end - for i = 1,ncol do - -- Try to get equal width among remaining columns - local size = math.min( (wasize - (coord - wa[x])) / (ncol - i + 1) ) - local first = last + 1 - last = last + math.floor((#cls - last)/(ncol - i + 1)) - -- tile the column and update our current x coordinate - if not data[i] then - data[i] = {} - end - coord = coord + tile_group(cls, wa, orientation, data[i], { first = first, last = last, coord = coord, size = size }) - end - end - place_master = not place_master - end - -end - -right = {} -right.name = "tile" -right.arrange = tile - ---- The main tile algo, on left. --- @param screen The screen number to tile. -left = {} -left.name = "tileleft" -function left.arrange(p) - return tile(p, "left") -end - ---- The main tile algo, on bottom. --- @param screen The screen number to tile. -bottom = {} -bottom.name = "tilebottom" -function bottom.arrange(p) - return tile(p, "bottom") -end - ---- The main tile algo, on top. --- @param screen The screen number to tile. -top = {} -top.name = "tiletop" -function top.arrange(p) - return tile(p, "top") -end - -arrange = right.arrange -name = right.name diff --git a/rc.lua.blackburn b/rc.lua.blackburn index 7d52708..d62ca63 100755 --- a/rc.lua.blackburn +++ b/rc.lua.blackburn @@ -18,6 +18,7 @@ local naughty = require("naughty") local vicious = require("vicious") local scratch = require("scratch") local yawn = require("yawn") +local layouts = require("layouts") -- Run once function @@ -97,6 +98,7 @@ layouts = awful.layout.suit.fair, -- 3 awful.layout.suit.tile.left, -- 4 awful.layout.suit.tile.top, -- 5 + layouts.tilegaps, -- 6 } diff --git a/rc.lua.dremora b/rc.lua.dremora index f18595f..f73b148 100755 --- a/rc.lua.dremora +++ b/rc.lua.dremora @@ -18,6 +18,7 @@ local naughty = require("naughty") local vicious = require("vicious") local scratch = require("scratch") local yawn = require("yawn") +local layouts = require("layouts") -- Run once function @@ -98,6 +99,7 @@ layouts = awful.layout.suit.fair, -- 3 awful.layout.suit.tile.left, -- 4 awful.layout.suit.tile.top, -- 5 + layouts.tilegaps, -- 6 } diff --git a/rc.lua.multicolor b/rc.lua.multicolor index acd91c0..f77e369 100755 --- a/rc.lua.multicolor +++ b/rc.lua.multicolor @@ -17,6 +17,7 @@ beautiful = require("beautiful") naughty = require("naughty") vicious = require("vicious") scratch = require("scratch") +layouts = require("layouts") -- }}} @@ -112,6 +113,7 @@ layouts = awful.layout.suit.max, -- 10 --awful.layout.suit.max.fullscreen, -- 11 --awful.layout.suit.magnifier -- 12 + layouts.tilegaps, -- 13 } -- }}} diff --git a/rc.lua.powerarrow-darker b/rc.lua.powerarrow-darker index f955aeb..2bebb2b 100755 --- a/rc.lua.powerarrow-darker +++ b/rc.lua.powerarrow-darker @@ -17,6 +17,7 @@ beautiful = require("beautiful") naughty = require("naughty") vicious = require("vicious") scratch = require("scratch") +layouts = require("layouts") -- }}} @@ -116,6 +117,7 @@ layouts = awful.layout.suit.max, -- 10 --awful.layout.suit.max.fullscreen, -- 11 --awful.layout.suit.magnifier -- 12 + layouts.tilegaps, -- 13 } -- }}} diff --git a/rc.lua.rainbow b/rc.lua.rainbow index 5ae933c..09ad149 100755 --- a/rc.lua.rainbow +++ b/rc.lua.rainbow @@ -103,7 +103,7 @@ layouts = awful.layout.suit.fair, -- 3 awful.layout.suit.tile.bottom, -- 4 awful.layout.suit.fair.horizontal, -- 5 - layouts.tile, -- 6 + layouts.tilegaps, -- 6 } -- }}} @@ -556,7 +556,7 @@ function (widget, args) bg = "#242424" }) no_net_shown = false end - return gray .. " Net " .. coldef .. "Off " .. coldef + return gray .. " Net " .. coldef .. "Off " .. coldef else no_net_shown = true return '' @@ -919,13 +919,18 @@ awful.rules.rules = { properties = { opacity = 0.99 } }, { rule = { class = "MPlayer" }, - properties = { floating = true } }, + properties = { floating = true } }, { rule = { class = "Dwb" }, + properties = { tag = tags[1][1], + maximized_horizontal = true, + maximized_vertical = true } }, + + { rule = { instance = "plugin-container" }, properties = { tag = tags[1][1] } }, { rule = { class = "Gimp" }, - properties = { tag = tags[1][4] } }, + properties = { tag = tags[1][4] } }, { rule = { class = "Gimp", role = "gimp-image-window" }, properties = { maximized_horizontal = true, diff --git a/rc.lua.steamburn b/rc.lua.steamburn index 1528722..83130ce 100755 --- a/rc.lua.steamburn +++ b/rc.lua.steamburn @@ -17,6 +17,7 @@ beautiful = require("beautiful") naughty = require("naughty") vicious = require("vicious") scratch = require("scratch") +layouts = require("layouts") -- Run once function @@ -105,6 +106,7 @@ layouts = awful.layout.suit.max, -- 10 --awful.layout.suit.max.fullscreen, -- 11 --awful.layout.suit.magnifier -- 12 + layouts.tilegaps, -- 13 } diff --git a/themes/blackburn/icons/tilegaps.png b/themes/blackburn/icons/tilegaps.png new file mode 100644 index 0000000..69fed1a Binary files /dev/null and b/themes/blackburn/icons/tilegaps.png differ diff --git a/themes/blackburn/theme.lua b/themes/blackburn/theme.lua index 6edcb28..fdabc94 100644 --- a/themes/blackburn/theme.lua +++ b/themes/blackburn/theme.lua @@ -46,6 +46,7 @@ theme.arrl_lr_pre = themes_dir .. "/icons/arrl_lr_pre. theme.arrl_lr_post = themes_dir .. "/icons/arrl_lr_post.png" theme.layout_tile = themes_dir .. "/icons/tile.png" +theme.layout_tilegaps = themes_dir .. "/icons/tilegaps.png" theme.layout_tileleft = themes_dir .. "/icons/tileleft.png" theme.layout_tilebottom = themes_dir .. "/icons/tilebottom.png" theme.layout_tiletop = themes_dir .. "/icons/tiletop.png" diff --git a/themes/dremora/icons/tilegaps.png b/themes/dremora/icons/tilegaps.png new file mode 100644 index 0000000..cab4c7e Binary files /dev/null and b/themes/dremora/icons/tilegaps.png differ diff --git a/themes/dremora/theme.lua b/themes/dremora/theme.lua index 3a9f919..2491220 100644 --- a/themes/dremora/theme.lua +++ b/themes/dremora/theme.lua @@ -36,6 +36,7 @@ theme.arrl_lr_pre = themes_dir .. "/icons/arrl_lr_pre. theme.arrl_lr_post = themes_dir .. "/icons/arrl_lr_post.png" theme.layout_tile = themes_dir .. "/icons/tile.png" +theme.layout_tilegaps = themes_dir .. "/icons/tilegaps.png" theme.layout_tileleft = themes_dir .. "/icons/tileleft.png" theme.layout_tilebottom = themes_dir .. "/icons/tilebottom.png" theme.layout_tiletop = themes_dir .. "/icons/tiletop.png" diff --git a/themes/multicolor/layouts/tilegaps.png b/themes/multicolor/layouts/tilegaps.png new file mode 100644 index 0000000..539e29c Binary files /dev/null and b/themes/multicolor/layouts/tilegaps.png differ diff --git a/themes/multicolor/theme.lua b/themes/multicolor/theme.lua index c195b3d..b728903 100644 --- a/themes/multicolor/theme.lua +++ b/themes/multicolor/theme.lua @@ -69,6 +69,7 @@ theme.tasklist_maximized_horizontal = "" theme.tasklist_maximized_vertical = "" theme.layout_tile = theme.confdir .. "/layouts/tile.png" +theme.layout_tilegaps = theme.confdir .. "/layouts/tilegaps.png" theme.layout_tileleft = theme.confdir .. "/layouts/tileleft.png" theme.layout_tilebottom = theme.confdir .. "/layouts/tilebottom.png" theme.layout_tiletop = theme.confdir .. "/layouts/tiletop.png" diff --git a/themes/powerarrow-darker/icons/tilegaps.png b/themes/powerarrow-darker/icons/tilegaps.png new file mode 100644 index 0000000..b1cc143 Binary files /dev/null and b/themes/powerarrow-darker/icons/tilegaps.png differ diff --git a/themes/powerarrow-darker/theme.lua b/themes/powerarrow-darker/theme.lua index ac74e6e..9cc0627 100644 --- a/themes/powerarrow-darker/theme.lua +++ b/themes/powerarrow-darker/theme.lua @@ -42,6 +42,7 @@ theme.taglist_squares_sel = themes_dir .. "/icons/square_sel.p theme.taglist_squares_unsel = themes_dir .. "/icons/square_unsel.png" theme.layout_tile = themes_dir .. "/icons/tile.png" +theme.layout_tilegaps = themes_dir .. "/icons/tilegaps.png" theme.layout_tileleft = themes_dir .. "/icons/tileleft.png" theme.layout_tilebottom = themes_dir .. "/icons/tilebottom.png" theme.layout_tiletop = themes_dir .. "/icons/tiletop.png" diff --git a/themes/rainbow/theme.lua b/themes/rainbow/theme.lua index 44c2016..36ad6c6 100644 --- a/themes/rainbow/theme.lua +++ b/themes/rainbow/theme.lua @@ -12,6 +12,7 @@ themes_dir = os.getenv("HOME") .. "/.config/awe theme.wallpaper = themes_dir .. "/wall.png" theme.font = "Tamsyn 10" +--theme.font = "Ohsnapu 12" theme.fg_normal = "#9E9E9E" theme.fg_focus = "#EBEBFF" theme.bg_normal = "#242424" @@ -19,7 +20,7 @@ theme.bg_focus = "#242424" theme.fg_urgent = "#000000" theme.bg_urgent = "#FFFFFF" theme.border_width = "1" -theme.border_normal = "#222222" +theme.border_normal = "#242424" theme.border_focus = "#999999" theme.titlebar_bg_focus = "#292929" theme.taglist_fg_focus = "#EBEBFF" @@ -35,6 +36,7 @@ theme.widget_no_net_notify = themes_dir .. "/icons/no_net_notif theme.vol_mute = themes_dir .. "/icons/vol_mute.png" theme.layout_txt_tile = "[t]" +theme.layout_txt_tilegaps = "[t2]" theme.layout_txt_tileleft = "[l]" theme.layout_txt_tilebottom = "[b]" theme.layout_txt_tiletop = "[tt]" diff --git a/themes/steamburn/icons/tilegaps.png b/themes/steamburn/icons/tilegaps.png new file mode 100644 index 0000000..eccd966 Binary files /dev/null and b/themes/steamburn/icons/tilegaps.png differ diff --git a/themes/steamburn/theme.lua b/themes/steamburn/theme.lua index 13fde34..1b1b914 100644 --- a/themes/steamburn/theme.lua +++ b/themes/steamburn/theme.lua @@ -42,6 +42,7 @@ theme.taglist_squares_sel = themes_dir .. "/icons/square_sel.p theme.taglist_squares_unsel = themes_dir .. "/icons/square_unsel.png" theme.layout_tile = themes_dir .. "/icons/tile.png" +theme.layout_tilegaps = themes_dir .. "/icons/tilegaps.png" theme.layout_tileleft = themes_dir .. "/icons/tileleft.png" theme.layout_tilebottom = themes_dir .. "/icons/tilebottom.png" theme.layout_tiletop = themes_dir .. "/icons/tiletop.png"