Skip to content

Commit

Permalink
Merge pull request #50 from budlabs/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
budRich authored Feb 7, 2019
2 parents 0dcdfb5 + 43804ac commit b8931ab
Show file tree
Hide file tree
Showing 81 changed files with 6,625 additions and 925 deletions.
88 changes: 32 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ directory or the scripts to your **$PATH**.
---

There is no oneline way to describe what **i3ass** does.
And some of the scripts are rather complex, To get an idea I
suggest taking a look in the [wiki] or the individual readme
files for each script (linked in the table below).
And some of the scripts are rather complex. The links in the
table below, will take you to the wiki page for the script.

|**file** | **function** |
|:---------|:--------------------------|
Expand All @@ -64,6 +63,7 @@ files for each script (linked in the table below).
|[i3gw] | a ghost window wrapper for i3wm
|[i3Kornhe] | move and resize windows gracefully
|[i3list] | list information about the current i3 session.
|[i3menu] | Adds more features to rofi when used in i3wm
|[i3run] | Run, Raise or hide windows in i3wm
|[i3var] | Set or get a i3 variable
|[i3viswiz] | Professional window focus for i3wm
Expand All @@ -79,8 +79,25 @@ about the command.
`i3ass` show version info for all scripts and dependencies.
## updates

### 2019.02.07.06

Added [i3menu] which is an improved version of the script
`oneliner` that has been available in the **budlabs
organization** for some time. I figured i include it with
**i3ass** instead, since it is very *i3 focused*, see the
wiki for more info.

Refactored [i3list] to make it easier to manage and fixed a
small issue that resulted in splits being reported with the
wrong size if the *main container* of the split was hidden.
The issue had never caused any serious issues, but now that
it is fixed I experience faster creation of the [i3fyra]
layout, it also made some functions in the new script
[i3menu] work as expected.

### 2019.01.30.2


Fixed two bugs (#46,#47) in [i3fyra] and [i3list]. `--hide`
in [i3fyra] now works again. The issue in [i3list] was
affecting targeted windows and their floating state,
Expand All @@ -99,50 +116,6 @@ and added `make uninstall` to the **PKGBUILD** on [AUR]. To
improve the installation process. (*thanks to Johan for
reporting issue with i3ass command in makefil*).

### 2019.01.11.0


Extreme refactoring edition.
The project now uses [bashbud] as the backbone for code and
documentation organization. A lot of changes "under the
hood" and to documentation, but few functional changes
except:

A new command will get installed, `i3ass`, when executed a
list of installed i3 ass scripts, their version number and
dependencies will get printed. Please include this output in
any submitted issues.

[i3fyra] Should now work well with the latest (4.16)
version of [i3]. A new environment variable can be set for
i3fyra, **I3FYRA_ORIENTATION**, setting this to 'vertical'
changes the layout, read more in the [wiki].

[i3viswiz] No includes `--focus` option, that will replace
the previous `focusvisible` command. Likewise specifying a
search option (`--title`, `--instance`, `--parent`,
`--class`, `--winid`, `--parent`, `--titleformat`) and a
search string, will return the **CON_ID** of any found
visible window, replacing `getvisible` command. If no search
string is passed, a list of all visible tiles windows and a
string representing the search option will be displayed.

EXAMPLE
-------


```text
i3viswiz --class
trgcon=94759781247616 trgx=0 trgy=0 wall=none trgpar=A sx=0 sy=0 sw=1080 sh=1920
* 94759781247616 x: 0 y: 0 w: 514 h: 399 | URxvt
- 94759780179248 x: 515 y: 0 w: 564 h: 399 | Pavucontrol
- 94759779366272 x: 0 y: 400 w: 1079 h: 1519 | Sublime_text
```


Starting with this release a [wiki] for i3ass is available
here on github.


## known issues

Expand All @@ -151,22 +124,25 @@ reload` instead (*it's faster and usually works just as good
as restart*).

[wiki]: https://github.com/budlabs/i3ass/wiki
[i3flip]: https://github.com/budRich/i3ass/tree/dev/ass/i3flip
[i3fyra]: https://github.com/budRich/i3ass/tree/dev/ass/i3fyra
[i3gw]: https://github.com/budRich/i3ass/tree/dev/ass/i3gw
[i3Kornhe]: https://github.com/budRich/i3ass/tree/dev/ass/i3Kornhe
[i3list]: https://github.com/budRich/i3ass/tree/dev/ass/i3list
[i3get]: https://github.com/budRich/i3ass/tree/dev/ass/i3get
[i3run]: https://github.com/budRich/i3ass/tree/dev/ass/i3run
[i3var]: https://github.com/budRich/i3ass/tree/dev/ass/i3var
[i3viswiz]: https://github.com/budRich/i3ass/tree/dev/ass/i3viswiz
[Makefile]: https://github.com/budRich/i3ass/blob/master/Makefile
[install.sh]: https://github.com/budRich/i3ass/blob/master/install.sh
[i3add]: https://github.com/budRich/scripts/i3add/
[AUR]: https://aur.archlinux.org/packages/i3ass/
[i3]: https://i3wm.org/
[i3wm]: https://i3wm.org/
[bashbud]: https://github.com/budlabs/bashbud
[i3flip]: https://github.com/budlabs/i3ass/wiki/10AS_i3flip
[i3fyra]: https://github.com/budlabs/i3ass/wiki/11AS_i3fyra
[i3get]: https://github.com/budlabs/i3ass/wiki/12AS_i3get
[i3gw]: https://github.com/budlabs/i3ass/wiki/13AS_i3gw
[i3Kornhe]: https://github.com/budlabs/i3ass/wiki/14AS_i3Kornhe
[i3list]: https://github.com/budlabs/i3ass/wiki/15AS_i3list
[i3menu]: https://github.com/budlabs/i3ass/wiki/16AS_i3menu
[i3run]: https://github.com/budlabs/i3ass/wiki/17AS_i3run
[i3var]: https://github.com/budlabs/i3ass/wiki/18AS_i3var
[i3viswiz]: https://github.com/budlabs/i3ass/wiki/19AS_i3viswiz



## license

Expand Down
48 changes: 48 additions & 0 deletions ass/i3list/awklib/BEGIN.awk
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"

}
134 changes: 134 additions & 0 deletions ass/i3list/awklib/END.awk
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])
}
}
}
Loading

0 comments on commit b8931ab

Please sign in to comment.