]>
git.madduck.net Git - etc/awesome.git/commitdiff
madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@ git. madduck. net .
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged .
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (parent:
5d7c607 )
-local tag = require("awful.tag ")
+local scr = require("awful.screen ")
local tonumber = tonumber
local cascade = {
local tonumber = tonumber
local cascade = {
-- Screen.
local wa = p.workarea
local cls = p.clients
-- Screen.
local wa = p.workarea
local cls = p.clients
+ local ta = scr.focused().selected_tag
+
+ if not ta then return end
if #cls <= 0 then return end
if #cls <= 0 then return end
if cascade.nmaster > 0 then
num_c = cascade.nmaster
else
if cascade.nmaster > 0 then
num_c = cascade.nmaster
else
- num_c = tag .master_count
+ num_c = ta.master_count
end
-- Opening a new window will usually force all existing windows to
end
-- Opening a new window will usually force all existing windows to
if cascade.tile.mwfact > 0 then
mwfact = cascade.tile.mwfact
else
if cascade.tile.mwfact > 0 then
mwfact = cascade.tile.mwfact
else
- mwfact = tag.getmwfact(t)
+ mwfact = ta.master_width_factor
end
-- Make slave windows overlap main window? Do this if ncol is 1.
end
-- Make slave windows overlap main window? Do this if ncol is 1.
if cascade.tile.ncol > 0 then
overlap_main = cascade.tile.ncol
else
if cascade.tile.ncol > 0 then
overlap_main = cascade.tile.ncol
else
- overlap_main = tag .column_count
+ overlap_main = ta.column_count
end
-- Minimum space for slave windows? See cascade.tile.lua.
end
-- Minimum space for slave windows? See cascade.tile.lua.
if cascade.tile.nmaster > 0 then
num_c = cascade.tile.nmaster
else
if cascade.tile.nmaster > 0 then
num_c = cascade.tile.nmaster
else
- num_c = tag .master_count
+ num_c = ta.master_count
end
local how_many = (#cls - 1 >= num_c and (#cls - 1)) or num_c
end
local how_many = (#cls - 1 >= num_c and (#cls - 1)) or num_c
-local tag = require("awful.tag")
local tonumber = tonumber
local math = { floor = math.floor }
local tonumber = tonumber
local math = { floor = math.floor }
+local scr = require("awful.screen")
local centerwork = {
name = "centerwork",
local centerwork = {
name = "centerwork",
-- Screen.
local wa = p.workarea
local cls = p.clients
-- Screen.
local wa = p.workarea
local cls = p.clients
+ local ta = scr.focused().selected_tag
+
+ if not ta then return end
if #cls <= 0 then return end
if #cls <= 0 then return end
local g = {}
-- Main column, fixed width and height.
local g = {}
-- Main column, fixed width and height.
- local mwfact = tag.object.get_master_width_factor(t)
+ local mwfact = ta.master_width_factor
local mainhei = math.floor(wa.height * mwfact)
local mainwid = math.floor(wa.width * mwfact)
local slavewid = wa.width - mainwid
local mainhei = math.floor(wa.height * mwfact)
local mainwid = math.floor(wa.width * mwfact)
local slavewid = wa.width - mainwid
-local tag = require("awful.tag ")
+local scr = require("awful.screen ")
local math = { ceil = math.ceil,
floor = math.floor,
max = math.max }
local math = { ceil = math.ceil,
floor = math.floor,
max = math.max }
-- Screen.
local wa = p.workarea
local cls = p.clients
-- Screen.
local wa = p.workarea
local cls = p.clients
+ local ta = scr.focused().selected_tag
+
+ if not ta then return end
if #cls <= 0 then return end
if #cls <= 0 then return end
if #cls <= 0 then return end
-- How many vertical columns? Read from nmaster on the tag.
if #cls <= 0 then return end
-- How many vertical columns? Read from nmaster on the tag.
- local num_x = tonumber(termfair.nmaster) or tag.master_count
- local ncol = tonumber(termfair.ncol) or tag.column_count
- local width = math.floor((wa.width - (num_x + 1)*useless_gap) / num_x)
+ local num_x = tonumber(termfair.nmaster) or ta.master_count
+ local ncol = tonumber(termfair.ncol) or ta.column_count
if num_x <= 2 then num_x = 2 end
if ncol <= 1 then ncol = 1 end
if num_x <= 2 then num_x = 2 end
if ncol <= 1 then ncol = 1 end
+ local width = math.floor((wa.width - (num_x + 1)*useless_gap) / num_x)
local num_y = math.max(math.ceil(#cls / num_x), ncol)
local height = math.floor((wa.height - (num_y + 1)*useless_gap) / num_y)
local num_y = math.max(math.ceil(#cls / num_x), ncol)
local height = math.floor((wa.height - (num_y + 1)*useless_gap) / num_y)
-- +---+---+---+ +---+---+---+
-- How many vertical columns? Read from nmaster on the tag.
-- +---+---+---+ +---+---+---+
-- How many vertical columns? Read from nmaster on the tag.
- local num_x = tonumber(termfair.center.nmaster) or tag.master_count
- local ncol = tonumber(termfair.center.ncol) or tag.column_count
- local width = math.floor((wa.width - (num_x + 1)*useless_gap) / num_x)
+ local num_x = tonumber(termfair.center.nmaster) or ta.master_count
+ local ncol = tonumber(termfair.center.ncol) or ta.column_count
if num_x <= 2 then num_x = 2 end
if ncol <= 1 then ncol = 1 end
if num_x <= 2 then num_x = 2 end
if ncol <= 1 then ncol = 1 end
+ local width = math.floor((wa.width - (num_x + 1)*useless_gap) / num_x)
+
if #cls < num_x then
-- Less clients than the number of columns, let's center it!
local offset_x = wa.x + (wa.width - #cls*width - (#cls - 1)*useless_gap) / 2
if #cls < num_x then
-- Less clients than the number of columns, let's center it!
local offset_x = wa.x + (wa.width - #cls*width - (#cls - 1)*useless_gap) / 2