From 05ae7f24a08be580638ca4cc843ac47cf4038016 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Fri, 4 Mar 2016 00:12:48 +0000 Subject: Remove uzbl --- .uzbl/bookmarks | 1 - .uzbl/config | 446 -------------------------------------- .uzbl/scripts/adblock.js | 28 --- .uzbl/scripts/adblock.py | 86 -------- .uzbl/scripts/downloadviewer.sh | 7 - .uzbl/scripts/url_from_surfraw.sh | 17 -- .uzbl/style.css | 35 --- 7 files changed, 620 deletions(-) delete mode 120000 .uzbl/bookmarks delete mode 100644 .uzbl/config delete mode 100755 .uzbl/scripts/adblock.js delete mode 100755 .uzbl/scripts/adblock.py delete mode 100755 .uzbl/scripts/downloadviewer.sh delete mode 100755 .uzbl/scripts/url_from_surfraw.sh delete mode 100644 .uzbl/style.css diff --git a/.uzbl/bookmarks b/.uzbl/bookmarks deleted file mode 120000 index 6d1a57e..0000000 --- a/.uzbl/bookmarks +++ /dev/null @@ -1 +0,0 @@ -../.personal/bookmarks \ No newline at end of file diff --git a/.uzbl/config b/.uzbl/config deleted file mode 100644 index ef3c18c..0000000 --- a/.uzbl/config +++ /dev/null @@ -1,446 +0,0 @@ -## Core settings - -# Common directory locations -set prefix = @(echo $PREFIX)@ -set data_home = @(echo $XDG_DATA_HOME)@ -set cache_home = @(echo $XDG_CACHE_HOME)@ -set config_home = @(echo $XDG_CONFIG_HOME)@ - -# Interface paths -set fifo_dir = /tmp -set socket_dir = /tmp - -# Shell command -set shell_cmd = sh -c - -## General config aliases - -# Config related events (use the request function): - -# request MODE_CONFIG = -set mode_config = request MODE_CONFIG - -# request ON_EVENT -set on_event = request ON_EVENT - -# request ON_SET -set on_set = request ON_SET - -# request MODMAP -set modmap = request MODMAP - -# request IGNORE_KEY -set ignore_key = request IGNORE_KEY - -# request TOGGLE_MODES ... -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 = /home/urbain/dotfiles/.uzbl:@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 request_handler = sync_spawn @scripts_dir/request.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 wait -# Reset the keycmd on navigation -@on_event LOAD_START @set_mode - -# Load commit handlers -@on_event LOAD_COMMIT @set_status recv - - # add some javascript to the page for other 'js' and 'script' commands to access later. -@on_event LOAD_COMMIT js uzbl = {}; -@on_event LOAD_COMMIT script @scripts_dir/formfiller.js -@on_event LOAD_COMMIT script @scripts_dir/follow.js - -# 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 - -# Load finish handlers -@on_event LOAD_FINISH @set_status done -# @on_event LOAD_FINISH spawn @scripts_dir/history.sh - -# Switch to insert mode if a (editable) html form is clicked -@on_event FOCUS_ELEMENT sh 'if [ "$1" = INPUT -o "$1" = TEXTAREA -o "$1" = SELECT ]; then echo "@set_mode insert" > $UZBL_FIFO; fi' %s -# 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(curr, min, max, size){if(max == size) return '--'; var p=(curr/(max - size)); return Math.round(10000*p)/100;})(%1,%2,%3,%4)>\@% - -## Behaviour and appearance - -# Custom CSS can be defined here, including link follower hint styles -set stylesheet_uri = file://@config_home/uzbl/style.css - -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 = [\@[\@mode_indicator]\@] -set keycmd_section = [\@[\@keycmd_prompt]\@\@modcmd\@keycmd\@completion_list] -set progress_section = \@[\@progress.output]\@ -set scroll_section = \@[\@scroll_message]\@ -set uri_section = \@[\@uri]\@ -set name_section = \@[\@NAME]\@ -set status_section = \@status_message -set selected_section = \@[\@SELECTED_URI]\@ - -set download_section = \@downloads - -set status_format = @mode_section @keycmd_section @progress_section @name_section @status_section @scroll_section @selected_section @download_section -set status_format_right = uri: @uri_section - -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 - -# Accept 'session cookies' from uzbl.org (when you have a whitelist all other cookies are dropped) -#request WHITELIST_COOKIE domain 'uzbl.org$' expires '^$' - -# Drop google analytics tracking cookies (applied after whitelists if any) -#request BLACKLIST_COOKIE name '^__utm.$' - -## SSL related configuration - -# Set it to certificates store of your distribution, or your own CAfile. -set ssl_ca_file = /etc/ssl/certs/ca-certificates.crt -set ssl_verify = 1 -# Command to toggle ssl_verify value: -@cbind !ssl = chain 'toggle ssl_verify' 'reload' -# Example SSL error handler: -@on_event LOAD_ERROR js var patt=new RegExp('SSL handshake failed'); if (patt.test('%3')) {alert ('%3');} - -## Key binding configuration -# --- Internal modmapping and ignoring --------------------------------------- - -#modmap -@modmap -@modmap -@modmap -@modmap - -#ignore_key -@ignore_key -@ignore_key -@ignore_key -@ignore_key - -# --- Bind aliases ----------------------------------------------------------- - -# request BIND = -set bind = request MODE_BIND global - -# request MODE_BIND = -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 -@on_event ESCAPE event KEYCMD_CLEAR -@on_event ESCAPE js uzbl.follow.clearHints() -@on_event ESCAPE search_clear -@on_event ESCAPE js window.getSelection().removeAllRanges() -@bind = event ESCAPE -@bind [ = event ESCAPE - -# Commands for editing and traversing the keycmd. -@ebind = event KEYCMD_EXEC_CURRENT -@ebind = event SET_CURSOR_POS 0 -@ebind = event SET_CURSOR_POS -1 -@ebind = event SET_CURSOR_POS - -@ebind = event SET_CURSOR_POS + -@ebind = event KEYCMD_BACKSPACE -@ebind = event KEYCMD_DELETE -@ebind = event START_COMPLETION -# Readline-ish bindings. -@ebind w = event KEYCMD_STRIP_WORD \ -./&?= -@ebind u = event SET_KEYCMD -@ebind a = event SET_CURSOR_POS 0 -@ebind e = event SET_CURSOR_POS -1 - -@ebind = event HISTORY_PREV -@ebind = event HISTORY_NEXT -@ebind r_ = event HISTORY_SEARCH %s -# Keycmd injection/append examples. -#@ebind su = event INJECT_KEYCMD \@uri -#@ebind st = event INJECT_KEYCMD \@title -#@ebind du = event APPEND_KEYCMD \@uri -#@ebind dt = event APPEND_KEYCMD \@title - -# --- Mouse bindings --------------------------------------------------------- - -# Middle click open in new window -@bind = 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 -@cbind t_ = sh '$XDG_CONFIG_HOME/uzbl/scripts/url_from_surfraw.sh "%s" "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 e = scroll vertical 40 -@cbind y = scroll vertical -40 -@cbind f = scroll vertical 100% -@cbind b = scroll vertical -100% -@cbind gg = scroll vertical begin -@cbind G = scroll vertical end -@cbind ^ = scroll horizontal begin -@cbind $ = scroll horizontal end -@cbind = scroll vertical end -@cbind g_ = scroll vertical %r! - -# Navigation binds -@cbind H = back -@cbind L = 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 s = toggle show_status - -# Page searching binds -@cbind /* = search %s -@cbind ?* = search_reverse %s - -# Jump to next and previous items -@cbind n = search -@cbind N = search_reverse - -# Print pages to a printer -@cbind p = hardcopy - - -# Handy binds -@cbind s__ = set %1 = %2 -@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\"" - -@cbind o_ = sh '$XDG_CONFIG_HOME/uzbl/scripts/url_from_surfraw.sh "%s" "uri"' -@cbind O_ = uri %s - -# Mode setting binds -@cbind i = @set_mode insert - -# Hard-bound bookmarks -@cbind gh = uri google.co.uk - -# SSL-ify bindings -@cbind zs = uri \@(echo "$UZBL_URI" | sed -e 's/^http:/https:/')\@ -@cbind zS = event REQ_NEW_WINDOW \@(echo "$UZBL_URI" | sed -e 's/^http:/https:/')\@ - -# 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' -@cbind ys = spawn @scripts_dir/follow.sh \@< uzbl.follow.followSelection('returnuri') >\@ clipboard - -# 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 = sh 'echo "event INJECT_KEYCMD $(xclip -o | sed s/\\\@/%40/g)" > "$UZBL_FIFO"' - -# Bookmark inserting binds -@cbind m_ = sh 'echo "$UZBL_URI $1" >> "$XDG_DATA_HOME"/uzbl/bookmarks' '%s' - -# Or use a script to insert a bookmark. -@cbind M = 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 - -# Temporary bookmarks -@cbind d = spawn @scripts_dir/insert_temp.sh -@cbind D = spawn @scripts_dir/load_url_from_temps.sh - -set follow_hint_keys = uhetonasidpgcr -@cbind f* = spawn @scripts_dir/follow.sh \@< uzbl.follow("\@follow_hint_keys", "%s", 'click') >\@ -@cbind F* = spawn @scripts_dir/follow.sh \@< uzbl.follow("\@follow_hint_keys", "%s", 'newwindow') >\@ -@cbind fL* = spawn @scripts_dir/follow.sh \@< uzbl.follow("\@follow_hint_keys", "%s", 'returnuri') >\@ set -@cbind FL* = spawn @scripts_dir/follow.sh \@< uzbl.follow("\@follow_hint_keys", "%s", 'returnuri') >\@ clipboard - -@cbind '* = spawn @scripts_dir/follow.sh \@< uzbl.follow.followTextContent("%s", 'click') >\@ - -# 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 ze = @formfiller edit -@cbind zn = @formfiller new -@cbind zl = @formfiller load -@cbind zo = @formfiller once - -## Uzbl tabbed binds - -# Tab opening -@cbind gn = event NEW_TAB -@cbind gN = event NEW_TAB_NEXT -@cbind go_ = event NEW_TAB %s -@cbind gO_ = 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_ = event GOTO_TAB %s - -# Preset loading -set preset = event PRESET_TABS -@cbind gs_ = @preset save %s -@cbind glo_ = @preset load %s -@cbind gd_ = @preset del %s -# This doesn't work right now. -#@cbind gli = @preset list - -## Context menu items - -# Default context menu -menu_add Google = set uri = http://google.co.uk -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 = "" - -@on_event DOWNLOAD_COMPLETE spawn @scripts_dir/downloadviewer.sh %s - -# vim: set fdm=syntax: diff --git a/.uzbl/scripts/adblock.js b/.uzbl/scripts/adblock.js deleted file mode 100755 index b581f9b..0000000 --- a/.uzbl/scripts/adblock.js +++ /dev/null @@ -1,28 +0,0 @@ -var blocklist = new Array(); -blocklist["IMG"] = [["src", /.*doubleclick.net.*/], - ["src", /.*last.fm\/adserver.*/]]; - -blocklist["SCRIPT"] = [["src", /.*doubleclick.net.*/]]; - -blocklist["IFRAME"] = [["name", /.*google_ads.*/], - ["id", /.*ad-google.*/]]; - - - - -function adblock(event) -{ - var tag = event.target.tagName; - if (!blocklist[tag]) - return; - for(var i = 0; i < blocklist[tag].length; i++) { - if (event.target.getAttribute(blocklist[tag][i][0])) { - if (event.target.getAttribute(blocklist[tag][i][0]).match(blocklist[tag][i][1])) { - event.preventDefault(); - return; - } - } - } -} - -document.addEventListener("beforeload", adblock, true); diff --git a/.uzbl/scripts/adblock.py b/.uzbl/scripts/adblock.py deleted file mode 100755 index aae39f4..0000000 --- a/.uzbl/scripts/adblock.py +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/python -import os -from sys import argv -from urlparse import urlparse - -# This is the original adblock.py script from http://www.uzbl.org/wiki/adblock -# Nothing was modified. This script is here just to have everything at one place. - -def xdghome(key, default): - '''Attempts to use the environ XDG_*_HOME paths if they exist otherwise - use $HOME and the default path.''' - - xdgkey = "XDG_%s_HOME" % key - if xdgkey in os.environ.keys() and os.environ[xdgkey]: - return os.environ[xdgkey] - - return os.path.join(os.environ['HOME'], default) - -# Setup xdg paths. -DATA_DIR = os.path.join(xdghome('DATA', '.local/share/'), 'uzbl/') - -# Blockfile location. -BLOCKFILE = os.path.join(DATA_DIR, 'adblock') - -JAVASCRIPT = ' '.join(filter(None, map(str.strip, ''' -var uzblAdBlock = function() { - var toblock = %s; - for(var n = 0; n < toblock.length; n++) { - var items; - while (1) { - try { - items = document.evaluate(toblock[n], document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null); - if (items == null) { break; } - var i = items.iterateNext(); - if (i == null) { break; } - i.parentNode.removeChild(i); - } catch (e) { - break; - } - } - } -}; -'''.split('\n')))) - - -def get_domain(url): - '''Return domain segment of url.''' - - if not url.startswith('http'): - url = "http://%s" % url - - loc = urlparse(url).netloc - if loc.startswith('www.'): - loc = loc[4:] - - return loc - - -def adblock(url, fifo): - fh = open(BLOCKFILE, 'r') - lines = [line.strip() for line in fh.readlines()] - fh.close() - - rules, capture = [], False - for l in lines: - if not l: # newline splits section - capture = False - - elif l[0] == '#': - continue - - elif capture: - rules.append(l) - - elif l[-1] == ':': - if get_domain(l[:-1]) == url or l[:-1] == "global": - capture = True - - rulestr = repr(rules).replace("@", "\@") - js = "js %s\n" % (JAVASCRIPT % rulestr) - fh = open(fifo, "w") - fh.write(js) - fh.close() - -if __name__ == '__main__': - adblock(get_domain(argv[6]), argv[4]) diff --git a/.uzbl/scripts/downloadviewer.sh b/.uzbl/scripts/downloadviewer.sh deleted file mode 100755 index 306460d..0000000 --- a/.uzbl/scripts/downloadviewer.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -case "$1" in -*.pdf*) zathura "$1" & ;; -*.jpg*|*.png*|*.jpeg*) feh "$1" & ;; -*.txt*|*README*|*.pl*|*.sh*|*.py*|*.hs*|*.hl*) urxvt -e vim "$1" & ;; -*.mov*|*.avi*|*.mpeg*|*.mpg*|*.flv*|*.wmv*|*.mp4*) mplayer "$1" & ;; -esac diff --git a/.uzbl/scripts/url_from_surfraw.sh b/.uzbl/scripts/url_from_surfraw.sh deleted file mode 100755 index bf3c501..0000000 --- a/.uzbl/scripts/url_from_surfraw.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -DEFAULT_SEARCH=startpage -string=$1 -cmd=$2 -set -- $string -is_elvi=$(surfraw -elvi | grep -c "^$1\s") -nbr_words=$(echo "$string" | wc -w) -if [ "$nbr_words" -eq 1 ] && [ "$is_elvi" -eq 0 ] && ([[ "$string" == *.* ]] || [[ "$string" == *:* ]]) -then - url="$1" -elif [ $is_elvi -eq 1 ] -then - url="$(surfraw -print $string)" -else - url="$(surfraw -print $DEFAULT_SEARCH $string)" -fi -echo "$cmd $url" > $UZBL_FIFO diff --git a/.uzbl/style.css b/.uzbl/style.css deleted file mode 100644 index 1080ce4..0000000 --- a/.uzbl/style.css +++ /dev/null @@ -1,35 +0,0 @@ -#uzbl_link_hints > span { - z-index: 1000 !important; - - background-color: #FFFF00 !important; - margin: 0 !important; - padding: 3px !important; - - color: #000 !important; - font-size: 12px !important; - line-height: 12px !important; - font-weight: bold !important; - font-variant: normal !important; - text-decoration: none !important; - text-transform: uppercase; - - -webkit-transform: translate(-3px,-1px); - opacity: 1.0; - -webkit-border-radius: 6px !important; - /* Play around with this, pretty fun things to do :) */ - /* -webkit-transform: scale(1) rotate(90deg) translate(-6px,-5px) !important; */ -} - -/* we can have different colours for different types of hints! */ -#uzbl_link_hints.new-window > span { - background-color: #ffff00 !important; - color: black !important; -} - -.uzbl-follow-text-match { - outline: 2px solid invert; - background: #333 !important; - color: white !important; -} - -/* vim:set et ts=4: */ -- cgit v1.2.3