-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from budlabs/dev
Dev
- Loading branch information
Showing
81 changed files
with
6,625 additions
and
925 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
BEGIN { | ||
# sq contains a single quote for convenience | ||
sq = "'" | ||
|
||
# act|trg == 0: active/target window not found yet | ||
# act|trg == 1: active/target window in process | ||
# act|trg == 2: active/target window processed | ||
|
||
# hit !=0: inside i3fyra container | ||
|
||
act=trg=hit=0 | ||
|
||
# set trg to processed if no criterion is given. | ||
# mirror active window to target before print. | ||
|
||
if (crit=="X") {trg=2} | ||
|
||
# define layout depending on orientation | ||
# splits[1] & splits[2] = families | ||
# splits[3] = main split | ||
|
||
if (ENVIRON["I3FYRA_ORIENTATION"]=="vertical") { | ||
splits[1]="AB" | ||
splits[2]="CD" | ||
splits[3]="AC" | ||
} | ||
else { | ||
splits[1]="AC" | ||
splits[2]="BD" | ||
splits[3]="AB" | ||
} | ||
|
||
# fam array used to calculate relation between | ||
# containers in setfamily function. | ||
|
||
fam[1][1] = substr(splits[1],1,1) | ||
fam[1][-1] = substr(splits[1],2,1) | ||
fam[-1][1] = substr(splits[2],1,1) | ||
fam[-1][-1] = substr(splits[2],2,1) | ||
|
||
# base layout array | ||
|
||
defaults[1]="A" | ||
defaults[2]="B" | ||
defaults[3]="C" | ||
defaults[4]="D" | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
END { | ||
|
||
# mirror active to target if no criteria is given | ||
|
||
if (crit == "X") { | ||
for (k in window["A"]) { | ||
tk=k;sub("A","T",tk) | ||
if (!window["T"][tk]) {window["T"][tk]=window["A"][k]} | ||
} | ||
|
||
if (!workspace["WST"]) {setworkspace(workspace["WAI"],"T")} | ||
} | ||
|
||
stringformat="i3list[%s]=%-15s\t# %s\n" | ||
descriptions() | ||
|
||
if (toprint ~ /^(all|active|window)$/) { | ||
for (k in window["A"]){ | ||
printf(stringformat, k, window["A"][k], desc[k]) | ||
} | ||
} | ||
|
||
|
||
if (toprint ~ /^(all|target|window)$/) { | ||
|
||
if (window["T"]["TWC"]) { | ||
for (k in window["T"]) { | ||
printf(stringformat, k, window["T"][k], desc[k]) | ||
} | ||
} | ||
} | ||
|
||
|
||
# following block will only get printed if there is | ||
# an i3fyra layout. | ||
|
||
if (workspace["WSF"]) { | ||
|
||
if (toprint ~ /^(all|container|i3fyra)$/) { | ||
for (k in container) { | ||
printf(stringformat, k, container[k], desc[k]) | ||
} | ||
} | ||
|
||
for (k in defaults) { | ||
|
||
if (container["C" defaults[k] "W"]){ | ||
if (container["C" defaults[k] "W"] == workspace["WSF"]){ | ||
layout["LVI"]=defaults[k] layout["LVI"] | ||
} else { | ||
layout["LHI"]=defaults[k] layout["LHI"] | ||
} | ||
} | ||
|
||
} | ||
|
||
if (ENVIRON["I3FYRA_ORIENTATION"]=="vertical") { | ||
splits[1]="AB" | ||
splits[2]="CD" | ||
splits[3]="AC" | ||
} | ||
|
||
|
||
layout["LEX"]=layout["LVI"] layout["LHI"] | ||
|
||
if (ENVIRON["I3FYRA_ORIENTATION"]=="vertical") { | ||
# ac and bd is the same, height of a or b | ||
if (layout["LVI"] ~ "A") { | ||
outsplit["SAC"]=dim[acon["A"]]["window"]["height"] | ||
} | ||
else if (layout["LVI"] ~ "B") { | ||
outsplit["SAC"]=dim[acon["B"]]["window"]["height"] | ||
} | ||
else { | ||
outsplit["SAC"]=0 | ||
} | ||
|
||
outsplit["SBD"]=outsplit["SAC"] | ||
outsplit["SAB"]=dim[acon["A"]]["window"]["width"] | ||
outsplit["SCD"]=dim[acon["C"]]["window"]["width"] | ||
} else { | ||
# ab and cd is the same, width of a or c | ||
if (layout["LVI"] ~ "A") { | ||
outsplit["SAB"]=dim[acon["A"]]["window"]["width"] | ||
} | ||
else if (layout["LVI"] ~ "C") { | ||
outsplit["SAB"]=dim[acon["C"]]["window"]["width"] | ||
} | ||
else { | ||
outsplit["SAB"]=0 | ||
} | ||
|
||
outsplit["SBD"]=outsplit["SAB"] | ||
|
||
outsplit["SAC"]=dim[acon["A"]]["window"]["height"] | ||
outsplit["SCD"]=dim[acon["C"]]["window"]["width"] | ||
} | ||
|
||
if (layout["LVI"] ~ "[" splits[1] "]") { | ||
if (layout["LVI"] !~ "[" splits[2] "]") {outsplit["S"splits[3]]=0} | ||
if (layout["LHI"] ~ "[" splits[1] "]") {outsplit["S"splits[1]]=0} | ||
} | ||
|
||
if (layout["LVI"] ~ "[" splits[2] "]") { | ||
if (layout["LVI"] !~ "[" splits[1] "]") {outsplit["S"splits[3]]=0} | ||
if (layout["LHI"] ~ "[" splits[2] "]") {outsplit["S"splits[2]]=0} | ||
} | ||
|
||
if (toprint ~ /^(all|splits|i3fyra)$/) { | ||
for(k in outsplit){ | ||
printf(stringformat, k, outsplit[k], desc[k]) | ||
} | ||
} | ||
|
||
|
||
if (toprint ~ /^(all|layout|i3fyra)$/) { | ||
for(k in layout){ | ||
printf(stringformat, k, layout[k], desc[k]) | ||
} | ||
|
||
for(k in family){ | ||
printf(stringformat, k, family[k], desc[k]) | ||
} | ||
} | ||
} | ||
|
||
layout["LAL"]=splits[1] splits[2] | ||
printf(stringformat, "LAL", layout["LAL"], desc["LAL"]) | ||
if (toprint ~ /^(all|workspace)$/) { | ||
for(k in workspace){ | ||
printf(stringformat, k, workspace[k], desc[k]) | ||
} | ||
} | ||
} |
Oops, something went wrong.