about summary refs log tree commit diff stats
path: root/bin/catgirl-open.sh
diff options
context:
space:
mode:
authorensa <psii@riseup.net>2020-07-08 15:32:24 -0700
committerensa <psii@riseup.net>2020-07-08 15:32:24 -0700
commiteec480ccb22f3166d723befc9522e8a25eabf8c1 (patch)
tree28ec200089f6d5797a06590defcb1c4ccf254c7c /bin/catgirl-open.sh
parent4606fd8469199d5497b4b2fa4ea74d237ec9688b (diff)
downloadcfg-eec480ccb22f3166d723befc9522e8a25eabf8c1.tar.gz
catgirl-open.sh simplified, lh now handles stdin
bin/
	bar.sh: doesn't specify width (defaults to display width)
	bother: incorrectly used last, now uses tail
		uses : instead of true (telling the shell to do nothing)
	catgirl-open.sh: tabbed now called with -c, network chosen
		before invoking tabbed
		just tests xprop instead of hacky $? handling
	comm-sel: no longer specifies config directory for cordless
		(cordless does this correctly now)
	lh: if no arguments are given, set $1 to standard input.
		turned actual link handling into a loop, lh can now be
		sent multiple links and handle them all in sequence.
Diffstat (limited to 'bin/catgirl-open.sh')
-rwxr-xr-xbin/catgirl-open.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/catgirl-open.sh b/bin/catgirl-open.sh
index 76673ec..3783422 100755
--- a/bin/catgirl-open.sh
+++ b/bin/catgirl-open.sh
@@ -12,20 +12,20 @@ choosenet() {
 }
 
 runtabbed() {
-	tabbed -fdn comm -r 2 $TERMINAL -into '' -e catgirl $(choosenet) >"$xidfile" &
+	network=$(choosenet)
+	tabbed -cdn comm -r 2 $TERMINAL -into '' -e catgirl $network >"$xidfile" &
 }
 
 if [ ! -r "$xidfile" ];
 then
 	runtabbed
 else
-	xid=$(<"$xidfile")
-	xprop -id "$xid" >/dev/null 2>&1
-	if [ $? -gt 0 ];
+	xid=$(cat "$xidfile")
+	if xprop -id "$xid" >/dev/null 2>&1
 	then
-		runtabbed
-	else
 		$TERMINAL -into "$xid" -e catgirl $(choosenet) >/dev/null 2>&1 &
+	else
+		runtabbed
 	fi
 fi