You are not logged in.

#1001 2011-02-25 18:51:08

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 18,315
Website

Re: uzbl. A browser that adheres to the unix philosophy.

M_ller wrote:

So uzbl is temporary dead or what?

http://www.uzbl.org/news.php?id=32


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#1002 2011-02-25 20:29:38

tladuke
Member
Registered: 2009-07-23
Posts: 171

Re: uzbl. A browser that adheres to the unix philosophy.

Does anyone use supergenpass (in other browsers)? I found a python implementation of it. Since it's bookmarklets are a pain and hacky...

It works in terminal, but integrating it into uzbl is beyond me...

Offline

#1003 2011-02-26 06:41:50

M_ller
Member
Registered: 2010-04-17
Posts: 80
Website

Re: uzbl. A browser that adheres to the unix philosophy.

@jasonwryan: Oh, sorry, the post confused me a tad. In the title it says 2011.02.15, but in the text itself it says 2010-02-15.

Anyways, since this browser is still alive and healthy, could we do a topic to share the scripts we've made?
I'd be very interested in a script such as AdBlock, NoScript, Ghostery and CookieSafe for FireFox.

Offline

#1004 2011-02-26 07:46:12

tjwoosta
Member
Registered: 2008-12-18
Posts: 453

Re: uzbl. A browser that adheres to the unix philosophy.

uzbl has a wiki where users can submit scripts wink

For noscript alternative you can use the per-site-settings that comes with this release.


First put this in your config (this will disable all scripts)

set disable_scripts = 1

Then copy /usr/share/uzbl/examples/data/per-site-settings to ~/.local/share/uzbl/ and put something like this in it.  (this will allow scripts on youtube)

youtube.com
  .*
    set disable_scripts = 0

You can use per-site-settings to do all kinds of neat stuff.


EDIT: oh yea, forgot to mention you might need to uncomment the Userscripts/per-site-settings line in your config too.

Last edited by tjwoosta (2011-02-26 08:13:53)

Offline

#1005 2011-02-26 12:01:47

M_ller
Member
Registered: 2010-04-17
Posts: 80
Website

Re: uzbl. A browser that adheres to the unix philosophy.

tjwoosta: Thanks a lot for that little neat feature!
However, I need some more guidance. At first when I installed UZBL, I did put the scripts I wanted into ~/.local/share/uzbl/userstyles/, but for some reason uzbl couldn't find my scripts.
This is how my scripts_dir is defined in my config file:

# Spawn path shortcuts. In spawn the first dir+path match is used in "dir1:dir2:dir3:executable"
#set scripts_dir      = @data_home/uzbl:@prefix/share/uzbl/examples/data:scripts

However, it does not read any of my scripts in /home/USERNAME/.local/share/uzbl/scripts no matter how I try to edit that scripts_dir define.
I'd see if it worked, since I've used this userstyle.sh to make the CSS of archlinux.org different. It's in /home/USERNAME/.local/share/uzbl/scripts/userstyle.sh

Loading the script

@on_event   LOAD_COMMIT    spawn @scripts_dir/userstyle.sh

The script

#/bin/bash
 
# Author: Jurica Bradaric <jbradaric at gmail.com> 
# A simple script to use custom stylesheets for websites.
# Similar to the Stylish extension for Firefox.
# I hope someone finds it useful. All comments and suggestions
# are welcome.
 
XDG_DATA_HOME=${XDG_DATA_HOME:-"$HOME/.local/share/"}
 
# Set the path to the .css files
# Every custom css style must be in a file named web_address.css
# e.g. reddit.com.css
STYLE_PATH=$XDG_DATA_HOME/uzbl/userstyles
 
STYLESHEET_SET=0
 
