fixes
[distro-setup] / i3-abrowser
index eb2d47c5fc3112936ea50ef5216357968112ab86..83c216a485654ff4da813493435a2853f863d9f1 100755 (executable)
@@ -26,6 +26,14 @@ set -eE -o pipefail
 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" exit status: $?, PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR
 
 
+# remove local/bin from path
+# https://stackoverflow.com/a/2108540
+tmp=:$PATH:
+del=/usr/local/bin
+tmp=${tmp//:$del:/:}
+tmp=${tmp%:}
+tmp=${tmp#:}
+PATH=$tmp
 # prefer abrowser
 if type -P abrowser &>/dev/null; then
   b=abrowser
@@ -47,9 +55,9 @@ if i3-msg -t get_tree | jq --stream -r 'select(.[1]|scalars!=null) | "\(.[0]|joi
 
 else
   i3-split-maybe
-  abrowser &
+  $b "$@" &
   # on a fast computer, .5 is too fast, 1 is ok. on x200, 1 is too fast, 2 is ok.
   sleep 2
-  i3-msg "[workspace=__focused__ class=\"$b\"] mark abrowser"
+  i3-msg "[workspace=__focused__ class=\"$b\" instance=\"Navigator\" window_role=\"browser\"] mark abrowser"
   wait
 fi