Skip to content

Commit 446436d

Browse files
committed
Merge branch 'next'
2 parents 54d8837 + 79e6da6 commit 446436d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+222
-135
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
src/*/func/_*
22
src/*/.cache/
33
src/*/_*
4+
docs/_*
45

56
wiki/
67
notes.md

GNUmakefile

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
.PHONY: \
2+
all clean check \
3+
wiki readme manpage \
4+
install uninstall \
5+
install-dev uninstall-dev
6+
7+
default: all
8+
9+
.ONESHELL:
10+
SHELL := /bin/bash
11+
12+
README_LAYOUT = \
13+
docs/readme_header.md \
14+
docs/readme_install.md \
15+
docs/readme_about.md \
16+
docs/_readme_table.md \
17+
docs/readme_issues.md \
18+
docs/readme_license.md \
19+
docs/readme_links.md
20+
21+
ass_dirs := $(wildcard src/*)
22+
wiki_mds := $(ass_dirs:src/%=wiki/doc/%.md)
23+
wiki_src := $(ass_dirs:%=%/.cache/wiki.md)
24+
25+
$(wiki_src):
26+
@[[ $@ =~ ^(src/[^/]+) ]] && trg=$${BASH_REMATCH[1]}
27+
$(MAKE) -C $$trg .cache/wiki.md
28+
29+
wiki: $(wiki_mds)
30+
31+
$(wiki_mds): wiki/doc/%.md : src/%/.cache/wiki.md
32+
cat $< > $@
33+
34+
readme: README.md
35+
36+
README.md: $(README_LAYOUT)
37+
cat $^ > $@
38+
39+
docs/_readme_table.md: $(addsuffix /config.mak,$(ass_dirs))
40+
@{
41+
echo
42+
printf '%s\n' "script | description" "|:-|:-|"
43+
gawk '
44+
$$1 == "NAME" {name=$$3}
45+
$$1 == "DESCRIPTION" {
46+
printf ("[%s] | %s \n", name , gensub(".+:= ","",1,$$0))
47+
}' $^
48+
} > $@
49+
50+
ass_names := $(ass_dirs:src/%=%)
51+
52+
each_check := $(ass_names:%=%-check)
53+
each_all := $(ass_names:%=%-all)
54+
each_clean := $(ass_names:%=%-clean)
55+
each_manpage := $(ass_names:%=%-manpage)
56+
each_install := $(ass_names:%=%-install)
57+
each_install-dev := $(ass_names:%=%-install-dev)
58+
each_uninstall := $(ass_names:%=%-uninstall)
59+
each_uninstall-dev := $(ass_names:%=%-uninstall-dev)
60+
61+
each_each := $(each_check) $(each_all) $(each_clean) $(each_manpage) $(each_install) $(each_install-dev) $(each_uninstall) $(each_uninstall-dev)
62+
63+
check: $(each_check)
64+
all: $(each_all)
65+
clean: $(each_clean)
66+
manpage: $(each_manpage)
67+
install: $(each_install)
68+
install-dev: $(each_install-dev)
69+
uninstall: $(each_uninstall)
70+
uninstall-dev: $(each_uninstall-dev)
71+
72+
$(each_each):
73+
@v=$@ action=$${v#*-} name=$${v%%-*}
74+
$(MAKE) -C src/$$name $$action

Makefile

-45
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ script | description
5050
[i3gw] | a ghost window wrapper for i3wm
5151
[i3king] | window ruler
5252
[i3Kornhe] | move and resize windows gracefully
53-
[i3list] | list information about the current i3 session.
53+
[i3list] | list information about the current i3 session
5454
[i3menu] | Adds more features to rofi when used in i3wm
5555
[i3run] | Run, Raise or hide windows in i3wm
5656
[i3var] | get or get a i3 variable

docs/readme_table.md

-15
This file was deleted.

docs/releasenotes/0next.md

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
1-
### 2022.05.21
1+
#### i3ass
22

3-
#### bashbud
3+
Fixed an issue in `share/main.awk` . Titles containing
4+
a colon (`:`) character where not being captured by
5+
f.i. `i3get -r o`. #174 thanks @DominikMarcinowski
6+
7+
#### i3run
8+
9+
Added `--silent` option
10+
11+
#### i3king
12+
13+
fixed issue where commented lines ending with backslash
14+
concatenated the next line.
15+
16+
added support for `$ROLE and $TYPE` variables in config.
17+
18+
#### i3get
19+
20+
added `--timeout SECONDS` option. To adjust the timeout
21+
before `--synk` stops waiting for a window (default 60s)
422

5-
fixed issue reported in #170, that made all scripts
6-
broken (tried to start main() passing `@$` instead of `$@`).
723

8-
Fixed issue that made all programs look like they
9-
where updated on the installation data.

docs/releasenotes/2022.05.21.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### 2022.05.21
2+
3+
#### bashbud
4+
5+
fixed issue reported in #170, that made all scripts
6+
broken (tried to start main() passing `@$` instead of `$@`).
7+
8+
Fixed issue that made all programs look like they
9+
where updated on the installation data.

docs/releasenotes/2022.06.05.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#### i3fyra
2+
3+
Added "redo" functionality to `--layout`:
4+
`i3fyra --layout redo`
5+
6+
#### i3list
7+
8+
New key: **RED**, contains the last layout applied
9+
with `i3fyra --layout`. Needed for `i3fyra --layout redo`.

share/main.awk

+39-31
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,42 @@
1-
$(NF-1) ~ /"(class|current_border_width|floating|focus|focused|fullscreen_mode|id|instance|layout|marks|name|num|output|sticky|title_format|type|urgent|window|window_role|window_type|x)"$/ {
1+
# name|title_format field holds the title, it is the value that
2+
# is trickiest to capture since it can contain
3+
# double quotes, commas (RS) and colon (FS).
4+
# therefor it is handled here separate from the other
5+
# keys, which always are at NF-1.
6+
$1 ~ /"(name|title_format)"/ {
7+
key=gensub(/"/,"","g",$1)
8+
9+
title=gensub(/^"(name|title_format)":/,"","1",$0)
10+
title=gensub(/\\"/,"@@_DQ_@@","g",title)
11+
12+
# this makes sure to capture titles with escaped quotes
13+
# and commas.
14+
while (title ~ /[^"]$/ && title != "null") {
15+
getline
16+
title = title "," gensub(/\\"/,"@@_DQ_@@","g",$0)
17+
}
18+
title=gensub("@@_DQ_@@","\"","g",title)
19+
20+
ac[cid][key]=title
21+
22+
if ( key in arg_search && match(title, arg_search[key]) )
23+
suspect_targets[cid]=1
24+
25+
# store output container id in separate array
26+
if ( ac[cid]["type"] ~ /"output"/ && $NF !~ /__i3/)
27+
outputs[$NF]=cid
28+
29+
else if (ac[cid]["type"] == "\"workspace\"") {
30+
31+
if ($NF == "\"" i3fyra_workspace_name "\"")
32+
i3fyra_workspace_id = cid
33+
34+
else if ($NF == "\"__i3_scratch\"")
35+
scratchpad_id = cid
36+
}
37+
}
38+
39+
$(NF-1) ~ /"(class|current_border_width|floating|focus|focused|fullscreen_mode|id|instance|layout|marks|num|output|sticky|type|urgent|window|window_role|window_type|x)"$/ {
240

341
key=gensub(/.*"([^"]+)"$/,"\\1","g",$(NF-1))
442

@@ -16,42 +54,12 @@ $(NF-1) ~ /"(class|current_border_width|floating|focus|focused|fullscreen_mode|i
1654
case "window_role":
1755
case "class":
1856
case "instance":
19-
case "title_format":
2057
case "type":
2158
ac[cid][key]=$NF
2259
if ( key in arg_search && $NF == "\""arg_search[key]"\"" )
2360
suspect_targets[cid]=1
2461
break
2562

26-
case "name":
27-
# this makes sure to capture titles with escaped quotes
28-
# and commas.
29-
title=gensub(/\\"/,"@@_DQ_@@","g",$NF)
30-
while (title ~ /[^"]$/ && title != "null") {
31-
getline
32-
title = title "," gensub(/\\"/,"@@_DQ_@@","g",$0)
33-
}
34-
title=gensub("@@_DQ_@@","\"","g",title)
35-
36-
ac[cid][key]=title
37-
38-
if ( key in arg_search && match(title, arg_search[key]) )
39-
suspect_targets[cid]=1
40-
41-
# store output container id in separate array
42-
if ( ac[cid]["type"] ~ /"output"/ && $NF !~ /__i3/)
43-
outputs[$NF]=cid
44-
45-
else if (ac[cid]["type"] == "\"workspace\"") {
46-
47-
if ($NF == "\"" i3fyra_workspace_name "\"")
48-
i3fyra_workspace_id = cid
49-
50-
else if ($NF == "\"__i3_scratch\"")
51-
scratchpad_id = cid
52-
}
53-
break
54-
5563
case "id":
5664
# when "nodes": (or "floating_nodes":) and "id":
5765
# is on the same record.
File renamed without changes.
File renamed without changes.

src/i3flip/config.mak

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME := i3flip
2-
VERSION := 0.101
2+
VERSION := 0.105
33
CREATED := 2018-01-03
44
UPDATED := 2022-05-21
55
AUTHOR := budRich

src/i3flip/func/CLEANUP.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ trap 'CLEANUP' EXIT INT HUP
44

55
CLEANUP() {
66

7-
[[ -f /tmp/i3flip_lock ]] && rm /tmp/i3flip_lock
7+
[[ -f /tmp/i3flip_lock ]] && rm -f /tmp/i3flip_lock
88

99
[[ -n $_msgstring ]] && {
1010
((_o[verbose])) || qflag='-q'
File renamed without changes.

src/i3fyra/config.mak

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NAME := i3fyra
2-
VERSION := 1.25
2+
VERSION := 1.35
33
CREATED := 2017-01-14
4-
UPDATED := 2022-05-21
4+
UPDATED := 2022-06-05
55
AUTHOR := budRich
66
CONTACT := https://github.com/budlabs/i3ass
77
USAGE := options

src/i3fyra/docs/options/layout

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
update the size of the layout
22

3-
AB is on X axis from the left side if INT is
4-
positive, from the right side if it is negative.
5-
AC and BD is on Y axis from the top if INT is
6-
positive, from the bottom if it is negative. The
7-
whole argument needs to be quoted. Example: `$
8-
i3fyra --layout 'AB=-300 BD=420'
3+
AB is point on the X axis, calculated from the
4+
left side if INT is positive, from the right side
5+
if it is negative. AC and BD is on Y axis from
6+
the top if INT is positive, from the bottom if it
7+
is negative. The whole argument needs to be
8+
quoted. Example:
9+
10+
`i3fyra --layout 'AB=-300 BD=420'
11+
12+
LAYOUT argument can also be the word 'redo', if it
13+
is, the last layout appended will be restored.

src/i3fyra/func/apply_splits.sh

+16-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ apply_splits(){
44

55
((_o[verbose])) && ERM "f ${FUNCNAME[0]}($*)"
66

7-
local i tsn dir target sibling
8-
declare -i tsv splitexist size
7+
local i tsn dir target sibling layout_string last_layout
8+
declare -i tsv splitexist size
99

10-
for i in ${1}; do
10+
if [[ ${_o[layout]} = redo ]]
11+
then layout_string=${i3list[RED]//:/ }
12+
else layout_string=$1
13+
fi
14+
15+
[[ $layout_string =~ = ]] \
16+
|| ERX "$layout_string is not a valid layout"
17+
18+
for i in ${layout_string}; do
1119
tsn=${i%=*} # target split name
1220
tsv=${i#*=} # target split value
1321

@@ -36,6 +44,8 @@ apply_splits(){
3644

3745
((tsv<0)) && tsv=$((size-(tsv*-1)))
3846

47+
last_layout+="${tsn}=${i3list[S${tsn}]}:"
48+
3949
((splitexist)) && {
4050
# i3list[Sxx] = current/actual split xx
4151
i3list[S${tsn}]=${tsv}
@@ -47,4 +57,7 @@ apply_splits(){
4757
mark_vars["i34M${tsn}"]=$tsv
4858

4959
done
60+
61+
# store last_layout for --layout redo
62+
[[ ${_o[layout]} ]] && mark_vars["i34RED"]=$last_layout
5063
}

0 commit comments

Comments
 (0)