aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/scripts/load_url_from_temps.sh
blob: 9788b0fb34d657c6c9bf5af06257b8c2b6e3d218 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

DMENU_SCHEME="temps"
DMENU_OPTIONS="xmms vertical resize"

. "$UZBL_UTIL_DIR/dmenu.sh"
. "$UZBL_UTIL_DIR/uzbl-dir.sh"
. "$UZBL_UTIL_DIR/uzbl-util.sh"

[ -r "$UZBL_TEMPS_FILE" ] || exit 1

if [ -z "$DMENU_HAS_VERTICAL" ]; then
    # because they are all after each other, just show the url, not their titles.
    goto=$( awk '{ print $1 }' "$UZBL_TEMPS_FILE" | $DMENU )
else
    # show titles
    goto=$( $DMENU < "$UZBL_TEMPS_FILE" | cut -d ' ' -f 1 )
fi

sed -i -e "\<^$goto <d" $UZBL_TEMPS_FILE

[ -n "$goto" ] && print "uri $goto\n" > "$UZBL_FIFO"
#[ -n "$goto" ] && print "uri $goto\n" | socat - "unix-connect:$UZBL_SOCKET"