aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--AUTHORS3
-rw-r--r--FAQ47
-rw-r--r--INSTALLING60
-rw-r--r--Makefile5
-rw-r--r--TODO24
-rw-r--r--examples/configs/sampleconfig7
-rw-r--r--examples/configs/sampleconfig-dev6
-rwxr-xr-xexamples/scripts/insert_bookmark.sh2
-rw-r--r--uzbl.c56
9 files changed, 176 insertions, 34 deletions
diff --git a/AUTHORS b/AUTHORS
index b57d253..e1e5ca5 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -3,10 +3,13 @@ Developers:
Dieter Plaetinck (Dieter@be) <dieter@plaetinck.be>
Dusan Popovic (dusanx)
Michael Walker (Barrucadu) <mike@barrucadu.co.uk>
+ Přemysl Hrubý, (anydot) <dfenze@gmail.com>
Contributors:
+ Robert Manea - Various improvements
Zane Ashby (HashBox) - Rewrote FIFO interface. Fixed various bugs.
(sentientswitch) - Cleaned up code. Added some commands.
+ Jan Kolkmeier (jouz) - scrolling
Originaly based on http://trac.webkit.org/browser/trunk/WebKitTools/GtkLauncher/main.c
Which is copyrighted:
diff --git a/FAQ b/FAQ
new file mode 100644
index 0000000..5a255b6
--- /dev/null
+++ b/FAQ
@@ -0,0 +1,47 @@
+FAQ
+---
+
+### I just installed uzbl but it doesn't do much. I can load one uri and quit the program but that's it.
+You did not load a configuration. Uzbl does not create a default config file on startup like some other programs do.
+Because we want to give you the freedom to place your config where you want, and to use a config or not.
+Have a look in /usr/share/uzbl/examples/configs.
+Use the --config parameter or save your config as $XDG\_CONFIG\_HOME/uzbl/config to have it auto-loaded.
+
+### Where is the location bar? How do I change the URL ?
+Uzbl has no location bar. All changes to the uri (editing of current uri, typing new uri, loading of uri from bookmarks/history/...) happens *outside* of uzbl.
+Have a look at the sample scripts in /usr/share/uzbl/examples. Most of our examples use dmenu which is a nifty little tool to pick an item from a list of items (very
+useful with history/bookmarks) with a limited set of keystrokes. see man dmenu.
+You can also use it to make edits to a uri (press tab to load it into the
+search field) or type a url from scratch, though dmenu
+is not the most suitable editor. We're looking into a better way to make edits.
+Zenity is also an option, if you want copy-paste support.
+
+### Where are the widgets (forward, back,.. button etc)
+Uzbl's layout only contains what you really need to see. we only have a statusbar, which even can also be disabled. There are no buttons, but we do
+have lots of keybinding possibilities.
+
+### Why can't I type anything in forms? How does the keybinding work?
+You are in command mode, not in insert mode.
+
+* command mode: you can trigger actions inside uzbl with minimum amount of keypresses (eg 'q' to quit) (see config examples), but not to type actual text into forms, because all your keypresses are interpreted.
+* insert mode: after going into insert mode (by default this is the 'i' binding from inside command mode), your keypresses are not interpreted but passed on, so you can enter text into forms. Press Esc to go out of insert mode.
+
+The above method is called "modal" as inspired on VI. If you don't like
+this you can easily change this:
+
+* enable always\_insert\_mode in your config. You will always be in insert mode.
+* configure a modkey. Since your keypresses are not interpreted anymore to trigger actions, you need a modkey to do things (eg alt+'q' to quit instead of just 'q' from command mode)
+
+This method is how many applications work.
+
+Both have their pro's and cons. We don't want to force anyone in using
+either, so by tuning the modkey and always\_insert\_mode settings you can pick
+whichever method you like, or both at the same time (command mode, insert mode, and the modkey to perform actions while in insert mode)
+
+### Why do you depend on gtk?
+Uzbl itself doesn't use much gtk stuff (only the statusbar) so we could do without gtk. But Webkit needs a widget toolkit to create widgets (think javascript popups, html forms etc).
+It also supports QT and wxwigdets. One could argue we don't need no popups or fancy form widgets and you could have a point, but forking webkit would bring us way to far.
+And we don't find the use of gtk *that* disturbing. Besides, a curses/xlib html form wouldn't look too nice, would it?
+
+### What? You call all of this user-friendly?
+Yes. If you don't agree, don't use it :)
diff --git a/INSTALLING b/INSTALLING
index 0d10d24..654bde3 100644
--- a/INSTALLING
+++ b/INSTALLING
@@ -1,23 +1,49 @@
-* Arch Linux:
- pkgbuild @ http://aur.archlinux.org/packages.php?ID=25972
+Arch Linux
+----------
+[Arch Linux](http://www.archlinux.org) is our distro of choice, and the distro we use for testing.
-* From source:
+You can find a [PKGBUILD](http://aur.archlinux.org/packages.php?ID=25972) on the AUR, which installs the latest
+from the master branch. You can edit the PKGBUILD to change to any other
+branch you want.
-$ git clone git://github.com/Dieterbe/uzbl.git
-[ $ git checkout master/experimental ] # master == fairly stable. experimental is more bleeding edge
-$ cd uzbl
-$ make
-$ sudo make install
+From source
+-----------
+ $ git clone git://github.com/Dieterbe/uzbl.git
+ [ $ git checkout master/experimental ] # master == fairly stable. experimental is more bleeding edge
+ $ cd uzbl
+ $ make
+ $ sudo make install
-Dependencies:
-libwebkit 1.1.4 or higher
-gtk 2 something something
-pkgconfig (for Make/gcc)
+Dependencies
+------------
+* git (for building)
+* pkgconfig (for Make/gcc)
+* libwebkit 1.1.4 or higher
+* gtk 2 something something
-Optional:
-dmenu, zenity, bash for the sample scripts
+Optional/Recommended
+--------------------
+The following tools are quite useful, and some of them are used in the
+sample scripts:
-You will have the program in /usr/bin and various sample scripts, a sample config, sample bookmarks file and some documentation in /usr/share/uzbl. You
-will probably want to change the scripts to behave more like you want, so copy the scripts to your home dir. If you save your config as
-$XDG_CONFIG_HOME/uzbl/config (this expands to ~/.config/uzbl/config on most systems) it will be recognized automatically. You can also pass the path to
+* dmenu
+* zenity
+* bash
+
+File locations
+--------------
+After installing - using either method - you will find:
+
+* /usr/bin : uzbl [and uzblctrl]
+* /usr/share/uzbl/docs/ : documentation files included with uzbl. (readme, checklist,..)
+* /usr/share/uzbl/examples: sample scripts, config files and a sample bookmarks file.
+
+You will probably want to change the scripts to behave more like you want, so copy the scripts to your home dir. If you save your config as
+$XDG\_CONFIG\_HOME/uzbl/config (this expands to ~/.config/uzbl/config on most systems) it will be recognized automatically. You can also pass the path to
the config file with the --config parameter.
+
+You're free to store your personal stuff where you want, but we think the [XDG basedir spec](http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html)
+is very useful for keeping a clean home directory, so we recommend:
+
+* $XDG\_CONFIG\_HOME/uzbl/config* (~/.config/uzbl/config on most systems): config file
+* $XDG\_DATA\_HOME/uzbl (~/.local/share/uzbl on most systems): bookmarks file, history file. and "scripts" directory with scripts \ No newline at end of file
diff --git a/Makefile b/Makefile
index 26c2fa5..52d96b6 100644
--- a/Makefile
+++ b/Makefile
@@ -24,3 +24,8 @@ install:
cp -ax examples $(DESTDIR)/usr/share/uzbl/
install -D -m644 CHECKLIST $(DESTDIR)/usr/share/uzbl/docs
install -D -m644 README $(DESTDIR)/usr/share/uzbl/docs
+
+uninstall:
+ rm -rf $(DESTDIR)/usr/bin/uzbl
+ rm -rf $(DESTDIR)/usr/bin/uzblctrl
+ rm -rf $(DESTDIR)/usr/share/uzbl
diff --git a/TODO b/TODO
index 8ee398d..80440a3 100644
--- a/TODO
+++ b/TODO
@@ -1,21 +1,21 @@
ASAP
+* fix bug that causes hang after first fifo command
+
* implement all the ideas from README
* get a logo
-* improve site
* when launching new instance, don't just try 'uzbl' and then './uzbl', rather launch a new uzbl in the same way the current uzbl instance was started. (same command, same arguments, except --uri)
-* where to put proxy config? webkit support?
-* implement XDG basedir spec (config is done, but not cache/data, which I presume we'll need at some point)
+* where to put proxy config? webkit support? depend on libsoup?
+* compare libsoup to curl backend. there are probably performance differences
* 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?
* implement a vimperator-like link following scheme. but let user pick his favorite characters to construct the "link identifiers" with.
* add a keybind to hand the current url to an external scrips, so you can edit it and/or store it in the primary and secondary clipboards
-* use http://library.gnome.org/devel/glib/stable/glib-Hash-Tables.html#g-hash-table-insert for tracking bindings and wherever we use structs and ugly loops
-* fifo -> socket. so you can do question-response. socket is slightly more complicated so we'll need to create a uzblctrl (half done - commands can't yet send data back)
+* clean up our structures for settings + sane defaults + don't iterate over struct to fill hasthtable. rather fill hashtable directly
+* implement getting feedback from socket
* select/fork based instead of the pthread stuff -> drops dependency, more lightweight.
-* on website, see if we can <pre><?php include('..'); ?></pre> the documentation inside the uzbl project itself, so we need to maintain the stuff on only 1 place
-* see if we can use the github bugtracker (anonymous posting allowed?)
-* allow user to change bindings for navigation (up,down,left,right, page up, page down etc)and use vim-like defaults
+* scrolling: make page up and page down configurable.
+* show % of location in statusbar/title if page doesn't fit entirely on view.
* put on uzbl.org that you can use http://github.com/Dieterbe/uzbl/issues after registering
* make default size configurable, and optional
* on uzbl.org commits overview: add date+time and repository
@@ -29,19 +29,19 @@ ASAP
* ideal uri editor: awesome mode like FF, some keyb shortcuts (erase search string, go to end/begin of string,..), history (if you patch dmenu to be in vertical mode and you order correctly, that's it), support copy paste
* blinking cursor when not in insert mode is confusing. i suggest dimming it's color if possible
* open in new window -> uzbl: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
-* make it more clear to newbs insert vs command
* note about merging better then patches. because commit names, and code can have changed in meanwhile. also github makes the process quite easy
* check that in new version pageup etc works also in command
* tab key to jump between input fields should probably work in both insert and command mode
* allow to name a uzbl instance, name fifo/socket after it. use xorgwindow id as fallback
* allow to tag , to group instances together
-* document a bit how insert mode, command mode, always_insert_mode, modkey etc work
-* find a simple format (ascii doc, markdow, textile,..) to format uzbl docs (and remain "plaintext") while still being able to generate html for it so we can use them on the website
* allow users to customize order, separating, colors,.. of items in statusbar using pango markup thing
* mention bugtracker in readme, move tickets from github to new bugtracker
-* default value for fifo_dir so we don't need to if(fifo_dir)
+* default value for fifo_dir, socket_dir so we don't need to if(fifo_dir). it will always be set to something?
+* change User-agent to contain uzbl + build date or something. + why is there "Mozilla" in the string
+* backspace key to pop characters from (multichar) command
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)
figure out caching with webkit and in general how we can speed up everything
figure out how webkit intercepts key input
+make "disable insert mode" (esc key) configurable
diff --git a/examples/configs/sampleconfig b/examples/configs/sampleconfig
index 230ef30..2f9df6f 100644
--- a/examples/configs/sampleconfig
+++ b/examples/configs/sampleconfig
@@ -21,6 +21,10 @@ show_status = 1
status_top = 0
[bindings]
+j = scroll_down
+k = scroll_up
+h = scroll_left
+l = scroll_right
b = back
m = forward
s = stop
@@ -33,10 +37,11 @@ w = follow_link_new_window
+ = zoom_in
- = zoom_out
t = toggle_status
-k = exit
+ZZ = exit
i = insert_mode
B = spawn /bin/bash /usr/share/uzbl/examples/scripts/insert_bookmark.sh
u = spawn /bin/bash /usr/share/uzbl/examples/scripts/load_url_from_history.sh
U = spawn /bin/bash /usr/share/uzbl/examples/scripts/load_url_from_bookmarks.sh
+
[network]
diff --git a/examples/configs/sampleconfig-dev b/examples/configs/sampleconfig-dev
index 35e7746..9fcc906 100644
--- a/examples/configs/sampleconfig-dev
+++ b/examples/configs/sampleconfig-dev
@@ -21,6 +21,10 @@ show_status = 1
status_top = 0
[bindings]
+j = scroll_down
+k = scroll_up
+h = scroll_left
+l = scroll_right
b = back
m = forward
s = stop
@@ -33,7 +37,7 @@ w = follow_link_new_window
+ = zoom_in
- = zoom_out
t = toggle_status
-k = exit
+ZZ = exit
i = insert_mode
B = spawn /bin/bash ./examples/scripts/insert_bookmark.sh
u = spawn /bin/bash ./examples/scripts/load_url_from_history.sh
diff --git a/examples/scripts/insert_bookmark.sh b/examples/scripts/insert_bookmark.sh
index be17c05..5d76c35 100755
--- a/examples/scripts/insert_bookmark.sh
+++ b/examples/scripts/insert_bookmark.sh
@@ -10,7 +10,7 @@ fi
which zenity &>/dev/null || exit 2
-entry=`zenity --entry --text="Add bookmark. add tags at the end, separated by commas" --entry-text="$5"`
+entry=`zenity --entry --text="Add bookmark. add tags at the end, separated by commas" --entry-text="$6"`
url=`awk '{print $1}' <<< $entry`
# TODO: check if already exists, if so, and tags are different: ask if you want to replace tags
echo "$entry" >> $file
diff --git a/uzbl.c b/uzbl.c
index eec7097..ed4859a 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -55,6 +55,10 @@
static GtkWidget* main_window;
static GtkWidget* mainbar;
static GtkWidget* mainbar_label;
+static GtkScrollbar* scbar_v; // Horizontal and Vertical Scrollbar
+static GtkScrollbar* scbar_h; // (These are still hidden)
+static GtkAdjustment* bar_v; // Information about document length
+static GtkAdjustment* bar_h; // and scrolling position
static WebKitWebView* web_view;
static gchar* main_title;
static gchar selected_url[500] = "\0";
@@ -81,6 +85,8 @@ static gboolean insert_mode = FALSE;
static gboolean status_top = FALSE;
static gchar* modkey = NULL;
static guint modmask = 0;
+static gdouble hscroll = 20;
+static gdouble vscroll = 20;
/* settings from config: group bindings, key -> action */
static GHashTable* bindings;
@@ -144,10 +150,45 @@ download_cb (WebKitWebView *web_view, GObject *download, gpointer user_data) {
return (FALSE);
}
+/* scroll a bar in a given direction */
+static void
+scroll (double i, GtkAdjustment* bar) {
+ gtk_adjustment_set_value (bar, gtk_adjustment_get_value(bar)+i);
+}
+
+static void scroll_up (WebKitWebView* page, const char *param) {
+ (void) page;
+ (void) param;
+
+ scroll (-vscroll, bar_v);
+}
+
+static void scroll_left (WebKitWebView* page, const char *param) {
+ (void) page;
+ (void) param;
+
+ scroll (-hscroll, bar_h);
+}
+
+static void scroll_down (WebKitWebView* page, const char *param) {
+ (void) page;
+ (void) param;
+
+ scroll (vscroll, bar_v);
+}
+
+static void scroll_right (WebKitWebView* page, const char *param) {
+ (void) page;
+ (void) param;
+
+ scroll (hscroll, bar_h);
+}
+
static void
toggle_status_cb (WebKitWebView* page, const char *param) {
(void)page;
(void)param;
+
if (show_status) {
gtk_widget_hide(mainbar);
} else {
@@ -239,6 +280,10 @@ static struct {char *name; Command command;} cmdlist[] =
{
{ "back", view_go_back },
{ "forward", view_go_forward },
+ { "scroll_down", scroll_down },
+ { "scroll_up", scroll_up },
+ { "scroll_left", scroll_left },
+ { "scroll_right", scroll_right },
{ "reload", view_reload, }, //Buggy
{ "refresh", view_reload, }, /* for convenience, will change */
{ "stop", view_stop_loading, },
@@ -497,6 +542,7 @@ static void
setup_threading () {
pthread_t control_thread;
pthread_create(&control_thread, NULL, control_socket, NULL);
+ pthread_detach(control_thread);
}
static void
@@ -546,9 +592,9 @@ key_press_cb (WebKitWebView* page, GdkEventKey* event)
|| event->keyval == GDK_Up || event->keyval == GDK_Down || event->keyval == GDK_Left || event->keyval == GDK_Right)
return FALSE;
- /* turn of insert mode */
+ /* turn off insert mode (if always_insert_mode is not used) */
if (insert_mode && (event->keyval == GDK_Escape)) {
- insert_mode = !insert_mode || always_insert_mode;
+ insert_mode = always_insert_mode;
update_title();
return TRUE;
}
@@ -791,6 +837,12 @@ main (int argc, char* argv[]) {
printf("window_id %i\n",(int) xwin);
printf("pid %i\n", getpid ());
+ scbar_v = (GtkScrollbar*) gtk_vscrollbar_new (NULL);
+ bar_v = gtk_range_get_adjustment((GtkRange*) scbar_v);
+ scbar_h = (GtkScrollbar*) gtk_hscrollbar_new (NULL);
+ bar_h = gtk_range_get_adjustment((GtkRange*) scbar_h);
+ gtk_widget_set_scroll_adjustments ((GtkWidget*) web_view, bar_h, bar_v);
+
if (!show_status)
gtk_widget_hide(mainbar);