#!/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 $HOME_ETC/catgirl/*.conf do printf '%s\n' $(basename ${network%.*}); done | dmenu -p "choose network:" } runtabbed() { network=$(choosenet).conf tabbed -cdn comm -r 2 $TERMINAL -into '' -e catgirl $network >"$xidfile" & } if [ ! -r "$xidfile" ]; then runtabbed else xid=$(cat "$xidfile") if xprop -id "$xid" >/dev/null 2>&1 then $TERMINAL -into "$xid" -e catgirl $(choosenet).conf >/dev/null 2>&1 & else runtabbed fi fi