diff options
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | TODO | 3 | ||||
-rw-r--r-- | uzbl.c | 48 |
3 files changed, 36 insertions, 21 deletions
@@ -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 @@ -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) @@ -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); |