aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Barrucadu <mike@barrucadu.co.uk>2009-04-26 19:32:25 +0100
committerGravatar Barrucadu <mike@barrucadu.co.uk>2009-04-26 19:32:25 +0100
commit6cf30e85dfa87dbb636751381c97fe7160628527 (patch)
tree76c5ceb95ff6d57d8031ba5b450dc4e853331149
parente821515a4d95f39d72e9a298fb920a228300d90b (diff)
parent2949de66f119ca352d17f6cfd81267d35ed381d6 (diff)
Merge branch 'dieter/experimental' into experimental
-rw-r--r--Makefile6
-rw-r--r--TODO3
-rw-r--r--uzbl.c48
3 files changed, 36 insertions, 21 deletions
diff --git a/Makefile b/Makefile
index 6faf614..4f4e6f0 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,9 @@ clean:
install:
install -d $(DESTDIR)/usr/bin
install -d $(DESTDIR)/usr/share/uzbl/docs
- install -d $(DESTDIR)/usr/share/uzbl/example-scripts
+ install -d $(DESTDIR)/usr/share/uzbl/examples/scripts
+ install -d $(DESTDIR)/usr/share/uzbl/examples/configs
install -D -m755 uzbl $(DESTDIR)/usr/bin/uzbl
- install -D -m644 extra/* $(DESTDIR)/usr/share/uzbl/example-scripts
+ install -D -m644 extra/* $(DESTDIR)/usr/share/uzbl/examples/scripts
+ install -D -m644 sampleconfig $(DESTDIR)/usr/share/uzbl/examples/configs
install -D -m644 README $(DESTDIR)/usr/share/uzbl/docs
diff --git a/TODO b/TODO
index a45bd35..02a34fa 100644
--- a/TODO
+++ b/TODO
@@ -4,6 +4,9 @@
* improve commandline arguments
* implement XDG basedir spec
* 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?
+* fix config loading from arg
SOMEDAY:
check if we can make the settings loading less hard coded. eg( keep a list of all settings, and for each one, try to load it)
diff --git a/uzbl.c b/uzbl.c
index 9471c70..3e90100 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -43,13 +43,23 @@
#include <unistd.h>
#include <stdlib.h>
+/* housekeeping / internal variables */
static GtkWidget* main_window;
static GtkWidget* mainbar;
static WebKitWebView* web_view;
static gchar* main_title;
static gchar selected_url[500];
+static gint load_progress;
+static guint status_context_id;
+static Window xwin = 0;
+static char fifopath[64];
-/* Behaviour variables */
+/* state variables (initial values coming from command line arguments but may be changed later) */
+static gchar* uri = NULL;
+static gchar* config_file = NULL;
+static gboolean verbose = FALSE;
+
+/* settings from config: group behaviour */
static gchar* history_handler = NULL;
static gchar* fifodir = NULL;
static gchar* download_handler = NULL;
@@ -58,21 +68,31 @@ static gboolean show_status = FALSE;
static gboolean insert_mode = FALSE;
static gchar* modkey = NULL;
-static char fifopath[64];
-static gint load_progress;
-static guint status_context_id;
-static Window xwin = 0;
-static gchar* uri = NULL;
-static gboolean verbose = FALSE;
+typedef struct
+{
+ const char *binding;
+ const char *action;
+} Binding;
+/* settings from config: group bindings_internal */
+static Binding internal_bindings[256];
+static int num_internal_bindings = 0;
+
+/* settings from config: group bindings_external */
+static Binding external_bindings[256];
+static int num_external_bindings = 0;
+
+/* commandline arguments (set initial values for the state variables) */
static GOptionEntry entries[] =
{
- { "uri", 'u', 0, G_OPTION_ARG_STRING, &uri, "Uri to load", NULL },
- { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL },
+ { "uri", 'u', 0, G_OPTION_ARG_STRING, &uri, "Uri to load", NULL },
+ { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL },
+ { "config", 'c', 0, G_OPTION_ARG_STRING, &config_file, "Config file", NULL },
{ NULL }
};
+/* for internal list of commands */
typedef struct
{
const char *command;
@@ -80,16 +100,6 @@ typedef struct
void (*func_2_params)(WebKitWebView*, char *);
} Command;
-typedef struct
-{
- const char *binding;
- const char *action;
-} Binding;
-
-static Binding internal_bindings[256];
-static Binding external_bindings[256];
-static int num_internal_bindings = 0;
-static int num_external_bindings = 0;
static void
update_title (GtkWindow* window);