dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 97088ad1c79b672f7e23dfc00fedc0f072e539e6
parent 0332686adc1baeb8aefff7ab24bb4ffbbb8d483a
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Thu, 12 Nov 2020 12:28:38 +0100

surf-open.sh: print surf PID if requested

Diffstat:
M.local/bin/surf-open.sh | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.local/bin/surf-open.sh b/.local/bin/surf-open.sh @@ -4,6 +4,7 @@ prefix="" #prefix="torsocks" #prefix="firejail --profile=$HOME/.config/firejail/surf.config" xidfile="/tmp/tabbed-surf-$(whoami).xid" +surfxidfile="/tmp/surf-$(whoami).xid" uri="" [ "$#" -gt 0 ] && uri="$1" @@ -26,7 +27,9 @@ opensurf() { if [ "$(screen_resolution)" -gt 3000 ]; then zoomlevel="2.5" fi - nohup $prefix surf $SURFFLAGS -z "$zoomlevel" -e "$xid" -u 'Mozilla/5.0 (X11; OpenBSD amd64; rv:76.0) Gecko/20100101 Firefox/76.0' "$uri" >/dev/null 2>&1 & + nohup $prefix surf $SURFFLAGS -z "$zoomlevel" -e "$xid" \ + -u 'Mozilla/5.0 (X11; OpenBSD amd64; rv:76.0) Gecko/20100101 Firefox/76.0' \ + "$uri" >"$surfxidfile" 2>/dev/null & } [ ! -r "$xidfile" ] && runtabbed @@ -40,5 +43,7 @@ xid=$(cat "$xidfile") if ! xprop -id "$xid" >/dev/null 2>&1; then runtabbed fi -#printf '%s: %s\n' "$xidfile" "$xid" opensurf +case "$SURFFLAGS" in + *-w*) sleep 1; cat "$surfxidfile";; +esac