From eeab3def726000c36cc0ba36ca0506b2eecbaf49 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 21 Aug 2010 11:36:32 -0400 Subject: Migrate to using uzbl-args util script --- examples/data/scripts/session.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'examples/data/scripts/session.sh') diff --git a/examples/data/scripts/session.sh b/examples/data/scripts/session.sh index 68ce4d4..1585159 100755 --- a/examples/data/scripts/session.sh +++ b/examples/data/scripts/session.sh @@ -8,6 +8,7 @@ # and doesn't need to be called manually at any point. # Add a line like 'bind quit = /path/to/session.sh endsession' to your config +source $UZBL_UTIL_DIR/uzbl-args.sh source $UZBL_UTIL_DIR/uzbl-dir.sh [ -d $UZBL_DATA_DIR ] || exit 1 @@ -15,12 +16,12 @@ source $UZBL_UTIL_DIR/uzbl-dir.sh scriptfile=$0 # this script UZBL="uzbl-browser -c $UZBL_CONFIG_FILE" # add custom flags and whatever here. -thisfifo="$4" -act="$8" -url="$6" +act="$1" -if [ "$act." = "." ]; then - act="$1" +# Test if we were run alone or from uzbl +if [ "x$UZBL_FIFO" = "x" ]; then + # Take the old config + act="$UZBL_CONFIG" fi @@ -38,20 +39,20 @@ case $act in ;; "endinstance" ) - if [ "$url" != "(null)" ]; then - echo "$url" >> $UZBL_SESSION_FILE + if [ "$UZBL_URL" != "(null)" ]; then + echo "$UZBL_URL" >> $UZBL_SESSION_FILE fi - echo "exit" > "$thisfifo" + echo "exit" > "$UZBL_FIFO" ;; "endsession" ) mv "$UZBL_SESSION_FILE" "$UZBL_SESSION_FILE~" for fifo in $UZBL_FIFO_DIR/uzbl_fifo_*; do - if [ "$fifo" != "$thisfifo" ]; then + if [ "$fifo" != "$UZBL_FIFO" ]; then echo "spawn $scriptfile endinstance" > "$fifo" fi done - echo "spawn $scriptfile endinstance" > "$thisfifo" + echo "spawn $scriptfile endinstance" > "$UZBL_FIFO" ;; * ) echo "session manager: bad action" -- cgit v1.2.3