for i in $STYLE_PATH/*.css; do
    stylesheet=$(basename $i '.css')
    if [[ "$6" =~ "${stylesheet}" ]]; then
        #echo "set stylesheet_uri = file://$STYLE_PATH/${stylesheet}.css" >> "$4"
        echo "set stylesheet_uri = file://${STYLE_PATH}/${stylesheet}.css" | socat - unix-connect:$5
        STYLESHEET_SET=1
        break
    fi
done
 
if [ $STYLESHEET_SET -eq 0 ]; then
    echo "set stylesheet_uri = file://${STYLE_PATH}/default.css" | socat - unix-connect:$5
fi
 
exit 0

EDIT:
So at the moment, all my scripts must be placed in /usr/share/uzbl/examples/data/scripts, which is very annoying.

Last edited by M_ller (2011-02-26 12:02:20)

Offline

#1006 2011-02-26 17:59:27

tjwoosta
Member
Registered: 2008-12-18
Posts: 453

Re: uzbl. A browser that adheres to the unix philosophy.

hmm, Im also using the change_style.sh that your using and it works fine here.

Heres my current directory layout (I didn't need to change the scripts_dir paths in my config, it just worked)

~/.local/share/uzbl/scripts/(my scripts)

~/.local/share/uzbl/per-site-settings

~/.local/share/uzbl/userstyles/(my custom stylesheets)

Offline

#1007 2011-02-27 04:09:27

hatten
Arch Linux f@h Team Member
From: Sweden, Borlange
Registered: 2009-02-23
Posts: 736

Re: uzbl. A browser that adheres to the unix philosophy.

uzbl is using the XDG variables, you may have to set them yourself in your .bashrc.

example from my .bashrc:
XDG_DATA_HOME=/home/hatten/.data
XDG_CONFIG_HOME=/home/hatten/.config

Offline

#1008 2011-02-27 14:51:01

M_ller
Member
Registered: 2010-04-17
Posts: 80
Website

Re: uzbl. A browser that adheres to the unix philosophy.

hatten wrote:

uzbl is using the XDG variables, you may have to set them yourself in your .bashrc.

example from my .bashrc:
XDG_DATA_HOME=/home/hatten/.data
XDG_CONFIG_HOME=/home/hatten/.config

[marcus@archlinux ~]$ $XDG_DATA_HOME
bash: /home/marcus/.local/share: is a directory
[marcus@archlinux ~]$ $XDG_CONFIG_HOME
bash: /home/marcus/.config: is a directory

I am pretty sure it is done already, without me doing it manually.

@tjwoosta: My setup is pretty much the same, with the userstyles in the userstyles/ folder, such as archlinux.org.css, but nevertheless, it does not change anything, which leads me to the conclusion that it is not reading my scripts/ folder.

EDIT: Was wondering if permissions had anything to do with this?

EDIT2:
It seems that per_site_settings.py is loaded perfectly! The problem must be userstyle.sh itself, or the .css files perhaps.

Last edited by M_ller (2011-02-27 15:05:33)

Offline

#1009 2011-02-27 17:04:49

tjwoosta
Member
Registered: 2008-12-18
Posts: 453

Re: uzbl. A browser that adheres to the unix philosophy.

I think $XDG_DATA_HOME  gets set in /usr/share/uzbl/examples/data/scripts/util/uzbl-dir.sh.  I could be wrong 
(btw if you want to move your util dir away from that directory you need to export UZBL_UTIL_DIR in bashrc, but that shouldnt have any bearing on your scripts working so long as that file still exists)

@M_ller, did you follow the link in the uzbl news for this release? It leads you to a page on the wiki where it shows you the changes your supposed to make to scripts to make them work with this release.

I.E your supposed to replace all the $1, $2, $3, etc..

Heres the link, the title says experamental-branch, but this info applies to this latest stable release, they just never changed the title. You shouldnt need to worry about the config file changes since you proabably started with the updated config file that came in examples dir. Btw not sure what youve already done but config should be moved from /usr/share/uzbl/examples/config/config to ~/.config/uzbl/config

http://www.uzbl.org/wiki/experimental-branch

Last edited by tjwoosta (2011-02-27 17:11:49)

Offline

#1010 2011-02-27 17:16:07

M_ller
Member
Registered: 2010-04-17
Posts: 80
Website

Re: uzbl. A browser that adheres to the unix philosophy.

tjwoosta wrote:

I think $XDG_DATA_HOME  gets set in /usr/share/uzbl/examples/data/scripts/util/uzbl-dir.sh.  I could be wrong 
(btw if you want to move your util dir away from that directory you need to export UZBL_UTIL_DIR in bashrc, but that shouldnt have any bearing on your scripts working so long as that file still exists)

@M_ller, did you follow the link in the uzbl news for this release? It leads you to a page on the wiki where it shows you the changes your supposed to make to scripts to make them work with this release.

I.E your supposed to replace all the $1, $2, $3, etc..

Heres the link, the title says experamental-branch, but this info applies to this latest stable release, they just never changed the title. You shouldnt need to worry about the config file changes since you proabably started with the updated config file that came in examples dir. Btw not sure what youve already done but config should be moved from /usr/share/uzbl/examples/config/config to ~/.config/uzbl/config

http://www.uzbl.org/wiki/experimental-branch

I edited my change_style.sh according to the link, but no success. Perhaps you could take a look at my config?

config

# Example uzbl config. All settings are optional. You can use uzbl without
# any config at all (but it won't do much).

# === Core settings ==========================================================

# common directory locations
set prefix     = @(echo $PREFIX)@
set data_home  = @(echo $XDG_DATA_HOME)@
set cache_home = @(echo $XDG_CACHE_HOME)@

# Interface paths.
set fifo_dir   = /tmp
set socket_dir = /tmp

set shell_cmd       = sh -c

# === General config aliases =================================================

# Config related events (use the request function):
# request MODE_CONFIG <mode> <key> = <value>
set mode_config     = request MODE_CONFIG
# request ON_EVENT <EVENT_NAME> <command>
set on_event        = request ON_EVENT
# request ON_SET   <key/glob> <command>
set on_set          = request ON_SET
# request MODMAP <From> <To>
set modmap          = request MODMAP
# request IGNORE_KEY <glob>
set ignore_key      = request IGNORE_KEY
# request MODKEY_ADDITION <key1> <key2> <keyn> <result>
set modkey_addition = request MODKEY_ADDITION
# request TOGGLE_MODES <mode1> <mode2> ... <moden>
set toggle_modes    = request TOGGLE_MODES

set set_mode        = set mode =
set set_status      = set status_message =

# Spawn path shortcuts. In spawn the first dir+path match is used in "dir1:dir2:dir3:executable"
set scripts_dir      = @data_home/uzbl/:@prefix/share/uzbl/examples/data:scripts

# === Hardcoded handlers =====================================================

# These handlers can't be moved to the new event system yet as we don't
# support events that can wait for a response from a script.
set scheme_handler      = sync_spawn @scripts_dir/scheme.py
set authentication_handler = sync_spawn @scripts_dir/auth.py
set download_handler    = sync_spawn @scripts_dir/download.sh

# === Dynamic event handlers =================================================

#   What to do when a website wants to open a new window:
# Open link in new window
@on_event   NEW_WINDOW     sh 'uzbl-browser ${1:+-u "$1"}' %r
# Open in current window (also see the REQ_NEW_WINDOW event handler below)
#@on_event   NEW_WINDOW     uri %s
# Open in new tab. Other options are NEW_TAB_NEXT, NEW_BG_TAB and NEW_BG_TAB_NEXT.
#@on_event   NEW_WINDOW     event NEW_TAB %s

#   What to do when the user requests a new window:
# If your the NEW_WINDOW handler opens the uri in the current window, you'll
# probably want to change this handler to open a new window or tab.
@on_event   REQ_NEW_WINDOW event NEW_WINDOW %s

# Load start handler
@on_event   LOAD_START     @set_status <span foreground="khaki">wait</span>
# Reset the keycmd on navigation
@on_event   LOAD_START     @set_mode

# Load commit handlers
@on_event   LOAD_COMMIT    @set_status <span foreground="green">recv</span>

# Userscripts/per-site-settings. See the script and the example configuration for details
@on_event   LOAD_COMMIT    spawn  @scripts_dir/per-site-settings.py @data_home/uzbl/per-site-settings

#Userstyles ##MARCUS
@on_event   LOAD_COMMIT    spawn  @scripts_dir/change_style.sh

#AdBlock ##MARCUS
@on_event   LOAD_COMMIT    script @scripts_dir/adblock.js

# Load finish handlers
@on_event   LOAD_FINISH    @set_status <span foreground="gold">done</span>
@on_event   LOAD_FINISH    spawn @scripts_dir/history.sh

# Switch to insert mode if a (editable) html form is clicked
@on_event   FORM_ACTIVE    @set_mode insert
# Switch to command mode if anything else is clicked
@on_event   ROOT_ACTIVE    @set_mode command

# Example CONFIG_CHANGED event handler
#@on_event  CONFIG_CHANGED print Config changed: %1 = %2

# Scroll percentage calculation
@on_event   SCROLL_VERT    set scroll_message = \@<(function(){var a='%1'.split(' ');var p='--';if(a[2]!=a[1]){p=(a[0]/(a[2]-a[3]));p=Math.round(10000*p)/100;};return p+'%';})()>\@

# === Behaviour and appearance ===============================================

set show_status       = 1
set status_top        = 0
set status_background = #303030

set modcmd_style      = weight="bold" foreground="red"
set keycmd_style      = weight="light" foreground="red"
set prompt_style      = foreground="grey"
set cursor_style      = underline="single"
set completion_style  = foreground="green"
set hint_style        = weight="bold"

set mode_section      = <span background="khaki" foreground="black">[\@[\@mode_indicator]\@]</span>
set keycmd_section    = [<span \@prompt_style>\@[\@keycmd_prompt]\@</span><span \@modcmd_style>\@modcmd</span><span \@keycmd_style>\@keycmd</span><span \@completion_style>\@completion_list</span>]
set progress_section  = <span foreground="#606060">\@[\@progress.output]\@</span>
set scroll_section    = <span foreground="#606060">\@[\@scroll_message]\@</span>
set uri_section       = <span foreground="#99FF66">\@[\@uri]\@</span>
set name_section      = <span foreground="khaki">\@[\@NAME]\@</span>
set status_section    = <span foreground="orange">\@status_message</span>
set selected_section  = <span foreground="#606060">\@[\@SELECTED_URI]\@</span>

set download_section  = <span foreground="white">\@downloads</span>

set status_format       = <span font_family="monospace">@mode_section @keycmd_section @progress_section @name_section @status_section @scroll_section @selected_section @download_section</span>
set status_format_right = <span font_family="monospace"><span foreground="#666">uri:</span> @uri_section</span>

set title_format_long = \@keycmd_prompt \@raw_modcmd \@raw_keycmd \@TITLE - Uzbl browser <\@NAME> \@SELECTED_URI

# Progress bar config
# %d = done, %p = pending %c = percent done, %i = int done, %s = spinner,
# %t = percent pending, %o = int pending, %r = sprite scroll
set progress.width      = 8
set progress.format     = [%d%p]%c
set progress.done       = #
set progress.pending    = .

# === Useragent setup ========================================================

set useragent         = Uzbl (Webkit @{WEBKIT_MAJOR}.@{WEBKIT_MINOR}) (@(+uname -sm)@ [@ARCH_UZBL])

# === Configure cookie blacklist ========================================================
# Drop google analytics tracking cookies
#request BLACKLIST_COOKIE name '^__utm.$'

# === Key binding configuration ==============================================
# --- Internal modmapping and ignoring ---------------------------------------

#modmap <From>          <To>
@modmap <Control>       <Ctrl>
@modmap <ISO_Left_Tab>  <Shift-Tab>
@modmap <space>         <Space>
@modmap <KP_Enter>      <Enter>

#modkey_addition <Key1>  <Key2>    <Result>
@modkey_addition <Shift> <Ctrl>    <Meta>
@modkey_addition <Shift> <Tab>     <Shift-Tab>
@modkey_addition <Shift> <Insert>  <Shift-Insert>

#ignore_key <glob>
@ignore_key <ISO_*>
@ignore_key <Shift>
@ignore_key <Multi_key>

# --- Bind aliases -----------------------------------------------------------

# request BIND <bind cmd> = <command>
set bind      = request MODE_BIND global

# request MODE_BIND <mode> <bind cmd> = <command>
set mode_bind = request MODE_BIND

# Insert mode binding alias
set ibind     = @mode_bind insert

# Command mode binding alias
set cbind     = @mode_bind command

# Non-insert mode bindings alias (ebind for edit-bind).
set ebind     = @mode_bind global,-insert

# --- Global & keycmd editing binds ------------------------------------------

# Resets keycmd and returns to default mode.
@on_event  ESCAPE    @set_mode
@bind   <Escape>     = event ESCAPE
@bind   <Ctrl>[      = event ESCAPE

# Commands for editing and traversing the keycmd.
@ebind  <Return>     = event KEYCMD_EXEC_CURRENT
@ebind  <Home>       = event SET_CURSOR_POS 0
@ebind  <End>        = event SET_CURSOR_POS -1
@ebind  <Left>       = event SET_CURSOR_POS -
@ebind  <Right>      = event SET_CURSOR_POS +
@ebind  <BackSpace>  = event KEYCMD_BACKSPACE
@ebind  <Delete>     = event KEYCMD_DELETE
@ebind  <Tab>        = event START_COMPLETION
# Readline-ish bindings.
@ebind  <Ctrl>w      = event KEYCMD_STRIP_WORD
@ebind  <Ctrl>u      = event SET_KEYCMD
@ebind  <Ctrl>a      = event SET_CURSOR_POS 0
@ebind  <Ctrl>e      = event SET_CURSOR_POS -1

# --- Mouse bindings ---------------------------------------------------------

# Middle click open in new window
@bind  <Button2>  = sh 'if [ "$1" ]; then echo "event REQ_NEW_WINDOW $1" > "$UZBL_FIFO"; else echo "uri $(xclip -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"; fi' '\@SELECTED_URI'

# --- Keyboard bindings ------------------------------------------------------

# With this command you can enter in any command at runtime when prefixed with
# a colon.
@cbind    :_        = %s

# open a new window or a new tab (see the on_event NEW_WINDOW settings above)
@cbind  w            = event REQ_NEW_WINDOW

# Page movement binds
@cbind  j            = scroll vertical 20
@cbind  k            = scroll vertical -20
@cbind  h            = scroll horizontal -20
@cbind  l            = scroll horizontal 20
@cbind  <Page_Up>    = scroll vertical -100%
@cbind  <Page_Down>  = scroll vertical 100%
@cbind  <Ctrl>f      = scroll vertical 100%
@cbind  <Ctrl>b      = scroll vertical -100%
@cbind  <<           = scroll vertical begin
@cbind  >>           = scroll vertical end
@cbind  <Home>       = scroll vertical begin
@cbind  <End>        = scroll vertical end
@cbind  ^            = scroll horizontal begin
@cbind  $            = scroll horizontal end
@cbind  <Space>      = scroll vertical end

# Navigation binds
@cbind  b   = back
@cbind  m   = forward
@cbind  S   = stop
@cbind  r   = reload
@cbind  R   = reload_ign_cache

# Zoom binds
@cbind  +   = zoom_in
@cbind  -   = zoom_out
@cbind  T   = toggle_zoom_type
@cbind  1   = set zoom_level = 1.0
@cbind  2   = set zoom_level = 2.0

# Appearance binds
@cbind  t   = toggle_status

# Page searching binds
@cbind  /*  = search %s
@cbind  ?*  = search_reverse %s
# Jump to next and previous items
@cbind  n   = search
@cbind  N   = search_reverse

# Web searching binds
#@cbind  gg<Google:>_         = uri http://www.google.com/search?q=\@<encodeURIComponent(%r)>\@
@cbind  ddg<DuckDuckGo:>_    = uri http://duckduckgo.com/?q=%s
@cbind  \\awiki<Archwiki:>_  = uri http://wiki.archlinux.org/index.php/Special:Search?search=\@<encodeURIComponent(%r)>\@&go=Go
@cbind  \\wiki<Wikipedia:>_  = uri http://en.wikipedia.org/w/index.php?title=Special:Search&search=\@<encodeURIComponent(%r)>\@&go=Go
@cbind  gg<Scroogle:>_  = uri https://ssl.scroogle.org/cgi-bin/nbbwssl.cgi?Gw=%s

# Handy binds
# Set function shortcut
@cbind  s<var:>_<value:>_  = set %1 = %2
# Exit binding
@cbind  ZZ                 = exit
# Dump config to stdout
@cbind  !dump              = sh 'echo dump_config > "$UZBL_FIFO"'
# Reload all variables in the config
@cbind  !reload            = sh "sed '/^# === Post-load misc commands/,$d' \"$UZBL_CONFIG\" | grep '^set ' > \"$UZBL_FIFO\""

# Use socat to directly inject commands into uzbl-core and view events
# raised by uzbl-core:
@cbind  <Ctrl><Alt>t  = sh 'xterm -e "socat unix-connect:\"$UZBL_SOCKET\" -"'
#@cbind  <Ctrl><Alt>t  = sh 'urxvt -e socat unix-connect:"$UZBL_SOCKET" -'

# Uri opening prompts
@cbind  o<uri:>_       = uri %s
# Or have it load the current uri into the keycmd for editing
@cbind  O<uri:\@uri>_  = uri %s

# Mode setting binds
@cbind  i        = @set_mode insert
@bind   <Ctrl>i  = @set_mode insert

# Hard-bound bookmarks
@cbind  gh  = uri http://www.uzbl.org

# Yanking & pasting binds
@cbind  yu  = sh 'echo -n "$UZBL_URI" | xclip'
@cbind  yU  = sh 'echo -n "$1" | xclip' \@SELECTED_URI
@cbind  yy  = sh 'echo -n "$UZBL_TITLE" | xclip'

# Clone current window
@cbind  c   = event REQ_NEW_WINDOW \@uri
# Go the page from primary selection
@cbind  p   = sh 'echo "uri $(xclip -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"'
# Go to the page in clipboard
@cbind  P   = sh 'echo "uri $(xclip -selection clipboard -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"'
# Start a new uzbl instance from the page in primary selection
@cbind  'p  = sh 'echo "event REQ_NEW_WINDOW $(xclip -o)" > "$UZBL_FIFO"'
# paste primary selection into keycmd at the cursor position
@bind <Shift-Insert> = sh 'echo "event INJECT_KEYCMD $(xclip -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"'

# Bookmark inserting binds
@cbind <Ctrl>b<tags:>_  = sh 'echo `printf "$UZBL_URI %s"` >> "$XDG_DATA_HOME"/uzbl/bookmarks'
# Or use a script to insert a bookmark.
@cbind  B  = spawn @scripts_dir/insert_bookmark.sh

# Bookmark/history loading
@cbind  U  = spawn @scripts_dir/load_url_from_history.sh
@cbind  u  = spawn @scripts_dir/load_url_from_bookmarks.sh

# Link following (similar to vimperator and konqueror)
# Set custom keys you wish to use for navigation. Some common examples:
set follow_hint_keys = 0123456789
#set follow_hint_keys = qwerty
#set follow_hint_keys = asdfghjkl;
#set follow_hint_keys = thsnd-rcgmvwb/;789aefijkopquxyz234
@cbind  fl*  = spawn @scripts_dir/follow.sh "%s"
@cbind  gi   = spawn @scripts_dir/go_input.sh

# Form filler binds
# This script allows you to configure (per domain) values to fill in form
# fields (eg login information) and to fill in these values automatically.
# This implementation allows you to save multiple profiles for each form
# (think about multiple accounts on some website).
set formfiller = spawn @scripts_dir/formfiller.sh
@cbind  za  = @formfiller add
@cbind  ze  = @formfiller edit
@cbind  zn  = @formfiller new
@cbind  zl  = @formfiller load

# --- Uzbl tabbed binds ------------------------------------------------------

# Tab opening
@cbind  gn              = event NEW_TAB
@cbind  gN              = event NEW_TAB_NEXT
@cbind  go<uri:>_       = event NEW_TAB %s
@cbind  gO<uri:>_       = event NEW_TAB_NEXT %s

# Closing / resting
@cbind  gC              = exit
@cbind  gQ              = event CLEAN_TABS

# Tab navigating
@cbind  g<              = event FIRST_TAB
@cbind  g>              = event LAST_TAB
@cbind  gt              = event NEXT_TAB
@cbind  gT              = event PREV_TAB
@cbind  gi<index:>_     = event GOTO_TAB %s

# Preset loading
set preset = event PRESET_TABS
@cbind  gs<preset save:>_   = @preset save %s
@cbind  glo<preset load:>_  = @preset load %s
@cbind  gd<preset del:>_    = @preset del %s
@cbind  gli                 = @preset list

# === Context menu items =====================================================

# Default context menu
menu_add Scroogle = set uri = http://scroogle.org/cgi-bin/scraper.htm
menu_add Go Home = set uri = http://uzbl.org
menu_separator separator_1
menu_add Quit uzbl = exit

# Link context menu
menu_link_add Print Link = print \@SELECTED_URI

# === Mode configuration =====================================================

# Define some mode specific uzbl configurations.
set command  = @mode_config command
set insert   = @mode_config insert
set stack    = @mode_config stack

# Command mode config.
@command  keycmd_style        = foreground="red"
@command  status_background   = #202020
@command  mode_indicator      = Cmd
@command  keycmd_events       = 1
@command  forward_keys        = 0
@command  modcmd_updates      = 1

# Insert mode config.
@insert   status_background   = #303030
@insert   mode_indicator      = Ins
@insert   forward_keys        = 1
@insert   keycmd_events       = 0
@insert   modcmd_updates      = 0

# Multi-stage-binding mode config.
@stack    keycmd_style        = foreground="red"
@stack    status_background   = #202020
@stack    mode_indicator      = Bnd
@stack    prompt_style        = foreground="#888" weight="light"
@stack    keycmd_events       = 1
@stack    modcmd_updates      = 1
@stack    forward_keys        = 0

set default_mode = command

# === Post-load misc commands ================================================
sync_spawn_exec @scripts_dir/load_cookies.sh
sync_spawn_exec @scripts_dir/load_cookies.sh @data_home/uzbl/session-cookies.txt

# Set the "home" page.
set uri = archlinux.org

# vim: set fdm=syntax:

Edited version of change_style.sh

#/bin/bash
 
# Author: Jurica Bradaric <jbradaric at gmail.com> 
# A simple script to use custom stylesheets for websites.
# Similar to the Stylish extension for Firefox.
# I hope someone finds it useful. All comments and suggestions
# are welcome.
 
XDG_DATA_HOME=${XDG_DATA_HOME:-"$HOME/.local/share/"}
 
# Set the path to the .css files
# Every custom css style must be in a file named web_address.css
# e.g. reddit.com.css
STYLE_PATH=$XDG_DATA_HOME/uzbl/userstyles
 
STYLESHEET_SET=0
 
for i in $STYLE_PATH/*.css; do
    stylesheet=$(basename $i '.css')
    if [[ "$UZBL_URI" =~ "${stylesheet}" ]]; then
        #echo "set stylesheet_uri = file://$STYLE_PATH/${stylesheet}.css" >> "$4"
        echo "set stylesheet_uri = file://${STYLE_PATH}/${stylesheet}.css" | socat - unix-connect:$UZBL_SOCKET
        STYLESHEET_SET=1
        break
    fi
done
 
if [ $STYLESHEET_SET -eq 0 ]; then
    echo "set stylesheet_uri = file://${STYLE_PATH}/default.css" | socat - unix-connect:$UZBL_SOCKET
fi
 
exit 0

Offline

#1011 2011-02-27 17:32:20

tjwoosta
Member
Registered: 2008-12-18
Posts: 453

Re: uzbl. A browser that adheres to the unix philosophy.

everything looks fine to me, i dont know

Last edited by tjwoosta (2011-02-27 17:34:27)

Offline

#1012 2011-02-27 19:07:30

M_ller
Member
Registered: 2010-04-17
Posts: 80
Website

Re: uzbl. A browser that adheres to the unix philosophy.

tjwoosta wrote:

everything looks fine to me, i dont know

Could you possibly show me your config?

EDIT:
For some weird reason it is 100% working now!
I have a thought that it was because of an extra space between "spawn" and "@scripts_.....", but that would just be weird!
It fixed it however.

This bugs me:

# Userstyles ##MARCUS
@on_event   LOAD_COMMIT     spawn  @scripts_dir/change_style.sh

This does not:

# Userstyles ##MARCUS
@on_event   LOAD_COMMIT     spawn @scripts_dir/change_style.sh

Is it perhaps a bug in the application itself?

Anyways, it's working perfectly now, but am I the only one feeling that it's a tad slower than Firefox?

EDIT2:
And for some reason, it seems that I have to do

sudo a+rwx *

in my script file, everytime I create a new script. Otherwise I get this output while running UZBL:

error on run_command: Failed to execute child process "/home/marcus/.local/share/uzbl//scripts/noscript.sh" (Permission denied)

Last edited by M_ller (2011-02-27 19:47:50)

Offline

#1013 2011-02-27 20:23:39

tjwoosta
Member
Registered: 2008-12-18
Posts: 453

Re: uzbl. A browser that adheres to the unix philosophy.

you only need to give scripts executable permissions, I thought that much would be obvious  (probably not a good idea to give everyone write permissions like you did)

# chmod +x script.sh

example of what permissions look like for me

┌─[Arch]─[~/.local/share/uzbl/scripts]
└─╼ ls -l change_style.sh
-rwxr-xr-x 1 tj users 913 Feb 26 01:24 change_style.sh
┌─[Arch]─[~/.local/share/uzbl/scripts]
└─╼ 

EDIT:

Anyways, it's working perfectly now, but am I the only one feeling that it's a tad slower than Firefox?

It could possibly be because uzbl instances dont share a cache. You can improve speed by using a local caching proxy

see here for more..
http://www.uzbl.org/wiki/improving_speed_with_proxies

Last edited by tjwoosta (2011-02-28 05:53:26)

Offline

#1014 2011-03-01 04:15:31

ryeguy146
Member
Registered: 2009-10-28
Posts: 33

Re: uzbl. A browser that adheres to the unix philosophy.

I've been having some issues since updating, one thing in particular is preventing me from even using the browser. When hovering the mouse over any links that lead to long URLs, the window expands to fit the target URL into the status bar. Even when the window is fullscreen, the entire rendering shifts to the right when hovering over such a link.

When installing and first noticing the issue, I thought that it was my configuration files, so I removed all config files (including .local files) relating to uzbl and did a clean install, but the issue persists.

Am I just doing something wrong? Any ideas on how I can resolve the issue?

Offline

#1015 2011-03-01 04:27:27

Floft
Member
Registered: 2009-11-15
Posts: 36
Website

Re: uzbl. A browser that adheres to the unix philosophy.

ryeguy146 wrote:

When hovering the mouse over any links that lead to long URLs, the window expands to fit the target URL into the status bar.

I am having the exact same problem. I attempted to set my config up to max out the url at 35 digits, but couldn't quite get it to work. I would love finding a solution to this problem. In the mean time... I'm using Icecat.

Offline

#1016 2011-03-01 18:11:41

tjwoosta
Member
Registered: 2008-12-18
Posts: 453

Re: uzbl. A browser that adheres to the unix philosophy.

Hmm..

I dont dont have the problem, but its probably because Im using a tiling wm. Id reccomend going on #uzbl and asking the devs about it.

Offline

#1017 2011-03-01 18:27:10

vincekd
Member
From: USA
Registered: 2011-02-27
Posts: 15

Re: uzbl. A browser that adheres to the unix philosophy.

I'm having the same problem.

Offline

#1018 2011-03-02 05:22:04

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 194
Website

Re: uzbl. A browser that adheres to the unix philosophy.

Floft wrote:
ryeguy146 wrote:

When hovering the mouse over any links that lead to long URLs, the window expands to fit the target URL into the status bar.

I am having the exact same problem. I attempted to set my config up to max out the url at 35 digits, but couldn't quite get it to work. I would love finding a solution to this problem. In the mean time... I'm using Icecat.

The uzbl devs need to look at gtk_label_set_width_chars. Luakit & jumanji set all statusbar label widgets to 1 which allows the window to be resized down to 1x1 pixels.

Edit: A word of warning though, it is very hard (if at all possible) to get pango ellipsize options to work after you start playing with gtk_label_set_width_chars, packing options & alignments.  As such luakit doesn't provide any pango API functions.

Last edited by mason.larobina (2011-03-05 17:57:29)

Offline

#1019 2011-03-05 20:05:06

M_ller
Member
Registered: 2010-04-17
Posts: 80
Website

Re: uzbl. A browser that adheres to the unix philosophy.

So I disabled IPv6 as explained how-to in the ArchWiki, and it really sped up uzbl!
seems that I finally can replace Firefox with this.

EDIT:
I've made a little script myself, which is slightly the same as NoScript for FireFox.
It requires that you use per-site-settings.py, as all this script does is writing the settings for the current site in the per-site-settings file, and there it allows the site you're on to do JavaScript.

To use it, you just have to type in "ns" or whatever you have binded it to, and JavaScript is usually enabled after a reload.

noscript.sh (put it in your script folder)

##REQUIRES "sed" package

#!/bin/sh

UZBL_DATA_DIR=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl

[ -d "$UZBL_DATA_DIR" ] || exit 1
[ -w "$UZBL_DATA_DIR/per-site-settings" ] || [ ! -a "$UZBL_DATA_DIR/per-site-settings" ] || exit 1

which zenity >/dev/null 2>&1 || exit 2

exitstatus=$?
[ $exitstatus -eq 0 ] || exit $exitstatus

echo "$UZBL_URI" | sed -e "s/[^/]*\/\/\([^@]*@\)\?\([^:/]*\).*/\2/">> "$UZBL_DATA_DIR/per-site-settings"
echo "    .*" >> "$UZBL_DATA_DIR/per-site-settings"
echo -e "        set disable_scripts = 0\n" >> "$UZBL_DATA_DIR/per-site-settings"

