Skip to content

Commit f9c3631

Browse files
authored
Merge pull request #206 from budlabs/next
release - ordnung auf der kommando linie
2 parents db0120d + d472019 commit f9c3631

37 files changed

+412
-209
lines changed

docs/releasenotes/0next.md

+35-12
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,43 @@
1-
[i3ass]
1+
# WE STRICT NOW
2+
### 2023.08.19
23

3-
A *"new"* command, that prints environment information.
4+
Parsing of commandline arguments are stricter
5+
for the following commands:
6+
- `i3fyra`
7+
- `i3Kornhe`
8+
- `i3viwiz`
9+
- `i3flip`
410

5-
[i3list]
11+
The change is related to the issue (#183).
12+
Before this patch f.i. the command: `i3flip perv`
13+
was valid and would flip the focus in the *previous* direction.
14+
Because only the first character in the argument was used.
615

7-
Fixed an issue where i3fyra workspace couldn't be
8-
seen if it wasn't the currently active workspace (#180)
16+
Now this will result in an error: `perv` is not a valid direction.
17+
Valid directions for this case would be "prev, p, previous".
18+
Arguments are still case insensitive.
919

10-
[i3fyra]
20+
---
1121

12-
Fixed a typo that made I3FYRA_MAIN_CONTAINER be ignored
22+
A bugfix in `i3king` on the same theme is that, previously
23+
it was possible to define a rule without a command (probably because of a typo/mistake: #207),
24+
and this could lead to unpredictable bad behaviour and issues.
25+
**Now** if a rule is defined without a command, it will be ignored
26+
and proper error messages will be printed.
1327

14-
[i3king]
28+
---
1529

16-
Fixed an issue where commands where not printed
17-
when `--print-commands` was used (i3fyra)
30+
I also fixed the bug related to workspace name of
31+
i3fyra workspace for the 42'nd time.
1832

19-
Account for `"actual_deco_rect":` in JSON, not doing
20-
this made it so some windows never triggered rules
33+
---
34+
35+
Finally a minor printf debugging improvement where
36+
arguments to `--json` (usually a full `i3-msg -t
37+
get_tree` string) is now replaced with `...` in
38+
debugging stderr output.
39+
40+
---
41+
42+
big thanks to @gmardom and @1ntronaut for reporting
43+
and helping to troublehsoot the issues!

docs/releasenotes/2023.07.13.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[i3ass]
2+
3+
A *"new"* command, that prints environment information.
4+
5+
[i3list]
6+
7+
Fixed an issue where i3fyra workspace couldn't be
8+
seen if it wasn't the currently active workspace (#180)
9+
10+
[i3fyra]
11+
12+
Fixed a typo that made I3FYRA_MAIN_CONTAINER be ignored
13+
14+
[i3king]
15+
16+
Fixed an issue where commands where not printed
17+
when `--print-commands` was used (i3fyra)
18+
19+
Account for `"actual_deco_rect":` in JSON, not doing
20+
this made it so some windows never triggered rules

docs/releasenotes/2023.08.19.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# WE STRICT NOW
2+
### 2023.08.19
3+
4+
Parsing of commandline arguments are stricter
5+
for the following commands:
6+
- `i3fyra`
7+
- `i3Kornhe`
8+
- `i3viwiz`
9+
- `i3flip`
10+
11+
The change is related to the issue (#183).
12+
Before this patch f.i. the command: `i3flip perv`
13+
was valid and would flip the focus in the *previous* direction.
14+
Because only the first character in the argument was used.
15+
16+
Now this will result in an error: `perv` is not a valid direction.
17+
Valid directions for this case would be "prev, p, previous".
18+
Arguments are still case insensitive.
19+
20+
---
21+
22+
A bugfix in `i3king` on the same theme is that, previously
23+
it was possible to define a rule without a command (probably because of a typo/mistake: #207),
24+
and this could lead to unpredictable bad behaviour and issues.
25+
**Now** if a rule is defined without a command, it will be ignored
26+
and proper error messages will be printed.
27+
28+
---
29+
30+
I also fixed the bug related to workspace name of
31+
i3fyra workspace for the 42'nd time.
32+
33+
---
34+
35+
Finally a minor printf debugging improvement where
36+
arguments to `--json` (usually a full `i3-msg -t
37+
get_tree` string) is now replaced with `...` in
38+
debugging stderr output.
39+
40+
---
41+
42+
big thanks to @gmardom and @1ntronaut for reporting
43+
and helping to troublehsoot the issues!

share/TIMER.sh

+18-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,25 @@
66
((___t)) && {
77
___t=$(( 10#${EPOCHREALTIME//[!0-9]} ))
88

9-
for ((___arg=0; ___arg<${#@}+1;___arg++)); do
10-
[[ ${!___arg} = --verbose ]] && ((___arg--)) && break
9+
# don't include options after "--verbose" in debug output
10+
# example: i3fyra --move C --verbose --conid 94881549553328
11+
# will result in: i3fyra --move C
12+
for ___arg ; do
13+
[[ $___arg = --verbose ]] && break
14+
15+
# replace --json argument with ...
16+
[[ $___replace_next ]] && {
17+
___debug_args+=(...)
18+
unset -v ___replace_next
19+
continue
20+
}
21+
22+
[[ $___arg = --json ]] && ___replace_next=1
23+
___debug_args+=("$___arg")
1124
done
1225

13-
printf -v ___cmd "%s " "${0##*/}" "${@:1:___arg}"
14-
unset -v ___arg
26+
27+
printf -v ___cmd "%s " "${0##*/}" "${___debug_args[@]}"
28+
unset -v ___arg '___debug_args[@]'
1529
>&2 echo ">>> $___cmd"
1630
}

share/main.awk

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ $1 ~ /"(name|title_format)"/ {
2828

2929
else if (ac[cid]["type"] == "\"workspace\"") {
3030

31-
if ($NF == "\"" i3fyra_workspace_name "\"")
31+
if ($NF == i3fyra_workspace_name)
3232
i3fyra_workspace_id = cid
3333

3434
else if ($NF == "\"__i3_scratch\"")
@@ -275,7 +275,7 @@ $(NF-1) ~ /"(class|current_border_width|floating|focus|focused|fullscreen_mode|i
275275
match($0,/"(i3viswiz|i34)?([^"=]+)=([^"]*)"([]])?$/,ma)
276276

277277
if (ma[2] == "i3fyra_ws")
278-
i3fyra_workspace_name=ma[3]
278+
i3fyra_workspace_name = "\"" ma[3] "\""
279279
else if (ma[1] == "i3viswiz")
280280
last_direction_id=ma[3]
281281
else if (ma[2] == "focus_wrap")

src/i3Kornhe/config.mak

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NAME := i3Kornhe
2-
VERSION := 0.669
2+
VERSION := 0.7
33
CREATED := 2017-12-12
4-
UPDATED := 2022-05-21
4+
UPDATED := 2023-07-22
55
AUTHOR := budRich
66
CONTACT := https://github.com/budlabs/i3ass
77
USAGE := options

src/i3Kornhe/i3Kornhe

+18-8
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,29 @@ main(){
3131

3232
((_o[verbose])) || _qflag='-q'
3333

34-
# mode is first arg, size|move|x|0-9 -> s|m|x|0-9
35-
_next_mode="${1:0:1}" ; _next_mode="${_next_mode,,}"
34+
[[ ${_next_mode:=${1,,}} =~ ^(l|r|u|d|left|right|up|down|[0-9]|size|move|s|m|x)$ ]] \
35+
|| ERX "i3Kornhe: mode ('$1') is not valid!"
36+
37+
_next_mode=${_next_mode:0:1} ; mode=$1
38+
shift
39+
40+
[[ ! $_next_mode =~ s|m && ${#@} -gt 0 ]] \
41+
&& ERX "i3Kornhe: mode ('$mode') expected 0 arguments got '($*)'"
42+
43+
[[ $_next_mode =~ s|m && ${#@} -gt 1 ]] \
44+
&& ERX "i3Kornhe: mode ('$mode') expected 0-1 arguments got '($*)'"
3645

37-
__lastarg=${!#}
38-
# last arg is direction, left|right|up|down -> l|r|u|d
39-
_direction=${__lastarg:0:1} ; _direction=${_direction,,}
46+
[[ ${_direction:=${1,,}} ]] && {
47+
[[ ${_direction} =~ ^(l|r|u|d|left|right|up|down|[0-9])$ ]] \
48+
|| ERX "i3Kornhe: direction ('$_direction') is not valid!" \
49+
"( left|right|up|down|l|r|u|d|0-9 )"
50+
}
51+
52+
: "${_direction:=$_next_mode}" ; _direction=${_direction:0:1}
4053

41-
# remove all none digits from --speed arg
4254
_speed=${_o[speed]//[!0-9]}
4355
((_speed >= 0)) || _speed=10
4456

45-
4657
_margin=${_o[margin]//[!0-9]}
4758
((_margin >= 0)) || _margin=5
4859

@@ -71,7 +82,6 @@ main(){
7182
rm -f "$I3_KORNHE_FIFO_FILE"
7283
mkdir -p "${I3_KORNHE_FIFO_FILE%/*}"
7384
mkfifo "$I3_KORNHE_FIFO_FILE"
74-
7585
echo "$_direction $_next_mode $_speed $_margin" >> "$I3_KORNHE_FIFO_FILE" &
7686
trap 'CLEANUP' EXIT INT HUP
7787

src/i3Kornhe/i3Kornhe.1

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.nh
2-
.TH I3KORNHE 1 2022-05-19 budlabs "User Manuals"
2+
.TH I3KORNHE 2023-07-22 budlabs "User Manuals"
33
.SH NAME
44
.PP
55
i3Kornhe - move and resize windows gracefully
@@ -71,6 +71,6 @@ https://github.com/budlabs/i3ass/issues
7171

7272
.SH COPYRIGHT
7373
.PP
74-
Copyright (c) 2017-2022, budRich of budlabs
74+
Copyright (c) 2017-2023, budRich of budlabs
7575
.br
7676
SPDX-License-Identifier: MIT

src/i3ass/config.mak

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NAME := i3ass
2-
VERSION := 2023.07.13.1
2+
VERSION := 2023.08.19.1
33
CREATED := 2023-07-12
4-
UPDATED := 2023-07-13
4+
UPDATED := 2023-08-19
55
AUTHOR := budRich
66
CONTACT := https://github.com/budlabs/i3ass
77
USAGE := i3ass

src/i3ass/i3ass.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.nh
2-
.TH I3ASS 2023-07-13 budlabs "User Manuals"
2+
.TH I3ASS 2023-08-19 budlabs "User Manuals"
33
.SH NAME
44
.PP
55
i3ass - Print environment information

src/i3flip/config.mak

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NAME := i3flip
2-
VERSION := 0.105
2+
VERSION := 0.106
33
CREATED := 2018-01-03
4-
UPDATED := 2022-05-21
4+
UPDATED := 2023-08-13
55
AUTHOR := budRich
66
CONTACT := https://github.com/budlabs/i3ass
77
USAGE := i3flip [--move|-m] DIRECTION

src/i3flip/docs/description.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ works on all layouts. If direction is `next` and
44
the active container is the last, the first
55
container will get focused.
66

7-
**DIRECTION can be either *prev* or *next*, which
8-
**can be defined with different words:
7+
**DIRECTION** can be either *prev* or *next*, which
8+
can be defined with different words:
99

1010
**next**|right|down|n|r|d
1111
**prev**|left|up|p|l|u

src/i3flip/i3flip

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,23 @@ main(){
1010
declare -g _msgstring
1111
declare -i next prev
1212

13-
_dir=$1
14-
15-
((_o[verbose])) && ERM "target direction: $_dir"
16-
_dir=${_dir,,}
17-
1813
read -r layout last first pos size < <(
1914
i3viswiz --parent LIST ${_o[json]:+--json "${_o[json]}"} \
2015
--debug grouplayout,lastingroup,firstingroup,grouppos,groupsize \
2116
--debug-format "%v "
22-
)
17+
)
2318

2419
((_o[verbose])) && ERM "w" "layout:$layout" "last:$last" \
2520
"first:$first" "pos:$pos" "size:$size"
2621

2722
((size < 2)) && ERX only container in group
2823

24+
[[ ${_dir:=${1,,}} =~ ^(l|r|u|d|p|n|left|right|up|down|next|prev(ious)?)$ ]] \
25+
|| ERX "i3flip: direction ('$1') is not valid!" \
26+
$'\n'"Expected: (left|right|up|down|next|previous|l|r|u|d|p|n)"
27+
28+
((_o[verbose])) && ERM "flipping: $_dir"
29+
2930
case "${_dir:0:1}" in
3031

3132
r|d|n )
@@ -40,7 +41,6 @@ main(){
4041
&& ldir=left || ldir=up
4142
;;
4243

43-
* ) ERX "$1 is not a valid direction" ;;
4444
esac
4545

4646
# focus/move normally

src/i3flip/i3flip.1

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.nh
2-
.TH I3FLIP 1 2022-05-19 budlabs "User Manuals"
2+
.TH I3FLIP 2023-08-13 budlabs "User Manuals"
33
.SH NAME
44
.PP
55
i3flip - Tabswitching done right
@@ -31,8 +31,8 @@ the active container is the last, the first
3131
container will get focused.
3232

3333
.PP
34-
**DIRECTION can be either \fIprev\fP or \fInext\fP, which
35-
**can be defined with different words:
34+
\fBDIRECTION\fP can be either \fIprev\fP or \fInext\fP, which
35+
can be defined with different words:
3636

3737
.PP
3838
\fBnext\fP|right|down|n|r|d
@@ -62,6 +62,6 @@ https://github.com/budlabs/i3ass/issues
6262

6363
.SH COPYRIGHT
6464
.PP
65-
Copyright (c) 2018-2022, budRich of budlabs
65+
Copyright (c) 2018-2023, budRich of budlabs
6666
.br
6767
SPDX-License-Identifier: MIT

src/i3fyra/config.mak

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

src/i3fyra/func/initialize_globals.sh

-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ initialize_globals() {
2222
I3FYRA_WS=${i3list[WAN]}
2323
}
2424

25-
[[ $I3FYRA_WS =~ ^\" ]] \
26-
|| I3FYRA_WS=$(printf '"%s"' "$I3FYRA_WS")
27-
2825
(( _o[float] && i3list[AWF]==0 )) \
2926
|| i3var set i3fyra_ws "$I3FYRA_WS"
3027

src/i3fyra/func/swap_move.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ swap_move(){
2424
# -> ik_current=([0]=C [1]=B [2]=A [3]=D)
2525
for k in A B C D; do
2626
current_val=${i3list[VP${k}]:=${ck_default[$k]}}
27-
ik_current[${current_val}]=$k
27+
ik_current[current_val]=$k
2828
done
2929

3030
ERM "${ik_current[*]} LLLLLLLL"

0 commit comments

Comments
 (0)