Qutebrowser: Init

master
Pierre Neidhardt 2015-10-19 15:15:12 +02:00
parent baab2d5377
commit a4b35b32bc
16 changed files with 2036 additions and 109 deletions

View File

@ -1,11 +1,5 @@
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! Xresources
!! 2013-08-04
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!------------------------------------------------------------------------------
!! URxvt
!! ------------------------------------------------------------------------------
!!==============================================================================
!! URxvt.
!! url-select, clipboard and keyboard-select are provided in Muennich perl
!! plugins.
@ -17,10 +11,9 @@ URxvt.iso14755: False
URxvt*saveLines: 5000
URxvt*scrollBar: false
!! URL Support
!! URL Support.
URxvt.perl-ext: url-select
URxvt.keysym.C-M-u: perl:url-select:select_next
URxvt.url-select.launcher: dwb
URxvt.url-select.underline: true
URxvt.perl-ext-common: keyboard-select,clipboard
@ -32,9 +25,9 @@ URxvt.clipboard.autocopy: true
URxvt.clipboard.pastecmd: xclip -o -selection primary -quiet
URxvt.clipboard.copycmd: xclip -i -selection primary
!!==============================================================================
!! Font
!!==============================================================================
!!------------------------------------------------------------------------------
!! Fonts.
!! WARNING: some Xft fonts (DejaVu, Liberation) seem to be messy with w3m image preview.
! URxvt*font: xft:Liberation Mono:pixelsize=14
! URxvt*font: xft:Dejavu Sans Mono:pixelsize=14
@ -59,9 +52,9 @@ Xft.rgba: rgb
!! If not patched for letter spacing, this option might help.
! URxvt*letterSpace: -1
!!==============================================================================
!! Styles
!!==============================================================================
!!------------------------------------------------------------------------------
!! Styles.
!! Find more styles on:
!! http://xcolors.net/
!! http://xcolors.net/dl/derp
@ -91,9 +84,7 @@ URxvt.color15 : white
!!==============================================================================
!! Xterm
!!==============================================================================
*VT100*translations: #override Meta <Btn1Up>: exec-formatted("dwb '%t'", PRIMARY)
! XTerm*charClass: 33:48,36-47:48,58-59:48,61:48,63-64:48,95:48,126:48
! xterm.font: xft:Dina:pixelsize=18
! xterm*font : -*-dejavu sans-medium-r-*-*-14-*-*-*-*-*-*-*

View File