Add this to your config file, so that JavaScript is disabled globally.

# Disable JavaScript
set disable_scripts = 1

And add this as well, so that when you type "ns", it loads our noscript.sh

# Noscript binds
@cbind  ns = spawn @scripts_dir/noscript.sh

Please note that I had to comment out the "jump to next search item", which is binded to "n".
So either replace the noscript bind, or comment out the "n" to search.

#@cbind  n   = search

Last edited by M_ller (2011-03-05 22:43:35)

Offline

#1020 2011-03-08 13:19:12

Isola
Member
Registered: 2010-02-02
Posts: 99

Re: uzbl. A browser that adheres to the unix philosophy.

I there a way to launch a external command depending on what the URI is?

For example, if I click a irc://irc.something.org, I want it to launch my IRC-client.

I tried to launch a script everytime with the event LOAD_START and have it `grep' for different things. The script isn't launched when I click a IRC-link, instead is says "wait". If I however right click and choose "Download Linked File" it works, but I don't want it to work like that way!

Same thing with mailto: links. I haven't tried those, but I guess there isn't a difference there either.

Offline

#1021 2011-03-08 14:28:59

M_ller
Member
Registered: 2010-04-17
Posts: 80
Website

Re: uzbl. A browser that adheres to the unix philosophy.

Isola wrote:

I there a way to launch a external command depending on what the URI is?

For example, if I click a irc://irc.something.org, I want it to launch my IRC-client.

I tried to launch a script everytime with the event LOAD_START and have it `grep' for different things. The script isn't launched when I click a IRC-link, instead is says "wait". If I however right click and choose "Download Linked File" it works, but I don't want it to work like that way!

