X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=filesystem%2Fusr%2Flocal%2Fbin%2Fabrowser;h=7892cc7cafcc2838882dd39a62bae1f0084a842a;hb=b714b0dde29aaf5e44d628c1d723077465e9c488;hp=80f2371beaa40a6824ab1f719f12d5d9741c753f;hpb=858993fb6c3e9351988b193e6c296e6ea7862501;p=distro-setup diff --git a/filesystem/usr/local/bin/abrowser b/filesystem/usr/local/bin/abrowser index 80f2371..7892cc7 100755 --- a/filesystem/usr/local/bin/abrowser +++ b/filesystem/usr/local/bin/abrowser @@ -48,8 +48,8 @@ else firefox "$@" & fi -# .5 was too fast -sleep 1 +# on a fast computer, .5 is too fast, 1 is ok. on x200, 1 is too fast, 2 is ok. +sleep 2 # debug #printf "%s\n" "$*" >> /tmp/a if (( $# == 0 )) && ! i3-msg -t get_tree | jq --stream -r 'select(.[1]|scalars!=null) | "\(.[0]|join(".")): \(.[1]|tojson)"' | grep 'marks.0: "abrowser"$' &>/dev/null; then @@ -60,7 +60,7 @@ if (( $# == 0 )) && ! i3-msg -t get_tree | jq --stream -r 'select(.[1]|scalars!= # into a single array instead of a list of arrays with [.[]], or else # it will add the arrays a bunch of times and give several results. # comm gives us just the new id. - id=$(i3-msg -t get_tree | jq -e '.nodes[].nodes[].nodes[].nodes | [.[]] + ( [.[].nodes[]]) | .[] | select(.window_properties.class=="abrowser") | .id' | comm -23 - $tmpf | head -n1) + id=$(i3-msg -t get_tree | jq -e '.nodes[].nodes[].nodes[].nodes | [.[]] + ( [.[].nodes[]]) + ( [.[].nodes[].nodes[]]) + ( [.[].nodes[].nodes[].nodes[]]) | .[] | select(.window_properties.class=="abrowser") | .id' | comm -23 - $tmpf | head -n1) rm -f $tmpf if [[ $id ]]; then i3-msg "[con_id=$id] mark abrowser"