@ -32,7 +32,7 @@ if ostype == "Linux" then
end
-- Custom variables.
local termcmd = os.getenv("TERMCMD") or "urxvt"
local termcmd = os.getenv("TERMCMD")
local term = termcmd .. " -e "
local home = os.getenv("HOME")
@ -281,8 +281,8 @@ globalkeys = awful.util.table.join(
awful.key({ }, "XF86Mail", function () awful.util.spawn(term .. "sh -c 'cd ~/temp && mutt'") end),
-- Web browser
awful.key({ modkey, }, "w", function () awful.util.spawn_with_shell("dwb 2>>/tmp/dwb" .. uid .. ".log") end),
awful.key({ }, "XF86WWW", function () awful.util.spawn_with_shell("dwb 2>>/tmp/dwb" .. uid .. ".log") end),
awful.key({ modkey, }, "w", function () awful.util.spawn(os.getenv("BROWSER")) end),
awful.key({ }, "XF86WWW", function () awful.util.spawn(os.getenv("BROWSER")) end),
-- Music player
awful.key({ modkey, }, "a", function () awful.util.spawn(term .. "cmus") end),

View File

@ -0,0 +1,631 @@
# vim: ft=conf
#
# In this config file, qutebrowser's key bindings are configured.
# The format looks like this:
#
# [keymode]
#
# command
# keychain
# keychain2
# ...
#
# All blank lines and lines starting with '#' are ignored.
# Inline-comments are not permitted.
#
# keymode is a comma separated list of modes in which the key binding should be
# active. If keymode starts with !, the key binding is active in all modes
# except the listed modes.
#
# For special keys (can't be part of a keychain), enclose them in `<`...`>`.
# For modifiers, you can use either `-` or `+` as delimiters, and these names:
#
# * Control: `Control`, `Ctrl`
# * Meta: `Meta`, `Windows`, `Mod4`
# * Alt: `Alt`, `Mod1`
# * Shift: `Shift`
#
# For simple keys (no `<>`-signs), a capital letter means the key is pressed
# with Shift. For special keys (with `<>`-signs), you need to explicitly add
# `Shift-` to match a key pressed with shift. You can bind multiple commands
# by separating them with `;;`.
[!normal]
clear-keychain ;; leave-mode
<Escape>
<Ctrl-[>
[normal]
# Keybindings for normal mode.
clear-keychain ;; search
<Escape>
set-cmd-text -s :open
o
set-cmd-text :open {url}
go
set-cmd-text -s :open -t
O
set-cmd-text :open -t {url}
gO
set-cmd-text -s :open -b
xo
set-cmd-text :open -b {url}
xO
set-cmd-text -s :open -w
wo
set-cmd-text :open -w {url}
wO
open -t
ga
<Ctrl-T>
tab-close
d
<Ctrl-W>
tab-close -o
D
tab-only
co
tab-focus
J
gt
tab-move
gm
tab-move -
gl
<
tab-move +
gr
>
tab-prev
K
gT
tab-clone
gC
reload
r
reload -f
R
back
H
back -t
th
back -w
wh
forward
L
forward -t
tl
forward -w
wl
fullscreen
<F11>
hint
f
hint all tab
F
hint all window
wf
hint all tab-bg
;b
hint all tab-fg
;f
hint all hover
;h
hint images
;i
hint images tab
;I
hint images tab-bg
.i
hint links fill ":open {hint-url}"
;o
hint links fill ":open -t {hint-url}"
;O
hint links fill ":open -b {hint-url}"
.o
hint links yank
;y
hint links yank-primary
;Y
hint --rapid links tab-bg
;r
hint --rapid links window
;R
hint links download
;d
scroll left
h
scroll down
j
scroll up
k
scroll right
l
undo
u
<Ctrl-Shift-T>
scroll-perc 0
gg
scroll-perc
G
search-next
n
search-prev
N
enter-mode insert
i
enter-mode caret
v
yank
yY
yank -s
yy
yank -t
yT
yank -ts
yt
yank -d
yD
yank -ds
yd
paste
pP
paste -s
pp
paste -t
PP
paste -ts
Pp
paste -w
wP
paste -ws
wp
quickmark-save
m
set-cmd-text -s :quickmark-load
b
set-cmd-text -s :quickmark-load -t
B
set-cmd-text -s :quickmark-load -w
wb
bookmark-add
M
set-cmd-text -s :bookmark-load
gb
set-cmd-text -s :bookmark-load -t
gB
set-cmd-text -s :bookmark-load -w
wB
save
sf
set-cmd-text -s :set
ss
set-cmd-text -s :set -t
sl
set-cmd-text -s :set keybind
sk
zoom-out
-
zoom-in
+
zoom
=
navigate prev
[[
navigate next
]]
navigate prev -t
{{
navigate next -t
}}
navigate up
gu
navigate up -t
gU
navigate increment
<Ctrl-A>
navigate decrement
<Ctrl-X>
inspector
wi
download
gd
download-cancel
ad
download-remove --all
cd
view-source
gf
tab-focus last
<Ctrl-Tab>
enter-mode passthrough
<Ctrl-V>
quit
<Ctrl-Q>
scroll-page 0 1
<Ctrl-F>
scroll-page 0 -1
<Ctrl-B>
scroll-page 0 0.5
<Ctrl-D>
scroll-page 0 -0.5
<Ctrl-U>
tab-focus 1
<Alt-1>
tab-focus 2
<Alt-2>
tab-focus 3
<Alt-3>
tab-focus 4
<Alt-4>
tab-focus 5
<Alt-5>
tab-focus 6
<Alt-6>
tab-focus 7
<Alt-7>
tab-focus 8
<Alt-8>
tab-focus 9
<Alt-9>
home
<Ctrl-h>
stop
<Ctrl-s>
print
<Ctrl-Alt-p>
open qute:settings
Ss
follow-selected
<Return>
<Ctrl-M>
<Ctrl-J>
<Shift-Return>
<Enter>
<Shift-Enter>
follow-selected -t
<Ctrl-Return>
<Ctrl-Enter>
spawn mpv {url}
x
hint links spawn mpv {hint-url}
;x
[insert]
# Keybindings for insert mode.
# Since normal keypresses are passed through, only special keys are
# supported in this mode.
# Useful hidden commands to map in this section:
# * `open-editor`: Open a texteditor with the focused field.
open-editor
<Ctrl-E>
[hint]
# Keybindings for hint mode.
# Since normal keypresses are passed through, only special keys are
# supported in this mode.
# Useful hidden commands to map in this section:
# * `follow-hint`: Follow the currently selected hint.
follow-hint
<Return>
<Ctrl-M>
<Ctrl-J>
<Shift-Return>
<Enter>
<Shift-Enter>
hint --rapid links tab-bg
<Ctrl-R>
hint links
<Ctrl-F>
hint all tab-bg
<Ctrl-B>
[command]
# Keybindings for command mode.
# Since normal keypresses are passed through, only special keys are
# supported in this mode.
# Useful hidden commands to map in this section:
# * `command-history-prev`: Switch to previous command in history.
# * `command-history-next`: Switch to next command in history.
# * `completion-item-prev`: Select previous item in completion.
# * `completion-item-next`: Select next item in completion.
# * `command-accept`: Execute the command currently in the commandline.
command-history-prev
<Ctrl-P>
command-history-next
<Ctrl-N>
completion-item-prev
<Shift-Tab>
<Up>
completion-item-next
<Tab>
<Down>
completion-item-del
<Ctrl-D>
command-accept
<Return>
<Ctrl-M>
<Ctrl-J>
<Shift-Return>
<Enter>
<Shift-Enter>
[prompt]
# Keybindings for prompts in the status line.
# You can bind normal keys in this mode, but they will be only active
# when a yes/no-prompt is asked. For other prompt modes, you can only
# bind special keys.
# Useful hidden commands to map in this section:
# * `prompt-accept`: Confirm the entered value.
# * `prompt-yes`: Answer yes to a yes/no question.
# * `prompt-no`: Answer no to a yes/no question.
prompt-accept
<Return>
<Ctrl-M>
<Ctrl-J>
<Shift-Return>
<Enter>
<Shift-Enter>
prompt-yes
y
prompt-no
n
[command,prompt]
rl-backward-char
<Ctrl-B>
rl-forward-char
<Ctrl-F>
rl-backward-word
<Alt-B>
rl-forward-word
<Alt-F>
rl-beginning-of-line
<Ctrl-A>
rl-end-of-line
<Ctrl-E>
rl-unix-line-discard
<Ctrl-U>
rl-kill-line
<Ctrl-K>
rl-kill-word
<Alt-D>
rl-unix-word-rubout
<Ctrl-W>
<Alt-Backspace>
rl-yank
<Ctrl-Y>
rl-delete-char
<Ctrl-?>
rl-backward-delete-char
<Ctrl-H>
[caret]
toggle-selection
v
<Space>
drop-selection
<Ctrl-Space>
enter-mode normal
c
move-to-next-line
j
move-to-prev-line
k
move-to-next-char
l
move-to-prev-char
h
move-to-end-of-word
e
move-to-next-word
w
move-to-prev-word
b
move-to-start-of-next-block
]
move-to-start-of-prev-block
[
move-to-end-of-next-block
}
move-to-end-of-prev-block
{
move-to-start-of-line
0
move-to-end-of-line
$
move-to-start-of-document
gg
move-to-end-of-document
G
yank-selected -p
Y
yank-selected
y
<Return>
<Ctrl-M>
<Ctrl-J>
<Shift-Return>
<Enter>
<Shift-Enter>
scroll left
H
scroll down
J
scroll up
K
scroll right
L

File diff suppressed because it is too large Load Diff

View File

@ -54,6 +54,7 @@
# Rarely installed browsers get higher priority; It is assumed that if you
# install a rare browser, you probably use it. Firefox/konqueror/w3m on the
# other hand are often only installed as fallback browsers.
ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
ext x?html?, has surf, X, flag f = surf -- file://"$1"
ext x?html?, has vimprobable, X, flag f = vimprobable -- "$@"
ext x?html?, has vimprobable2, X, flag f = vimprobable2 -- "$@"
@ -175,7 +176,7 @@ ext e?ps, has zathura, X, flag f = zathura -- "$@"
#-------------------------------------------
# Image Viewing:
#-------------------------------------------
mime ^image/svg, has dwb, X, flag f = dwb -- "$@"
mime ^image/svg, has qutebrowser, X, flag f = qutebrowser -- "$@"
mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
mime ^image/svg, has display, X, flag f = display -- "$@"

View File

@ -249,11 +249,12 @@
;; Do not open other window for buffer menu, plus hide non-file buffers.
(define-key my-keys-minor-mode-map (kbd "C-x C-b") 'bs-show)
;; Remove auto-fill in dwb edit because wikis and forums do not like it.
;; Remove auto-fill in web edits because wikis and forums do not like it.
;; This works for qutebrowser, but may need changes for other browsers.
(add-hook
'find-file-hook
(lambda ()
(if (string-match "edit*" (buffer-name))
(if (string-match (concat (getenv "BROWSER") "-editor-*") (buffer-name))
(auto-fill-mode -1))))
;; Speedbar options.

View File

@ -1,13 +1,13 @@
[Default Applications]
application/pdf=zathura.desktop
text/html=dwb.desktop
x-scheme-handler/http=dwb.desktop
x-scheme-handler/https=dwb.desktop
x-scheme-handler/ftp=dwb.desktop
x-scheme-handler/chrome=dwb.desktop
application/x-extension-htm=dwb.desktop
application/x-extension-html=dwb.desktop
application/x-extension-shtml=dwb.desktop
application/xhtml+xml=dwb.desktop
application/x-extension-xhtml=dwb.desktop
application/x-extension-xht=dwb.desktop
text/html=qutebrowser.desktop
x-scheme-handler/http=qutebrowser.desktop
x-scheme-handler/https=qutebrowser.desktop
x-scheme-handler/ftp=qutebrowser.desktop
x-scheme-handler/chrome=qutebrowser.desktop
application/x-extension-htm=qutebrowser.desktop
application/x-extension-html=qutebrowser.desktop
application/x-extension-shtml=qutebrowser.desktop
application/xhtml+xml=qutebrowser.desktop
application/x-extension-xhtml=qutebrowser.desktop
application/x-extension-xht=qutebrowser.desktop

View File

@ -1,7 +1,6 @@
# $Id$
text/html; w3m -I %{charset} -T text/html; copiousoutput;
# text/html; dwb %s; nametemplate=%s.html
image/*; sxiv -- %s

View File

@ -4,7 +4,6 @@ clyrics-git
cppcheck-nox
demlo
docx2txt
dwb-git
emacs-guess-style-git
ff-git
freds-imagemagick-scripts
@ -16,6 +15,7 @@ multimarkdown
mutt-sidebar
peg-multimarkdown-latex-support-git
pkgtools
qutebrowser
sdlmame-wout-toolkits
tespeed-git
texlive-dummy

View File

@ -45,7 +45,6 @@ dosbox
driconf
dtach
dvtm
dwb
elfutils
emacs
encfs

View File

@ -1,9 +1,6 @@
#!/bin/sh
################################################################################
## .profile
################################################################################
## This file is sourced by .xprofile and shell rc files to make sure it work in
## TTY as well as under X.
## This file should be automatically sourced by the login manager. We source it
## manually from shell rc files to make sure it works in TTY as well
## Mask
## Result for 027 is: rwxr-x---
@ -98,13 +95,7 @@ fi
export EDITOR
export GIT_EDITOR
## Internet Browser
for i in dwb luakit google-chrome; do
command -v $i >/dev/null 2>&1 && export BROWSER=$i && break
done
## SSH-Agent
## WARNING: this is insecure on machines where someone else has root access.
command -v ssh-agent >/dev/null 2>&1 && eval "$(ssh-agent)"
## Kill ssh-agent on session end. Console login only.
command -v sessionclean >/dev/null 2>&1 && trap 'sessionclean' 0

View File

@ -1,13 +1,13 @@
#!/bin/sh
set -- "$HOME/.cache/dwb" \
"$HOME/.cache/emacs/backups" \
set -- "$HOME/.cache/emacs/backups" \
"$HOME/.cache/emacs/elpa/archives" \
"$HOME/.cache/emacs/elpa/gnupg" \
"$HOME/.cache/emacs/ido.last" \
"$HOME/.cache/emacs/saveplace" \
"$HOME/.cache/mutt" \
"$HOME/.cache/rtorrent" \
"$HOME/.cache/qutebrowser" \
"$HOME/.cache/zsh" \
"$HOME/.cmus/autosave" \
"$HOME/.cmus/cache" \
@ -16,18 +16,6 @@ set -- "$HOME/.cache/dwb" \
"$HOME/.cmus/queue.pl" \
"$HOME/.cmus/resume" \
"$HOME/.cmus/search-history" \
"$HOME/.config/dwb/default/commands.history" \
"$HOME/.config/dwb/default/cookies" \
"$HOME/.config/dwb/default/cookies_session.allow" \
"$HOME/.config/dwb/default/dwb-uni.fifo" \
"$HOME/.config/dwb/default/history" \
"$HOME/.config/dwb/default/hsts" \
"$HOME/.config/dwb/default/navigate.history" \
"$HOME/.config/dwb/default/plugindb" \
"$HOME/.config/dwb/default/plugins.allow" \
"$HOME/.config/dwb/default/scripts.allow" \
"$HOME/.config/dwb/default/search.history" \
"$HOME/.config/dwb/default/session" \
"$HOME/.config/gtk-2.0" \
"$HOME/.config/gtk-3.0" \
"$HOME/.config/ranger/bookmarks" \
@ -37,6 +25,7 @@ set -- "$HOME/.cache/dwb" \
"$HOME/.gtk-bookmarks" \
"$HOME/.lesshst" \
"$HOME/.local/share/newsbeuter" \
"$HOME/.local/share/qutebrowser" \
"$HOME/.local/share/webkit" \
"$HOME/.mpv/watch_later" \
"$HOME/.mtap.fuseiso" \

View File

@ -31,31 +31,26 @@ if [ -d "$SOURCEDIR/todo" ]; then
echo
fi
## dwb -- Install extensions.
if command -v dwbem >/dev/null 2>&1; then
echo "==> dwb"
# [ $(dwbem -l | grep -c "adblock_subscriptions") -eq 0 ] && dwbem -Ni adblock_subscriptions
[ $(dwbem -l | grep -c "navtools") -eq 0 ] && dwbem -Ni navtools
[ $(dwbem -l | grep -c "contenthandler") -eq 0 ] && dwbem -Ni contenthandler
# dwbem -Ni youtube_html5
(cd ~/.config/dwb/userscripts/ && git checkout extension_loader.js)
echo
fi
## Bookmarks
if [ -d "$SOURCEDIR" ]; then
echo "==> Bookmarks"
if [ -z "$BROWSER" ]; then
echo "Variable BROWSER is not set."
else
BROWSER_DATA_DIR="$XDG_DATA_HOME/$BROWSER/"
[ "$BROWSER" = "dwb" ] && BROWSER_DATA_DIR="$XDG_CONFIG_HOME/$BROWSER/default/"
[ -d "$SOURCEDIR" ] && ln -sf "$SOURCEDIR/bookmarks/bookmarks" "$BROWSER_DATA_DIR"
[ -d "$SOURCEDIR" ] && ln -sf "$SOURCEDIR/bookmarks/quickmarks" "$BROWSER_DATA_DIR"
[ -d "$SOURCEDIR" ] && ln -sf "$SOURCEDIR/bookmarks/cookies.allow" "$BROWSER_DATA_DIR"
case "$BROWSER" in
dwb)
BOOKMARKS="$XDG_CONFIG_HOME/$BROWSER/default/"
QUICKMARKS="$XDG_CONFIG_HOME/$BROWSER/default/" ;;
qutebrowser)
mkdir -p "$XDG_CONFIG_HOME/$BROWSER/bookmarks"
BOOKMARKS="$XDG_CONFIG_HOME/$BROWSER/bookmarks/urls"
QUICKMARKS="$XDG_CONFIG_HOME/$BROWSER/" ;;
*)
BOOKMARKS="$XDG_CONFIG_HOME/$BROWSER/"
QUICKMARKS="$XDG_CONFIG_HOME/$BROWSER/" ;;
esac
ln -sf "$SOURCEDIR/bookmarks/bookmarks" "$BOOKMARKS"
ln -sf "$SOURCEDIR/bookmarks/quickmarks" "$QUICKMARKS"
fi
echo
fi

View File

@ -15,11 +15,3 @@ fi
## when 'exec' is not called. But why?
# command -v sessionclean >/dev/null 2>&1 && sessionclean
## Crappy desktops
# exec openbox-session
# exec razor-session
# exec cinnamon-session
# exec startkde
# exec startlxde
# exec gnome-session

View File

@ -1,16 +1,22 @@
#!/bin/sh
## This file is sourced by some DM and should not contain any desktop execution.
## X config (for URxvt, etc.)
[ -f "${HOME}/.Xresources" ] && xrdb -merge "${HOME}/.Xresources"
## Internet browsers. They need X to run.
for i in qutebrowser dwb luakit chromium google-chrome; do
command -v $i >/dev/null 2>&1 && export BROWSER=$i && break
done
## Numlock
numlockx on
## X resources for URxvt et al.
[ -f "$HOME/.Xresources" ] && xrdb -merge "$HOME/.Xresources"
## Dynamic values. We could have defined the value from a variable in
## .Xresources which we would have set with the preprocessor. But the login
## manager may merge after sourcing this file without setting the preprocessor
## variable, thus overwriting the value with the variable name.
echo "URxvt.url-select.launcher: $BROWSER" | xrdb -merge
## Keymap
## Load custom keymap and configure input devices.
xkbcomp -I"$HOME/.xkb" "$HOME/.xkb/usim.xkb" $DISPLAY
## Disable Touchpad
numlockx on
synclient TouchpadOff=1
if [ "$OSTYPE" = "linux-gnu" ] ; then
@ -21,9 +27,9 @@ if [ "$OSTYPE" = "linux-gnu" ] ; then
command -v udiskie >/dev/null 2>&1 && udiskie &
fi
## This env variable is used by some programs (like ranger and awesome) to get
## This env variable is used by some programs (e.g. ranger, awesome) to get the
## terminal executable name.
export TERMCMD="urxvt"
## Hook. Should be sourced last
## Hook. Should be sourced last.
[ -f ~/.xprofile_hook ] && . ~/.xprofile_hook

View File

@ -27,19 +27,17 @@ implementation is straightforward since I am using the Vicious plugin.
This configuration is very version-sensitive, so make sure to use the latest
build.
### dwb
Some custom options, download location, search engines, plugins, etc.
Custom "fast-forward" javascript.
### Emacs
Emacs daemon is flawlessly integrated thanks to a small _em_ script -- see the
scripts folder. Unlike the terminal client, the graphical client does not return
and spawns a new window. For these reasons the terminal client can prove useful
in some contexts: Mutt, ranger bulkrename, git and dwb. I wrote a lot of Lisp
helper functions and a custom theme with 256 colors, works for both text and
graphical Emacs.
scripts folder. _em_ forks and does not return. _emw_ and _emc_ (windowed and
console version respectively) return to their caller. This can be useful in some
contexts: Mutt, ranger bulkrename, git and web editing. The windowed version of
Emacs is not limited to terminal capabilities. The console version has the
advantage of not spawning a new window when already running in console.
I wrote a lot of Lisp helper functions and a custom theme with 256 colors, works
for both text and graphical Emacs.
C-based modes: bindings to compile either from makefile or from a custom command
if no makefile is found, formatting with Uncrustify, skeletons.