commit bc49bfadb68e604daa471d85bd83e5ae9a02b470
parent 92fef18025ec34517a37ad8ff913f997d52f077a
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Tue, 20 Oct 2020 10:28:02 +0200
surf-open.sh: use simpler awk syntax and keep tabbed open
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/.local/bin/surf-open.sh b/.local/bin/surf-open.sh
@@ -14,16 +14,16 @@ fi
  
 screen_resolution() {
 	xrandr -q | awk '
-	{
-		if (printline) { gsub(/x.*/,"", $0); printline=0; res=$1 }
-		if (match($0, / connected/)) { printline=1 }
-	}
+	{ if (printline) { gsub(/x.*/,"", $0); printline=0; res=$1 } };
+	/ connected/ { printline=1 }
 	END { print res }'
 }
+screen_resolution; exit
+
 runtabbed() {
 	echo "starting tabbed"
-	nohup tabbed -c -dn tabbed-surf -r 2 >"$xidfile" 2>/dev/null &
-	sleep 2
+	nohup tabbed -dn tabbed-surf -r 2 >"$xidfile" 2>/dev/null &
+	sleep 1
 }
 opensurf() {
 	zoomlevel="1.0"