aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/data/scripts/download.sh5
-rwxr-xr-xexamples/data/scripts/instance-select-wmii.sh4
-rwxr-xr-xexamples/data/scripts/load_url_from_bookmarks.sh2
-rwxr-xr-xexamples/data/scripts/load_url_from_history.sh2
-rwxr-xr-xexamples/data/scripts/session.sh6
-rw-r--r--examples/data/scripts/util/dmenu.sh6
-rw-r--r--examples/data/scripts/util/editor.sh2
7 files changed, 15 insertions, 12 deletions
diff --git a/examples/data/scripts/download.sh b/examples/data/scripts/download.sh
index f2ee4a8..7375535 100755
--- a/examples/data/scripts/download.sh
+++ b/examples/data/scripts/download.sh
@@ -13,7 +13,10 @@ url="$1"
http_proxy="$2"
export http_proxy
-test "x$url" = "x" && { echo "you must supply a url! ($url)"; exit 1; }
+if [ -z "$url" ]; then
+ echo "you must supply a url! ($url)"
+ exit 1
+fi
# only changes the dir for the $get sub process
if echo "$url" | grep -E '.*\.torrent' >/dev/null; then
diff --git a/examples/data/scripts/instance-select-wmii.sh b/examples/data/scripts/instance-select-wmii.sh
index 82acf3b..dcb8866 100755
--- a/examples/data/scripts/instance-select-wmii.sh
+++ b/examples/data/scripts/instance-select-wmii.sh
@@ -26,13 +26,13 @@ elif [ "$1" == 'next' ]; then
current=$(wmiir read /client/sel/ctl | head -n 1)
# find the next uzbl window and focus it
next=$(wmiir read /tag/sel/index | grep -A 10000 " $current " | grep -m 1 uzbl | cut -d ' ' -f2)
- if [ x"$next" != "x" ]; then
+ if [ -n "$next" ]; then
wmiir xwrite /tag/sel/ctl "select client $next"
fi
elif [ "$1" == 'prev' ]; then
current=$(wmiir read /client/sel/ctl | head -n 1)
prev=$(wmiir read /tag/sel/index | grep -B 10000 " $current " | tac | grep -m 1 uzbl | cut -d ' ' -f2)
- if [ x"$prev" != "x" ]; then
+ if [ -n "$prev" ]; then
wmiir xwrite /tag/sel/ctl "select client $prev"
fi
else
diff --git a/examples/data/scripts/load_url_from_bookmarks.sh b/examples/data/scripts/load_url_from_bookmarks.sh
index d5f7bd6..7613624 100755
--- a/examples/data/scripts/load_url_from_bookmarks.sh
+++ b/examples/data/scripts/load_url_from_bookmarks.sh
@@ -8,7 +8,7 @@ source $UZBL_UTIL_DIR/uzbl-dir.sh
[ -r "$UZBL_BOOKMARKS_FILE" ] || exit 1
-if [ "x$DMENU_HAS_VERTICAL" = "x" ]; then
+if [ -z "$DMENU_HAS_VERTICAL" ]; then
# because they are all after each other, just show the url, not their tags.
goto=$(awk '{print $1}' $UZBL_BOOKMARKS_FILE | $DMENU)
else
diff --git a/examples/data/scripts/load_url_from_history.sh b/examples/data/scripts/load_url_from_history.sh
index f79e018..ca8959c 100755
--- a/examples/data/scripts/load_url_from_history.sh
+++ b/examples/data/scripts/load_url_from_history.sh
@@ -8,7 +8,7 @@ source $UZBL_UTIL_DIR/uzbl-dir.sh
# choose from all entries, sorted and uniqued
# goto=$(awk '{print $3}' $history_file | sort -u | dmenu -i)
-if [ "x$DMENU_HAS_VERTICAL" = "x" ]; then
+if [ -z "$DMENU_HAS_VERTICAL" ]; then
current=$(tail -n 1 $UZBL_HISTORY_FILE | awk '{print $3}');
goto=$((echo $current; awk '{print $3}' $UZBL_HISTORY_FILE | grep -v "^$current\$" \
| sort -u) | $DMENU)
diff --git a/examples/data/scripts/session.sh b/examples/data/scripts/session.sh
index d30f3da..3f1c6d3 100755
--- a/examples/data/scripts/session.sh
+++ b/examples/data/scripts/session.sh
@@ -19,7 +19,7 @@ UZBL="uzbl-browser -c $UZBL_CONFIG_FILE" # add custom flags and whatever here.
act="$1"
# Test if we were run alone or from uzbl
-if [ "x$UZBL_FIFO" = "x" ]; then
+if [ -z "$UZBL_FIFO" ]; then
# Take the old config
act="$UZBL_CONFIG"
fi
@@ -27,7 +27,7 @@ fi
case $act in
"launch" )
urls=$(cat $UZBL_SESSION_FILE)
- if [ "x$urls" = "x" ]; then
+ if [ -z "$urls" ]; then
$UZBL
else
for url in $urls; do
@@ -39,7 +39,7 @@ case $act in
;;
"endinstance" )
- if [ "x$UZBL_FIFO" = "x" ]; then
+ if [ -z "$UZBL_FIFO" ]; then
echo "session manager: endinstance must be called from uzbl"
exit 1
fi
diff --git a/examples/data/scripts/util/dmenu.sh b/examples/data/scripts/util/dmenu.sh
index 3f307f2..2326cea 100644
--- a/examples/data/scripts/util/dmenu.sh
+++ b/examples/data/scripts/util/dmenu.sh
@@ -40,12 +40,12 @@ case "$DMENU_SCHEME" in
esac
# Default arguments
-if [ "x$DMENU_ARGS" = "x" ]; then
+if [ -z "$DMENU_ARGS" ]; then
DMENU_ARGS="-i"
fi
# Set the prompt if wanted
-if [ ! "x$DMENU_PROMPT" = "x" ]; then
+if [ -n "$DMENU_PROMPT" ]; then
DMENU_ARGS="$DMENU_ARGS -p $DMENU_PROMPT"
fi
@@ -58,7 +58,7 @@ fi
# Detect the vertical patch
if dmenu --help 2>&1 | grep -q '\[-l lines\]'; then
# Default to 10 lines
- if [ "x$DMENU_LINES" = "x" ]; then
+ if [ -z "$DMENU_LINES" ]; then
DMENU_LINES=10
fi
diff --git a/examples/data/scripts/util/editor.sh b/examples/data/scripts/util/editor.sh
index a152ebd..1969769 100644
--- a/examples/data/scripts/util/editor.sh
+++ b/examples/data/scripts/util/editor.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Editor selection
-if [ "x$VTERM" = "x" ]; then
+if [ -z "$VTERM" ]; then
VTERM="xterm"
fi