Same thing with mailto: links. I haven't tried those, but I guess there isn't a difference there either.

I think you can just edit your origscheme.py to match your IRC client. Let me mess around with it.

Another note: Does anybody know how to disable all cookies by default, and then add a few sites to a whitelist?

EDIT: I think you should add something similar to this to your scheme.py at the "if" part.

    elif u.scheme == 'irc':
        detach_open(['xterm', '-e', 'irssi', '-c', u.path])

However, it doesn't seem to do much for me at the moment. Basically what it does, is to start a terminal, then irssi with the argument -c URL.

Last edited by M_ller (2011-03-08 14:54:49)

Offline

#1022 2011-03-08 17:00:53

Isola
Member
Registered: 2010-02-02
Posts: 99

Re: uzbl. A browser that adheres to the unix philosophy.

M_ller wrote:
Isola wrote:

I there a way to launch a external command depending on what the URI is?

For example, if I click a irc://irc.something.org, I want it to launch my IRC-client.

I tried to launch a script everytime with the event LOAD_START and have it `grep' for different things. The script isn't launched when I click a IRC-link, instead is says "wait". If I however right click and choose "Download Linked File" it works, but I don't want it to work like that way!

Same thing with mailto: links. I haven't tried those, but I guess there isn't a difference there either.

I think you can just edit your origscheme.py to match your IRC client. Let me mess around with it.

Another note: Does anybody know how to disable all cookies by default, and then add a few sites to a whitelist?

EDIT: I think you should add something similar to this to your scheme.py at the "if" part.

    elif u.scheme == 'irc':
        detach_open(['xterm', '-e', 'irssi', '-c', u.path])

However, it doesn't seem to do much for me at the moment. Basically what it does, is to start a terminal, then irssi with the argument -c URL.

Oh! So that's what the scheme.py was for! I first thought it was used for sites with user/pass auth.

I'll play around with it a little. Since I don't know python I'll probably make it launch another script and sort out the channel name and such from the link.

Offline

#1023 2011-05-09 14:46:37

bruuce
Member
Registered: 2011-04-04
Posts: 30

Re: uzbl. A browser that adheres to the unix philosophy.

I can't use uzbl or don't know how to use it :
I tried all the keystroke of this documentation https://wiki.archlinux.org/index.php/UZBL-Browser
And particulary 'o' and 'O'.

None seems to have an effect.
I am using a praticular dvorak keyboard… to press the key and the key that would make the intended letter on a qwerty keyboard.
I tried uzbl-core and uzbl-browser, I tried uzbl-core -v and in a terminal and it doesn't seems to face any problem.

Any ideas? is it beaceause I am using a tilling space wm?

Offline

#1024 2011-05-09 19:34:06

tjwoosta
Member
Registered: 2008-12-18
Posts: 453

Re: uzbl. A browser that adheres to the unix philosophy.

It sounds like the python2 thing. Archlinux by default links python to python3, where most other distros still use python2 as default. Uzbl and all of its scripts are supposed to be using python2. The current pkgbuild maintainer did the python2 fix for all of the scripts, but forgot to apply it to uzbl-event-manager and uzbl-tabbed. For now you can simply edit /usr/bin/uzbl-event-manager (and uzbl-tabbed if your using it). Change the header line from  "#!/usr/bin/env python" to "#!/usr/bin/env python2".

Really though the correct thing to do is for the pkgbuild maintainer to fix it. There are bug reports filed on the arch bug tracker, but theyre low priority and havnt been addressed yet. This has been an issue for a couple of months now, and just about every day someone brings it up on #uzbl.

Last edited by tjwoosta (2011-05-09 19:41:33)

Offline

#1025 2011-05-10 07:04:10

bruuce
Member
Registered: 2011-04-04
Posts: 30

Re: uzbl. A browser that adheres to the unix philosophy.

thanks it works !

Offline

Board footer

Powered by FluxBB