Browse Source

fixed fullscreen flash in xmonad :O

master
James Wheaton 10 years ago
parent
commit
d3d0a69f2d
12 changed files with 452 additions and 6943 deletions
  1. 44
    3
      .Xdefaults
  2. 4
    15
      .bashrc
  3. 0
    89
      .config/Terminal/terminalrc
  4. 386
    112
      .config/uzbl/config
  5. 0
    6501
      .local/share/uzbl/adblock
  6. 0
    84
      .local/share/uzbl/adblock.py
  7. 0
    134
      .local/share/uzbl/dl-progress.sh
  8. 1
    1
      .local/share/uzbl/readability.js
  9. 3
    0
      .vimrc
  10. 10
    1
      .xmonad/xmonad.hs
  11. 3
    2
      .zshrc
  12. 1
    1
      bin/dvd2avi

+ 44
- 3
.Xdefaults View File

@@ -1,14 +1,55 @@
URxvt*termName: rxvt-unicode
URxvt.buffered: true
URxvt.visualBell: true
URxvt.background: black
URxvt.foreground: white
URxvt.cursorColor: gray
URxvt.underlineColor: gray
URxvt*keysym.Del: \033[3~
URxvt*keysym.Home: \033[1~
URxvt*keysym.End: \033[4~
URxvt*keysym.Del: \033[3~
URxvt*keysym.Prior: \033[5~
URxvt*keysym.Next: \033[6~
URxvt.font:xft:Bitstream Vera Sans Mono:pixelsize=12:antialias=true
URxvt.perl-ext-common: default,matcher
URxvt.urlLauncher: /usr/bin/uzbl-browser
URxvt.matcher.button: 1

urxvt*foreground: #f2f2f2
urxvt*background: #101010

! Normal
! color0    black
! color1    red
! color2    green
! color3    yellow
! color4    blue
! color5    purple
! color6    cyan
! color7    white

urxvt*color0: #6c6c6c
urxvt*color1: #e9897c
urxvt*color2: #b6e77d
urxvt*color3: #ecebbe
urxvt*color4: #a9cdeb
urxvt*color5: #ea96eb
urxvt*color6: #c9caec
urxvt*color7: #f2f2f2

! Light
! color8 black
! color9 red
! color10 green
! color11 yellow
! color12 blue
! color13 purple
! color14 cyan
! color15 white

urxvt*color8: #747474
urxvt*color9: #f99286
urxvt*color10: #c3f786
urxvt*color11: #fcfbcc
urxvt*color12: #b6defb
urxvt*color13: #fba1fb
urxvt*color14: #d7d9fc
urxvt*color15: #e2e2e2

+ 4
- 15
.bashrc View File

@@ -1,17 +1,6 @@
#!/bin/sh

alias ls='ls --color=always'
alias ll='ls -l'
alias la='ls -a'
alias vi='vim'
# Check for an interactive session
[ -z "$PS1" ] && return

case $TERM in
xterm*|rxvt*)
TITLEBAR='\[\033]0;\u@\h:\w\007\]'
;;
*)
TITLEBAR=""
;;
esac

PS1="[\W]\$ "
alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '

+ 0
- 89
.config/Terminal/terminalrc View File

@@ -1,89 +0,0 @@
[Configuration]
AccelNewTab=<control><shift>t
AccelNewWindow=<control><shift>n
AccelDetachTab=<control><shift>d
AccelCloseTab=<control><shift>w
AccelCloseWindow=<control><shift>q
AccelCopy=<control><shift>c
AccelPaste=<control><shift>v
AccelPreferences=Disabled
AccelShowMenubar=Disabled
AccelShowToolbars=Disabled
AccelShowBorders=Disabled
AccelFullscreen=F11
AccelSetTitle=Disabled
AccelReset=Disabled
AccelResetAndClear=Disabled
AccelPrevTab=<control>Page_Up
AccelNextTab=<control>Page_Down
AccelSwitchToTab1=<Alt>1
AccelSwitchToTab2=<Alt>2
AccelSwitchToTab3=<Alt>3
AccelSwitchToTab4=<Alt>4
AccelSwitchToTab5=<Alt>5
AccelSwitchToTab6=<Alt>6
AccelSwitchToTab7=<Alt>7
AccelSwitchToTab8=<Alt>8
AccelSwitchToTab9=<Alt>9
AccelContents=F1
BackgroundMode=TERMINAL_BACKGROUND_SOLID
BackgroundImageFile=
BackgroundImageStyle=TERMINAL_BACKGROUND_STYLE_TILED
BackgroundDarkness=0.500000
BindingBackspace=TERMINAL_ERASE_BINDING_AUTO
BindingDelete=TERMINAL_ERASE_BINDING_AUTO
ColorForeground=#e3e3e3e3e3e3
ColorBackground=#000000000000
ColorPalette1=#808080808080
ColorPalette2=#e6e685857b7b
ColorPalette3=#b6b6eaea7c7c
ColorPalette4=#ebebebebbdbd
ColorPalette5=#a9a9cbcbeaea
ColorPalette6=#e8e88e8eeaea
ColorPalette7=#c8c8c8c8ebeb
ColorPalette8=#e1e1e1e1e1e1
ColorPalette9=#9ad69ad69ad6
ColorPalette10=#f7f78e8e8585
ColorPalette11=#c3c3fafa8686
ColorPalette12=#fcfcfcfccbcb
ColorPalette13=#b5b5dadafbfb
ColorPalette14=#f8f89898fbfb
ColorPalette15=#d6d6d6d6fcfc
ColorPalette16=#f2f2f2f2f2f2
CommandUpdateRecords=TRUE
CommandLoginShell=FALSE
FontAllowBold=TRUE
FontAntiAlias=TRUE
FontName=Monospace 10
MiscAlwaysShowTabs=FALSE
MiscBell=FALSE
MiscBordersDefault=TRUE
MiscCursorBlinks=FALSE
MiscDefaultGeometry=80x24
MiscInheritGeometry=FALSE
MiscMenubarDefault=TRUE
MiscMouseAutohide=FALSE
MiscToolbarsDefault=FALSE
MiscConfirmClose=TRUE
MiscCycleTabs=TRUE
MiscTabCloseButtons=TRUE
MiscTabPosition=GTK_POS_TOP
MiscHighlightUrls=TRUE
ScrollingBar=TERMINAL_SCROLLBAR_RIGHT
ScrollingLines=1000
ScrollingOnOutput=TRUE
ScrollingOnKeystroke=TRUE
ScrollingSingleLine=TRUE
ShortcutsNoMenukey=FALSE
ShortcutsNoMnemonics=FALSE
TitleInitial=Terminal
TitleMode=TERMINAL_TITLE_APPEND
Term=xterm
VteWorkaroundTitleBug=TRUE
WordChars=-A-Za-z0-9,./?%&#:_~
TabActivityColor=#afff00000000
TabActivityTimeout=2.000000
ColorCursor=#e3e3e3e3e3e3
ColorSelection=White
ColorSelectionUseDefault=TRUE


+ 386
- 112
.config/uzbl/config View File

@@ -1,123 +1,397 @@
# Example uzbl config. All settings are optional. You can use uzbl without
# any config at all (but it won't do much).

# example uzbl config. in a real config, we should obey the xdg spec
# all settings are optional. you can use uzbl without any config at all (but it won't do much)
# === Core settings ==========================================================

# keyboard behavior is vimstyle by default (all commands -> 1 key). set
# always_insert_mode to always be in insert mode and disable going out of it.
# if you do this, make sure you've set a modkey so you can reach the commands
# from insert mode by combining them with the modkey
# Install location prefix.
set prefix = /usr

# TODO: ability to attach misc things (spawn <foo>, script <bar>,.. to internal events)
# You can use any command in place of spawn
set history_handler = spawn /usr/share/uzbl/examples/scripts/history.sh
set download_handler = spawn /usr/share/uzbl/examples/scripts/download.sh
set cookie_handler = spawn /usr/share/uzbl/examples/scripts/cookies.sh
# 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 = $XDG_DATA_HOME/uzbl:@prefix/share/uzbl/examples/data:scripts
set stylesheet_uri = file://$XDG_DATA_HOME/uzbl/lich.css

# === 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 cookie_handler = talk_to_socket $XDG_CACHE_HOME/uzbl/cookie_daemon_socket
set scheme_handler = sync_spawn @scripts_dir/scheme.py
set authentication_handler = sync_spawn @scripts_dir/auth.py
set proxy_url = http://localhost:8118

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

# Open link in new window
@on_event NEW_WINDOW sh 'uzbl-browser -u "$8"' %r
# Open in current window
#@on_event NEW_WINDOW uri %s
# Open in new tab
#@on_event NEW_WINDOW event NEW_TAB %s

set minimum_font_size = 6
set font_size = 11
# monospace_size defaults to font_size, but you can alter it independently
#set monospace_size = 10
# Download handler
@on_event DOWNLOAD_REQUEST spawn @scripts_dir/dl-progress.sh %s

# use with bind ... = sh <shell-oneliner>
set shell_cmd = sh -c
# 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>
#@on_event LOAD_COMMIT spawn @scripts_dir/adblock.py

#@on_event LOAD_PROGRESS js uzblAdBlock();

# Load finish handlers
@on_event LOAD_FINISH @set_status <span foreground="gold">done</span>
@on_event LOAD_FINISH spawn @scripts_dir/history.sh
# @on_event LOAD_FINISH chain 'set status_message = ...' 'spawn @scripts_dir/ytvp.sh $4 $6'

# 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

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

# Behaviour and appearance
set show_status = 1
# you can optionally use this setting to override the background color of the statusbar from your GTK theme.
set status_top = 0
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">MSG</span><span foreground="#606060">SELECTED_URI</span></span>
set status_top = 0
# define how your titlebar should look like. (short = statusbar is also shown, long = show everything you must see if statusbar is off)
set title_format_short = TITLE - Uzbl browser <NAME>
set title_format_long = KEYCMD MODE TITLE - Uzbl browser <NAME> > SELECTED_URI
# set the characters to use for, and the width of the progress bar
set status_pbar_done = *
set status_pbar_pending = -
set status_pbar_width = 12

set modkey = Mod1
# reset to command mode when new page is loaded
set reset_command_mode = 1
# this var has precedence over reset_command_mode
set always_insert_mode = 0
# to start a local socks server, do : ssh -fND localhost:8118 localhost
#set proxy_url = http://127.0.0.1:8118
#values 0-3
#set http_debug = 0
#set useragent = uzbl (Webkit WEBKIT_MAJOR.WEBKIT_MINOR.WEBKIT_MICRO)
# Example user agent containing everything:
set useragent = Uzbl (Webkit WEBKIT_MAJOR.WEBKIT_MINOR.WEBKIT_MICRO) (SYSNAME NODENAME KERNREL KERNVER ARCH_SYSTEM [ARCH_UZBL]) (Commit COMMIT)
#set max_conns = 0
#set max_conns_host = 0

set fifo_dir = /tmp
set socket_dir = /tmp

# Key bindings
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 0 = sh "echo set zoom_level = 1.0 > $4"
bind t = toggle_status
# Hilight matches. Notice the * after the slash - it makes the command incremental, i.e. gets called
# on every character you type. You can do `bind /_ = search %s' if you want it less interactive.
bind /* = search %s
bind ?* = search_reverse %s
#jump to next
bind n = search
bind N = search_reverse
bind gh = uri http://www.uzbl.org
#TODO: set uri?
bind o _ = uri %s
bind :wiki _ = uri http://wiki.archlinux.org/index.php/Special:Search?search=%s&go=Go
bind gg _ = uri http://www.google.com/search?q=%s
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
bind B = spawn /usr/share/uzbl/examples/scripts/insert_bookmark.sh
bind U = spawn /usr/share/uzbl/examples/scripts/load_url_from_history.sh
bind u = spawn /usr/share/uzbl/examples/scripts/load_url_from_bookmarks.sh
# with the sample yank script, you can yank one of the arguments into clipboard/selection
bind yurl = spawn /usr/share/uzbl/examples/scripts/yank.sh 6 primary
bind ytitle = spawn /usr/share/uzbl/examples/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"
bind ZZ = exit
bind S = 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
# Parameters are separated by spaces and the script body must be one parameter, so enclose it in
# quotes and escape any inner quotes using backslashes
bind XS = sh 'echo "js alert (\'This is sent by the shell via a fifo\')" > "$4"'


# 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 /usr/share/uzbl/examples/scripts/hint.js
# the most stable version:
bind fl* = script /usr/share/uzbl/examples/scripts/follow_Numbers.js %s
# using strings, not polished yet:
bind fL* = script /usr/share/uzbl/examples/scripts/follow_Numbers_Strings.js %s


# "home" page if you will
set uri = uzbl.org
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 status_format = <span font_family="monospace">@mode_section @keycmd_section @progress_section @uri_section @name_section @status_section @scroll_section @selected_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}.@{WEBKIT_MICRO}) (@(+uname -sm)@ [@ARCH_UZBL]) (Commit @COMMIT)

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

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

#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>

# --- 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 [ "\@SELECTED_URI" ]; then uzbl-browser -u "\@SELECTED_URI"; else echo "uri $(xclip -o | sed s/\\\@/%40/g)" > $4; fi'

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

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

# Page movement binds
@cbind j = scroll vertical 40
@cbind J = scroll vertical 25%
@cbind k = scroll vertical -40
@cbind K = scroll vertical -25%
@cbind h = scroll horizontal -40
@cbind l = scroll horizontal 40
@cbind <Page_Up> = scroll vertical -100%
@cbind <Page_Down> = scroll vertical 100%
@cbind << = scroll vertical begin
@cbind >> = 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 = 1.5

# 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 \\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

# Handy binds
# Set function shortcut
@cbind s<var:>_<value:>_ = set %1 = %2
# Open new uzbl-browser window with blank page
@cbind ZN = sh "uzbl-browser -u ''"
# Exit binding
# Toggle view source - must refresh
# @cbind a = set view_source = 1
# @cbind A = set view_source = 0

@cbind ZZ = exit
# Dump config to stdout
@cbind !dump = sh "echo dump_config > $4"
# Reload config
@cbind !reload = sh "cat $1 > $4"

# 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:$5 -"'
#@cbind <Ctrl><Alt>t = sh 'urxvt -e socat unix-connect:$5 -'

# 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
@cbind gd = uri delicious.com/uranther
@cbind gr = uri reddit.com
@cbind gm = uri gmail.com
@cbind ga = uri archlinux.org

# Bookmarklets
@cbind x = script $XDG_DATA_HOME/uzbl/readability.js
#@cbind db = script $XDG_DATA_HOME/uzbl/delicious_bookmark.js
# Delicious bookmark
@cbind q = script $XDG_DATA_HOME/uzbl/jquery.js

# Hide elements after jquery has been loaded
@cbind C<hide element:>_ = js $('%s').hide()

# Yanking & pasting binds
@cbind yu = sh 'echo -n $6 | xclip'
@cbind yy = sh 'echo -n $7 | xclip'

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

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

# 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* = script @scripts_dir/follow.js '@follow_hint_keys %s'

# 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
@cbind gY = sh 'echo "event NEW_TAB `xclip -selection primary -o | sed s/\\\@/%40/g`" > $4'

# 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 Google = set uri = http://google.com
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_events = 1
@stack modcmd_updates = 1
@stack forward_keys = 0
@stack keycmd_style = foreground="red"
@stack prompt_style = foreground="#888" weight="light"
@stack status_background = #202020
@stack mode_indicator = Bnd

set default_mode = command

# === Post-load misc commands ================================================

# Set the "home" page.
# set uri = www.google.com/

# vim: set fdm=syntax:

+ 0
- 6501
.local/share/uzbl/adblock
File diff suppressed because it is too large
View File


+ 0
- 84
.local/share/uzbl/adblock.py View File

@@ -1,84 +0,0 @@
#! /usr/bin/env python

import os
from sys import argv
from urlparse import urlparse

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])

+ 0
- 134
.local/share/uzbl/dl-progress.sh View File

@@ -1,134 +0,0 @@
#!/bin/bash
#
# the original dget.sh script:
# (c) 2007 by Robert Manea
#
# bashtardized and heavily modded for uzbl:
# 2009 by pbrisbin
#
# requires:
# dzen2
# gdbar
# wget
# xwininfo
# wmctrl (for now)
#
###

# dzen
# xft font available with dzen2-svn from aur
#FONT='-xos4-terminus-*-*-*-*-12-*-*-*-*-*-*-*'
FONT='-*-bitstream vera sans mono-*-r-*-*-12-*-*-*-*-*-*-*'
FG='#606060'
BG='#303030'

# gdbar
bar_FG='#909090'
bar_BG='#606060'
bar_H=7
bar_W=150

# the place to download to
DIR="$HOME"

# refresh rate on the progress bar
SECS=1

# this allows for some simple WM-specific adjustments
pad_Y=38
pad_X=2

# these are passed in from uzbl
PID="$2"
XID="$3"
URL="$8"

# auto open the file post-download based on the
# file's extension
# TODO: please people, add your own here and report them on
# the uzbl wiki page. these are the ones i use, i'd love
# to have a more complete list
open() {
case "$1" in
*.pdf) epdfview "$1" & ;;
*.jpg|*.png|*.jpeg) mirage "$1" & ;;
*.txt|*README*|*.pl|*.sh|*.py|*.hs) urxvtc -e vim "$1" & ;;
*.mov|*.avi|*.mpeg|*.mpg|*.flv|*.wmv|*.mp4) mplayer "$1" & ;;
esac
}

# this function returns XY geometry for the spawning uzbl
find_uzbl() {
# x-winid is in the documentation but coming over blank for me
# if it's blank, wmctrl provides a workaround
[ "$XID" = "" ] && XID="$(wmctrl -lp | awk "/$PID/"'{print $1}')"

# someone better with awk could probably parse this all at once
uzbl_X=$(xwininfo -id "$XID" | awk '/Corners/ {print $2}' | cut -d '+' -f 2)
uzbl_Y=$(xwininfo -id "$XID" | awk '/Corners/ {print $2}' | cut -d '+' -f 3)
uzbl_W=$(xwininfo -id "$XID" | awk '/Width/ {print $2}')
uzbl_H=$(xwininfo -id "$XID" | awk '/Height/ {print $2}')

# some math here to place the first progress bar just above
# the uzbl status bar
H=16
W=$uzbl_W
X=$((uzbl_X+pad_X))
Y=$((uzbl_Y+uzbl_H-pad_Y))
}

# file to dump wget progress into and read from
# it needs to be specific to this DL instance
STAT="/tmp/dl_progress.$$"

# this file holds the HW and XY to use for the next
# download instance and must span across each download
LOC="/tmp/dl_location"

# if no other wgets are running, we clear the stored
# location. this is the best way i can determine if
# this is a new 'downloading session' and we need to
# start over at the bottom of the stack
ps -A | grep -q wget || rm -f $LOC

# and if the location file still exists we source it
# to know where to place the next status bar, else
# we find uzbl
[ -f $LOC ] && . $LOC || find_uzbl

# set up the location of the next display
new_Y=$((Y-H))
echo -e "H=$H\nW=$W\nX=$X\nY=$new_Y\n" > $LOC

# get filename from the url and convert some hex codes
# i hate spaces in filenames so i'm switching them
# with underscores here, adjust the first s///g if
# you want to keep the spaces
FILE="$(basename $URL | sed -r \
's/[_%]20/\_/g;s/[_%]22/\"/g;s/[_%]23/\#/g;s/[_%]24/\$/g;
s/[_%]25/\%/g;s/[_%]26/\&/g;s/[_%]28/\(/g;s/[_%]29/\)/g;
s/[_%]2C/\,/g;s/[_%]2D/\-/g;s/[_%]2E/\./g;s/[_%]2F/\//g;
s/[_%]3C/\</g;s/[_%]3D/\=/g;s/[_%]3E/\>/g;s/[_%]3F/\?/g;
s/[_%]40/\@/g;s/[_%]5B/\[/g;s/[_%]5C/\\/g;s/[_%]5D/\]/g;
s/[_%]5E/\^/g;s/[_%]5F/\_/g;s/[_%]60/\`/g;s/[_%]7B/\{/g;
s/[_%]7C/\|/g;s/[_%]7D/\}/g;s/[_%]7E/\~/g;s/[_%]2B/\+/g')"

# download
wget -O "$DIR/$FILE" --user-agent=Firefox "$URL" > $STAT 2>&1 &
pid=$!

# show the dzen notification
(while ps -A | grep -q $pid; do
REM="$(awk '/s$/ {print $NF}' $STAT | tail -n1)"
PROG=$(grep -Eo " [0-9]{1,3}%" $STAT | tail -n1 | sed 's/%$//g')
echo -n " Downloading ${FILE:0:22}... (${REM:-unknown}) "
echo "${PROG:-0} 100" | gdbar -h $bar_H -w $bar_W -fg $bar_FG -bg $bar_BG
sleep "$SECS"
done; echo " Download saved to $DIR/$FILE"; sleep 3) | dzen2 -ta l -w $W -h $H -x $X -y $Y -fg $FG -bg $BG -fn "$FONT" -e "onstart=stick;button3=exec:kill $pid,rm -f $STAT,exit:1"

# finally, auto-open the downloaded file
[ $? -eq 0 ] && open "$DIR/$FILE"

rm -f "$STAT"

exit 0

+ 1
- 1
.local/share/uzbl/readability.js View File

@@ -1 +1 @@
(function(){readConvertLinksToFootnotes=false;readStyle='style-apertura';readSize='size-x-large';readMargin='margin-narrow';_readability_script=document.createElement('script');_readability_script.type='text/javascript';_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random());document.documentElement.appendChild(_readability_script);_readability_css=document.createElement('link');_readability_css.rel='stylesheet';_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';_readability_css.type='text/css';_readability_css.media='all';document.documentElement.appendChild(_readability_css);_readability_print_css=document.createElement('link');_readability_print_css.rel='stylesheet';_readability_print_css.href='http://lab.arc90.com/experiments/readability/css/readability-print.css';_readability_print_css.media='print';_readability_print_css.type='text/css';document.getElementsByTagName('head')[0].appendChild(_readability_print_css);})();
(function(){readConvertLinksToFootnotes=false;readStyle='style-apertura';readSize='size-large';readMargin='margin-narrow';_readability_script=document.createElement('script');_readability_script.type='text/javascript';_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random());document.documentElement.appendChild(_readability_script);_readability_css=document.createElement('link');_readability_css.rel='stylesheet';_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';_readability_css.type='text/css';_readability_css.media='all';document.documentElement.appendChild(_readability_css);_readability_print_css=document.createElement('link');_readability_print_css.rel='stylesheet';_readability_print_css.href='http://lab.arc90.com/experiments/readability/css/readability-print.css';_readability_print_css.media='print';_readability_print_css.type='text/css';document.getElementsByTagName('head')[0].appendChild(_readability_print_css);})();

+ 3
- 0
.vimrc View File

@@ -4,6 +4,9 @@ set softtabstop=4
set shiftwidth=4
set expandtab
set cindent
au BufEnter *.hs compiler ghc
filetype plugin on
let g:haddock_browser = "/usr/bin/uzbl-browser"
syntax enable
autocmd BufEnter ?akefile* set noet ts=8 sw=8 nocindent list lcs=tab:>-,trail:x
colorscheme ir_black

+ 10
- 1
.xmonad/xmonad.hs View File

@@ -1,4 +1,6 @@
import XMonad
import XMonad.ManageHook
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
@@ -11,9 +13,16 @@ main = do
{ terminal = "urxvt"
, modMask = mod4Mask
, borderWidth = 2
, focusedBorderColor = "#5D0085"
, layoutHook = avoidStruts $ layoutHook defaultConfig
, logHook = dynamicLogWithPP $ xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 50
}
}
, manageHook = manageDocks <+> composeAll
[ className =? "MPlayer" --> doFloat
, className =? "Gimp" --> doFloat
, isFullscreen --> doFullFloat ]
} `additionalKeys`
[ (( mod4Mask, xK_u), spawn "uzbl-browser")
]

+ 3
- 2
.zshrc View File

@@ -1,4 +1,5 @@
alias vi='vim'
export EDITOR="vim"

fortune ~/fortune-mod-buddhism/buddhism
echo ""
@@ -12,7 +13,7 @@ export ZSH=$HOME/.oh-my-zsh

# Set to the name theme to load.
# Look in ~/.oh-my-zsh/themes/
export ZSH_THEME="geoffgarside"
export ZSH_THEME="uranther"

# Set to this to use case-sensitive completion
# export CASE_SENSITIVE="true"
@@ -25,7 +26,7 @@ export ZSH_THEME="geoffgarside"

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git)
plugins=()

source $ZSH/oh-my-zsh.sh


+ 1
- 1
bin/dvd2avi View File

@@ -22,7 +22,7 @@ fi

if [[ $Q = h ]]; then
# If h passed, use high quality
mencoder dvd://$TITLE -slang en -oac mp3lame -lameopts br=320:cbr -ovc lavc -lavcopts vcodec=mpeg4:vhq -vf scale -zoom -xy 800 -o $FILE.avi
mencoder dvd://$TITLE -alang en -oac mp3lame -lameopts br=320:cbr -ovc lavc -lavcopts vcodec=mpeg4:vhq -vf scale -zoom -xy 800 -o $FILE.avi
exit $?
fi


Loading…
Cancel
Save