New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give the user more flexibility #150

Merged
merged 3 commits into from Mar 22, 2015

Conversation

Projects
None yet
2 participants
@Konubinix
Contributor

Konubinix commented Dec 24, 2014

Those commits don't change the default behavior of uzbl. They attempt to replace hard coded behavior by configurable ones.

@@ -6,6 +6,7 @@
# common directory locations
set prefix @(echo $UZBL_PREFIX)@
set data_home @(echo $XDG_DATA_HOME/uzbl)@
set data_dirs @(echo $(echo ${XDG_DATA_DIRS}|sed 's%:%/uzbl:%g')/uzbl)@

This comment has been minimized.

@mathstuf

mathstuf Feb 11, 2015

Member

This misses the last directory in the list.

@mathstuf

mathstuf Feb 11, 2015

Member

This misses the last directory in the list.

This comment has been minimized.

@Konubinix

Konubinix Feb 11, 2015

Contributor

Actually, adding /uzbl to the last directory is the reason why I had to put two nested echo commands.

If XDG_DATA_DIRS=a🅱️c, then
echo $(echo ${XDG_DATA_DIRS}|sed 's%:%/uzbl:%g')/uzbl
Will correctly output a/uzbl:b/uzbl:c/uzbl

@Konubinix

Konubinix Feb 11, 2015

Contributor

Actually, adding /uzbl to the last directory is the reason why I had to put two nested echo commands.

If XDG_DATA_DIRS=a🅱️c, then
echo $(echo ${XDG_DATA_DIRS}|sed 's%:%/uzbl:%g')/uzbl
Will correctly output a/uzbl:b/uzbl:c/uzbl

This comment has been minimized.

@mathstuf

mathstuf Feb 11, 2015

Member

Ah, indeed.

@mathstuf

mathstuf Feb 11, 2015

Member

Ah, indeed.

Show outdated Hide outdated bin/uzbl-browser.in
UZBL_COOKIE_FILE = os.environ.get("UZBL_COOKIE_FILE", os.path.join(xdg_data_home, 'uzbl/cookies.txt'))
UZBL_SESSION_COOKIE_FILE = os.environ.get("UZBL_SESSION_COOKIE_FILE", os.path.join(xdg_data_home, 'uzbl/session-cookies.txt'))
DefaultStore = TextStore(UZBL_COOKIE_FILE)
SessionStore = TextStore(UZBL_SESSION_COOKIE_FILE)

This comment has been minimized.

@mathstuf

mathstuf Feb 11, 2015

Member

Looks good, but remove the execute permissions you added to the file.

@mathstuf

mathstuf Feb 11, 2015

Member

Looks good, but remove the execute permissions you added to the file.

This comment has been minimized.

@Konubinix

Konubinix Feb 11, 2015

Contributor

Done.

Thanks

@Konubinix

Konubinix Feb 11, 2015

Contributor

Done.

Thanks

@@ -516,7 +517,7 @@ set ssl_policy fail
# === Post-load misc commands ================================================
spawn_sync_exec @scripts_dir/load_cookies.sh
spawn_sync_exec @scripts_dir/load_cookies.sh @data_home/session-cookies.txt
spawn_sync_exec @scripts_dir/load_cookies.sh @(echo "${UZBL_SESSION_COOKIE_FILE:-@data_home/session-cookies.txt}")@

This comment has been minimized.

@Konubinix

Konubinix Feb 12, 2015

Contributor

Here, the UZBL_SESSION_COOKIE_FILE environment variable is used.

If it is not set, the set command falls back to the same default value than used in the cookies plugins and the scripts.

@Konubinix

Konubinix Feb 12, 2015

Contributor

Here, the UZBL_SESSION_COOKIE_FILE environment variable is used.

If it is not set, the set command falls back to the same default value than used in the cookies plugins and the scripts.

Konubinix added some commits Dec 24, 2014

Search for uzbl scripts in XDG_DATA_DIRS
This makes the implementation compliant with the XDG standard.

See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html for
more information
Prefer the use of environment variables like defined in uzbl-dir.sh i…
…nstead of

hardcoding their value.

* (uzbl/plugins/cookies.py) Use the value from the environment variables
  UZBL_COOKIE_FILE and UZBL_SESSION_COOKIE_FILE if they exist
* (examples/config/config) Load the session cookies using
  UZBL_SESSION_COOKIE_FILE instead of hardcoding the value

The scripts, the plugins and the configuration file don't make use of the same
mechanism to set variables. The default values for the session cookies where not
coherent between those: the plugins and the configuration file hardcoded the
value ${XDG_DATA_HOME}/session-cookies.txt while the scripts could override this
value by setting the environment variable UZBL_SESSION_COOKIE_FILE (see the
examples/data/scripts/util/uzbl-dir.sh file). This caused strange behavior when
the user would set the UZBL_SESSION_COOKIE_FILE variable since the scripts did
not reach the session cookies at the same location than the uzbl-core and the
cookies plugin.

This patch makes sure that the configuration file and the cookies plugin also
take into account the environment variable UZBL_SESSION_COOKIE_FILE so that the
behavior remain coherent with the scripts.
@Konubinix

This comment has been minimized.

Show comment
Hide comment
@Konubinix

Konubinix Mar 9, 2015

Contributor

Do you think those changes could be applied?

Contributor

Konubinix commented Mar 9, 2015

Do you think those changes could be applied?

@mathstuf

This comment has been minimized.

Show comment
Hide comment
@mathstuf

mathstuf Mar 13, 2015

Member

Yeah, it looks good to me. I'll pull it when I get around to doing more uzbl stuff (hopefully Sunday, but I can make no guarantees).

Member

mathstuf commented Mar 13, 2015

Yeah, it looks good to me. I'll pull it when I get around to doing more uzbl stuff (hopefully Sunday, but I can make no guarantees).

@mathstuf mathstuf merged commit 4174bac into uzbl:next Mar 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment