diff options
-rw-r--r-- | CHECKLIST | 4 | ||||
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | uzbl.c | 13 |
3 files changed, 11 insertions, 8 deletions
@@ -13,7 +13,7 @@ Also testers and interested people can use this list to see what uzbl is about, * history logging: the script as defined in sample config should write history entries (date,time, url) into the file defined in the script (by default ./extra/history.sh and /tmp/uzbl.history) * invocations of external commands: you'll see it on stdout everytime uzbl calls an external script/program. the invocations should work and none of the arguments passed should be null/garbage/.. . all should be valid strings and contain things like the pid, fifo file, config file,.. (see README for details). +* XDG_CONFIG_HOME and XDG_CONFIG_DIRS (+ default values) fully supported and working (looks for a config file called 'uzbl'). - -TODO: add stuff about internal/external keybinds, mod key, insert mode, status bar, xdg stuff, +TODO: add stuff about internal/external keybinds, mod key, insert mode, status bar, behavior settings,....
\ No newline at end of file @@ -5,7 +5,7 @@ ASAP * improve site * Support for binding keyboard shortcuts in config file. * where to put proxy config? webkit support? -* implement XDG basedir spec +* implement XDG basedir spec (config is done, but not cache/data, which I presume we'll need at some point) * check configured commands if they end on .sh so users don't need to prepend /bin/<shell> * implement a more advanced dmenu alike that behaves like FF's awesomebar and where you can search in url + window title * recognize -h with GOption? @@ -101,7 +101,7 @@ typedef struct } Command; /* XDG stuff */ -char *XDG_CONFIG_HOME_default = "~/.config"; +char *XDG_CONFIG_HOME_default[256]; char *XDG_CONFIG_DIRS_default = "/etc/xdg"; static void @@ -245,7 +245,7 @@ parse_command(const char *cmd) { unsigned int i; Command *c = NULL; char buffer[512]; - strcpy(buffer,cmd); + strcpy (buffer, cmd); char * command_name = strtok (buffer, " "); gchar * command_param = strtok (NULL, " ,"); @@ -451,8 +451,8 @@ settings_init () { if (! config_file) { const char* XDG_CONFIG_HOME = getenv ("XDG_CONFIG_HOME"); char conf[256]; - if (! XDG_CONFIG_HOME) { - XDG_CONFIG_HOME = XDG_CONFIG_HOME_default; + if (! XDG_CONFIG_HOME || ! strcmp (XDG_CONFIG_HOME, "")) { + XDG_CONFIG_HOME = (char *)XDG_CONFIG_HOME_default; } printf("XDG_CONFIG_HOME: %s\n", XDG_CONFIG_HOME); @@ -464,7 +464,7 @@ settings_init () { } else { // Now we check $XDG_CONFIG_DIRS char *XDG_CONFIG_DIRS = getenv ("XDG_CONFIG_DIRS"); - if (! XDG_CONFIG_DIRS) + if (! XDG_CONFIG_DIRS || ! strcmp (XDG_CONFIG_DIRS, "")) XDG_CONFIG_DIRS = XDG_CONFIG_DIRS_default; printf("XDG_CONFIG_DIRS: %s\n", XDG_CONFIG_DIRS); @@ -582,6 +582,9 @@ main (int argc, char* argv[]) { if (!g_thread_supported ()) g_thread_init (NULL); + strcat ((char *) XDG_CONFIG_HOME_default, getenv ("HOME")); + strcat ((char *) XDG_CONFIG_HOME_default, "/.config"); + GError *error = NULL; GOptionContext* context = g_option_context_new ("- some stuff here maybe someday"); g_option_context_add_main_entries (context, entries, NULL); |