diff options
-rw-r--r-- | .crontab.local | 10 | ||||
-rw-r--r-- | .emacs | 175 | ||||
-rw-r--r-- | .emacs.d/.gitignore | 4 | ||||
-rw-r--r-- | .emacs.d/custom.el | 4 | ||||
-rw-r--r-- | .full.asound | 347 | ||||
-rwxr-xr-x | .local/bin/notifyd | 14 | ||||
-rw-r--r-- | .profile | 8 | ||||
-rwxr-xr-x | .wmii/autostart | 1 | ||||
-rwxr-xr-x | .wmii/exec | 2 | ||||
-rw-r--r-- | .wmii/include.sh | 70 | ||||
-rwxr-xr-x | .wmii/quit | 3 | ||||
-rwxr-xr-x | .wmii/rbar_battery | 10 | ||||
-rwxr-xr-x | .wmii/rbar_clock | 10 | ||||
-rwxr-xr-x | .wmii/rbar_cpu | 13 | ||||
-rwxr-xr-x | .wmii/rbar_wifi | 10 | ||||
-rwxr-xr-x | .wmii/wmiirc | 115 | ||||
-rw-r--r-- | .wmii/wmiirc_local | 6 | ||||
-rw-r--r-- | .xinitrc | 2 | ||||
-rw-r--r-- | .xmodmap | 7 |
19 files changed, 622 insertions, 189 deletions
diff --git a/.crontab.local b/.crontab.local new file mode 100644 index 0000000..d0c580d --- /dev/null +++ b/.crontab.local @@ -0,0 +1,10 @@ +# m h dom mon dow command +#0 4 * * 1-5 /usr/sbin/alsactl restore --file "$HOME/.full.asound" + +#0 5 * * 1-5 cvlc --volume 256 --random $HOME/Music +#30 5 * * 1-5 cvlc --volume 256 --random $HOME/Music +#0 6 * * 1-5 cvlc --volume 256 --random $HOME/Music +#30 6 * * 1-5 cvlc --volume 256 --random $HOME/Music +#0 7 * * * cvlc --volume 256 --random $HOME/Music + +#0 8 * * * cvlc --volume 256 --random $HOME/Music @@ -1,132 +1,81 @@ -(set-face-attribute 'default nil :height 80) +;; Preliminary settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(set-face-attribute 'default nil :height 80) +(setq notify-method 'notify-via-libnotify) +(add-to-list 'load-path "~/.emacs.d/") +(add-to-list 'load-path "~/.emacs.d/el-get/el-get") (setq custom-file "~/.emacs.d/custom.el") -(load custom-file 'noerror) -(defun load-identica-mode () - (when (require 'netrc nil t) - (autoload 'identica-mode "identica-mode" nil t) - (let ((identica (netrc-machine (netrc-parse "~/.netrc") "identi.ca" t))) - (setq identica-password (netrc-get identica "password")) - (setq identica-username (netrc-get identica "login")) - ) - ) -) +; derived from ELPA installation +; http://tromey.com/elpa/install.html +(defun eval-url (url) + (let ((buffer (url-retrieve-synchronously url))) + (save-excursion + (set-buffer buffer) + (goto-char (point-min)) + (re-search-forward "^$" nil 'move) + (eval-region (point) (point-max)) + (kill-buffer (current-buffer))))) + + ;; ELPA stuff ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(unless (require 'package nil t) + (eval-url "http://tromey.com/elpa/package-install.el")) (setq package-archives '(("ELPA" . "http://tromey.com/elpa/") ("marmalade" . "http://marmalade-repo.org/packages/") ("gnu" . "http://elpa.gnu.org/packages/"))) +;; el-get stuff ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(add-to-list 'load-path "~/.emacs.d/") -(add-to-list 'load-path "~/.emacs.d/el-get/el-get") +(setq el-get-install-branch "master") ;; live life on the edge (unless (require 'el-get nil t) - (url-retrieve - "https://github.com/dimitri/el-get/raw/master/el-get-install.el" - (lambda (s) - (end-of-buffer) - (eval-print-last-sexp)))) - -(setq el-get-sources - '((:name scss-mode - :url "git://github.com/antonj/scss-mode.git" - :after (lambda () - (setq scss-compile-at-save nil))) - (:name color-theme - :after (lambda () - (color-theme-tty-dark))) - (:name color-theme-solarized - :after (lambda () - (add-hook 'after-make-frame-functions - (lambda (frame) - (set-variable 'color-theme-is-global nil) - (select-frame frame) - (if window-system - (color-theme-solarized-dark) - (color-theme-tty-dark)))))) - (:name org-mode - :after (lambda () - (require 'org-checklist) - (setq org-hide-leading-stars t) - (setq org-log-done 'time))) - (:name identica-mode - :type http-tar - :options ("xzf") - :url "http://git.savannah.gnu.org/cgit/identica-mode.git/snapshot/identica-mode-1.1.tar.gz" - :load "identica-mode.el" - :after (lambda () - (load-identica-mode))) - (:name nginx-mode - :description "Major mode for editing Nginx configuration files" - :type git - :url "git://github.com/ajc/nginx-mode.git") - (:name autopair - :after (lambda () - (autopair-global-mode 1) - (setq autopair-autowrap t))) - )) + (eval-url "https://github.com/dimitri/el-get/raw/master/el-get-install.el")) + +(setq el-get-sources '( + (:name nxhtml + :type http + :url "http://ourcomments.org/Emacs/DL/elisp/nxhtml/zip/nxhtml-2.08-100425.zip" + :build ("unzip nxhtml-2.08-100425.zip") + :load "nxhtml/autostart.el") + )) -(setq lts-el-get-packages +(setq my-el-get-packages '(el-get - package - rainbow-delimiters - php-mode-improved - mmm-mode - dtrt-indent - coffee-mode - folding - apel flim semi wanderlust - scss-mode - color-theme color-theme-solarized - org-mode - identica-mode +; nxhtml smarttabs - markdown-mode - autopair - nginx-mode )) -(when (require 'el-get nil t) - (el-get 'sync lts-el-get-packages)) +;; Now load all of that ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(add-hook 'text-mode-hook 'turn-on-auto-fill) -(add-hook 'after-make-frame-functions - (lambda (frame) - (set-variable 'term-default-fg-color - (face-foreground 'default)) - (set-variable 'term-default-bg-color - (face-background 'default))) - t) +;; ELPA +(package-initialize) +;; el-get +(when (require 'el-get nil t) (el-get 'sync my-el-get-packages)) +;; custom +(load custom-file 'noerror) + +;; General settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;(load "mdmua") (load "emacsutils") (tool-bar-mode -1) (ido-mode t) (show-paren-mode 1) - -(defun toggle-fullscreen (&optional f) - (interactive) - (let ((current-value (frame-parameter nil 'fullscreen))) - (set-frame-parameter nil 'fullscreen - (if (equal 'fullboth current-value) - (if (boundp 'old-fullscreen) old-fullscreen nil) - (progn (setq old-fullscreen current-value) - 'fullboth))))) -(global-set-key [f11] 'toggle-fullscreen) +(setq org-hide-leading-stars t) +(setq org-log-done 'time) +;(xclip-mode 1) (load "whitespace") -(global-set-key "\C-cw" 'global-whitespace-mode) (setq whitespace-style '( -; face -; tabs tab-mark -; spaces space-mark -; newline newline-mark empty )) + ;; These are my preferred settings; we let dtrt-indent detect when we play with other's files (setq-default tab-width 8) (setq-default c-basic-offset 8) @@ -135,7 +84,7 @@ (setq backup-by-copying t ;; don't clobber symlinks - backup-directory-alist '(("." . "~/.saves")) ;; don't litter my fs tree + backup-directory-alist '(("." . "~/.emacs.d/saves")) ;; don't litter my fs tree delete-old-versions t kept-new-versions 6 kept-old-versions 2 @@ -152,6 +101,34 @@ (setq browse-url-generic-program (executable-find "v-www-browser") browse-url-browser-function 'browse-url-generic) + +(defun toggle-fullscreen (&optional f) + (interactive) + (let ((current-value (frame-parameter nil 'fullscreen))) + (set-frame-parameter nil 'fullscreen + (if (equal 'fullboth current-value) + (if (boundp 'old-fullscreen) old-fullscreen nil) + (progn (setq old-fullscreen current-value) + 'fullboth))))) + +;; Custom keybindings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(global-set-key [f11] 'toggle-fullscreen) +(global-set-key "\C-cw" 'global-whitespace-mode) + +;; mode-hooks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(add-hook 'text-mode-hook 'turn-on-auto-fill) + +; for term-mode +;; (add-hook 'after-make-frame-functions +;; (lambda (frame) +;; (set-variable 'term-default-fg-color +;; (face-foreground 'default)) +;; (set-variable 'term-default-bg-color +;; (face-background 'default))) +;; t) + (add-hook 'lisp-mode-hook '(lambda () (set (make-local-variable 'indent-tabs-mode) nil) diff --git a/.emacs.d/.gitignore b/.emacs.d/.gitignore index 675a8be..ef4ec20 100644 --- a/.emacs.d/.gitignore +++ b/.emacs.d/.gitignore @@ -1,7 +1,9 @@ auto-save-list/* el-get/* -server/* elmo/* +elpa/* image-dired/* +server/* session.* +tramp url/* diff --git a/.emacs.d/custom.el b/.emacs.d/custom.el index 0d4cf4a..ee82309 100644 --- a/.emacs.d/custom.el +++ b/.emacs.d/custom.el @@ -3,7 +3,11 @@ ;; 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. + '(custom-enabled-themes (quote (wombat))) + '(custom-safe-themes (quote ("71b172ea4aad108801421cc5251edb6c792f3adbaecfa1c52e94e3d99634dee7" "fc5fcb6f1f1c1bc01305694c59a1a861b008c534cae8d0e48e4d5e81ad718bc6" default))) '(erc-nick "lukeshu") + '(explicit-shell-file-name "/bin/bash") + '(inhibit-startup-screen t) '(mdmua-maildir "~/Maildir") '(ruby-deep-arglist nil) '(ruby-deep-indent-paren nil) diff --git a/.full.asound b/.full.asound new file mode 100644 index 0000000..bf41e03 --- /dev/null +++ b/.full.asound @@ -0,0 +1,347 @@ +state.PCH { + control.1 { + iface MIXER + name 'Headphone Playback Volume' + value.0 87 + value.1 87 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 87' + dbmin -6525 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.2 { + iface MIXER + name 'Headphone Playback Switch' + value.0 true + value.1 true + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.3 { + iface MIXER + name 'Speaker Playback Volume' + value.0 87 + value.1 87 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 87' + dbmin -6525 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.4 { + iface MIXER + name 'Speaker Playback Switch' + value.0 true + value.1 true + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.5 { + iface MIXER + name 'Mic Playback Volume' + value.0 0 + value.1 0 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 31' + dbmin -3450 + dbmax 1200 + dbvalue.0 -3450 + dbvalue.1 -3450 + } + } + control.6 { + iface MIXER + name 'Mic Playback Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.7 { + iface MIXER + name 'Internal Mic Playback Volume' + value.0 0 + value.1 0 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 31' + dbmin -3450 + dbmax 1200 + dbvalue.0 -3450 + dbvalue.1 -3450 + } + } + control.8 { + iface MIXER + name 'Internal Mic Playback Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.9 { + iface MIXER + name 'Auto-Mute Mode' + value Enabled + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 Disabled + item.1 Enabled + } + } + control.10 { + iface MIXER + name 'Mic Boost Volume' + value.0 0 + value.1 0 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 3' + dbmin 0 + dbmax 3600 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.11 { + iface MIXER + name 'Internal Mic Boost Volume' + value.0 0 + value.1 0 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 3' + dbmin 0 + dbmax 3600 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.12 { + iface MIXER + name 'Capture Switch' + value.0 true + value.1 true + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.13 { + iface MIXER + name 'Capture Volume' + value.0 19 + value.1 19 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 31' + dbmin -1650 + dbmax 3000 + dbvalue.0 1200 + dbvalue.1 1200 + } + } + control.14 { + iface MIXER + name 'Beep Playback Volume' + value.0 0 + value.1 0 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 31' + dbmin -3450 + dbmax 1200 + dbvalue.0 -3450 + dbvalue.1 -3450 + } + } + control.15 { + iface MIXER + name 'Beep Playback Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.16 { + iface MIXER + name 'Master Playback Volume' + value 87 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 87' + dbmin -6525 + dbmax 0 + dbvalue.0 0 + } + } + control.17 { + iface MIXER + name 'Master Playback Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.18 { + iface CARD + name 'Headphone Jack' + value false + comment { + access read + type BOOLEAN + count 1 + } + } + control.19 { + iface CARD + name 'Mic Jack' + value false + comment { + access read + type BOOLEAN + count 1 + } + } + control.20 { + iface CARD + name 'HDMI/DP,pcm=3 Jack' + value false + comment { + access read + type BOOLEAN + count 1 + } + } + control.21 { + iface MIXER + name 'IEC958 Playback Con Mask' + value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' + comment { + access read + type IEC958 + count 1 + } + } + control.22 { + iface MIXER + name 'IEC958 Playback Pro Mask' + value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' + comment { + access read + type IEC958 + count 1 + } + } + control.23 { + iface MIXER + name 'IEC958 Playback Default' + value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' + comment { + access 'read write' + type IEC958 + count 1 + } + } + control.24 { + iface MIXER + name 'IEC958 Playback Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.25 { + iface PCM + device 3 + name ELD + value '' + comment { + access read + type BYTES + count 0 + } + } + control.26 { + iface MIXER + name 'Digital Capture Volume' + value.0 60 + value.1 60 + comment { + access 'read write user' + type INTEGER + count 2 + range '0 - 120' + tlv '0000000100000008fffff44800000032' + dbmin -3000 + dbmax 3000 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.27 { + iface MIXER + name 'PCM Playback Volume' + value.0 255 + value.1 255 + comment { + access 'read write user' + type INTEGER + count 2 + range '0 - 255' + tlv '0000000100000008ffffec1400000014' + dbmin -5100 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } +} diff --git a/.local/bin/notifyd b/.local/bin/notifyd new file mode 100755 index 0000000..ddd5971 --- /dev/null +++ b/.local/bin/notifyd @@ -0,0 +1,14 @@ +#!/bin/bash + +connected_to_x_server() { + xdpyinfo &>/dev/null + return $? +} + +start_backend() { + /usr/lib/xfce4/notifyd/xfce4-notifyd +} + +while connected_to_x_server; do + start_backend +done @@ -42,6 +42,7 @@ _JAVA_OPTIONS='' _JAVA_OPTIONS+=' -Dawt.useSystemAAFontSettings=on' _JAVA_OPTIONS+=' -Dswing.aatext=true' _JAVA_OPTIONS+=' -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' +_JAVA_OPTIONS+=" -Djava.io.tmpdir=$TMPDIR" export _JAVA_OPTIONS # ALSA @@ -54,6 +55,13 @@ if [ -z "$XAUTHORITY" ]; then export XAUTHORITY=$HOME/.Xauthority fi +# D-Bus +if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then + eval `dbus-launch` + export DBUS_SESSION_BUS_ADDRESS + export DBUS_SESSION_BUS_PID +fi + # Start background programs ########################################## if [ -f "$HOME/.login-daemons" ]; then . "$HOME/.login-daemons" diff --git a/.wmii/autostart b/.wmii/autostart index b44ade8..aae23f4 100755 --- a/.wmii/autostart +++ b/.wmii/autostart @@ -1,3 +1,4 @@ #!/bin/bash daemon lxpanel &> /dev/null daemon wicd-client -t &> /dev/null +daemon notifyd &> /dev/null diff --git a/.wmii/exec b/.wmii/exec deleted file mode 100755 index c83d790..0000000 --- a/.wmii/exec +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -echo exec "$@" >> $WMII_DIR/ctl diff --git a/.wmii/include.sh b/.wmii/include.sh new file mode 100644 index 0000000..36f8f3e --- /dev/null +++ b/.wmii/include.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +if [ -z "$WMII_NAMESPACE" ]; then + export WMII_NAMESPACE=`wmiir namespace` +fi +if [ -z "$WMII_DIR" ]; then + export WMII_DIR=$WMII_NAMESPACE/mnt +fi + +# a -- a work-around for buggy IO append in 9pfuse +# useing '|a' should be just like using '>>', but will work +# when 9pfuse decides to bug out. +a() { + f="${1/#${WMII_DIR}/}" + if [ "$f" = "$1" ]; then + cat >> "$1" + else + if wmiir ls "$f" &>/dev/null; then + wmiir write "$f" + else + wmiir create "$f" + fi + fi +} + +# I like wmiir's setsid better than linux-utils' +setsid() { wmiir setsid "$@"; } + +path_ls() { + find -L `echo "$@"|sed 'y/:/ /'` -maxdepth 1 -type f -executable -printf '%f\n' 2>/dev/null| sort -u +} + +path_which() { + mypath=$1 + prog=$2 + which=`which which` + PATH="$mypath" "$which" -- "$prog" 2>/dev/null +} + + +lstags() { + ls $WMII_DIR/tag | sed '/^sel$/d' +} + +scansection() { + file=`path_which "$WMII_CONFPATH" wmiirc` + sec=$1 + tmp=`mktemp` + if [ -n "$sec" ]; then + < "$file" sed -n "/^\s*$sec\s*()/,/##\s*End $sec/p" | sed '1d;$d'> $tmp + else + < "$file" sed "/\s*}\s*##\s*End\s/d" > $tmp + fi + < $tmp sed -n '/##/p'|sed -r 's/^\s*(.*)\)\s*## ?/\t\1\t/;s/\s*## ?//' + rm $tmp +} + +conffile() { + echo "$HOME/.wmii/$@" +} + +Action() { + prog=`path_which "$WMII_CONFPATH" $1`; shift + if [ -n "$prog" ]; then + "$prog" "$@" + return $? + else + return 1 + fi +} @@ -1,2 +1,3 @@ #!/bin/bash -echo quit >> $WMII_DIR/ctl +. "$HOME/.wmii/include.sh" +echo quit |a $WMII_DIR/ctl diff --git a/.wmii/rbar_battery b/.wmii/rbar_battery new file mode 100755 index 0000000..7a7f24f --- /dev/null +++ b/.wmii/rbar_battery @@ -0,0 +1,10 @@ +#!/bin/bash +. "$HOME/.wmii/include.sh" + +priority=$1 + +set -e +while true; do + acpi -b |a "$WMII_DIR/rbar/${priority}_battery" + sleep 1 +done diff --git a/.wmii/rbar_clock b/.wmii/rbar_clock new file mode 100755 index 0000000..8e7d2a4 --- /dev/null +++ b/.wmii/rbar_clock @@ -0,0 +1,10 @@ +#!/bin/bash +. "$HOME/.wmii/include.sh" + +priority=$1 + +set -e +while true; do + date |a "$WMII_DIR/rbar/${priority}_clock" + sleep .5 +done diff --git a/.wmii/rbar_cpu b/.wmii/rbar_cpu new file mode 100755 index 0000000..7f891da --- /dev/null +++ b/.wmii/rbar_cpu @@ -0,0 +1,13 @@ +#!/bin/bash +. "$HOME/.wmii/include.sh" + +priority=$1 + +set -e +while true; do + # This doesn't work for me, it shows capacity + #echo -n 'Core MHz:' $(cat /proc/cpuinfo | grep 'cpu MHz' | sed 's/.*: //g; s/\..*//g;') |a "$WMII_DIR/rbar/${priority}_cpu" + # This actually displays %idle + echo 'CPU: [ '$(tail -n3 ~/tmp/cputime|sed -ur 's/\s\s+/\t/g'|cut -f2,11|sed 's/\t\(.*\)/(\1)/')' ]' |a "$WMII_DIR/rbar/${priority}_cpu" + sleep 1 +done diff --git a/.wmii/rbar_wifi b/.wmii/rbar_wifi new file mode 100755 index 0000000..608b164 --- /dev/null +++ b/.wmii/rbar_wifi @@ -0,0 +1,10 @@ +#!/bin/bash +. "$HOME/.wmii/include.sh" + +priority=$1 + +set -e +while true; do + echo 'Wlan0:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality) |a "$WMII_DIR/rbar/${priority}_wifi" + sleep 1 +done diff --git a/.wmii/wmiirc b/.wmii/wmiirc index f211d7f..82c424b 100755 --- a/.wmii/wmiirc +++ b/.wmii/wmiirc @@ -1,95 +1,30 @@ #!/bin/bash # Let any running instances of wmiirc know that we're starting - -echo ' ==> Starting wmiirc' wmiir xwrite /event Start -export WMII_NAMESPACE=`wmiir namespace` -mount9p=/opt/plan9/bin/9pfuse +. "$HOME/.wmii/include.sh" +echo ' ==> Starting wmiirc' +mount9p=/opt/plan9/bin/9pfuse mkdir -p $WMII_NAMESPACE/mnt $mount9p $WMII_NAMESPACE/{wmii,mnt} -export WMII_DIR=$WMII_NAMESPACE/mnt - -# a -- a work-around for buggy IO append in 9pfuse -# useing '|a' should be just like using '>>', but will work -# when 9pfuse decides to bug out. -a() { - f="${1/#${WMII_DIR}/}" - if [ "$f" = "$1" ]; then - cat >> "$1" - else - if wmiir ls "$f" &>/dev/null; then - wmiir write "$f" - else - wmiir create "$f" - fi - fi -} -# I like wmiir's setsid better than linux-utils' -setsid() { wmiir setsid "$@"; } -WMII_FONT='xft:Monospace-8' -WMII_TERM=x-terminal-emulator - -. $HOME/.wmii/wmiirc_local -# Configuration Variables + +MODKEY=Mod4 # super UP=p DOWN=n LEFT=b RIGHT=f # Colors tuples: "<text> <background> <border>" -. $HOME/.wmii/theme-solarized-dark +. `conffile theme-solarized-dark` # Menu history -hist="${WMII_CONFPATH%%:*}/history" +hist="`conffile history`" # Tagging Rules -echo '/Emacs|Navigator/ -> +sel' |a $WMII_DIR/tagrules -echo '/panel/ -> /.*/' |a $WMII_DIR/tagrules - -if [ -f "${WMII_CONFPATH%%:*}/wmiirc_local" ]; then - . "${WMII_CONFPATH%%:*}/wmiirc_local" -fi - -path_ls() { - find -L `echo "$@"|sed 'y/:/ /'` -maxdepth 1 -type f -executable -printf '%f\n' 2>/dev/null| sort -u -} - -path_which() { - mypath=$1 - prog=$2 - which=`which which` - PATH="$mypath" "$which" -- "$prog" 2>/dev/null -} - - -lstags() { - ls $WMII_DIR/tag | sed '/^sel$/d' -} - -scansection() { - file=`path_which "$WMII_CONFPATH" wmiirc` - sec=$1 - tmp=`mktemp` - if [ -n "$sec" ]; then - < "$file" sed -n "/^\s*$sec\s*()/,/##\s*End $sec/p" | sed '1d;$d'> $tmp - else - < "$file" sed "/\s*}\s*##\s*End\s/d" > $tmp - fi - < $tmp sed -n '/##/p'|sed -r 's/^\s*(.*)\)\s*## ?/\t\1\t/;s/\s*## ?//' - rm $tmp -} - -Action() { - prog=`path_which "$WMII_CONFPATH" $1`; shift - if [ -n "$prog" ]; then - "$prog" "$@" - return $? - else - return 1 - fi -} +echo '/Emacs|Navigator/ -> +sel' >> $WMII_DIR/tagrules +echo '/Eclipse/ -> +sel' >> $WMII_DIR/tagrules +echo '/panel/ -> /.*/' >> $WMII_DIR/tagrules Event() { event=$1; shift; @@ -107,10 +42,14 @@ Event() { ## WMII-meta events Quit) ## No args - fusermount -u $WMII_DIR - exit $?;; + echo ' ==> Stopping wmiirc' + echo " -> unmounting WMII_DIR=$WMII_DIR..." + # might complain about /etc/mtab if the x server has already stopped + fusermount -u "$WMII_DIR" 2>>/dev/null + echo " -> rmdir'ing WMII_DIR=$WMII_DIR..." + rmdir "$WMII_DIR";; Warning) ## $@=string - notify-send "wmii warning: $@";; + notify-send "wmii warning: $*";; Key) ## $1=keystroke Key "$@";; @@ -171,7 +110,7 @@ Event() { ## Tag events CreateTag) ## $1=tag - echo "$WMII_NORMCOLORS" $@ |a $WMII_DIR/lbar/$1;; + echo "$WMII_NORMCOLORS" $@ |a $WMII_DIR/lbar/$1;; DestroyTag) ## $1=tag rm $WMII_DIR/lbar/$1;; FocusTag) ## $1=tag @@ -264,7 +203,7 @@ Key() { $MODKEY-x) ## Open program menu setsid $(wimenu -h "${hist}.progs" -n 5000 <$progsfile) & ;; $MODKEY-Return) ## Launch a terminal - setsid $WMII_TERM & ;; + setsid x-terminal-emulator & ;; ## Other $MODKEY-Control-t) ## Toggle all other key bindings @@ -293,11 +232,11 @@ Key() { } ## End Key # WM Configuration -echo font $WMII_FONT |a $WMII_DIR/ctl +echo font xft:Monospace-8 |a $WMII_DIR/ctl echo focuscolors $WMII_FOCUSCOLORS |a $WMII_DIR/ctl -echo normcolors $WMII_NORMCOLORS |a $WMII_DIR/ctl -echo grabmod $MODKEY |a $WMII_DIR/ctl -echo border 1 |a $WMII_DIR/ctl +echo normcolors $WMII_NORMCOLORS |a $WMII_DIR/ctl +echo grabmod $MODKEY |a $WMII_DIR/ctl +echo border 1 |a $WMII_DIR/ctl xsetroot -solid "$WMII_BACKGROUND" & progsfile=$WMII_NAMESPACE/.proglist @@ -319,7 +258,13 @@ done Action autostart 2>/dev/null & +if [ -f "`conffile wmiirc_local`" ]; then + . "`conffile wmiirc_local`" +fi + +trap "Event Quit" EXIT + # use wmiir so it doesn't look like an open file -wmiir read /event | while read event; do +wmiir read /event 2>/dev/null | while read event; do Event $event done diff --git a/.wmii/wmiirc_local b/.wmii/wmiirc_local new file mode 100644 index 0000000..1bcff2c --- /dev/null +++ b/.wmii/wmiirc_local @@ -0,0 +1,6 @@ +#!/bin/bash this is included, not executed + +#Action rbar_cpu 01 & +#Action rbar_wifi 97 & +Action rbar_battery 98 & +Action rbar_clock 99 & @@ -11,7 +11,7 @@ if [ -d /etc/X11/xinit/xinitrc.d ]; then [ -x "$f" ] && "$f" & done unset f - echo ' -> done' + echo ' -> done' fi usermodmap="$HOME/.xmodmap" diff --git a/.xmodmap b/.xmodmap new file mode 100644 index 0000000..e4ade24 --- /dev/null +++ b/.xmodmap @@ -0,0 +1,7 @@ +remove lock = Caps_Lock +keysym Caps_Lock = Super_L + +keycode 135 = Super_R + +clear mod4 +add mod4 = Super_L Super_R Hyper_L Hyper_R Menu |