projects
/
uzbl-mobile
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
67b0fc2
)
be more friendly to people who have no XDG variables set + bitter checking and such
author
Dieter Plaetinck
<dieter@plaetinck.be>
Mon, 8 Jun 2009 19:16:25 +0000
(21:16 +0200)
committer
Dieter Plaetinck
<dieter@plaetinck.be>
Mon, 8 Jun 2009 19:16:25 +0000
(21:16 +0200)
examples/data/uzbl/scripts/cookies.py
patch
|
blob
|
history
examples/data/uzbl/scripts/cookies.sh
patch
|
blob
|
history
examples/data/uzbl/scripts/formfiller.pl
patch
|
blob
|
history
examples/data/uzbl/scripts/formfiller.sh
patch
|
blob
|
history
examples/data/uzbl/scripts/history.sh
patch
|
blob
|
history
examples/data/uzbl/scripts/insert_bookmark.sh
patch
|
blob
|
history
examples/data/uzbl/scripts/load_url_from_bookmarks.sh
patch
|
blob
|
history
examples/data/uzbl/scripts/load_url_from_history.sh
patch
|
blob
|
history
examples/data/uzbl/scripts/session.sh
patch
|
blob
|
history
diff --git
a/examples/data/uzbl/scripts/cookies.py
b/examples/data/uzbl/scripts/cookies.py
index
3cc7eb0
..
8d7027b
100755
(executable)
--- a/
examples/data/uzbl/scripts/cookies.py
+++ b/
examples/data/uzbl/scripts/cookies.py
@@
-61,7
+61,10
@@
class FakeResponse:
return FakeHeaders(self.argv)
if __name__ == '__main__':
return FakeHeaders(self.argv)
if __name__ == '__main__':
- jar = cookielib.MozillaCookieJar(os.environ['XDG_DATA_HOME']+'/uzbl/cookies.txt')
+ if os.environ['XDG_DATA_HOME']:
+ jar = cookielib.MozillaCookieJar(os.environ['XDG_DATA_HOME']+'/uzbl/cookies.txt')
+ else:
+ jar = cookielib.MozillaCookieJar(os.environ['HOME']+'.local/share/uzbl/cookies.txt')
try:
jar.load()
except:
try:
jar.load()
except:
@@
-79,4
+82,4
@@
if __name__ == '__main__':
res = FakeResponse(sys.argv)
jar.extract_cookies(res,req)
jar.save(ignore_discard=True) # save session cookies too
res = FakeResponse(sys.argv)
jar.extract_cookies(res,req)
jar.save(ignore_discard=True) # save session cookies too
- #jar.save() # save everything but session cookies
\ No newline at end of file
+ #jar.save() # save everything but session cookies
diff --git
a/examples/data/uzbl/scripts/cookies.sh
b/examples/data/uzbl/scripts/cookies.sh
index
78139d6
..
56b9c79
100755
(executable)
--- a/
examples/data/uzbl/scripts/cookies.sh
+++ b/
examples/data/uzbl/scripts/cookies.sh
@@
-24,10
+24,9
@@
# http://kb.mozillazine.org/Cookies.txt
# don't always append cookies, sometimes we need to overwrite
# http://kb.mozillazine.org/Cookies.txt
# don't always append cookies, sometimes we need to overwrite
-cookie_config=$XDG_CONFIG_HOME/uzbl/cookies
+cookie_config=${XDG_CONFIG_HOME:-$HOME/.config}/uzbl/cookies
[ -z "$cookie_config" ] && exit 1
[ -z "$cookie_config" ] && exit 1
-[ -d "$XDG_DATA_HOME/uzbl" ] || exit 1
-[ -d $XDG_DATA_HOME/uzbl/ ] && cookie_data=$XDG_DATA_HOME/uzbl/cookies.txt
+[ -d ${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/ ] && cookie_data=${XDG_DATA_HOME:-$home/.local/share}/uzbl/cookies.txt || exit 1
notifier=
notifier=
diff --git
a/examples/data/uzbl/scripts/formfiller.pl
b/examples/data/uzbl/scripts/formfiller.pl
index
c590836
..
9ac6959
100755
(executable)
--- a/
examples/data/uzbl/scripts/formfiller.pl
+++ b/
examples/data/uzbl/scripts/formfiller.pl
@@
-3,7
+3,7
@@
# a slightly more advanced form filler
#
# uses settings file like: $keydir/<domain>
# a slightly more advanced form filler
#
# uses settings file like: $keydir/<domain>
-
+#TODO: fallback to $HOME/.local/share
# user arg 1:
# edit: force editing of the file (fetches if file is missing)
# load: fill forms from file (fetches if file is missing)
# user arg 1:
# edit: force editing of the file (fetches if file is missing)
# load: fill forms from file (fetches if file is missing)
diff --git
a/examples/data/uzbl/scripts/formfiller.sh
b/examples/data/uzbl/scripts/formfiller.sh
index
d54c626
..
bbb9d1a
100755
(executable)
--- a/
examples/data/uzbl/scripts/formfiller.sh
+++ b/
examples/data/uzbl/scripts/formfiller.sh
@@
-12,8
+12,9
@@
# something else (or empty): if file not available: new, otherwise load.
# something else (or empty): if file not available: new, otherwise load.
-keydir=$XDG_DATA_HOME/uzbl/forms
-[ -z "$keydir" ] && exit 1
+keydir=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/forms
+[ -d "`dirname $keydir`" ] || exit 1
+[ -d "$keydir" ] || mkdir "$keydir"
#editor=gvim
editor='urxvt -e vim'
#editor=gvim
editor='urxvt -e vim'
diff --git
a/examples/data/uzbl/scripts/history.sh
b/examples/data/uzbl/scripts/history.sh
index
69f4034
..
ccc6b40
100755
(executable)
--- a/
examples/data/uzbl/scripts/history.sh
+++ b/
examples/data/uzbl/scripts/history.sh
@@
-1,3
+1,5
@@
#!/bin/bash
#TODO: strip 'http://' part
#!/bin/bash
#TODO: strip 'http://' part
-echo "$8 $6 $7" >> $XDG_DATA_HOME/uzbl/history
+file=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/history
+[ -d `dirname $file` ] || exit 1
+echo "$8 $6 $7" >> $file
diff --git
a/examples/data/uzbl/scripts/insert_bookmark.sh
b/examples/data/uzbl/scripts/insert_bookmark.sh
index
b3a7011
..
23c0d31
100755
(executable)
--- a/
examples/data/uzbl/scripts/insert_bookmark.sh
+++ b/
examples/data/uzbl/scripts/insert_bookmark.sh
@@
-1,8
+1,7
@@
#!/bin/bash
#!/bin/bash
-# you probably want your bookmarks file in your $XDG_DATA_HOME ( eg $HOME/.local/share/uzbl/bookmarks)
-[ -d "$XDG_DATA_HOME/uzbl" ] || exit 1
-file=$XDG_DATA_HOME/uzbl/bookmarks
+[ -d "${XDG_DATA_HOME:-$HOME/.local/share}/uzbl" ] || exit 1
+file=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/bookmarks
which zenity &>/dev/null || exit 2
which zenity &>/dev/null || exit 2
diff --git
a/examples/data/uzbl/scripts/load_url_from_bookmarks.sh
b/examples/data/uzbl/scripts/load_url_from_bookmarks.sh
index
eb04873
..
78ee726
100755
(executable)
--- a/
examples/data/uzbl/scripts/load_url_from_bookmarks.sh
+++ b/
examples/data/uzbl/scripts/load_url_from_bookmarks.sh
@@
-2,8
+2,8
@@
#NOTE: it's the job of the script that inserts bookmarks to make sure there are no dupes.
#NOTE: it's the job of the script that inserts bookmarks to make sure there are no dupes.
-file=$XDG_DATA_HOME/uzbl/bookmarks
-[ -z "$file" ] && exit
+file=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/bookmarks
+[ -r "$file" ] || exit
COLORS=" -nb #303030 -nf khaki -sb #CCFFAA -sf #303030"
if dmenu --help 2>&1 | grep -q '\[-rs\] \[-ni\] \[-nl\] \[-xs\]'
then
COLORS=" -nb #303030 -nf khaki -sb #CCFFAA -sf #303030"
if dmenu --help 2>&1 | grep -q '\[-rs\] \[-ni\] \[-nl\] \[-xs\]'
then
diff --git
a/examples/data/uzbl/scripts/load_url_from_history.sh
b/examples/data/uzbl/scripts/load_url_from_history.sh
index
39ef302
..
57d634a
100755
(executable)
--- a/
examples/data/uzbl/scripts/load_url_from_history.sh
+++ b/
examples/data/uzbl/scripts/load_url_from_history.sh
@@
-1,5
+1,6
@@
#!/bin/bash
#!/bin/bash
-history_file=$XDG_DATA_HOME/uzbl/history
+history_file=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/history
+[ -r "$history_file" ] || exit 1
# choose from all entries, sorted and uniqued
# goto=`awk '{print $3}' $history_file | sort -u | dmenu -i`
# choose from all entries, sorted and uniqued
# goto=`awk '{print $3}' $history_file | sort -u | dmenu -i`
diff --git
a/examples/data/uzbl/scripts/session.sh
b/examples/data/uzbl/scripts/session.sh
index
e2642c7
..
4dbae55
100755
(executable)
--- a/
examples/data/uzbl/scripts/session.sh
+++ b/
examples/data/uzbl/scripts/session.sh
@@
-8,9
+8,10
@@
# 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
# 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
+[ -d ${XDG_DATA_HOME:-$HOME/.local/share}/uzbl ] || exit 1
scriptfile=$0 # this script
scriptfile=$0 # this script
-sessionfile=$XDG_DATA_HOME/uzbl/session # the file in which the "session" (i.e. urls) are stored
-configfile=$XDG_DATA_HOME/uzbl/config # uzbl configuration file
+sessionfile=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/session # the file in which the "session" (i.e. urls) are stored
+configfile=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/config # uzbl configuration file
UZBL="uzbl -c $configfile" # add custom flags and whatever here.
fifodir=/tmp # remember to change this if you instructed uzbl to put its fifos elsewhere
UZBL="uzbl -c $configfile" # add custom flags and whatever here.
fifodir=/tmp # remember to change this if you instructed uzbl to put its fifos elsewhere