diff options
-rw-r--r-- | bash_profile | 1 | ||||
-rw-r--r-- | bashrc | 125 | ||||
-rw-r--r-- | emacs | 48 | ||||
-rw-r--r-- | liw.cronish | 36 | ||||
-rw-r--r-- | mailcap | 2 | ||||
-rwxr-xr-x | make-symlinks | 35 | ||||
-rw-r--r-- | muttrc | 13 | ||||
-rw-r--r-- | muttrc-codethink | 11 | ||||
-rw-r--r-- | muttrc-colours | 60 | ||||
-rw-r--r-- | muttrc-common | 31 | ||||
-rw-r--r-- | profile | 22 | ||||
-rw-r--r-- | signature | 2 | ||||
-rw-r--r-- | signature-codethink | 1 | ||||
-rw-r--r-- | vimrc | 7 | ||||
-rw-r--r-- | xmonad.hs | 59 | ||||
-rw-r--r-- | xsessionrc | 3 |
16 files changed, 456 insertions, 0 deletions
diff --git a/bash_profile b/bash_profile new file mode 100644 index 0000000..c49349b --- /dev/null +++ b/bash_profile @@ -0,0 +1 @@ +. $HOME/.bashrc @@ -0,0 +1,125 @@ +str2xterm() { + case "$TERM" in + xterm*) + printf '\033]1;%s\07' "$1" > /dev/tty + printf '\033]2;%s\07' "$1" > /dev/tty + ;; + screen) + printf '\033]0;%s\a' "$1" > /dev/tty + ;; + esac +} + +find_git_root() +{ + (set -e + while [ "$(pwd)" != / ] + do + if [ -d .git ] + then + pwd + break + else + cd .. + fi + done) +} + +is_git_repo() +{ + case "$(find_git_root)" in + /*) return 0 ;; + *) return 1 ;; + esac +} + +get_git_branch() +{ + git branch --no-color | + awk ' + BEGIN { max = 30 } + /^\* / { + name = $2 + if (length(name) > max) + name = "..." substr(name, length(name) - max) + print name + } + ' +} + +git_prompt_part() +{ + if is_git_repo + then + echo -n "\\[$(end_bold)\\][$(get_git_branch)]\\[$(start_bold)\\]" + fi +} + +iconpart="`whoami`@`hostname`: " +titlepart="`whoami`@`hostname` -- " +prompt_command() { + prompt_status=$? + if [ $prompt_status != 0 ] + then + echo "$(start_bold)[status $prompt_status]$(end_bold)" + fi + base="`basename "$PWD"`" + str2xterm "$base - $iconpart$PWD" "$base - $titlepart$PWD" + PS1="\\[$(start_bold)\\]$debian_chroot\\u@\\h$(git_prompt_part)\\$ \\[$(end_bold)\\]" +} + +we_have_term() +{ + [ "$TERM" ] && [ "$TERM" != dumb ] +} + +start_bold() +{ + if we_have_term + then + tput sgr0 + tput bold + fi +} + +end_bold() +{ + if we_have_term + then + tput sgr0 + fi +} + + +ulimit -c unlimited +umask 002 + +if command -v emacs > /dev/null +then + export EDITOR=emacs +else + export EDITOR=vi +fi +export PAGER=less +export LESSCHARSET=utf-8 +export HISTCONTROL=ignoredups +export PATH="/usr/lib/ccache:$PATH:$HOME/bin" +export PROMPT_COMMAND=prompt_command +export PS1='\$ ' +export DEBEMAIL=liw@liw.fi +export VIRSH_DEFAULT_CONNECT_URI=qemu:///system +export LANG=en_GB.UTF-8 +export LC_COLLATE=fi_FI.UTF-8 +if [ -r /etc/debian_chroot ] +then + debian_chroot="$(cat /etc/debian_chroot) " +else + debian_chroot="" +fi + +PROMPT_DIRTRIM=1 +# PS1 now set by PROMPT_COMMAND, since it is no longer static, and +# may include data about current git branch. +# PS1="\\[$(start_bold)\\]$debian_chroot\\u@\\h\\$ \\[$(end_bold)\\]" + +set +H @@ -0,0 +1,48 @@ +;; C-z under xmonad does nothing useful, and Emacs 23 gets confused +;; (needs to be de-focused and re-focused to de-confuse). +(when (display-graphic-p) (global-unset-key "\C-z")) + +;; Show column numbers in the mode line. +(column-number-mode t) + +;; Insert spaces instead of TAB characters. +(setq indent-tabs-mode nil) + +;; Turn on auto-fill-mode in all text modes automatically. +(setq text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify))) + +;; Do not make backup files when saving. +(setq make-backup-files nil) + +;; Enable X CLIPBOARD selection, instead of PRIMARY. +(setq x-select-enable-clipboard t) + +;; Disable tool bar. +(tool-bar-mode 0) + +;; Don't require double spaces to end sentences. +(setq sentence-end-double-space nil) + +;; Don't show initial help on startup. +(setq inhibit-startup-screen t) + +;; Don't show unwanted files with dired. +;; From: http://stackoverflow.com/questions/14850103/how-do-i-get-emacs-dired-to-ignore-uninteresting-file-extensions +(require 'dired-x) +(setq-default dired-omit-files-p t) +(setq dired-omit-files + (concat dired-omit-files "\\.pyc$")) + +;;;;;;;;;;; +;; Use custom-set-variables to set variables that cant' be set otherwise. + +;; truncate-lines: +;; Don't wrap long lines when displaying them. Make me scroll +;; sideways instead. + +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(truncate-lines t)) diff --git a/liw.cronish b/liw.cronish new file mode 100644 index 0000000..a86091d --- /dev/null +++ b/liw.cronish @@ -0,0 +1,36 @@ +offlineimap: + interval: 60 + timeout: 120 + command: offlineimap -u quiet + +GTD: + interval: 300 + timeout: 300 + command: | + set -eu + cd $HOME/GTD + if bzr status | grep . > /dev/null + then + bzr commit -m sync + bzr merge --pull + bzr push + else + bzr merge --pull + bzr push + fi + +wotsap: + trigger-file: /home/liw/.wotsapdb + trigger-age: 604800 + command: | + if [ -e /home/liw/bin/update-wotsap ] + then + /home/liw/bin/update-wotsap + else + touch /home/liw/.wotsapdb + fi + +annex: + interval: 300 + timeout: 120 + command: cd $HOME/annex && git annex --quiet sync @@ -0,0 +1,2 @@ +text/html; w3m -dump -T text/html %s; needsterminal; copiousoutput; +image/*; eog %s; diff --git a/make-symlinks b/make-symlinks new file mode 100755 index 0000000..3853a89 --- /dev/null +++ b/make-symlinks @@ -0,0 +1,35 @@ +#!/bin/sh + +set -e + +die() +{ + echo "$@" 1>&2 + exit 1 +} + + +abspath() +{ + (cd "$1" && pwd) +} + + +dirname=$(abspath $(dirname "$0")) +echo "$dirname" + +files="bashrc bash_profile profile xsessionrc vimrc muttrc mailcap emacs + signature signature-codethink" + +for x in $files +do + [ -e "$dirname/$x" ] || die "$dirname/$x does not exist, oops" +# [ ! -L "$HOME/.$x" ] || die "$HOME/.$x is already a symlink, oops" +done + +for x in $files +do + ln -sf "$dirname/$x" "$HOME/.$x" +done + +ln -sf "$dirname/xmonad.hs" "$HOME/.xmonad/xmonad.hs" @@ -0,0 +1,13 @@ +alternates '^liw@(liw|iki)\.fi$' '^liw@pieni\.net$' '^liw@braawi\.com$' '^lars@debian\.org$' '^lasutiti@googlemail\.com$' + +set folder=$HOME/Maildirs.pieni +set record=$HOME/Maildirs.pieni/Sent +set spoolfile=$HOME/Maildirs.pieni/INBOX + +set from=liw@liw.fi + +set smtp_url=smtps://liw@pieni.net/ +set signature=/home/liw/.signature + +source "~/liw-dot-files/muttrc-common" +source "~/liw-dot-files/muttrc-colours" diff --git a/muttrc-codethink b/muttrc-codethink new file mode 100644 index 0000000..2e8fd2c --- /dev/null +++ b/muttrc-codethink @@ -0,0 +1,11 @@ +set folder=$HOME/Maildirs.codethink +set record=$HOME/Maildirs.codethink/Sent +set spoolfile=$HOME/Maildirs.codethink/INBOX + +set from=lars.wirzenius@codethink.co.uk + +set smtp_url=smtps://larswirzenius@mail.codethink.co.uk/ +set signature=/home/liw/.signature-codethink + +source "~/liw-dot-files/muttrc-common" +source "~/liw-dot-files/muttrc-colours" diff --git a/muttrc-colours b/muttrc-colours new file mode 100644 index 0000000..c5b7246 --- /dev/null +++ b/muttrc-colours @@ -0,0 +1,60 @@ +########################################################## +# Color theme of my very own. + +# Remove all color settings that are in effect. Start from +# a clean slate. + +uncolor index * +uncolor header * +uncolor body * + +# Set color for each "object" mutt knows about, except body and header. +# See file:///usr/share/doc/mutt/html/configuration.html#color for +# a list of the objects. +# +# Valid colors are: +# +# white, black, green, magenta, blue, cyan, yellow, red, default, colorN +# +# A foreground color can be prefixed by "bright" for a brighter variant. +# +# I use gnome-terminal with the "Linux console" colour settings and a +# "black on white" colour theme. The "white" color is a grey, not +# white, so I use "default" as the background color to achieve white. +# +# * normal text: black on default (= white) +# * de-emphasised text: white (= grey) on default (white) +# * highlights: brightblue on default + +color attachment black default +color bold brightblue default +color error brightred default +color hdrdefault white default +color indicator black white +color markers green default +color message red default +color normal black default +color quoted white default +color search brightmagenta default +color signature white default +color status brightwhite black +color tilde black default +color tree black default +color underline brightblue default + +# Set color for specific headers, chosen by regular expressions. + +color header brightblue default ^(From|Subject|To|Cc): + +# Set color for specific parts of the body of a message. + +color body red default "^gpg: .*" +color body brightred default "^gpg: Can't check signature:.*" +color body brightred default "^gpg: Bad signature.*" +color body brightred default "^gpg: .*warning.*" +color body brightred default "^gpg: .*failed.*" + +# Set colors for specific entries in a list of messages (an "index"). + +#color index white default "~h List-*" # List mail +color index green default "~p" # personal mail diff --git a/muttrc-common b/muttrc-common new file mode 100644 index 0000000..c8ac5d5 --- /dev/null +++ b/muttrc-common @@ -0,0 +1,31 @@ +ignore x-mailer x-url user-agent +unignore reply-to +unhdr_order * +hdr_order from reply-to date to cc subject + +set pgp_use_gpg_agent=yes +set pgp_sort_keys=reverse-date +set pgp_auto_decode=yes + +set crypt_autopgp=yes +set crypt_autosign=no +set crypt_replysign=no +set crypt_replysignencrypted=no + +set pipe_decode=yes +set query_command="clab mutt-query -- %s" +#macro pager A |'abook --add-email'\n + +set reply_self=yes + +set header_cache=$HOME/UNBACKED/.mutt.header_cache + +set markers=no + +#set implicit_autoview=yes + +set check_new=yes + +set print_command="muttprint" + +set mime_forward=ask-yes @@ -0,0 +1,22 @@ +# ~/.profile: executed by the command interpreter for login shells. +# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login +# exists. +# see /usr/share/doc/bash/examples/startup-files for examples. +# the files are located in the bash-doc package. + +# the default umask is set in /etc/profile; for setting the umask +# for ssh logins, install and configure the libpam-umask package. +#umask 022 + +# if running bash +if [ -n "$BASH_VERSION" ]; then + # include .bashrc if it exists + if [ -f "$HOME/.bashrc" ]; then + . "$HOME/.bashrc" + fi +fi + +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/bin" ] ; then + PATH="$HOME/bin:$PATH" +fi diff --git a/signature b/signature new file mode 100644 index 0000000..c875db3 --- /dev/null +++ b/signature @@ -0,0 +1,2 @@ +http://www.cafepress.com/trunktees -- geeky funny T-shirts +http://gtdfh.branchable.com/ -- GTD for hackers diff --git a/signature-codethink b/signature-codethink new file mode 100644 index 0000000..03a6eb6 --- /dev/null +++ b/signature-codethink @@ -0,0 +1 @@ +http://www.codethink.co.uk/ http://wiki.baserock.org/ http://www.baserock.com/ @@ -0,0 +1,7 @@ +set ts=4 +set sw=4 +set expandtab +syntax off +set paste +set nobackup +set nowritebackup diff --git a/xmonad.hs b/xmonad.hs new file mode 100644 index 0000000..6b0bed0 --- /dev/null +++ b/xmonad.hs @@ -0,0 +1,59 @@ +import XMonad +import XMonad.Config.Gnome +import XMonad.Actions.DynamicWorkspaces +import XMonad.Prompt +import XMonad.Prompt.Shell +import XMonad.Prompt.XMonad +import qualified XMonad.Util.EZConfig as EZ +import qualified XMonad.StackSet as W +import XMonad.Actions.CycleWS +import qualified XMonad.Actions.DynamicWorkspaceOrder as DO +import XMonad.Hooks.DynamicLog +import XMonad.Hooks.EwmhDesktops +import XMonad.Layout.NoBorders +import XMonad.Layout.MultiToggle +import XMonad.Layout.MultiToggle.Instances + +main :: IO () +main = do + xmonad $ gnomeConfig + { modMask = mod4Mask + , workspaces = defaultWorkSpaces + , handleEventHook = fullscreenEventHook + , layoutHook = id + . smartBorders + . mkToggle (single FULL) + $ (layoutHook gnomeConfig) + , borderWidth = 3 + } `EZ.additionalKeysP` + [ -- General keys + ("M1-<F2>", shellPrompt defaultXPConfig) + -- Screens, Workspaces and Windows + , ("M1-C-<Left>", DO.moveTo Prev AnyWS) + , ("M1-C-<Right>", DO.moveTo Next AnyWS) + , ("M1-C-S-<Left>", DO.shiftTo Prev AnyWS >> DO.moveTo Prev AnyWS) + , ("M1-C-S-<Right>", DO.shiftTo Next AnyWS >> DO.moveTo Next AnyWS) + , ("M1-C-<Up>", prevScreen) + , ("M1-C-<Down>", nextScreen) + , ("M1-C-S-<Up>", shiftPrevScreen >> prevScreen) + , ("M1-C-S-<Down>", shiftNextScreen >> nextScreen) + , ("M1-<F4>", kill) + , ("M-<F11>", sendMessage $ Toggle FULL) + -- Management keys + , ("M-<F12>", xmonadPrompt defaultXPConfig) + , ("M-S-r", spawn "if type xmonad; then xmonad --recompile && xmonad --restart; else xmessage xmonad not in \\$PATH: \"$PATH\"; fi") + , ("M-S-t", withFocused $ windows . W.sink) + ] + `EZ.additionalKeys` extraKeyMappings mod4Mask + +defaultWorkSpaces :: [String] +defaultWorkSpaces = ["naught","one", "two", "three", "four", "five", "six","seven"] + +extraKeyMappings :: ButtonMask -> [((ButtonMask, KeySym), X ())] +extraKeyMappings modm = + [ ((modm, xK_Menu), spawn "dmenu_shutdown") + ] ++ + zip (zip (repeat (modm)) [xK_1..xK_9]) (map (withNthWorkspace W.greedyView) [0..]) + ++ + zip (zip (repeat (modm .|. shiftMask)) [xK_1..xK_9]) (map (withNthWorkspace W.shift) [0..]) + diff --git a/xsessionrc b/xsessionrc new file mode 100644 index 0000000..34715fd --- /dev/null +++ b/xsessionrc @@ -0,0 +1,3 @@ +export LANG=en_GB.UTF-8 +export LC_COLLATE=fi_FI.UTF-8 +xset b off |