3 # Very simple session manager for uzbl. When called with "endsession" as the
4 # argument, it'lla empty the sessionfile, look for fifos in $fifodir and
5 # instruct each of them to store their current url in $sessionfile and
6 # terminate themselves. Run with "launch" as the argument and an instance of
7 # uzbl will be launched for each stored url. "endinstance" is used internally
8 # and doesn't need to be called manually at any point.
11 scriptfile=$XDG_CONFIG_HOME/uzbl/session.sh # this script
12 sessionfile=$XDG_DATA_HOME/uzbl/session # the file in which the "session" (i.e. urls) are stored
13 UZBL="uzbl" # add custom flags and whatever here.
15 fifodir=/tmp # remember to change this if you instructed uzbl to put its fifos elsewhere
22 for url in $(cat $sessionfile); do
27 if [ "$url" != "(null)" ]; then
28 echo "$url" >> $sessionfile;
30 echo "exit" > "$thisfifo"
33 echo -n "" > "$sessionfile"
34 for fifo in $fifodir/uzbl_fifo_*; do
35 if [ "$fifo" != "$thisfifo" ]; then
36 echo "spawn $scriptfile endinstance" > "$fifo"
39 echo "spawn $scriptfile endinstance" > "$thisfifo";;
40 * ) echo "session manager: bad action";;