Ceci est une ancienne révision du document !



Introduction

Uzbl est un navigateur web qui utilise comme moteur de rendu de page web : Webkit.

Il est présenté comme le Vi du navigateur web.

Depuis les dépôts officiels (Lucid)

Depuis un dépôt tiers (Karmic et versions antérieures d'Ubuntu)

Ajoutez les dépôts suivants à vos sources de logiciels (remplacez "jaunty" par votre version d'Ubuntu) 1) :

# UZBL
deb http://ppa.launchpad.net/pplr/uzbl/ubuntu jaunty main 
# PPA for WebKit Team  
deb http://ppa.launchpad.net/webkit-team/ppa/ubuntu jaunty main 

Ainsi que les clés d'authentification en tapant dans un terminal :

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 2D9A3C5B
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 2A8BDB14

Rechargez la liste des paquets, puis installez le paquet uzbl

Depuis le tarball

(cette option permet d'avoir le système d'onglets!) Tout d'abord installez le paquet git-core.
Puis lancez

git clone git://github.com/Dieterbe/uzbl.git
cd uzbl
make
sudo make install-uzbl-core
sudo make install-uzbl-browser
sudo make install-uzbl-tabbed

Optionnel : Logiciel à installer

Comme vous pouvez le remarquer au premier lancement, uzbl n'est pas opérationnel.
Pour pouvoir utiliser uzbl , lancez les commandes suivantes :
Création du répertoire de configuration

mkdir ~/.uzbl/

On copie la configuration de base dans le répertoire

sudo cp -r /usr/share/uzbl/examples/* ~/.uzbl/

On s'approprie les fichiers copiés

sudo chown -Rv "votre_user":users ~/.uzbl/

On ajoute des variables utiles pour les scripts de uzbl dans notre bashrc

 echo "export XDG_DATA_HOME=~/.uzbl/data" >> ~/.bashrc
 echo "export XDG_CONFIG_HOME=~/.uzbl/config" >> ~/.bashrc 

On ajoute l'icone de l'application (optionnel)

 echo "set icon = /home/launay/.uzbl/data/uzbl/uzbl.png" >> ~/.uzbl/config/uzbl/config 

Votre nouveau navigateur est maintenant prêt à l'usage !!

o une_adresse_web : ouvrir l'adresse web demandée
b : retourner à la page précédente
u : ouvre le gestionnaire de favoris
U : ouvre le gestionnaire d'historique
/blabla : recherche l'occurence "blabla" dans la page
B : ajoute la page actuelle aux favoris

Les commandes de base ainsi que les alias de uzbl sont contenus dans le fichier config à l'adresse ~/.uzbl/config/uzbl/config
Voici un exemple de fichier config opérationnel :

# config uzbl revue par helly
# la config est optionnelle . vous pouvez utiliser uzbl sans elle (mais uzbl ne ferra pas grand chose)

#les commandes sont inspirées de vim

# Handlers
set download_handler = spawn $XDG_DATA_HOME/uzbl/scripts/download.sh
set cookie_handler   = spawn $XDG_DATA_HOME/uzbl/scripts/cookies.py
#set new_window      = sh 'echo uri "$8" > $4' # open in same window
set new_window       = sh 'uzbl -u $8' # equivalent to the default behaviour
set scheme_handler   = spawn $XDG_DATA_HOME/uzbl/scripts/scheme.py
set load_start_handler = chain 'set keycmd = ' 'set status_message = <span foreground="khaki">wait</span>'
set load_commit_handler = set status_message = <span foreground="green">recv</span>
set load_finish_handler = chain 'set status_message = <span foreground="gold">done</span>' 'spawn $XDG_DATA_HOME/uzbl/scripts/history.sh'

## desactiver Javascript
#set disable_scripts = 1

# Apparences
set show_status       = 1
set status_background = #303030
set status_format     = <span font_family="monospace"><span background="khaki" foreground="black">[\@[\@MODE]\@]</span> [<span weight="bold" foreground="red">\@[\@keycmd]\@</span>] <span foreground="#606060"> \@[\@LOAD_PROGRESSBAR]\@ </span><span foreground="#99FF66">\@[\@uri]\@</span> <span foreground="khaki">\@[\@NAME]\@</span>   <span foreground="orange">\@status_message</span><span foreground="#606060"> \@[\@SELECTED_URI]\@</span></span>
set status_top        = 0
set insert_indicator = I
set command_indicator = C
set useragent       = Uzbl (Webkit @WEBKIT_MAJOR.@WEBKIT_MINOR.@WEBKIT_MICRO) (@(uname -o)@ @(uname -m)@ [@ARCH_UZBL]) (Commit @COMMIT)

set fifo_dir = /tmp
set socket_dir = /tmp
set shell_cmd         = sh -c

# déclaration des commandes
set modkey = Mod1
# like this you can enter any command at runtime, interactively. prefixed by ':'
bind    :_        = chain '%s'

bind    j         = scroll_vert 20
bind    k         = scroll_vert -20
bind    h         = scroll_horz -20
bind    l         = scroll_horz 20
bind    <<        = scroll_begin
bind    >>        = scroll_end
bind    b         = back
bind    m         = forward
bind    S         = stop
bind    r         = reload
bind    R         = reload_ign_cache
bind    +         = zoom_in
bind    -         = zoom_out
bind    T         = toggle_zoom_type
bind    1         = sh "echo set zoom_level = 1.0 > $4"
bind    2         = sh "echo set zoom_level = 2.0 > $4"
bind    t         = toggle_status
bind    /*        = search %s
bind    ?*        = search_reverse %s
#jump to next
bind    n         = search
bind    N         = search_reverse
bind    gh _      = uri http://ixquick.com/do/metasearch.pl?query=%s&cat=web&pl=chrome&language=francais
# shortcut to set the uri. TODO: i think we can abandon the uri command in favor of 'set uri = ..'
bind    o _       = uri %s
# shortcut to set variables
bind    s _       = set %s
bind    \wiki _   = uri http://fr.wikipedia.org/w/index.php?search=%s&go=Lire
bind    \doc _    = uri http://doc.ubuntu-fr.org/?do=search&id=%s
bind    \des _    = uri http://desencyclopedie.wikia.com/index.php?search=%s&fulltext=Rechercher
bind    gg _      = uri http://www.google.com/search?q=%s
#bin     gg _      = uri http://ixquick.com/do/metasearch.pl?query=%s&cat=web&pl=chrome&language=francais
bind    i         = toggle_insert_mode
# disable insert mode (1 to enable).  note that Esc works to disable, regardless of this setting
bind    I         = toggle_insert_mode 0
# Enclose the executable in quotes if it has spaces.  Any additional parameters you use will
# appear AFTER the default parameters
bind    B         = spawn $XDG_DATA_HOME/uzbl/scripts/insert_bookmark.sh
bind    U         = spawn $XDG_DATA_HOME/uzbl/scripts/load_url_from_history.sh
bind    u         = spawn $XDG_DATA_HOME/uzbl/scripts/load_url_from_bookmarks.sh
# with the sample yank script, you can yank one of the arguments into clipboard/selection
bind    yurl      = spawn $XDG_DATA_HOME/uzbl/scripts/yank.sh 6 primary
bind    ytitle    = spawn $XDG_DATA_HOME/uzbl/scripts/yank.sh 7 clipboard
# does the same as yurl but without needing a script
bind    y2url     = sh 'echo -n $6 | xclip'
# go the page from primary selection
bind    p         = sh 'echo "uri `xclip -selection primary -o`" > $4'
# go to the page in clipboard
bind    P         = sh 'echo "uri `xclip -selection clipboard -o`" > $4'
# start a new uzbl instance from the page in primary selection
bind    'p        = sh 'exec uzbl --uri $(xclip -o)'
bind    ZZ        = exit
bind    Xs         = js alert("hi");
# example showing how to use sh
# it sends a command to the fifo, whose path is told via a positional param
# if fifo_dir is not set, it'll echo to a file named (null) somewhere >:) remember to delete it
# The body of the shell command should be one parameter, so if it has spaces like here,
# you must enclose it in quotes.  Remember to escape (and double-escape) quotes and backslashes
# in the body.  Any additional parameters you use will appear AFTER the default parameters (cfg file
# path, fifo & socket dirs, etc.)
bind    XS        = sh 'echo "js alert (\\"This is sent by the shell via a fifo\\")" > "$4"'

bind    !dump     = sh "echo dump_config > $4"
bind    !reload   = sh 'cat $1 > $4'

# this script allows you to configure (per domain) values to fill in form fields (eg login information) and to fill in these values automatically
bind za = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.sh
bind ze = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.sh edit
bind zn = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.sh new
bind zl = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.sh load

# other - more advanced - implementation using perl: (could not get this to run - Dieter )
bind LL = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.pl load
bind LN = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.pl new
bind LE = spawn $XDG_DATA_HOME/uzbl/scripts/formfiller.pl edit

# we ship some javascripts to do keyboard based link hinting/following.  (webkit does not have C DOM bindings yet)
# this is similar to how it works in vimperator (and konqueror)
# TODO: did we resolve: "no click() event for hyperlinks so no referrer set" ?
#hit F to toggle the Hints (now in form of link numbering)
bind    F = script $XDG_DATA_HOME/uzbl/scripts/hint.js
# the most stable version:
bind    fl* = script $XDG_DATA_HOME/uzbl/scripts/follow_Numbers.js %s
# using strings, not polished yet:
bind    fL* = script $XDG_DATA_HOME/uzbl/scripts/follow_Numbers_Strings.js %s

uzbl dépend à 100% des scripts, en effet comme vous avez pu le voir l'ors de l'installation, uzbl sans script n'est qu'une fenêtre Webkit.
Les scripts se trouvent à l'adresse ~/.uzbl/data/uzbl/scripts/
Ils sont pour la plupart en python et en shell. Il semble que le script load_url_from_bookmarks.sh sois mal codé, il n'affiche pas les tags des favoris, vous pouvez le remplacer par celui ci:

#!/bin/bash
#revu par helly le 9/04/2010

#NOTE: it's the job of the script that inserts bookmarks to make sure there are no dupes.

file=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/bookmarks
[ -r "$file" ] || exit
COLORS=" -nb #303030 -nf khaki -sb #CCFFAA -sf #303030"

if dmenu --help 2>&1 | grep -q '\[-rs\] \[-ni\] \[-nl\] \[-xs\]'
then
        DMENU="dmenu -i -xs -rs -l 10" # vertical patch
        # show tags as well
        goto=`$DMENU $COLORS < $file | awk '{print $1}'`
else
        DMENU="dmenu -i"
        tag=`awk '{print $2}' $file | $DMENU $COLORS` # $1
fi

lien=$(grep "$tag" $file | cut -d " " -f1)

#[ -n "$goto" ] && echo "uri $goto" > $4
[ -n "$lien" ] && echo "uri $lien" | socat - unix-connect:$5

Le site officiel

Le sujet du forum


Contributeurs principaux : helly


1)
Aucun paquet n'est disponible pour Hardy
  • uzbl.1271154509.txt.gz
  • Dernière modification: Le 18/04/2011, 14:54
  • (modification externe)