Skip to content

Commit

Permalink
Merge pull request #212 from budlabs/next
Browse files Browse the repository at this point in the history
[FIX] #211 regex search on window properties broken
  • Loading branch information
budRich authored Apr 21, 2024
2 parents f9c3631 + 46c7585 commit 4d4aec8
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 64 deletions.
46 changes: 5 additions & 41 deletions docs/releasenotes/0next.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,7 @@
# WE STRICT NOW
### 2023.08.19
## broken regex search now works

Parsing of commandline arguments are stricter
for the following commands:
- `i3fyra`
- `i3Kornhe`
- `i3viwiz`
- `i3flip`
fix for issue #211 .
Big thanks to @henryzxb for reporting

The change is related to the issue (#183).
Before this patch f.i. the command: `i3flip perv`
was valid and would flip the focus in the *previous* direction.
Because only the first character in the argument was used.

Now this will result in an error: `perv` is not a valid direction.
Valid directions for this case would be "prev, p, previous".
Arguments are still case insensitive.

---

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

---

I also fixed the bug related to workspace name of
i3fyra workspace for the 42'nd time.

---

Finally a minor printf debugging improvement where
arguments to `--json` (usually a full `i3-msg -t
get_tree` string) is now replaced with `...` in
debugging stderr output.

---

big thanks to @gmardom and @1ntronaut for reporting
and helping to troublehsoot the issues!
Allthough small, this change affects all i3ass commands,
except i3king. Hopefully we didn't break something.
7 changes: 7 additions & 0 deletions docs/releasenotes/2024.04.21.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## broken regex search now works

fix for issue #211 .
Big thanks to @henryzxb for reporting

Allthough small, this change affects all i3ass commands,
except i3king. Hopefully we didn't break something.
7 changes: 5 additions & 2 deletions share/main.awk
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ $(NF-1) ~ /"(class|current_border_width|floating|focus|focused|fullscreen_mode|i
case "class":
case "instance":
case "type":
if (key in arg_search) {
gsub(/^"|"$/,"",$NF)
if (match($NF,arg_search[key]))
suspect_targets[cid]=1
}
ac[cid][key]=$NF
if ( key in arg_search && $NF == "\""arg_search[key]"\"" )
suspect_targets[cid]=1
break

case "id":
Expand Down
4 changes: 2 additions & 2 deletions src/i3Kornhe/config.mak
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NAME := i3Kornhe
VERSION := 0.7
VERSION := 0.71
CREATED := 2017-12-12
UPDATED := 2023-07-22
UPDATED := 2024-04-21
AUTHOR := budRich
CONTACT := https://github.com/budlabs/i3ass
USAGE := options
Expand Down
4 changes: 2 additions & 2 deletions src/i3flip/config.mak
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NAME := i3flip
VERSION := 0.106
VERSION := 0.107
CREATED := 2018-01-03
UPDATED := 2023-08-13
UPDATED := 2024-04-21
AUTHOR := budRich
CONTACT := https://github.com/budlabs/i3ass
USAGE := i3flip [--move|-m] DIRECTION
Expand Down
4 changes: 2 additions & 2 deletions src/i3fyra/config.mak
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NAME := i3fyra
VERSION := 1.4.2
VERSION := 1.4.3
CREATED := 2017-01-14
UPDATED := 2023-07-22
UPDATED := 2024-04-21
AUTHOR := budRich
CONTACT := https://github.com/budlabs/i3ass
USAGE := options
Expand Down
10 changes: 5 additions & 5 deletions src/i3get/awklib/END.awk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ END {

search_match=0

for (search in arg_search) {
for (search in arg_search) {
if (match(ac[suspect_id][search],arg_search[search]))
search_match+=1
}
Expand Down Expand Up @@ -39,15 +39,15 @@ END {

case "c":
k = "class"
v = gensub(/^"|"$/,"","g",ac[target_container_id]["class"])
v = ac[target_container_id]["class"]
out = gensub(/%v/,v,"g",format)
out = gensub(/%k/,k,"g",out)
printf ("%s", out)
break

case "i":
k = "instance"
v = gensub(/^"|"$/,"","g",ac[target_container_id]["instance"])
v = ac[target_container_id]["instance"]
out = gensub(/%v/,v,"g",format)
out = gensub(/%k/,k,"g",out)
printf ("%s", out)
Expand Down Expand Up @@ -151,7 +151,7 @@ END {

case "y":
k = "type"
v = gensub(/^"|"$/,"","g",ac[target_container_id]["window_type"])
v = ac[target_container_id]["window_type"]
out = gensub(/%v/,v,"g",format)
out = gensub(/%k/,k,"g",out)
printf ("%s", out)
Expand All @@ -161,7 +161,7 @@ END {
k = "role"

if ("window_role" in ac[target_container_id])
v = gensub(/^"|"$/,"","g",ac[target_container_id]["window_role"])
v = ac[target_container_id]["window_role"]
else
v = "unknown"

Expand Down
4 changes: 2 additions & 2 deletions src/i3get/config.mak
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NAME := i3get
VERSION := 0.83
VERSION := 0.93
CREATED := 2017-03-08
UPDATED := 2022-07-19
UPDATED := 2024-04-21
AUTHOR := budRich
CONTACT := https://github.com/budlabs/i3ass
USAGE := i3get [OPTIONS]
Expand Down
4 changes: 2 additions & 2 deletions src/i3list/config.mak
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NAME := i3list
VERSION := 0.53
VERSION := 0.54
CREATED := 2017-10-06
UPDATED := 2023-07-12
UPDATED := 2024-04-21
AUTHOR := budRich
CONTACT := https://github.com/budlabs/i3ass
USAGE := options
Expand Down
4 changes: 2 additions & 2 deletions src/i3run/config.mak
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NAME := i3run
VERSION := 0.2.1
VERSION := 0.2.2
CREATED := 2017-04-20
UPDATED := 2022-05-22
UPDATED := 2024-04-21
AUTHOR := budRich
CONTACT := https://github.com/budlabs/i3ass
USAGE := options
Expand Down
4 changes: 2 additions & 2 deletions src/i3viswiz/config.mak
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NAME := i3viswiz
VERSION := 0.56
VERSION := 0.57
CREATED := 2018-01-18
UPDATED := 2023-07-22
UPDATED := 2024-04-21
AUTHOR := budRich
CONTACT := https://github.com/budlabs/i3ass
USAGE := options
Expand Down
4 changes: 2 additions & 2 deletions src/i3zen/config.mak
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NAME := i3zen
VERSION := 0.2
VERSION := 0.21
CREATED := 2017-09-11
UPDATED := 2023-07-29
UPDATED := 2024-04-21
AUTHOR := budRich
CONTACT := https://github.com/budlabs/i3ass
USAGE := $(NAME) [OPTIONS]
Expand Down

0 comments on commit 4d4aec8

Please sign in to comment.