about summary refs log tree commit diff stats
path: root/bin/catgirl-open.sh
diff options
context:
space:
mode:
authorensa <psii@riseup.net>2020-06-26 17:04:50 -0700
committerensa <psii@riseup.net>2020-06-26 17:04:50 -0700
commita11f7c357236afea1b00df5f85dc8674f5f1d661 (patch)
treedfc5c2c7617709ee29803897ce24acd06c71b2e4 /bin/catgirl-open.sh
parent310c76b161e680a698995d61b2a741a05b384fbe (diff)
downloadcfg-a11f7c357236afea1b00df5f85dc8674f5f1d661.tar.gz
improved lh, switched to catgirl
bin/
	lh: now resolves link shorteners first, so web browser is used
	less
	catgirl-open.sh: uses tabbed with xterm to put multiple catgirl
	clients on one "window"
	comm-sel: now uses catgirl-open.sh instead of epic5 in xterm
		cordless specifies config dir so non-standard config
		locations will work
		added different x class flags for different TERMINAL
		values
config/
	cwmrc: removed St and tabbed from autogroups, added tabbed-surf
		things generally fixed to accommodate for xterm
		ALTSCR removed
		$SCR invocations now include -u to hide the cursor
		window force-killing uses non-old $() syntax
	ksh/prompt.ksh: uses unicode halfbar instead of
	powerline triangles
		clears formatting at start of PS1 before coloring things
Diffstat (limited to 'bin/catgirl-open.sh')
-rwxr-xr-xbin/catgirl-open.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/bin/catgirl-open.sh b/bin/catgirl-open.sh
new file mode 100755
index 0000000..76673ec
--- /dev/null
+++ b/bin/catgirl-open.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+# script for tabbing together catgirl instances, similar to surf-open.sh
+. ~/etc/shrc
+
+xidfile="$XDG_CACHE_HOME/catgirl/tabbed-catgirl.xid"
+
+choosenet() {
+	for network in $(ls $HOME_ETC/catgirl/*.conf|sed 's/.*\///');
+	do
+	printf '%s\n' $network;
+	done | dmenu -p "choose network:"
+}
+
+runtabbed() {
+	tabbed -fdn comm -r 2 $TERMINAL -into '' -e catgirl $(choosenet) >"$xidfile" &
+}
+
+if [ ! -r "$xidfile" ];
+then
+	runtabbed
+else
+	xid=$(<"$xidfile")
+	xprop -id "$xid" >/dev/null 2>&1
+	if [ $? -gt 0 ];
+	then
+		runtabbed
+	else
+		$TERMINAL -into "$xid" -e catgirl $(choosenet) >/dev/null 2>&1 &
+	fi
+fi
+