From 2d34aa1498b04f0128d58cace1f5a275d74bdfe5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 26 Aug 2012 15:30:06 -0400 Subject: add .wicd/ --- .wicd/CLIENT_CURSES_WARNING | 6 ++++++ .wicd/WHEREAREMYFILES | 1 + 2 files changed, 7 insertions(+) create mode 100644 .wicd/CLIENT_CURSES_WARNING create mode 120000 .wicd/WHEREAREMYFILES diff --git a/.wicd/CLIENT_CURSES_WARNING b/.wicd/CLIENT_CURSES_WARNING new file mode 100644 index 0000000..c98f13a --- /dev/null +++ b/.wicd/CLIENT_CURSES_WARNING @@ -0,0 +1,6 @@ +The wicd-client script checks for the existence of this file to determine +whether it should warn the user before launching wicd-curses instead, in +the event of the gui client being launched outside of the X Window environment. + +If you delete this file, then wicd-client will print the warning if it is +launched outside of X (and then recreate this file again). diff --git a/.wicd/WHEREAREMYFILES b/.wicd/WHEREAREMYFILES new file mode 120000 index 0000000..5e06b02 --- /dev/null +++ b/.wicd/WHEREAREMYFILES @@ -0,0 +1 @@ +/var/lib/wicd/WHEREAREMYFILES \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 1557b290b98286d8c44ea066b64cc0910eecc0f7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 24 Sep 2012 13:24:08 -0400 Subject: .profile: only set java.io.tmpdir if $TMPDIR is set --- .profile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.profile b/.profile index c2fbf49..2e2e1d0 100644 --- a/.profile +++ b/.profile @@ -42,7 +42,9 @@ _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" +if [ -n "$TMPDIR" ]; then + _JAVA_OPTIONS+=" -Djava.io.tmpdir=$TMPDIR" +fi export _JAVA_OPTIONS # ALSA -- cgit v1.2.3-54-g00ecf From 34a6c23f99988a75729b04880824b8d79d1391a2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 10 Oct 2012 01:20:24 -0400 Subject: Use XDG for bash, remove alsa, clean up bash & profile, add CACHEDIR.TAG .profile: fix up --- .bash.d/emacs.sh | 8 --- .bash_aliases | 66 ------------------------- .bash_login | 1 + .bash_logout | 10 +--- .bashrc | 121 +-------------------------------------------- .config/bash/aliases.sh | 59 ++++++++++++++++++++++ .config/bash/login.sh | 9 ++++ .config/bash/logout.sh | 9 ++++ .config/bash/rc.d/emacs.sh | 8 +++ .config/bash/rc.sh | 80 ++++++++++++++++++++++++++++++ .git.info.exclude | 107 --------------------------------------- .git.info.exclude.in | 108 ++++++++++++++++++++++++++++++++++++++++ .login-daemons | 10 ---- .profile | 74 ++++++++++++++------------- Makefile | 9 ++-- 15 files changed, 319 insertions(+), 360 deletions(-) delete mode 100644 .bash.d/emacs.sh delete mode 100644 .bash_aliases create mode 120000 .bash_login mode change 100644 => 120000 .bash_logout mode change 100644 => 120000 .bashrc create mode 100644 .config/bash/aliases.sh create mode 100644 .config/bash/login.sh create mode 100644 .config/bash/logout.sh create mode 100644 .config/bash/rc.d/emacs.sh create mode 100644 .config/bash/rc.sh delete mode 100644 .git.info.exclude create mode 100644 .git.info.exclude.in delete mode 100644 .login-daemons diff --git a/.bash.d/emacs.sh b/.bash.d/emacs.sh deleted file mode 100644 index f484bbb..0000000 --- a/.bash.d/emacs.sh +++ /dev/null @@ -1,8 +0,0 @@ -case "$TERM" in - eterm*) - SELECTED_EDITOR='emacsclient' - EDITOR=$SELECTED_EDITOR - VISUAL=$SELECTED_EDITOR - export SELECTED_EDITOR EDITOR VISUAL - :;; -esac diff --git a/.bash_aliases b/.bash_aliases deleted file mode 100644 index de1a321..0000000 --- a/.bash_aliases +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# The above line probably should never be *used* in this file, but it -# lets text editors know that this is BASH syntax. - -###################################################################### -# Set up colors and settings for ls/dir/vdir # -###################################################################### -if [ -x "`which dircolors`" ]; then - eval "`dircolors -b`" - alias ls='ls -1v --color=auto' - alias dir='dir -v --color=auto' - alias vdir='vdir -v--color=auto' - - for xgrep in ${PATH//:/\/*grep }/*grep; do - if [ -f "$xgrep" ]; then - xgrep=`basename "$xgrep"` - if [ "$xgrep" != pgrep ]; then - alias $xgrep="$xgrep --color=auto" - fi - fi - done -else - alias ls='ls -1v' - alias dir='dir -v' - alias vdir='vdir -v' -fi - -###################################################################### -# Set up the standard aliases for ls # -###################################################################### -alias ll='ls -l' -alias la='ls -a' -alias l='ls -CF' - -###################################################################### -# Some preferences for miscellaneous stuff # -###################################################################### -#alias rm='gvfs-trash' -alias ssh='ssh -XC' -alias sed='sed --follow-symlinks' -alias tree='tree --charset utf8' -alias cd=pushd -alias gitk='gitk --all --date-order' - -###################################################################### -# Remember lat/long for redshift # -###################################################################### -redshift='redshift -l39.9030:85.9979' -alias gtk-redshift="gtk-$redshift" -alias redshift="$redshift" - -###################################################################### -# Some almost-function aliases # -###################################################################### -#alias serva='ssh luke@servb.ath.cx -p3440' -#alias phpdoctor='php /usr/gnu/www/0-other/phpdoctor-head/phpdoc.php' -function xterm-title () { echo "];$@"; } # Oh, wait this one *is* a function -alias lock="clear; away -C 'This terminal is locked'" -alias plock="xterm-title Terminal Locked;lock" - -###################################################################### -# Other # -###################################################################### -case "$TERM" in - eterm*) alias editor='editor -n';; -esac diff --git a/.bash_login b/.bash_login new file mode 120000 index 0000000..31231da --- /dev/null +++ b/.bash_login @@ -0,0 +1 @@ +.config/bash/login.sh \ No newline at end of file diff --git a/.bash_logout b/.bash_logout deleted file mode 100644 index a8b88c1..0000000 --- a/.bash_logout +++ /dev/null @@ -1,9 +0,0 @@ -# ~/.bash_logout: executed by bash(1) when login shell exits. - -# when leaving the console clear the screen to increase privacy - -if [ "$SHLVL" = 1 ]; then - [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q -fi - -make -C "$HOME" diff --git a/.bash_logout b/.bash_logout new file mode 120000 index 0000000..d8117ff --- /dev/null +++ b/.bash_logout @@ -0,0 +1 @@ +.config/bash/logout.sh \ No newline at end of file diff --git a/.bashrc b/.bashrc deleted file mode 100644 index ff11c5b..0000000 --- a/.bashrc +++ /dev/null @@ -1,120 +0,0 @@ -# ~/.bashrc: executed by bash(1) for non-login shells. -# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) -# for examples - -# I include this file for all interactive invocations of bash(1), whether -# they are login shells or not. - -# If not running interactively, don't do anything -[ -z "$PS1" ] && return - -# don't put duplicate lines in the history. See bash(1) for more options -# don't overwrite GNU Midnight Commander's setting of `ignorespace'. -export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups -# ... or force ignoredups and ignorespace -export HISTCONTROL=ignoreboth - -# append to the history file, don't overwrite it -shopt -s histappend - -# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) - -# check the window size after each command and, if necessary, -# update the values of LINES and COLUMNS. -shopt -s checkwinsize - -# Let ** recursively scan directories -shopt -s globstar - -# Why is this not on by default? -# "We have a cached value, but it isn't valid anymore. Should we trash it?" -shopt -s checkhash - -# make less more friendly for non-text input files, see lesspipe(1) -[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" - -# set variable identifying the chroot you work in (used in the prompt below) -if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then - debian_chroot=$(cat /etc/debian_chroot) -fi - -case "$TERM" in - xterm) export TERM=xterm-256color;; -esac - -# set a fancy prompt (non-color, unless we know we "want" color) -case "$TERM" in - linux) color_prompt=yes;; - *-*color*) color_prompt=yes;; -esac - -# uncomment for a colored prompt, if the terminal has the capability; turned -# off by default to not distract the user: the focus in a terminal window -# should be on the output of commands, not on the prompt -#force_color_prompt=yes - -if [ -n "$force_color_prompt" ]; then - if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then - # We have color support; assume it's compliant with Ecma-48 - # (ISO/IEC-6429). (Lack of such support is extremely rare, and such - # a case would tend to support setf rather than setaf.) - color_prompt=yes - else - color_prompt= - fi -fi - -if [ "$color_prompt" = yes ]; then - PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\n\$ ' -else - PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\n\$ ' -fi -unset color_prompt force_color_prompt - -# If this is an xterm set the title to user@host:dir -case "$TERM" in -xterm*|rxvt*) - PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" - ;; -*) - ;; -esac - -# Include modular config files -if [ -d ~/.bash.d ]; then - for file in ~/.bash.d/*.sh; do - . $file; - done -fi - -# Alias definitions. -# You may want to put all your additions into a separate file like -# ~/.bash_aliases, instead of adding them here directly. -# See /usr/share/doc/bash-doc/examples in the bash-doc package. - -if [ -f ~/.bash_aliases ]; then - . ~/.bash_aliases -fi - -# enable programmable completion features (you don't need to enable -# this, if it's already enabled in /etc/bash.bashrc and /etc/profile -# sources /etc/bash.bashrc). -if [ -f /etc/bash_completion ]; then - . /etc/bash_completion -fi - -if [ -f "$HOME/.login-daemons" ]; then - . "$HOME/.login-daemons" -fi - -if [ -f "${HOME}/.gnupg/agent-info" ]; then - . "${HOME}/.gnupg/agent-info" - export GPG_AGENT_INFO - #export SSH_AUTH_SOCK -fi - -export PERL_LOCAL_LIB_ROOT="/home/luke/perl5"; -export PERL_MB_OPT="--install_base /home/luke/perl5"; -export PERL_MM_OPT="INSTALL_BASE=/home/luke/perl5"; -export PERL5LIB="/home/luke/perl5/lib/perl5/i686-linux-thread-multi:/home/luke/perl5/lib/perl5"; -export PATH="/home/luke/perl5/bin:$PATH"; diff --git a/.bashrc b/.bashrc new file mode 120000 index 0000000..18faac1 --- /dev/null +++ b/.bashrc @@ -0,0 +1 @@ +.config/bash/rc.sh \ No newline at end of file diff --git a/.config/bash/aliases.sh b/.config/bash/aliases.sh new file mode 100644 index 0000000..8241b95 --- /dev/null +++ b/.config/bash/aliases.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# The above line probably should never be *used* in this file, but it +# lets text editors know that this is BASH syntax. + +###################################################################### +# Set up colors and settings for ls/dir/vdir # +###################################################################### +if [ -x "`which dircolors`" ]; then + eval "`dircolors -b`" + alias ls='ls -1v --color=auto' + alias dir='dir -v --color=auto' + alias vdir='vdir -v--color=auto' + + for xgrep in ${PATH//:/\/*grep }/*grep; do + if [ -f "$xgrep" ]; then + xgrep=`basename "$xgrep"` + if [ "$xgrep" != pgrep ]; then + alias $xgrep="$xgrep --color=auto" + fi + fi + done +else + alias ls='ls -1v' + alias dir='dir -v' + alias vdir='vdir -v' +fi + +###################################################################### +# Set up the standard aliases for ls # +###################################################################### +alias ll='ls -l' +alias la='ls -a' +alias l='ls -CF' + +###################################################################### +# Some preferences for miscellaneous stuff # +###################################################################### +#alias rm='gvfs-trash' +alias ssh='ssh -XC' +alias sed='sed --follow-symlinks' +alias tree='tree --charset utf8' +alias cd=pushd +alias gitk='gitk --all --date-order' + +###################################################################### +# Remember lat/long for redshift # +###################################################################### +redshift='redshift -l39.9030:85.9979' +alias gtk-redshift="gtk-$redshift" +alias redshift="$redshift" +unset redshift + +###################################################################### +# Some almost-function aliases # +###################################################################### +xterm-title() { echo "];$@"; } # Oh, wait this one *is* a function +alias lock="clear; away -C 'This terminal is locked'" +alias plock="xterm-title Terminal Locked;lock" +mvln() { mv $1 $2; ln -s $2 $1; } diff --git a/.config/bash/login.sh b/.config/bash/login.sh new file mode 100644 index 0000000..1269a03 --- /dev/null +++ b/.config/bash/login.sh @@ -0,0 +1,9 @@ +# ~/.bash_login: executed by bash(1) when login shell starts. + +# I think this is sane default behavior + +# Load user settings +. "$HOME/.profile" + +# Load bash settings (automatic for non-login shells) +. "$HOME/.bashrc" diff --git a/.config/bash/logout.sh b/.config/bash/logout.sh new file mode 100644 index 0000000..a8b88c1 --- /dev/null +++ b/.config/bash/logout.sh @@ -0,0 +1,9 @@ +# ~/.bash_logout: executed by bash(1) when login shell exits. + +# when leaving the console clear the screen to increase privacy + +if [ "$SHLVL" = 1 ]; then + [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q +fi + +make -C "$HOME" diff --git a/.config/bash/rc.d/emacs.sh b/.config/bash/rc.d/emacs.sh new file mode 100644 index 0000000..f484bbb --- /dev/null +++ b/.config/bash/rc.d/emacs.sh @@ -0,0 +1,8 @@ +case "$TERM" in + eterm*) + SELECTED_EDITOR='emacsclient' + EDITOR=$SELECTED_EDITOR + VISUAL=$SELECTED_EDITOR + export SELECTED_EDITOR EDITOR VISUAL + :;; +esac diff --git a/.config/bash/rc.sh b/.config/bash/rc.sh new file mode 100644 index 0000000..ed55f75 --- /dev/null +++ b/.config/bash/rc.sh @@ -0,0 +1,80 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# I include this file for all interactive invocations of bash(1), whether +# they are login shells or not. + +# If not running interactively, don't do anything +[ -z "$PS1" ] && return + +# don't put duplicate lines in the history. See bash(1) for more options +export HISTCONTROL=ignoredups +export HISTFILE=${XDG_CACHE_HOME}/bash/history +export HISTTIMEFORMAT='[%Y-%m-%d %H:%M] ' +shopt -s histappend # append to the history file, don't overwrite it + +shopt -s checkwinsize # update the values of LINES and COLUMNS +shopt -s globstar # Let ** recursively scan directories + +# Why is this not on by default? +# "We have a cached value, but it isn't valid anymore. Should we trash it?" +shopt -s checkhash + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x "`which lesspipe 2>/dev/null`" ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +make_prompt() { + local RESET='' + local BOLD='' + local GREEN='' + local BLUE='' + if $1; then + RESET="$(tput sgr0)" + BOLD="$(tput bold)" + GREEN="$(tput setaf 2)" + BLUE="$(tput setaf 4)" + fi + local CHROOT='${debian_chroot:+($debian_chroot)}' + echo "${RESET}${BOLD}${CHROOT}${GREEN}"'\u@\h'"${RESET}:${BOLD}${BLUE}"'\w'"${RESET}" +} + +if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + PS1="$(make_prompt true )"'\n\$ ' +else + PS1="$(make_prompt false)"'\n\$ ' +fi + +# If this is an xterm set the title to user@host:dir +case "$TERM" in + xterm*|rxvt*) + PS1="\[\e]0;$(make_prompt false)\a\]$PS1";; +esac + +unset make_prompt + +# Include modular config files +if [ -d "${XDG_CONFIG_HOME}/rc.d" ]; then + for file in "${XDG_CONFIG_HOME}/rc.d"/*.sh; do + . "$file" + done +fi + +if [ -f ${XDG_CONFIG_HOME}/bash/aliases.sh ]; then + . ${XDG_CONFIG_HOME}/bash/aliases.sh +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if [ -f /etc/bash_completion ]; then + . /etc/bash_completion +fi diff --git a/.git.info.exclude b/.git.info.exclude deleted file mode 100644 index 871ebf6..0000000 --- a/.git.info.exclude +++ /dev/null @@ -1,107 +0,0 @@ -# Defualt to ignoring all files -/* - -# Except dotfiles -!.* - -# Or Makefile -!Makefile - -# Ignore these for privacy -.ssh/* -!.ssh/config -.gnupg/* -!.gnupg/gpg.conf -.netrc - -# Ignore temp/log/history files -*.log -log* - -*.tmp -*.tmp.* -tmp.* -tmp-* -tmp - -*_history -*_hist -history.* -history - -*.lock -.~lock.*# -lock - -*.state -*.cookie -*.bak - -*authority -*cache* - -# Ignore files left by editors -*~ -.#* -\#*# - - -# Ignore these special-purpose cache/temp files -.camel_certs -.compiz/session/* -.config/chromium/Default/History\ Index* -.current.asound -.dbus/session-bus/* -.ddd/sessions -.dvdcss -.esd_auth -.evolution/.* -.gconfd/saved_state -.gnash-media -.gnash/SharedObjects/* -.kde/share/apps/RecentDocuments/* -.kde/socket-* -.kde4/share/apps/RecentDocuments/* -.kde4/share/apps/okular/docdata/* -.kde4/socket-* -.lesshst -.link*/*.his -.local/share/Trash/* -.local/share/gvfs-metadata/* -.local/share/icons/* -.local/share/recently-used.xbel -.pki -.pulse -.pulse-cookie -.recently-used -.recently-used.xbel* -.setroubleshoot -.shotwell/thumbs/* -.sudo_as_admin_successful -.thumbnails/* -.wireshark/recent* -.xsession-errors* - -# Ignore files that are autogenerated -.folders -.nanorc -.config/libretools/blacklist.txt - -# Ignore these files for no good reason -.bogofilter -.config/Trolltech.conf -.config/vlc -.gem -.offlineimap -.prefix -.prefix.* -.terminfo -.wine* - -# Ignore these files that if I tracked them, would be a separate repo -.config/chromium -.config/libreoffice -.config/transmission -.eclipse -.mozilla -.netbeans diff --git a/.git.info.exclude.in b/.git.info.exclude.in new file mode 100644 index 0000000..37c1ee4 --- /dev/null +++ b/.git.info.exclude.in @@ -0,0 +1,108 @@ +# Defualt to ignoring all files +/* + +# Except dotfiles +!.* + +# Or Makefile +!Makefile + +# Ignore these for privacy +.ssh/* +!.ssh/config +.gnupg/* +!.gnupg/gpg.conf +.netrc + +# Ignore temp/log/history files +*.log +log.* + +*.tmp +*.tmp.* +tmp.* +tmp-* +tmp + +*_history +*_hist +history.* +history + +*.lock +.~lock.*# +lock + +*.state +*.cookie +*.bak + +*authority +*cache* + +# Ignore files left by editors +*~ +.#* +\#*# + + +# Ignore these special-purpose cache/temp files +.camel_certs +.compiz/session/* +.config/chromium/Default/History\ Index* +.current.asound +.dbus/session-bus/* +.ddd/sessions +.dvdcss +.esd_auth +.evolution/.* +.gconfd/saved_state +.gnash-media +.gnash/SharedObjects/* +.kde/share/apps/RecentDocuments/* +.kde/socket-* +.kde4/share/apps/RecentDocuments/* +.kde4/share/apps/okular/docdata/* +.kde4/socket-* +.lesshst +.link*/*.his +.local/share/Trash/* +.local/share/gvfs-metadata/* +.local/share/icons/* +.local/share/recently-used.xbel +.pki +.pulse +.pulse-cookie +.recently-used +.recently-used.xbel* +.setroubleshoot +.shotwell/thumbs/* +.sudo_as_admin_successful +.thumbnails/* +.wireshark/recent* +.xsession-errors* + +# Ignore files that are autogenerated +.config/libretools/blacklist.txt +.folders +.git.info.exclude +.nanorc + +# Ignore these files for no good reason +.bogofilter +.config/Trolltech.conf +.config/vlc +.gem +.offlineimap +.prefix +.prefix.* +.terminfo +.wine* + +# Ignore these files that if I tracked them, would be a separate repo +.config/chromium +.config/libreoffice +.config/transmission +.eclipse +.mozilla +.netbeans diff --git a/.login-daemons b/.login-daemons deleted file mode 100644 index bf8cf21..0000000 --- a/.login-daemons +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -if [ -x "`which daemon`" ]; then - daemon maildirproc - daemon gpg-agent --daemon --write-env-file "${HOME}/.gnupg/agent-info" - daemon batterymon 20 " - alsactl restore --file $HOME/.full.asound; - espeak 'PLUG ME IN'; - sleep .2;" -fi diff --git a/.profile b/.profile index 2e2e1d0..a6c4d91 100644 --- a/.profile +++ b/.profile @@ -1,4 +1,8 @@ # ~/.profile: executed by the command interpreter for login shells. +# Should be whether logging in graphically or not. +# +# This file should be executable by /bin/sh, but I'm going to assume bash(1) +# # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login # exists. @@ -9,33 +13,44 @@ umask 022 ## Paths ############################################################# # Unix -bins=$(echo $HOME/bin $HOME/.local.`uname -m`/bin $HOME/.local/bin $HOME/.prefix.`uname -m`/bin $HOME/.prefix/bin $HOME/.gem/ruby/*/bin) -for dir in $bins; do - if [ -d "$dir" ]; then - export PATH="$dir:$PATH" - fi +bins=($HOME/bin $HOME/.local.`uname -m`/bin $HOME/.local/bin $HOME/.prefix.`uname -m`/bin $HOME/.prefix/bin $HOME/.gem/ruby/*/bin) +for dir in "${bins[@]}"; do + if [ -d "$dir" ]; then + export PATH="$dir:$PATH" + fi done # Ruby for dir in $HOME/.prefix/lib; do - if [ -d "$dir" ]; then - export RUBYLIB="$dir" - fi + if [ -d "$dir" ]; then + export RUBYLIB="$dir" + fi done # Settings ########################################################### # Text editor if [ -f "$HOME/.selected_editor" ]; then - . "$HOME/.selected_editor" - export SELECTED_EDITOR - export ALTERNATE_EDITOR - export EDITOR="${EDITOR:-$SELECTED_EDITOR}" - export VISUAL="${VISUAL:-$SELECTED_EDITOR}" + . "$HOME/.selected_editor" + export SELECTED_EDITOR + export ALTERNATE_EDITOR + export EDITOR="${EDITOR:-$SELECTED_EDITOR}" + export VISUAL="${VISUAL:-$SELECTED_EDITOR}" fi # GPG -export GPGKEY=D4FFBFC9 +if [ -z "$GPGKEY" ] && [ -f "${HOME}/.gnupg/gpg.conf" ]; then + export GPGKEY=`sed -nr 's/^\s*default-key\s+//p' "${HOME}/.gnupg/gpg.conf"` +fi +if [ -z "$(pgrep -u `whoami` gpg-agent)" ]; then + mkdir -p ${XDG_RUNTIME_DIR}/sessions/gpg + gpg-agent --daemon --write-env-file "${XDG_RUNTIME_DIR}/sessions/gpg" +fi +if [ -f "${XDG_RUNTIME_DIR}/sessions/gpg" ]; then + . "${XDG_RUNTIME_DIR}/sessions/gpg" + export GPG_AGENT_INFO + #export SSH_AUTH_SOCK +fi # Java _JAVA_OPTIONS='' @@ -43,36 +58,27 @@ _JAVA_OPTIONS+=' -Dawt.useSystemAAFontSettings=on' _JAVA_OPTIONS+=' -Dswing.aatext=true' _JAVA_OPTIONS+=' -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' if [ -n "$TMPDIR" ]; then - _JAVA_OPTIONS+=" -Djava.io.tmpdir=$TMPDIR" + _JAVA_OPTIONS+=" -Djava.io.tmpdir=$TMPDIR" fi export _JAVA_OPTIONS -# ALSA -if [ -x "`which alsactl 2>/dev/null`" ]; then - alsactl restore "$HOME/.current.asound" &> /dev/null || true -fi - # X11 if [ -z "$XAUTHORITY" ]; then - export XAUTHORITY=$HOME/.Xauthority + 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 + # I want a separate instance for each login + #dbus-launch > "${HOME}/.cache/sessions/dbus" + #. "${HOME}/.cache/sessions/dbus" + eval `dbus-launch` -# Start background programs ########################################## -if [ -f "$HOME/.login-daemons" ]; then - . "$HOME/.login-daemons" + export DBUS_SESSION_BUS_ADDRESS + export DBUS_SESSION_BUS_PID fi -# BASH ############################################################### -if [ -n "$BASH_VERSION" ]; then - # include .bashrc if it exists - if [ -f "$HOME/.bashrc" ]; then - . "$HOME/.bashrc" - fi +# Load any box-specific stuff +if [ -f "$HOME/.profile.local" ]; then + . "$HOME/.profile.local" fi diff --git a/Makefile b/Makefile index 3cecf33..160a64c 100644 --- a/Makefile +++ b/Makefile @@ -4,22 +4,19 @@ NANO_BIN_PREFIX = $(patsubst %/bin/nano,%,$(shell which nano)) NANO_CHECK = $(HOME)/.prefix:$(HOME):/usr/local:/usr:$(NANO_BIN_PREFIX) NANO_SHARE = $(firstword $(wildcard $(addsuffix /share/nano,$(subst :, ,$(NANO_CHECK))))) -ALSACTL=$(firstword $(shell . $(HOME)/.profile &>/dev/null; which alsactl) echo) - -targets=.nanorc .folders .crontab.cookie .current.asound +targets=.nanorc .folders .crontab.cookie .git.info.exclude all: $(targets) clean: rm -f $(targets) -%.asound: FORCE - $(ALSACTL) store --file '$@' - .nanorc: .nanorc.in $(NANO_SHARE) cat '$<' > '$@' for file in $(NANO_SHARE)/*.nanorc; do echo "include \"$$file\""; done >> '$@' .folders: Maildir ( echo '..'; find ~/Maildir -maxdepth 2 -type f -name "maildirfolder" -printf '%h\n'|sed -r 's@.*/(.*\.)(.*)@.\1\2@' )|sort>'$@' +.git.info.exclude: .git.info.exclude.in . + ( cat $<; find . -type f -name 'CACHEDIR.TAG' -printf '%h\n'|sed 's@^\./@/@' ) > $@ .crontab.cookie: .crontab .crontab.local -(cat $^; echo) | crontab - 2>/dev/null -- cgit v1.2.3-54-g00ecf From 318568fb6db4981692d7b2abc5e0a42f0907a2b5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 10 Oct 2012 01:21:52 -0400 Subject: wmii: use a connected_to_x_server function --- .wmii/include.sh | 5 +++++ .wmii/rbar_battery | 3 +-- .wmii/rbar_clock | 3 +-- .wmii/rbar_cpu | 3 +-- .wmii/rbar_wifi | 3 +-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.wmii/include.sh b/.wmii/include.sh index 36f8f3e..f4b29b3 100644 --- a/.wmii/include.sh +++ b/.wmii/include.sh @@ -68,3 +68,8 @@ Action() { return 1 fi } + +connected_to_x_server() { + xdpyinfo &>/dev/null + return $? +} diff --git a/.wmii/rbar_battery b/.wmii/rbar_battery index 7a7f24f..0e70799 100755 --- a/.wmii/rbar_battery +++ b/.wmii/rbar_battery @@ -3,8 +3,7 @@ priority=$1 -set -e -while true; do +while connected_to_x_server; do acpi -b |a "$WMII_DIR/rbar/${priority}_battery" sleep 1 done diff --git a/.wmii/rbar_clock b/.wmii/rbar_clock index 8e7d2a4..86bf14d 100755 --- a/.wmii/rbar_clock +++ b/.wmii/rbar_clock @@ -3,8 +3,7 @@ priority=$1 -set -e -while true; do +while connected_to_x_server; do date |a "$WMII_DIR/rbar/${priority}_clock" sleep .5 done diff --git a/.wmii/rbar_cpu b/.wmii/rbar_cpu index 7f891da..d3bdd88 100755 --- a/.wmii/rbar_cpu +++ b/.wmii/rbar_cpu @@ -3,8 +3,7 @@ priority=$1 -set -e -while true; do +while connected_to_x_server; 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 diff --git a/.wmii/rbar_wifi b/.wmii/rbar_wifi index 608b164..2ea84a3 100755 --- a/.wmii/rbar_wifi +++ b/.wmii/rbar_wifi @@ -3,8 +3,7 @@ priority=$1 -set -e -while true; do +while connected_to_x_server; do echo 'Wlan0:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality) |a "$WMII_DIR/rbar/${priority}_wifi" sleep 1 done -- cgit v1.2.3-54-g00ecf From 48c87c85dc219ca3a4ab87a1861dba6d495e5e00 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 10 Oct 2012 01:23:39 -0400 Subject: maildirproc: add Jade's new email address --- .maildirproc/default.rc | 1 + 1 file changed, 1 insertion(+) diff --git a/.maildirproc/default.rc b/.maildirproc/default.rc index 71bc00c..c2ad6f2 100644 --- a/.maildirproc/default.rc +++ b/.maildirproc/default.rc @@ -165,6 +165,7 @@ def my_filters(mail): for address in [ "justicejade10@aol.com", "parsonsjade@aol.com", + "parsonstjade@gmail.com", ]: if mail["From"].contains(address): mail.move(".misc.Jade") -- cgit v1.2.3-54-g00ecf From 65cf2b407744320091f3bd1a1de0dee73992bd8c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 10 Oct 2012 01:32:35 -0400 Subject: symlink .kde4/share/{apps,config} to .config --- .git.info.exclude.in | 6 +++--- .kde | 1 + .kde4/share/apps | 1 + .kde4/share/config | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) create mode 120000 .kde create mode 120000 .kde4/share/apps create mode 120000 .kde4/share/config diff --git a/.git.info.exclude.in b/.git.info.exclude.in index 37c1ee4..fe97ec8 100644 --- a/.git.info.exclude.in +++ b/.git.info.exclude.in @@ -17,6 +17,7 @@ # Ignore temp/log/history files *.log log.* +log *.tmp *.tmp.* @@ -49,7 +50,9 @@ lock # Ignore these special-purpose cache/temp files .camel_certs .compiz/session/* +.config/RecentDocuments/* .config/chromium/Default/History\ Index* +.config/okular/docdata/* .current.asound .dbus/session-bus/* .ddd/sessions @@ -59,10 +62,7 @@ lock .gconfd/saved_state .gnash-media .gnash/SharedObjects/* -.kde/share/apps/RecentDocuments/* .kde/socket-* -.kde4/share/apps/RecentDocuments/* -.kde4/share/apps/okular/docdata/* .kde4/socket-* .lesshst .link*/*.his diff --git a/.kde b/.kde new file mode 120000 index 0000000..e604d30 --- /dev/null +++ b/.kde @@ -0,0 +1 @@ +.kde4 \ No newline at end of file diff --git a/.kde4/share/apps b/.kde4/share/apps new file mode 120000 index 0000000..7f8f949 --- /dev/null +++ b/.kde4/share/apps @@ -0,0 +1 @@ +../../.config \ No newline at end of file diff --git a/.kde4/share/config b/.kde4/share/config new file mode 120000 index 0000000..7f8f949 --- /dev/null +++ b/.kde4/share/config @@ -0,0 +1 @@ +../../.config \ No newline at end of file -- cgit v1.2.3-54-g00ecf From c13b6347ac065da59e8645479a37005fd3fb412d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 10 Oct 2012 01:33:02 -0400 Subject: ditch ConsoleKit in .xinitrc --- .xinitrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.xinitrc b/.xinitrc index 9c5ce55..bfc352b 100644 --- a/.xinitrc +++ b/.xinitrc @@ -23,4 +23,4 @@ fi # exec startkde # exec startxfce4 # ...or the Window Manager of your choice -exec ck-launch-session wmii +exec wmii -- cgit v1.2.3-54-g00ecf From e1127837281b134f3b141c2e417c0fb1dc4562ac Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 15 Oct 2012 20:12:20 -0400 Subject: ditch wicd --- .wicd/WHEREAREMYFILES | 1 - 1 file changed, 1 deletion(-) delete mode 120000 .wicd/WHEREAREMYFILES diff --git a/.wicd/WHEREAREMYFILES b/.wicd/WHEREAREMYFILES deleted file mode 120000 index 5e06b02..0000000 --- a/.wicd/WHEREAREMYFILES +++ /dev/null @@ -1 +0,0 @@ -/var/lib/wicd/WHEREAREMYFILES \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 281adcda20ee3b0d65a416dfb0d6a0d1413dc1be Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 15 Oct 2012 20:13:58 -0400 Subject: move the X11 config files to .config/X11, add a serverrc file remove extra newline from .config/X11/login --- .Xdefaults | 19 +------------------ .config/X11/clientrc | 27 +++++++++++++++++++++++++++ .config/X11/defaults | 18 ++++++++++++++++++ .config/X11/login | 9 +++++++++ .config/X11/modmap | 7 +++++++ .config/X11/serverrc | 6 ++++++ .xinitrc | 27 +-------------------------- .xserverrc | 1 + .xsession | 11 +---------- 9 files changed, 71 insertions(+), 54 deletions(-) mode change 100644 => 120000 .Xdefaults create mode 100644 .config/X11/clientrc create mode 100644 .config/X11/defaults create mode 100644 .config/X11/login create mode 100644 .config/X11/modmap create mode 100644 .config/X11/serverrc mode change 100644 => 120000 .xinitrc create mode 120000 .xserverrc mode change 100644 => 120000 .xsession diff --git a/.Xdefaults b/.Xdefaults deleted file mode 100644 index ceabc5c..0000000 --- a/.Xdefaults +++ /dev/null @@ -1,18 +0,0 @@ -URxvt.background: #000000 -URxvt.foreground: #CCCCCC - -URxvt.scrollstyle: plain -URxvt.scrollBar_floating: true - -URxvt.font: xft:Monospace-8 -URxvt.cursorBlink: true -URxvt.termName: xterm-256color -URxvt.pastableTabs: true - -URxvt.scrollTtyOutput: false -URxvt.scrollTtyKeypress: false -URxvt.scrollWithBuffer: true - -URxvt.perl-ext-common: default,matcher -URxvt.urlLauncher: v-www-browser -URxvt.matcher.button: 1 diff --git a/.Xdefaults b/.Xdefaults new file mode 120000 index 0000000..7588317 --- /dev/null +++ b/.Xdefaults @@ -0,0 +1 @@ +.config/X11/defaults \ No newline at end of file diff --git a/.config/X11/clientrc b/.config/X11/clientrc new file mode 100644 index 0000000..d1e1725 --- /dev/null +++ b/.config/X11/clientrc @@ -0,0 +1,27 @@ +#!/bin/sh +# +# ~/.xinitrc +# +# Executed by startx (run your window manager from here) + +if [ -d /etc/X11/xinit/xinitrc.d ]; then + echo ' ==> Running scripts in Entering xinitrc.d/*' + for f in /etc/X11/xinit/xinitrc.d/*; do + echo " -> $f" + [ -x "$f" ] && "$f" & + done + unset f + echo ' -> done' +fi + +usermodmap="$XDG_CONFIG_HOME/X11/modmap" +if [ -f "$usermodmap" ]; then + xmodmap "$usermodmap" +fi + +# exec gnome-session +# exec startkde +# exec startxfce4 +# ...or the Window Manager of your choice +#export WMII_CONFPATH="$XDG_CONFIG_HOME/wmii" +exec wmii diff --git a/.config/X11/defaults b/.config/X11/defaults new file mode 100644 index 0000000..ceabc5c --- /dev/null +++ b/.config/X11/defaults @@ -0,0 +1,18 @@ +URxvt.background: #000000 +URxvt.foreground: #CCCCCC + +URxvt.scrollstyle: plain +URxvt.scrollBar_floating: true + +URxvt.font: xft:Monospace-8 +URxvt.cursorBlink: true +URxvt.termName: xterm-256color +URxvt.pastableTabs: true + +URxvt.scrollTtyOutput: false +URxvt.scrollTtyKeypress: false +URxvt.scrollWithBuffer: true + +URxvt.perl-ext-common: default,matcher +URxvt.urlLauncher: v-www-browser +URxvt.matcher.button: 1 diff --git a/.config/X11/login b/.config/X11/login new file mode 100644 index 0000000..03bad2a --- /dev/null +++ b/.config/X11/login @@ -0,0 +1,9 @@ +#!/bin/sh + +# +# ~/.xsession +# +# Executed by xdm/gdm/kdm at login +# + +/bin/bash --login -i ~/.xinitrc diff --git a/.config/X11/modmap b/.config/X11/modmap new file mode 100644 index 0000000..e4ade24 --- /dev/null +++ b/.config/X11/modmap @@ -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 diff --git a/.config/X11/serverrc b/.config/X11/serverrc new file mode 100644 index 0000000..d6c6ffc --- /dev/null +++ b/.config/X11/serverrc @@ -0,0 +1,6 @@ +#!/bin/bash + +VT=vt07 +#VT=$(tty|sed 's@/dev/tty@vt@') + +exec /usr/bin/X -nolisten tcp "$VT" "$@" diff --git a/.xinitrc b/.xinitrc deleted file mode 100644 index bfc352b..0000000 --- a/.xinitrc +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# -# ~/.xinitrc -# -# Executed by startx (run your window manager from here) - -if [ -d /etc/X11/xinit/xinitrc.d ]; then - echo ' ==> Running scripts in Entering xinitrc.d/*' - for f in /etc/X11/xinit/xinitrc.d/*; do - echo " -> $f" - [ -x "$f" ] && "$f" & - done - unset f - echo ' -> done' -fi - -usermodmap="$HOME/.xmodmap" -if [ -f "$usermodmap" ]; then - xmodmap "$usermodmap" -fi - -# exec gnome-session -# exec startkde -# exec startxfce4 -# ...or the Window Manager of your choice -exec wmii diff --git a/.xinitrc b/.xinitrc new file mode 120000 index 0000000..c0f7e1c --- /dev/null +++ b/.xinitrc @@ -0,0 +1 @@ +.config/X11/clientrc \ No newline at end of file diff --git a/.xserverrc b/.xserverrc new file mode 120000 index 0000000..f46e3e3 --- /dev/null +++ b/.xserverrc @@ -0,0 +1 @@ +.config/X11/serverrc \ No newline at end of file diff --git a/.xsession b/.xsession deleted file mode 100644 index a16dc0b..0000000 --- a/.xsession +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# -# ~/.xsession -# -# Executed by xdm/gdm/kdm at login -# - -/bin/bash --login -i ~/.xinitrc - diff --git a/.xsession b/.xsession new file mode 120000 index 0000000..ee16887 --- /dev/null +++ b/.xsession @@ -0,0 +1 @@ +.config/X11/login \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 8f6fe81e1db6e1d95a4eb0ef303491b4aadf44c1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 10 Oct 2012 01:54:40 -0400 Subject: remove superfluous lines from .git.info.exclude.in --- .git.info.exclude.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/.git.info.exclude.in b/.git.info.exclude.in index fe97ec8..612ecf2 100644 --- a/.git.info.exclude.in +++ b/.git.info.exclude.in @@ -53,10 +53,8 @@ lock .config/RecentDocuments/* .config/chromium/Default/History\ Index* .config/okular/docdata/* -.current.asound .dbus/session-bus/* .ddd/sessions -.dvdcss .esd_auth .evolution/.* .gconfd/saved_state -- cgit v1.2.3-54-g00ecf From 4493d30ac4c747b08b2107a440084245a9157bd4 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 15 Oct 2012 12:48:36 -0400 Subject: wmii: use 9mount --- .wmii/include.sh | 2 +- .wmii/wmiirc | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.wmii/include.sh b/.wmii/include.sh index f4b29b3..29d4d67 100644 --- a/.wmii/include.sh +++ b/.wmii/include.sh @@ -4,7 +4,7 @@ if [ -z "$WMII_NAMESPACE" ]; then export WMII_NAMESPACE=`wmiir namespace` fi if [ -z "$WMII_DIR" ]; then - export WMII_DIR=$WMII_NAMESPACE/mnt + export WMII_DIR="$HOME/n/wmii" fi # a -- a work-around for buggy IO append in 9pfuse diff --git a/.wmii/wmiirc b/.wmii/wmiirc index 92adb8b..8d77394 100755 --- a/.wmii/wmiirc +++ b/.wmii/wmiirc @@ -5,9 +5,8 @@ wmiir xwrite /event Start . "$HOME/.wmii/include.sh" echo ' ==> Starting wmiirc' -mount9p=/opt/plan9/bin/9pfuse -mkdir -p $WMII_NAMESPACE/mnt -$mount9p $WMII_NAMESPACE/{wmii,mnt} +mkdir -p "$WMII_DIR" +9mount -i "unix!$WMII_NAMESPACE/wmii" "$WMII_DIR" MODKEY=Mod4 # super UP=p @@ -45,7 +44,7 @@ Event() { 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 + 9umount "$WMII_DIR" echo " -> rmdir'ing WMII_DIR=$WMII_DIR..." rmdir "$WMII_DIR" exit;; -- cgit v1.2.3-54-g00ecf From f5f19ca8e8d46ba1087f8531e2309ac392c24112 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 15 Oct 2012 14:33:31 -0400 Subject: wmii: phase out wmiir --- .wmii/include.sh | 37 ++++++++++++------------ .wmii/quit | 2 +- .wmii/rbar_battery | 2 +- .wmii/rbar_clock | 2 +- .wmii/rbar_cpu | 4 +-- .wmii/rbar_wifi | 2 +- .wmii/wmiirc | 84 +++++++++++++++++++++++------------------------------- 7 files changed, 61 insertions(+), 72 deletions(-) diff --git a/.wmii/include.sh b/.wmii/include.sh index 29d4d67..b1ec901 100644 --- a/.wmii/include.sh +++ b/.wmii/include.sh @@ -7,20 +7,22 @@ if [ -z "$WMII_DIR" ]; then export WMII_DIR="$HOME/n/wmii" 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 +# Linux's 9p kernel module sometimes omits entries in directory listings +unalias ls 2>/dev/null +ls() { + real_ls="`which ls` -1F" + [ $# = 0 ] && set -- "`pwd`" + case $# in + 1) + f="${1/#${WMII_DIR}/}" + if [ "$f" = "$1" ]; then + $real_ls "$f" + else + wmiir ls "$f" + fi + ;; + *) $real_ls "$f";; + esac } # I like wmiir's setsid better than linux-utils' @@ -37,9 +39,8 @@ path_which() { PATH="$mypath" "$which" -- "$prog" 2>/dev/null } - lstags() { - ls $WMII_DIR/tag | sed '/^sel$/d' + ls $WMII_DIR/tag | sed -e 's@/@@' -e '/^sel$/d' } scansection() { @@ -70,6 +71,6 @@ Action() { } connected_to_x_server() { - xdpyinfo &>/dev/null - return $? + xdpyinfo &>/dev/null + return $? } diff --git a/.wmii/quit b/.wmii/quit index 54f64e7..876a60e 100755 --- a/.wmii/quit +++ b/.wmii/quit @@ -1,3 +1,3 @@ #!/bin/bash . "$HOME/.wmii/include.sh" -echo quit |a $WMII_DIR/ctl +echo quit >> $WMII_DIR/ctl diff --git a/.wmii/rbar_battery b/.wmii/rbar_battery index 0e70799..ae8980a 100755 --- a/.wmii/rbar_battery +++ b/.wmii/rbar_battery @@ -4,6 +4,6 @@ priority=$1 while connected_to_x_server; do - acpi -b |a "$WMII_DIR/rbar/${priority}_battery" + acpi -b >> "$WMII_DIR/rbar/${priority}_battery" sleep 1 done diff --git a/.wmii/rbar_clock b/.wmii/rbar_clock index 86bf14d..18c4493 100755 --- a/.wmii/rbar_clock +++ b/.wmii/rbar_clock @@ -4,6 +4,6 @@ priority=$1 while connected_to_x_server; do - date |a "$WMII_DIR/rbar/${priority}_clock" + date >> "$WMII_DIR/rbar/${priority}_clock" sleep .5 done diff --git a/.wmii/rbar_cpu b/.wmii/rbar_cpu index d3bdd88..22da985 100755 --- a/.wmii/rbar_cpu +++ b/.wmii/rbar_cpu @@ -5,8 +5,8 @@ priority=$1 while connected_to_x_server; 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" + #echo -n 'Core MHz:' $(cat /proc/cpuinfo | grep 'cpu MHz' | sed 's/.*: //g; s/\..*//g;') >> "$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" + echo 'CPU: [ '$(tail -n3 ~/tmp/cputime|sed -ur 's/\s\s+/\t/g'|cut -f2,11|sed 's/\t\(.*\)/(\1)/')' ]' >> "$WMII_DIR/rbar/${priority}_cpu" sleep 1 done diff --git a/.wmii/rbar_wifi b/.wmii/rbar_wifi index 2ea84a3..2ada834 100755 --- a/.wmii/rbar_wifi +++ b/.wmii/rbar_wifi @@ -4,6 +4,6 @@ priority=$1 while connected_to_x_server; do - echo 'Wlan0:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality) |a "$WMII_DIR/rbar/${priority}_wifi" + echo 'Wlan0:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality) >> "$WMII_DIR/rbar/${priority}_wifi" sleep 1 done diff --git a/.wmii/wmiirc b/.wmii/wmiirc index 8d77394..1e88128 100755 --- a/.wmii/wmiirc +++ b/.wmii/wmiirc @@ -84,9 +84,9 @@ Event() { { case `wmii9menu Delete Fullscreen` in Delete) - echo kill |a $WMII_DIR/client/$client/ctl;; + echo kill >> $WMII_DIR/client/$client/ctl;; Fullscreen) - echo Fullscreen on |a $WMII_DIR/client/$1/ctl;; + echo Fullscreen on >> $WMII_DIR/client/$1/ctl;; esac }& ;; esac;; @@ -101,7 +101,7 @@ Event() { resp=$(wihack -transient $client \ xmessage -nearmouse -buttons Kill,Wait -print "$msg") if [ "$resp" = Kill ]; then - echo slay |a $WMII_DIR/client/$client/ctl + echo slay >> $WMII_DIR/client/$client/ctl fi }& ;; Fullscreen) ## $1=client $2=[on|off] @@ -110,24 +110,24 @@ Event() { ## Tag events CreateTag) ## $1=tag - echo "$WMII_NORMCOLORS" $@ |a $WMII_DIR/lbar/$1;; + echo "$WMII_NORMCOLORS" $@ >> $WMII_DIR/lbar/$1;; DestroyTag) ## $1=tag rm $WMII_DIR/lbar/$1;; FocusTag) ## $1=tag - echo "$WMII_FOCUSCOLORS" $1 |a $WMII_DIR/lbar/$1;; + echo "$WMII_FOCUSCOLORS" $1 >> $WMII_DIR/lbar/$1;; UnfocusTag) ## $1=tag - echo "$WMII_NORMCOLORS" $1 |a $WMII_DIR/lbar/$1;; + echo "$WMII_NORMCOLORS" $1 >> $WMII_DIR/lbar/$1;; UrgentTag) ## $1=tag $2=[Manager|Client] - echo "$WMII_URGENTCOLORS" $1 |a $WMII_DIR/lbar/$1;; + echo "$WMII_URGENTCOLORS" $1 >> $WMII_DIR/lbar/$1;; NotUrgentTag) ## $1=tag $2=[Manager|Client] - echo "$WMII_NORMCOLORS" $1 |a $WMII_DIR/lbar/$1;; + echo "$WMII_NORMCOLORS" $1 >> $WMII_DIR/lbar/$1;; ## LeftBar events (usually tag buttons) LeftBarMouseDown) ## $1=button $2=bar_item ;; LeftBarClick) ## $1=button $2=bar_item shift # ignore the button - echo view "$@" |a $WMII_DIR/ctl;; + echo view "$@" >> $WMII_DIR/ctl;; LeftMouseDND) ## $1=button $2=bar_item Event LeftBarClick "$@";; @@ -152,50 +152,49 @@ Key() { ## Moving around $MODKEY-$LEFT) ## Select the client to the left - echo select left |a $WMII_DIR/tag/sel/ctl;; + echo select left >> $WMII_DIR/tag/sel/ctl;; $MODKEY-$RIGHT) ## Select the client to the right - echo select right |a $WMII_DIR/tag/sel/ctl;; + echo select right >> $WMII_DIR/tag/sel/ctl;; $MODKEY-$UP) ## Select the client above - echo select up |a $WMII_DIR/tag/sel/ctl;; + echo select up >> $WMII_DIR/tag/sel/ctl;; $MODKEY-$DOWN) ## Select the client below - echo select down |a $WMII_DIR/tag/sel/ctl;; + echo select down >> $WMII_DIR/tag/sel/ctl;; $MODKEY-space) ## Toggle between floating and managed layers - echo select toggle |a $WMII_DIR/tag/sel/ctl;; + echo select toggle >> $WMII_DIR/tag/sel/ctl;; ## Moving clients around $MODKEY-Shift-$LEFT) ## Move selected client to the left - wmiir xwrite /tag/sel/ctl send sel left;; + echo send sel left >> $WMII_DIR/tag/sel/ctl;; $MODKEY-Shift-$RIGHT) ## Move selected client to the right - wmiir xwrite /tag/sel/ctl send sel right;; + echo send sel right >> $WMII_DIR/tag/sel/ctl;; $MODKEY-Shift-$UP) ## Move selected client up - wmiir xwrite /tag/sel/ctl send sel up;; + echo send sel up >> $WMII_DIR/tag/sel/ctl;; $MODKEY-Shift-$DOWN) ## Move selected client down - wmiir xwrite /tag/sel/ctl send sel down;; - + echo send sel down >> $WMII_DIR/tag/sel/ctl;; $MODKEY-Shift-space) ## Toggle selected client between floating and managed layers - wmiir xwrite /tag/sel/ctl send sel toggle;; + echo send sel toggle >> $WMII_DIR/tag/sel/ctl;; ## Moving through stacks $MODKEY-Control-$UP) ## Select the stack above - wmiir xwrite /tag/sel/ctl select up stack;; - $MODKEY-Control-$DOWN) # Select the stack below - wmiir xwrite /tag/sel/ctl select down stack;; + echo select up stack >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-Control-$DOWN) ## Select the stack below + echo select down stack >> $WMII_DIR/tag/sel/ctl;; ## Client actions $MODKEY-shift-1) ## Toggle selected client's fullsceen state - wmiir xwrite /client/sel/ctl Fullscreen toggle;; + echo Fullscreen toggle >> $WMII_DIR/client/sel/ctl;; $MODKEY-shift-0) ## Close client - wmiir xwrite /client/sel/ctl kill;; + echo kill >> $WMII_DIR/client/sel/ctl;; ## Changing column modes $MODKEY-d) ## Set column to default mode - wmiir xwrite /tag/sel/ctl colmode sel default-max;; + echo colmode sel default-max >> $WMII_DIR/tag/sel/ctl;; $MODKEY-s) ## Set column to stack mode - wmiir xwrite /tag/sel/ctl colmode sel stack-max;; + echo colmode sel stack-max >> $WMII_DIR/tag/sel/ctl;; $MODKEY-m) ## Set column to max mode - wmiir xwrite /tag/sel/ctl colmode sel stack+max;; + echo colmode sel stack+max >> $WMII_DIR/tag/sel/ctl;; ## Running programs $MODKEY-a) ## Open wmii actions menu @@ -205,44 +204,33 @@ Key() { $MODKEY-Return) ## Launch a terminal setsid x-terminal-emulator & ;; - ## Other - $MODKEY-Control-t) ## Toggle all other key bindings - case $(wmiir read /keys | wc -l | tr -d ' \t\n') in - 0|1) - echo -n "$Keys" | wmiir write /keys - wmiir xwrite /ctl grabmod $MODKEY;; - *) - wmiir xwrite /keys $MODKEY-Control-t - wmiir xwrite /ctl grabmod Mod3;; - esac;; - ## Tag actions $MODKEY-t) ## Change to another tag { tag=$(lstags | wimenu -h "${hist}.tags" -n 50) || return - wmiir xwrite /ctl view $tag + echo view $tag >> $WMII_DIR/ctl }& ;; $MODKEY-Shift-t) ## Retag the selected client sel=$(sed 1q $WMII_DIR/client/sel/ctl) { tag=$(lstags | wimenu -h "${hist}.tags" -n 50) || return - wmiir xwrite /client/$sel/tags "$tag" + echo "$tag" >> $WMII_DIR/client/$sel/tags }& ;; esac } ## End Key # WM Configuration -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 font xft:Monospace-8 >> $WMII_DIR/ctl +echo focuscolors $WMII_FOCUSCOLORS >> $WMII_DIR/ctl +echo normcolors $WMII_NORMCOLORS >> $WMII_DIR/ctl +echo grabmod $MODKEY >> $WMII_DIR/ctl +echo border 1 >> $WMII_DIR/ctl xsetroot -solid "$WMII_BACKGROUND" & progsfile=$WMII_NAMESPACE/.proglist path_ls $PATH > $progsfile & -eval arg `scansection Key|cut -sf2` |a $WMII_DIR/keys +eval arg `scansection Key|cut -sf2` >> $WMII_DIR/keys # Clear the LBar find $WMII_DIR/lbar -type f -delete @@ -265,6 +253,6 @@ fi trap "Event Quit" EXIT # use wmiir so it doesn't look like an open file -wmiir read /event 2>/dev/null | while read event; do +wmiir read /event | while read event; do Event $event done -- cgit v1.2.3-54-g00ecf From fdb7a68bec32153e696a440d2e7795c8e4b58e08 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 15 Oct 2012 20:18:49 -0400 Subject: make .wmii/autostart a profile-local --- .wmii/autostart | 4 ---- 1 file changed, 4 deletions(-) delete mode 100755 .wmii/autostart diff --git a/.wmii/autostart b/.wmii/autostart deleted file mode 100755 index aae23f4..0000000 --- a/.wmii/autostart +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -daemon lxpanel &> /dev/null -daemon wicd-client -t &> /dev/null -daemon notifyd &> /dev/null -- cgit v1.2.3-54-g00ecf From 4414160a4cce0080f3f2b33f9e7a7583c77c7062 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 15 Oct 2012 17:36:00 -0400 Subject: wmii: refactor --- .wmii/config.sh | 242 +++++++++++++++++++++++++++++++++++++++++++++++++++ .wmii/ctl-init | 5 ++ .wmii/fixes.sh | 24 ++++++ .wmii/include.sh | 71 ++------------- .wmii/tagrules | 3 + .wmii/util.sh | 121 ++++++++++++++++++++++++++ .wmii/wmiirc | 257 ++----------------------------------------------------- 7 files changed, 408 insertions(+), 315 deletions(-) create mode 100644 .wmii/config.sh create mode 100644 .wmii/ctl-init create mode 100644 .wmii/fixes.sh create mode 100644 .wmii/tagrules create mode 100644 .wmii/util.sh diff --git a/.wmii/config.sh b/.wmii/config.sh new file mode 100644 index 0000000..abe378f --- /dev/null +++ b/.wmii/config.sh @@ -0,0 +1,242 @@ +#!/bin/bash + +MODKEY=Mod4 # "super" +UP=p +DOWN=n +LEFT=b +RIGHT=f + +# Colors tuples: " " +. `conffile theme-solarized-dark` + +Event() { + event=$1; shift; + case "$event" in + ## Mouse event meanings: + ## MouseDown = mouse down + ## Click = mouse up + ## DND = hover, while dragging something (Drag 'n' Drop) + ## The associated mouse button is always "1" + ## + ## Mouse-button IDs: + ## 1 = left + ## 2 = middle + ## 3 = right + + ## Custom (non-WMII-generated) events + WmiircStart) ## No args + echo ' ==> Starting wmiirc' + 9umount "$WMII_DIR" &>/dev/null # just in case + mkdir -p "$WMII_DIR" + 9mount -i "unix!$WMII_NAMESPACE/wmii" "$WMII_DIR" + + # Configure wmii + < "`conffile tagrules`" expand_variables >> $WMII_DIR/tagrules + < "`conffile ctl-init`" expand_variables >> $WMII_DIR/ctl + scansection Key|cut -sf2 >> $WMII_DIR/keys + # Configure X11 + xsetroot -solid "$WMII_BACKGROUND" + + # Generate dynamic files + path_ls $PATH > $progsfile + + # Clear the LBar and RBar + find $WMII_DIR/{l,r}bar -type f -delete + # Populate the LBar by emulating [Create|Focus]Tag events + seltag=`sed 1q $WMII_DIR/tag/sel/ctl` + lstags | while read tag; do + Event CreateTag "$tag" + if [ "$tag" = "$seltag" ]; then + Event FocusTag "$tag" + fi + done + + # Run the autostart action + Action autostart 2>/dev/null & + ;; + WmiircQuit) ## No args + Event Quit;; + ## WMII-meta events + Quit) ## No args + echo ' ==> Stopping wmiirc' + echo " -> unmounting WMII_DIR=$WMII_DIR..." + 9umount "$WMII_DIR" + echo " -> rmdir'ing WMII_DIR=$WMII_DIR..." + rmdir "$WMII_DIR" + exit;; + Warning) ## $@=string + notify-send "wmii warning: $*";; + Key) ## $1=keystroke + Key "$@";; + + ## WMII Window management events + FocusFloating) ## No args + ;; + AreaFocus) ## $1=area + ;; + DestroyArea) ## $1=area + ;; + ColumnFocus) ## $1=column + ;; + CreateColumn) ## $1=column + ;; + + ## Client events + CreateClient) ## $1=client + ;; + DestroyClient) ## $1=client + ;; + Urgent) ## $1=client $2=[Manager|Client] + ;; + NotUrgent) ## $1=client $2=[Manager|Client] + ;; + ClientMouseDown) ## $1=client $2=button + client=$1 + button=$2 + case $button in + 1) ;; + 2) ;; + 3) + { + case `wmii9menu Delete Fullscreen` in + Delete) + echo kill >> $WMII_DIR/client/$client/ctl;; + Fullscreen) + echo Fullscreen on >> $WMII_DIR/client/$1/ctl;; + esac + }& ;; + esac;; + ClientClick) ## $1=client $2=button + ;; + Unresponsive) ## $1=client + client=$1 + client_name=`cat $WMII_DIR/client/$client/label` + msg="The client \`${client_name}' is not responding." + msg+=" What would you like to do?" + { + resp=$(wihack -transient $client \ + xmessage -nearmouse -buttons Kill,Wait -print "$msg") + if [ "$resp" = Kill ]; then + echo slay >> $WMII_DIR/client/$client/ctl + fi + }& ;; + Fullscreen) ## $1=client $2=[on|off] + # TODO: hide any clients with the 'panel' class + ;; + + ## Tag events + CreateTag) ## $1=tag + echo "$WMII_NORMCOLORS" $@ >> $WMII_DIR/lbar/$1;; + DestroyTag) ## $1=tag + rm $WMII_DIR/lbar/$1;; + FocusTag) ## $1=tag + echo "$WMII_FOCUSCOLORS" $1 >> $WMII_DIR/lbar/$1;; + UnfocusTag) ## $1=tag + echo "$WMII_NORMCOLORS" $1 >> $WMII_DIR/lbar/$1;; + UrgentTag) ## $1=tag $2=[Manager|Client] + echo "$WMII_URGENTCOLORS" $1 >> $WMII_DIR/lbar/$1;; + NotUrgentTag) ## $1=tag $2=[Manager|Client] + echo "$WMII_NORMCOLORS" $1 >> $WMII_DIR/lbar/$1;; + + ## LeftBar events (usually tag buttons) + LeftBarMouseDown) ## $1=button $2=bar_item + ;; + LeftBarClick) ## $1=button $2=bar_item + shift # ignore the button + echo view "$@" >> $WMII_DIR/ctl;; + LeftMouseDND) ## $1=button $2=bar_item + Event LeftBarClick "$@";; + + ## RightBar events + RightBarMouseDown) ## $1=button $2=bar_item + ;; + RightBarClick) ## $1=button $2=bar_item + ;; + RightMouseDND) ## $1=button $2=bar_item + Event RightBarClick "$@";; + esac +} ## End Event + +# Key Bindings +Key() { + key=$1 + case "$key" in + ## Moving around + + $MODKEY-$LEFT) ## Select the client to the left + echo select left >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-$RIGHT) ## Select the client to the right + echo select right >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-$UP) ## Select the client above + echo select up >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-$DOWN) ## Select the client below + echo select down >> $WMII_DIR/tag/sel/ctl;; + + $MODKEY-space) ## Toggle between floating and managed layers + echo select toggle >> $WMII_DIR/tag/sel/ctl;; + + ## Moving clients around + + $MODKEY-Shift-$LEFT) ## Move selected client to the left + echo send sel left >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-Shift-$RIGHT) ## Move selected client to the right + echo send sel right >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-Shift-$UP) ## Move selected client up + echo send sel up >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-Shift-$DOWN) ## Move selected client down + echo send sel down >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-Shift-space) ## Toggle selected client between floating and managed layers + echo send sel toggle >> $WMII_DIR/tag/sel/ctl;; + + ## Moving through stacks + $MODKEY-Control-$UP) ## Select the stack above + echo select up stack >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-Control-$DOWN) ## Select the stack below + echo select down stack >> $WMII_DIR/tag/sel/ctl;; + + ## Client actions + $MODKEY-shift-1) ## Toggle selected client's fullsceen state + echo Fullscreen toggle >> $WMII_DIR/client/sel/ctl;; + $MODKEY-shift-0) ## Close client + echo kill >> $WMII_DIR/client/sel/ctl;; + + ## Changing column modes + $MODKEY-d) ## Set column to default mode + echo colmode sel default-max >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-s) ## Set column to stack mode + echo colmode sel stack-max >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-m) ## Set column to max mode + echo colmode sel stack+max >> $WMII_DIR/tag/sel/ctl;; + + ## Running programs + $MODKEY-a) ## Open wmii actions menu + Action $(path_ls $WMII_CONFPATH | wimenu -h "${hist}.actions" -n 5000) & ;; + $MODKEY-x) ## Open program menu + setsid $(wimenu -h "${hist}.progs" -n 5000 <$progsfile) & ;; + $MODKEY-Return) ## Launch a terminal + setsid x-terminal-emulator & ;; + + ## Tag actions + $MODKEY-t) ## Change to another tag + { + tag=$(lstags | wimenu -h "${hist}.tags" -n 50) || return + echo view $tag >> $WMII_DIR/ctl + }& ;; + $MODKEY-Shift-t) ## Retag the selected client + sel=$(sed 1q $WMII_DIR/client/sel/ctl) + { + tag=$(lstags | wimenu -h "${hist}.tags" -n 50) || return + echo "$tag" >> $WMII_DIR/client/$sel/tags + }& ;; + esac +} ## End Key + +Action() { + prog=`path_which "$WMII_CONFPATH" $1`; shift + if [ -n "$prog" ]; then + "$prog" "$@" + return $? + else + return 1 + fi +} ## End Action diff --git a/.wmii/ctl-init b/.wmii/ctl-init new file mode 100644 index 0000000..026c0d5 --- /dev/null +++ b/.wmii/ctl-init @@ -0,0 +1,5 @@ +font xft:Monospace-8 +focuscolors $WMII_FOCUSCOLORS +normcolors $WMII_NORMCOLORS +grabmod $MODKEY +border 1 diff --git a/.wmii/fixes.sh b/.wmii/fixes.sh new file mode 100644 index 0000000..6e1f38b --- /dev/null +++ b/.wmii/fixes.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Fix various deficiencies in either the shell or the filesystem + +## +# Usage: ls DIRECTORY +# Linux's 9p kernel module sometimes omits entries in directory listings +## +unalias ls 2>/dev/null +ls() { + real_ls="`which ls` -1F" + [ $# = 0 ] && set -- "`pwd`" + f="${1/#${WMII_DIR}/}" + if [ "$f" = "$1" ]; then + $real_ls "$f" + else + wmiir ls "$f" + fi +} + +## +# Usage: setsid cmd [arguments...] +# I like wmiir's setsid better than linux-utils' +## +setsid() { wmiir setsid "$@"; } diff --git a/.wmii/include.sh b/.wmii/include.sh index b1ec901..43855e6 100644 --- a/.wmii/include.sh +++ b/.wmii/include.sh @@ -1,76 +1,15 @@ #!/bin/bash if [ -z "$WMII_NAMESPACE" ]; then - export WMII_NAMESPACE=`wmiir namespace` + export WMII_NAMESPACE="`wmiir namespace`" fi if [ -z "$WMII_DIR" ]; then export WMII_DIR="$HOME/n/wmii" fi -# Linux's 9p kernel module sometimes omits entries in directory listings -unalias ls 2>/dev/null -ls() { - real_ls="`which ls` -1F" - [ $# = 0 ] && set -- "`pwd`" - case $# in - 1) - f="${1/#${WMII_DIR}/}" - if [ "$f" = "$1" ]; then - $real_ls "$f" - else - wmiir ls "$f" - fi - ;; - *) $real_ls "$f";; - esac -} +. "$HOME/.wmii/util.sh" -# I like wmiir's setsid better than linux-utils' -setsid() { wmiir setsid "$@"; } +hist="`conffile history`" +progsfile=$WMII_NAMESPACE/.proglist -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 -e 's@/@@' -e '/^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 -} - -connected_to_x_server() { - xdpyinfo &>/dev/null - return $? -} +. "$HOME/.wmii/config.sh" diff --git a/.wmii/tagrules b/.wmii/tagrules new file mode 100644 index 0000000..990151f --- /dev/null +++ b/.wmii/tagrules @@ -0,0 +1,3 @@ +/Emacs|Navigator/ -> +sel +/Eclipse/ -> +sel +/panel/ -> /.*/ diff --git a/.wmii/util.sh b/.wmii/util.sh new file mode 100644 index 0000000..3234783 --- /dev/null +++ b/.wmii/util.sh @@ -0,0 +1,121 @@ +#!/bin/bash + +# I moved "fixes" into a separate file because it isn't so much configuration... +. "$HOME/.wmii/fixes.sh" + +################################################################################ +# Added shell features # +################################################################################ + +## +# Usage: dquote STRING +# Safely double-quotes a string. +# It escapes ways to execute code, but not variables. +## +dquote() { + str=$1 + str="${str//\\/\\\\}" # backslash + str="${str//\"/\\\"}" # dquote + str="${str//\$(/\\\$(}" # $(...) + str="${str//\`/\\\`}" # backtick + printf '"%s"\n' "$str" +} + +## +# Usage: expand_variables +# Expands variables read from /dev/stdin +## +expand_variables() { + while read; do + eval printf "'%s\n'" "$(dquote "$REPLY")" + done +} + +################################################################################ +# PATH manipulation # +################################################################################ + +## +# Usage: path_ls PATH +# List executables in PATH (PATH is delimited by `:') +## +path_ls() { + dirs="`echo "$@"|sed 'y/:/ /'`" + find -L $dirs -maxdepth 1 -type f -executable -printf '%f\n' 2>/dev/null | sort -u +} + +## +# Usage: path_which PATH PROGRAM +# Find the full path of PROGRAM by searching PATH +## +path_which() { + mypath=$1 + prog=$2 + which=`which which` + PATH="$mypath" "$which" -- "$prog" 2>/dev/null +} + +################################################################################ +# wmii convenience functions # +################################################################################ + +## +# Usage: lstags +# Lists wmii tags +## +lstags() { + ls $WMII_DIR/tag | sed -e 's@/@@' -e '/^sel$/d' +} + +################################################################################ +# X11 functions # +################################################################################ + +## +# Usage: connected_to_x_server +# Return status indicates whether there is an X server at $DISPLAY +## +connected_to_x_server() { + xdpyinfo &>/dev/null + return $? +} + +################################################################################ +# My wmii configuration # +################################################################################ + +## +# Usage: scansection [SECTION] +# Reads the doc comments from a section of wmiirc. +# If SECTION is not given, it reads all doc comments. +## +scansection() { + file=`conffile config.sh` + sec=$1 + tmp=`mktemp` + # Isolate the sections we want. + if [ -n "$sec" ]; then + # Find the section + < "$file" sed -n "/^\s*$sec\s*()/,/##\s*End $sec/p" | sed '1d;$d'> $tmp + else + # Remove extra lines that mark the end of a section + < "$file" sed "/\s*}\s*##\s*End\s/d" > $tmp + fi + < $tmp sed -n '/##/p' | while read; do + var="$(echo "$REPLY" | sed -nr 's/^\s*(.*)\)\s*##.*/\1/p')" + comment="$(echo "$REPLY" | sed -r 's/.*## ?//')" + if [ -z "$var" ]; then + printf '%s\n' "$comment" + else + printf '\t%s\t%s\n' "$(echo "$var"|expand_variables)" "$comment" + fi + done + rm $tmp +} + +## +# Usage: conffile FILE +## +conffile() { + echo "$HOME/.wmii/$@" +} diff --git a/.wmii/wmiirc b/.wmii/wmiirc index 1e88128..c513cd1 100755 --- a/.wmii/wmiirc +++ b/.wmii/wmiirc @@ -1,258 +1,17 @@ #!/bin/bash -# Let any running instances of wmiirc know that we're starting -wmiir xwrite /event Start - . "$HOME/.wmii/include.sh" -echo ' ==> Starting wmiirc' -mkdir -p "$WMII_DIR" -9mount -i "unix!$WMII_NAMESPACE/wmii" "$WMII_DIR" - -MODKEY=Mod4 # super -UP=p -DOWN=n -LEFT=b -RIGHT=f - -# Colors tuples: " " -. `conffile theme-solarized-dark` - -# Menu history -hist="`conffile history`" - -# Tagging Rules -echo '/Emacs|Navigator/ -> +sel' >> $WMII_DIR/tagrules -echo '/Eclipse/ -> +sel' >> $WMII_DIR/tagrules -echo '/panel/ -> /.*/' >> $WMII_DIR/tagrules - -Event() { - event=$1; shift; - case "$event" in - ## Mouse event meanings: - ## MouseDown = mouse down - ## Click = mouse up - ## DND = hover, while dragging something (Drag 'n' Drop) - ## The associated mouse button is always "1" - ## - ## Mouse-button IDs: - ## 1 = left - ## 2 = middle - ## 3 = right - - ## WMII-meta events - Quit) ## No args - echo ' ==> Stopping wmiirc' - echo " -> unmounting WMII_DIR=$WMII_DIR..." - # might complain about /etc/mtab if the x server has already stopped - 9umount "$WMII_DIR" - echo " -> rmdir'ing WMII_DIR=$WMII_DIR..." - rmdir "$WMII_DIR" - exit;; - Warning) ## $@=string - notify-send "wmii warning: $*";; - Key) ## $1=keystroke - Key "$@";; - - ## WMII Window management events - FocusFloating) ## No args - ;; - AreaFocus) ## $1=area - ;; - DestroyArea) ## $1=area - ;; - ColumnFocus) ## $1=column - ;; - CreateColumn) ## $1=column - ;; - - ## Client events - CreateClient) ## $1=client - ;; - DestroyClient) ## $1=client - ;; - Urgent) ## $1=client $2=[Manager|Client] - ;; - NotUrgent) ## $1=client $2=[Manager|Client] - ;; - ClientMouseDown) ## $1=client $2=button - client=$1 - button=$2 - case $button in - 1) ;; - 2) ;; - 3) - { - case `wmii9menu Delete Fullscreen` in - Delete) - echo kill >> $WMII_DIR/client/$client/ctl;; - Fullscreen) - echo Fullscreen on >> $WMII_DIR/client/$1/ctl;; - esac - }& ;; - esac;; - ClientClick) ## $1=client $2=button - ;; - Unresponsive) ## $1=client - client=$1 - client_name=`cat $WMII_DIR/client/$client/label` - msg="The client \`${client_name}' is not responding." - msg+=" What would you like to do?" - { - resp=$(wihack -transient $client \ - xmessage -nearmouse -buttons Kill,Wait -print "$msg") - if [ "$resp" = Kill ]; then - echo slay >> $WMII_DIR/client/$client/ctl - fi - }& ;; - Fullscreen) ## $1=client $2=[on|off] - # TODO: hide any clients with the 'panel' class - ;; - - ## Tag events - CreateTag) ## $1=tag - echo "$WMII_NORMCOLORS" $@ >> $WMII_DIR/lbar/$1;; - DestroyTag) ## $1=tag - rm $WMII_DIR/lbar/$1;; - FocusTag) ## $1=tag - echo "$WMII_FOCUSCOLORS" $1 >> $WMII_DIR/lbar/$1;; - UnfocusTag) ## $1=tag - echo "$WMII_NORMCOLORS" $1 >> $WMII_DIR/lbar/$1;; - UrgentTag) ## $1=tag $2=[Manager|Client] - echo "$WMII_URGENTCOLORS" $1 >> $WMII_DIR/lbar/$1;; - NotUrgentTag) ## $1=tag $2=[Manager|Client] - echo "$WMII_NORMCOLORS" $1 >> $WMII_DIR/lbar/$1;; - - ## LeftBar events (usually tag buttons) - LeftBarMouseDown) ## $1=button $2=bar_item - ;; - LeftBarClick) ## $1=button $2=bar_item - shift # ignore the button - echo view "$@" >> $WMII_DIR/ctl;; - LeftMouseDND) ## $1=button $2=bar_item - Event LeftBarClick "$@";; - - ## RightBar events - RightBarMouseDown) ## $1=button $2=bar_item - ;; - RightBarClick) ## $1=button $2=bar_item - ;; - RightMouseDND) ## $1=button $2=bar_item - Event RightBarClick "$@";; - - ## Custom (non-WMII-generated) events - Start) ## No args - Event Quit;; # get out of the way for a new event loop - esac -} ## End Event - -# Key Bindings -Key() { - key=$1 - case "$key" in - ## Moving around - - $MODKEY-$LEFT) ## Select the client to the left - echo select left >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-$RIGHT) ## Select the client to the right - echo select right >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-$UP) ## Select the client above - echo select up >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-$DOWN) ## Select the client below - echo select down >> $WMII_DIR/tag/sel/ctl;; - - $MODKEY-space) ## Toggle between floating and managed layers - echo select toggle >> $WMII_DIR/tag/sel/ctl;; - - ## Moving clients around - - $MODKEY-Shift-$LEFT) ## Move selected client to the left - echo send sel left >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-Shift-$RIGHT) ## Move selected client to the right - echo send sel right >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-Shift-$UP) ## Move selected client up - echo send sel up >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-Shift-$DOWN) ## Move selected client down - echo send sel down >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-Shift-space) ## Toggle selected client between floating and managed layers - echo send sel toggle >> $WMII_DIR/tag/sel/ctl;; - - ## Moving through stacks - $MODKEY-Control-$UP) ## Select the stack above - echo select up stack >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-Control-$DOWN) ## Select the stack below - echo select down stack >> $WMII_DIR/tag/sel/ctl;; - - ## Client actions - $MODKEY-shift-1) ## Toggle selected client's fullsceen state - echo Fullscreen toggle >> $WMII_DIR/client/sel/ctl;; - $MODKEY-shift-0) ## Close client - echo kill >> $WMII_DIR/client/sel/ctl;; - - ## Changing column modes - $MODKEY-d) ## Set column to default mode - echo colmode sel default-max >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-s) ## Set column to stack mode - echo colmode sel stack-max >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-m) ## Set column to max mode - echo colmode sel stack+max >> $WMII_DIR/tag/sel/ctl;; - - ## Running programs - $MODKEY-a) ## Open wmii actions menu - Action $(path_ls $WMII_CONFPATH | wimenu -h "${hist}.actions" -n 5000) & ;; - $MODKEY-x) ## Open program menu - setsid $(wimenu -h "${hist}.progs" -n 5000 <$progsfile) & ;; - $MODKEY-Return) ## Launch a terminal - setsid x-terminal-emulator & ;; - - ## Tag actions - $MODKEY-t) ## Change to another tag - { - tag=$(lstags | wimenu -h "${hist}.tags" -n 50) || return - echo view $tag >> $WMII_DIR/ctl - }& ;; - $MODKEY-Shift-t) ## Retag the selected client - sel=$(sed 1q $WMII_DIR/client/sel/ctl) - { - tag=$(lstags | wimenu -h "${hist}.tags" -n 50) || return - echo "$tag" >> $WMII_DIR/client/$sel/tags - }& ;; - esac -} ## End Key - -# WM Configuration -echo font xft:Monospace-8 >> $WMII_DIR/ctl -echo focuscolors $WMII_FOCUSCOLORS >> $WMII_DIR/ctl -echo normcolors $WMII_NORMCOLORS >> $WMII_DIR/ctl -echo grabmod $MODKEY >> $WMII_DIR/ctl -echo border 1 >> $WMII_DIR/ctl -xsetroot -solid "$WMII_BACKGROUND" & - -progsfile=$WMII_NAMESPACE/.proglist -path_ls $PATH > $progsfile & - -eval arg `scansection Key|cut -sf2` >> $WMII_DIR/keys - -# Clear the LBar -find $WMII_DIR/lbar -type f -delete - -# Emulate [Create|Focus]Tag events -seltag=`sed 1q $WMII_DIR/tag/sel/ctl` -lstags | while read tag; do - Event CreateTag "$tag" - if [ "$tag" = "$seltag" ]; then - Event FocusTag "$tag" - fi -done - -Action autostart 2>/dev/null & +# Let any running instances of wmiirc know that we're starting +PIDFILE=$WMII_NAMESPACE/.wmii.pid +echo $$ > $PIDFILE -if [ -f "`conffile wmiirc_local`" ]; then - . "`conffile wmiirc_local`" -fi +Event WmiircStart trap "Event Quit" EXIT # use wmiir so it doesn't look like an open file -wmiir read /event | while read event; do - Event $event +wmiir read /event 2>/dev/null | while read event; do + [[ $$ = $(cat $PIDFILE) ]] && Event $event done + +Event WmiircQuit -- cgit v1.2.3-54-g00ecf From 8996d931f15ae50bbae47bbafbd950fc420d2428 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 15 Oct 2012 17:38:06 -0400 Subject: wmii: add help-events and help-keys actions --- .wmii/help-events | 3 +++ .wmii/help-keys | 3 +++ 2 files changed, 6 insertions(+) create mode 100755 .wmii/help-events create mode 100755 .wmii/help-keys diff --git a/.wmii/help-events b/.wmii/help-events new file mode 100755 index 0000000..25b7d41 --- /dev/null +++ b/.wmii/help-events @@ -0,0 +1,3 @@ +#!/bin/bash +. "$HOME/.wmii/include.sh" +scansection Event | xmessage -file - diff --git a/.wmii/help-keys b/.wmii/help-keys new file mode 100755 index 0000000..c6e7038 --- /dev/null +++ b/.wmii/help-keys @@ -0,0 +1,3 @@ +#!/bin/bash +. "$HOME/.wmii/include.sh" +scansection Key | xmessage -file - -- cgit v1.2.3-54-g00ecf From 198455ac623054f46b4da3fec040fb7cb0494ce1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 15 Oct 2012 18:58:09 -0400 Subject: wmii: clean up a vew variables --- .wmii/config.sh | 13 ++++++------- .wmii/include.sh | 4 ---- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.wmii/config.sh b/.wmii/config.sh index abe378f..58217fa 100644 --- a/.wmii/config.sh +++ b/.wmii/config.sh @@ -6,6 +6,8 @@ DOWN=n LEFT=b RIGHT=f +HIST="`conffile history`" + # Colors tuples: " " . `conffile theme-solarized-dark` @@ -37,9 +39,6 @@ Event() { # Configure X11 xsetroot -solid "$WMII_BACKGROUND" - # Generate dynamic files - path_ls $PATH > $progsfile - # Clear the LBar and RBar find $WMII_DIR/{l,r}bar -type f -delete # Populate the LBar by emulating [Create|Focus]Tag events @@ -210,22 +209,22 @@ Key() { ## Running programs $MODKEY-a) ## Open wmii actions menu - Action $(path_ls $WMII_CONFPATH | wimenu -h "${hist}.actions" -n 5000) & ;; + Action $(path_ls $WMII_CONFPATH | wimenu -h "${HIST}.actions" -n 5000) & ;; $MODKEY-x) ## Open program menu - setsid $(wimenu -h "${hist}.progs" -n 5000 <$progsfile) & ;; + setsid $(path_ls $PATH | wimenu -h "${HIST}.progs" -n 5000) & ;; $MODKEY-Return) ## Launch a terminal setsid x-terminal-emulator & ;; ## Tag actions $MODKEY-t) ## Change to another tag { - tag=$(lstags | wimenu -h "${hist}.tags" -n 50) || return + tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return echo view $tag >> $WMII_DIR/ctl }& ;; $MODKEY-Shift-t) ## Retag the selected client sel=$(sed 1q $WMII_DIR/client/sel/ctl) { - tag=$(lstags | wimenu -h "${hist}.tags" -n 50) || return + tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return echo "$tag" >> $WMII_DIR/client/$sel/tags }& ;; esac diff --git a/.wmii/include.sh b/.wmii/include.sh index 43855e6..d4e58c3 100644 --- a/.wmii/include.sh +++ b/.wmii/include.sh @@ -8,8 +8,4 @@ if [ -z "$WMII_DIR" ]; then fi . "$HOME/.wmii/util.sh" - -hist="`conffile history`" -progsfile=$WMII_NAMESPACE/.proglist - . "$HOME/.wmii/config.sh" -- cgit v1.2.3-54-g00ecf From b18a02654e2c8b4a91f7c97352b75464e24c6edb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 15 Oct 2012 18:59:31 -0400 Subject: wmii: redo the mount/unmount and quit code --- .wmii/config.sh | 28 ++++++++++++++++++---------- .wmii/util.sh | 7 +++++++ .wmii/wmiirc | 9 ++------- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/.wmii/config.sh b/.wmii/config.sh index 58217fa..4c2da38 100644 --- a/.wmii/config.sh +++ b/.wmii/config.sh @@ -28,9 +28,8 @@ Event() { ## Custom (non-WMII-generated) events WmiircStart) ## No args echo ' ==> Starting wmiirc' - 9umount "$WMII_DIR" &>/dev/null # just in case - mkdir -p "$WMII_DIR" - 9mount -i "unix!$WMII_NAMESPACE/wmii" "$WMII_DIR" + is_mounted $WMII_DIR && Event WmiircUnmount + Event WmiircMount # Configure wmii < "`conffile tagrules`" expand_variables >> $WMII_DIR/tagrules @@ -54,15 +53,24 @@ Event() { Action autostart 2>/dev/null & ;; WmiircQuit) ## No args - Event Quit;; - ## WMII-meta events - Quit) ## No args echo ' ==> Stopping wmiirc' - echo " -> unmounting WMII_DIR=$WMII_DIR..." - 9umount "$WMII_DIR" - echo " -> rmdir'ing WMII_DIR=$WMII_DIR..." - rmdir "$WMII_DIR" exit;; + WmiircMount) ## No args + echo " -> Creating mountpoint WMII_DIR=$WMII_DIR..." + mkdir -p "$WMII_DIR" + echo " -> Mounting WMII_DIR=$WMII_DIR..." + 9mount -i "unix!$WMII_NAMESPACE/wmii" "$WMII_DIR";; + WmiircUnmount) ## No args + echo " -> Unmounting WMII_DIR=$WMII_DIR..." + 9umount "$WMII_DIR" + echo " -> Removing mountpoint WMII_DIR=$WMII_DIR..." + rmdir "$WMII_DIR";; + ## WMII-meta events + Quit) ## No args + echo ' ==> wmii quit: unmounting' + trap - EXIT + Event WmiircUnmount + Event WmiircQuit;; Warning) ## $@=string notify-send "wmii warning: $*";; Key) ## $1=keystroke diff --git a/.wmii/util.sh b/.wmii/util.sh index 3234783..43d7d4a 100644 --- a/.wmii/util.sh +++ b/.wmii/util.sh @@ -31,6 +31,13 @@ expand_variables() { done } +is_mounted() { + dir="$(readlink -m $1)" + mntpnt="$(cut -d' ' -f2 /proc/mounts|grep -- "$dir")" + [[ $dir = "$mntpnt" ]] + return $? +} + ################################################################################ # PATH manipulation # ################################################################################ diff --git a/.wmii/wmiirc b/.wmii/wmiirc index c513cd1..1f1ea18 100755 --- a/.wmii/wmiirc +++ b/.wmii/wmiirc @@ -1,17 +1,12 @@ #!/bin/bash . "$HOME/.wmii/include.sh" -# Let any running instances of wmiirc know that we're starting -PIDFILE=$WMII_NAMESPACE/.wmii.pid -echo $$ > $PIDFILE +wmiir xwrite /event WmiircQuit # close any existing wmiirc's Event WmiircStart trap "Event Quit" EXIT -# use wmiir so it doesn't look like an open file wmiir read /event 2>/dev/null | while read event; do - [[ $$ = $(cat $PIDFILE) ]] && Event $event + Event $event done - -Event WmiircQuit -- cgit v1.2.3-54-g00ecf From 3515a46d330af1d09bf1e0b963c13a86c2dbe8a8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 15 Oct 2012 18:59:51 -0400 Subject: wmii: touch up --- .wmii/config.sh | 2 +- .wmii/fixes.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.wmii/config.sh b/.wmii/config.sh index 4c2da38..1dac0ad 100644 --- a/.wmii/config.sh +++ b/.wmii/config.sh @@ -34,7 +34,7 @@ Event() { # Configure wmii < "`conffile tagrules`" expand_variables >> $WMII_DIR/tagrules < "`conffile ctl-init`" expand_variables >> $WMII_DIR/ctl - scansection Key|cut -sf2 >> $WMII_DIR/keys + scansection Key | cut -sf2 >> $WMII_DIR/keys # Configure X11 xsetroot -solid "$WMII_BACKGROUND" diff --git a/.wmii/fixes.sh b/.wmii/fixes.sh index 6e1f38b..aa09157 100644 --- a/.wmii/fixes.sh +++ b/.wmii/fixes.sh @@ -5,7 +5,7 @@ # Usage: ls DIRECTORY # Linux's 9p kernel module sometimes omits entries in directory listings ## -unalias ls 2>/dev/null +unalias ls &>/dev/null ls() { real_ls="`which ls` -1F" [ $# = 0 ] && set -- "`pwd`" -- cgit v1.2.3-54-g00ecf From f05b2b29bc7e0273af1e39ef310d5b09f8ea3dbc Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 15 Oct 2012 19:42:03 -0400 Subject: add .profile.local --- .profile.local | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .profile.local diff --git a/.profile.local b/.profile.local new file mode 100644 index 0000000..3bb0d5c --- /dev/null +++ b/.profile.local @@ -0,0 +1,11 @@ +#!/bin/sh + +# Start background programs ########################################## +if [ -x "`which daemon`" ]; then + daemon maildirproc + daemon batterymon 20 " + pactl set-sink-volume 0 100%; + pactl set-sink-mute 0 0; + espeak 'PLUG ME IN'; + sleep .2;" +fi -- cgit v1.2.3-54-g00ecf From abf3957398b2f97ed64c798fc4411b3b50f3880f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 26 Oct 2012 00:22:58 -0400 Subject: consolidate the .local/bin/x-* program-picking code into a `pick` command --- .local/bin/pick | 38 ++++++++++++++++++++++++++++++++++++++ .local/bin/x-pdf | 9 ++------- .local/bin/x-terminal-emulator | 12 +++--------- .local/bin/x-www-browser | 14 ++------------ 4 files changed, 45 insertions(+), 28 deletions(-) create mode 100755 .local/bin/pick diff --git a/.local/bin/pick b/.local/bin/pick new file mode 100755 index 0000000..ed2d44d --- /dev/null +++ b/.local/bin/pick @@ -0,0 +1,38 @@ +#!/bin/bash + +cmd=${0##*/} + +if [[ $1 = -h ]]; then + echo "Usage: $cmd PROG1 PROG2 PROG3..." + echo " $cmd -s PROG1 PROG2 PROG3..." + echo "" + echo "If \`-s' ISN'T given, print the first program name given that is" + echo "found in PATH." + echo "" + echo "If \`-s' IS given, print the first program name given that is" + echo "currently running. If no match is found, fall back to default" + echo "behavior." + exit 0 +fi + +if [[ $1 = -s ]]; then + shift + # Scan to find a running instance + for prog in "$@"; do + if [[ -n "`pgrep $prog`" ]]; then + printf '%s\n' "$prog" + exit 0 + fi + done +fi + +# Scan to find one that is installed +for prog in "$@"; do + if [[ -x "`which $prog 2>/dev/null`" ]]; then + printf '%s\n' "$prog" + exit 0 + fi +done + +printf '%s\n' "$cmd: no suitable program found" +exit 1 diff --git a/.local/bin/x-pdf b/.local/bin/x-pdf index a9893c0..1b23a3d 100755 --- a/.local/bin/x-pdf +++ b/.local/bin/x-pdf @@ -1,9 +1,4 @@ #!/bin/sh -if [ -x "`which okular 2>/dev/null`" ]; then - okular "$@" -elif [ -x "`which evince 2>/dev/null`" ]; then - evince "$@" -elif [ -x "`which xpdf 2>/dev/null`" ]; then - xpdf "$@" -fi +`pick evince okular xpdf` "$@" +exit $? diff --git a/.local/bin/x-terminal-emulator b/.local/bin/x-terminal-emulator index f7290b4..049b081 100755 --- a/.local/bin/x-terminal-emulator +++ b/.local/bin/x-terminal-emulator @@ -1,10 +1,4 @@ #!/bin/sh -if [ -x "`which emacsterm`" ]; then - emacsterm $@ -elif [ -x "`which urxvt`" ]; then - urxvt $@ -elif [ -x "`which gnome-terminal`" ]; then - gnome-terminal $@ -elif [ -x "`which xterm`"]; then - xterm $@ -fi + +`pick emacsterm urxvt gnome-terminal xterm` "$@" +exit $? diff --git a/.local/bin/x-www-browser b/.local/bin/x-www-browser index 0ead72a..bbd8943 100755 --- a/.local/bin/x-www-browser +++ b/.local/bin/x-www-browser @@ -1,14 +1,4 @@ #!/bin/sh -list='firefox iceweasel icecat conkeror' - -looking=true -for prog in $list; do - if $looking && [ -n "`pgrep $prog`" ]; then - $prog $@ - looking=false - fi -done -if $looking; then - conkeror $@ -fi +`pick -s conkeror iceweasel icecat firefox` "$@" +exit $? -- cgit v1.2.3-54-g00ecf From ae988f9679bd17c875501a4100503033071e19f9 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 27 Nov 2012 00:11:58 -0500 Subject: use the system xserverrc --- .config/X11/serverrc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) mode change 100644 => 120000 .config/X11/serverrc diff --git a/.config/X11/serverrc b/.config/X11/serverrc deleted file mode 100644 index d6c6ffc..0000000 --- a/.config/X11/serverrc +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -VT=vt07 -#VT=$(tty|sed 's@/dev/tty@vt@') - -exec /usr/bin/X -nolisten tcp "$VT" "$@" diff --git a/.config/X11/serverrc b/.config/X11/serverrc new file mode 120000 index 0000000..ce14133 --- /dev/null +++ b/.config/X11/serverrc @@ -0,0 +1 @@ +/etc/X11/xinit/xserverrc \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 1e9c2fdf6f8072002ef775a72c794170a7cea915 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 27 Nov 2012 00:12:43 -0500 Subject: largely redo my bash config --- .config/bash/aliases.sh | 3 +- .config/bash/rc.sh | 102 +++++++++++++++++++++++++----------------------- 2 files changed, 54 insertions(+), 51 deletions(-) diff --git a/.config/bash/aliases.sh b/.config/bash/aliases.sh index 8241b95..f47bf4c 100644 --- a/.config/bash/aliases.sh +++ b/.config/bash/aliases.sh @@ -53,7 +53,6 @@ unset redshift ###################################################################### # Some almost-function aliases # ###################################################################### -xterm-title() { echo "];$@"; } # Oh, wait this one *is* a function alias lock="clear; away -C 'This terminal is locked'" -alias plock="xterm-title Terminal Locked;lock" +alias plock="term-title Terminal Locked;lock" mvln() { mv $1 $2; ln -s $2 $1; } diff --git a/.config/bash/rc.sh b/.config/bash/rc.sh index ed55f75..bfba6d4 100644 --- a/.config/bash/rc.sh +++ b/.config/bash/rc.sh @@ -1,80 +1,84 @@ # ~/.bashrc: executed by bash(1) for non-login shells. -# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) -# for examples - # I include this file for all interactive invocations of bash(1), whether # they are login shells or not. # If not running interactively, don't do anything -[ -z "$PS1" ] && return +[[ $- != *i* ]] && return + +# set variable identifying the chroot you work in (used in the prompt below) +if [[ -z "$debian_chroot" ]] && [[ -r /etc/debian_chroot ]]; then + debian_chroot="$(cat /etc/debian_chroot)" +fi -# don't put duplicate lines in the history. See bash(1) for more options +# Why is this not on by default? +# "We have a cached value, but it isn't valid anymore. Should we trash it?" +# "Duh, yes!" +shopt -s checkhash + +################################################################################ + +# History settings export HISTCONTROL=ignoredups export HISTFILE=${XDG_CACHE_HOME}/bash/history export HISTTIMEFORMAT='[%Y-%m-%d %H:%M] ' shopt -s histappend # append to the history file, don't overwrite it +mkdir -p "${HISTFILE%/*}" +# General settings shopt -s checkwinsize # update the values of LINES and COLUMNS shopt -s globstar # Let ** recursively scan directories +PROMPT_COMMAND='' -# Why is this not on by default? -# "We have a cached value, but it isn't valid anymore. Should we trash it?" -shopt -s checkhash - -# make less more friendly for non-text input files, see lesspipe(1) -[ -x "`which lesspipe 2>/dev/null`" ] && eval "$(SHELL=/bin/sh lesspipe)" +################################################################################ +# Overly complicated setting of PS1 # +################################################################################ -# set variable identifying the chroot you work in (used in the prompt below) -if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then - debian_chroot=$(cat /etc/debian_chroot) -fi +# Belongs in aliases, but I use it here +term-title() { + local fmt='' + case "$TERM" in + screen|tmux) fmt='\ek%s\e\\';; + xterm*|rxvt*) fmt='\e]0;%s\a';; + esac + printf "$fmt" "$*" +} make_prompt() { - local RESET='' - local BOLD='' - local GREEN='' - local BLUE='' - if $1; then - RESET="$(tput sgr0)" - BOLD="$(tput bold)" - GREEN="$(tput setaf 2)" - BLUE="$(tput setaf 4)" - fi - local CHROOT='${debian_chroot:+($debian_chroot)}' - echo "${RESET}${BOLD}${CHROOT}${GREEN}"'\u@\h'"${RESET}:${BOLD}${BLUE}"'\w'"${RESET}" + local _CHROOT='${debian_chroot:+($debian_chroot)}' + echo "${BOLD}${_CHROOT}${GREEN}\u@\h${RESET}${BOLD}${BLUE}:\w${RESET}" } -if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then +if [[ -x /usr/bin/tput ]] && tput setaf 1 >&/dev/null; then # We have color support; assume it's compliant with Ecma-48 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such # a case would tend to support setf rather than setaf.) - PS1="$(make_prompt true )"'\n\$ ' + RESET="$(tput sgr0)" + BOLD="$(tput bold)" + RED="$(tput setaf 1)" + GREEN="$(tput setaf 2)" + BLUE="$(tput setaf 4)" + + _STATUS="${BOLD}[" + _STATUS+='$(v=$?; if [[ $v = 0 ]]; then c='"'${GREEN}'"'; else c='"${RED}"'; fi; printf %s%03i $c $v)' + _STATUS+="${RESET}${BOLD}]${RESET}" else - PS1="$(make_prompt false)"'\n\$ ' + _STATUS='[$?]' fi - -# If this is an xterm set the title to user@host:dir -case "$TERM" in - xterm*|rxvt*) - PS1="\[\e]0;$(make_prompt false)\a\]$PS1";; -esac - +PS1="${_STATUS} $(make_prompt)"'\n\$ ' +unset RESET BOLD RED GREEN BLUE _STATUS use_color +PS1="$(term-title $(make_prompt))$PS1" unset make_prompt -# Include modular config files -if [ -d "${XDG_CONFIG_HOME}/rc.d" ]; then - for file in "${XDG_CONFIG_HOME}/rc.d"/*.sh; do - . "$file" - done -fi +################################################################################ -if [ -f ${XDG_CONFIG_HOME}/bash/aliases.sh ]; then +# Load my alaises +if [[ -f ${XDG_CONFIG_HOME}/bash/aliases.sh ]]; then . ${XDG_CONFIG_HOME}/bash/aliases.sh fi -# enable programmable completion features (you don't need to enable -# this, if it's already enabled in /etc/bash.bashrc and /etc/profile -# sources /etc/bash.bashrc). -if [ -f /etc/bash_completion ]; then - . /etc/bash_completion +# Include modular config files +if [[ -d ${XDG_CONFIG_HOME}/bash/rc.d ]]; then + for file in "${XDG_CONFIG_HOME}/bash/rc.d"/*.sh; do + . "$file" + done fi -- cgit v1.2.3-54-g00ecf From 3cfabeec77580bc28db8e4d3ae49c11da31adee3 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 27 Nov 2012 00:25:48 -0500 Subject: stuff --- .arduino | 1 + .config/emacs/rc.d | 1 + .config/emacs/rc.el | 1 + .emacs | 1 + .emacs.d/custom.el | 5 ++- .git.info.exclude.in | 1 + .gitconfig | 4 +++ .maildirproc/default.rc | 42 +++++++++++++++---------- .maildirproc/purdue.rc | 82 +++++++++++++++++++++++++++++++++++++++++++++++++ .offlineimaprc | 36 +++++++++++++++++----- .profile | 4 +-- .profile.local | 3 +- .ssh/config | 4 +++ 13 files changed, 157 insertions(+), 28 deletions(-) create mode 120000 .arduino create mode 120000 .config/emacs/rc.d create mode 120000 .config/emacs/rc.el create mode 100644 .maildirproc/purdue.rc diff --git a/.arduino b/.arduino new file mode 120000 index 0000000..25bbfc1 --- /dev/null +++ b/.arduino @@ -0,0 +1 @@ +.config/arduino \ No newline at end of file diff --git a/.config/emacs/rc.d b/.config/emacs/rc.d new file mode 120000 index 0000000..cbf0836 --- /dev/null +++ b/.config/emacs/rc.d @@ -0,0 +1 @@ +../../.emacs.d \ No newline at end of file diff --git a/.config/emacs/rc.el b/.config/emacs/rc.el new file mode 120000 index 0000000..6d539f6 --- /dev/null +++ b/.config/emacs/rc.el @@ -0,0 +1 @@ +../../.emacs \ No newline at end of file diff --git a/.emacs b/.emacs index 3cd2ea3..65634cb 100644 --- a/.emacs +++ b/.emacs @@ -170,6 +170,7 @@ )) (add-to-list 'auto-mode-alist '("PKGBUILD" . sh-mode)) +(add-to-list 'auto-mode-alist '("SRCBUILD" . sh-mode)) ;(require 'flymake) ;(add-hook 'php-mode-hook (lambda() (flymake-mode 1))) diff --git a/.emacs.d/custom.el b/.emacs.d/custom.el index 5a3e67f..07c8d80 100644 --- a/.emacs.d/custom.el +++ b/.emacs.d/custom.el @@ -12,7 +12,10 @@ '(minibuffer-prompt-properties (quote (read-only t point-entered minibuffer-avoid-prompt face minibuffer-prompt))) '(ruby-deep-arglist nil) '(ruby-deep-indent-paren nil) - '(scroll-bar-mode nil)) + '(safe-local-variable-values (quote ((Nginx-indent-tabs-mode) (Nginx-indent-level . 4) (Nginx-indent-level . 8)))) + '(scroll-bar-mode nil) + '(sh-basic-offset 8) + '(sh-indent-comment t)) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/.git.info.exclude.in b/.git.info.exclude.in index 612ecf2..cd60859 100644 --- a/.git.info.exclude.in +++ b/.git.info.exclude.in @@ -32,6 +32,7 @@ history *.lock .~lock.*# +*.lock.* lock *.state diff --git a/.gitconfig b/.gitconfig index 9846d72..218b006 100644 --- a/.gitconfig +++ b/.gitconfig @@ -8,3 +8,7 @@ smtpserver = plus.smtp.mail.yahoo.com smtpuser = lukeshu@sbcglobal.net smtpserverport = 465 +[push] + default = matching +[alias] + lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative diff --git a/.maildirproc/default.rc b/.maildirproc/default.rc index c2ad6f2..cbdc908 100644 --- a/.maildirproc/default.rc +++ b/.maildirproc/default.rc @@ -10,7 +10,9 @@ def is_to_or_from(mail,address): Return true if [mail] is to or from an address that contains [address]. """ return ( - mail["From"].contains(address) + False + or mail["From"].contains(address) + or mail["Reply-To"].contains(address) or mail.target.contains(address)) def is_to_or_from_re(mail,address): """ @@ -90,6 +92,10 @@ def my_filters(mail): mail.move(".software.social") return + if mail["List-Id"].matches("networkmanager-list\.gnome\.org"): + mail.move(".software.networkmanager") + return + if mail["List-Id"].matches("maintenance.lists.parabolagnulinux.org"): mail.move(".software.parabola-maintenance") return @@ -97,6 +103,7 @@ def my_filters(mail): False or mail["List-Id"].matches("parabolagnulinux.org") or is_to_or_from(mail, "parabolagnulinux.org") + or is_to_or_from(mail, "kiwwwi.com.ar") or is_to_or_from(mail, "parabola.nu") ): mail.move(".software.parabola-dev") @@ -166,6 +173,7 @@ def my_filters(mail): "justicejade10@aol.com", "parsonsjade@aol.com", "parsonstjade@gmail.com", + "jadparso@umail.iu.edu", ]: if mail["From"].contains(address): mail.move(".misc.Jade") @@ -190,23 +198,24 @@ def my_filters(mail): # Sort mail from FRC people for address in [ - "jeffreysmith@msdlt.k12.in.us", - "jason.zielke@gmail.com", - "allison.m.babcock@gmail.com", - "william.walk@gmail.com", + "@ni.com", + "@usfirst.org", "BBonahoom@stanleyworks.com", - "wcxctrack829@aim.com", # Pat + "allison.m.babcock@gmail.com", + "bryanbonahoom@gmail.com", + "cdewalt3@yahoo.com", + "dave.nelson@ecolab.com", + "dickaustin190@yahoo.com", "djnels1@comcast.net", # Dave and Julie Nelson + "gamefreak207@gmail.com", # Brett Leedy + "jason.zielke@gmail.com", + "jeffreysmith@msdlt.k12.in.us", "sarahlittell@comcast.net", + "silioso@gmail.com", "skiplittell@comcast.net", - "dave.nelson@ecolab.com", - "@ni.com", - "@usfirst.org", - "gamefreak207@gmail.com", # Brett Leedy "tswilson4801@att.net", - "silioso@gmail.com", - "cdewalt3@yahoo.com", - "bryanbonahoom@gmail.com", + "wcxctrack829@aim.com", # Pat + "william.walk@gmail.com", ]: if is_to_or_from(mail,address): mail.move(".School.Robotics") @@ -224,6 +233,7 @@ def my_filters(mail): # Sort mail from software people for address in [ "gnu.org", + "gnome.org", "eff.org", "gitorious.org", "sourceforge.com", @@ -306,10 +316,10 @@ def my_filters(mail): return if ( False - or mail["From"].contains(".edu") + #or mail["From"].contains(".edu") or mail["From"].contains("admissions@") - or mail["From"].contains("college") - or mail["From"].contains("university") + #or mail["From"].contains("college") + #or mail["From"].contains("university") or mail["Subject"].contains("college") # now we get to the BS or mail["From"].contains("@dreamitdoitindiana.com") diff --git a/.maildirproc/purdue.rc b/.maildirproc/purdue.rc new file mode 100644 index 0000000..546b792 --- /dev/null +++ b/.maildirproc/purdue.rc @@ -0,0 +1,82 @@ +# -*- mode: python; -*- + +import subprocess + +processor.maildir_base = "~/Maildir.purdue" +processor.auto_reload_rcfile = True + +def is_to_or_from(mail,address): + """ + Return true if [mail] is to or from an address that contains [address]. + """ + return ( + mail["From"].contains(address) + or mail.target.contains(address)) +def is_to_or_from_re(mail,address): + """ + Return true if [mail] is to or from an address that matches the + regex [address]. + """ + return ( + mail["From"].matches(address) + or mail.target.matches(address)) + +def handle_incoming_ham(mail): + my_filters(mail) + +def handle_incoming_unknown(mail): + # Filter spam + + spam = bogofilter_auto(mail) + if spam == 0: + handle_incoming_spam(mail) + return + elif spam == 1: + handle_incoming_ham(mail) + return + elif spam == 2: + # maybe spam + return + else: + mail.move(".Error") + return + +def my_filters(mail): + if mail["Subject"].contains("[PASE]"): + mail.move("INBOX.PASE") + return + if mail["Subject"].contains("[PLUG]"): + mail.move("INBOX.PLUG") + return + if mail["Subject"].contains("Fall-2012-SCI-21000-001:"): + mail.move("INBOX.classes.SCI210") + if ( + False + or mail["Subject"].contains("[CS Opportunity Update]") + or mail["Subject"].contains("[CS Majors]") + ): + mail.move("INBOX.CS") + return + if is_to_or_from(mail,"linkedin.com"): + mail.move("INBOX.LinkedIn") + return + if mail["Subject"].contains("fall-2012-cs-18000"): + mail.move("INBOX.classes.CS180") + return + if ( + False + or is_to_or_from(mail,"CS 18000 on Piazza") + or mail["Subject"].contains("CS 18000 on Piazza") + ): + mail.move("INBOX.classes.CS180.Piazza") + return + if mail["Subject"].contains("Fall-2012-SOC-10000"): + mail.move("INBOX.classes.SOC100") + return + +handle_mapping = { + "INBOX": handle_incoming_ham, + } +processor.maildirs = handle_mapping.keys() +for mail in processor: + handle_mapping[mail.maildir](mail) diff --git a/.offlineimaprc b/.offlineimaprc index 319593c..8ea8f30 100644 --- a/.offlineimaprc +++ b/.offlineimaprc @@ -1,22 +1,22 @@ # -*- Mode: Conf -*- [general] -accounts = LukeShu +accounts = ATT,Purdue -[Account LukeShu] -localrepository = Local -remoterepository = Remote +## AT&T ############################################################### -[Repository Local] +[Account ATT] +localrepository = Local-Main +remoterepository = Remote-SBCGlobal + +[Repository Local-Main] type = Maildir localfolders = ~/Maildir sep = . folderfilter = lambda foldername: not re.search('(Trash|Del|-old|Draft)', foldername) - # transforms local -> remote nametrans = lambda foldername: re.sub('^$', 'Inbox', re.sub('^'+re.escape('%(sep)s'), '', foldername)) - -[Repository Remote] +[Repository Remote-SBCGlobal] type = IMAP ssl = yes cert_fingerprint = 700d84baa7e852240178dc2de18e7e528a2854df @@ -27,3 +27,23 @@ folderfilter = lambda foldername: not re.search('(Trash|Del)', foldername) # transforms remote -> local # we must assume that sep=/ on the remote IMAP server. nametrans = lambda foldername: '/'+re.sub('^Inbox$', '', foldername) + +## Purdue ############################################################ + +[Account Purdue] +localrepository = Local-Purdue +remoterepository = Remote-Purdue + +[Repository Local-Purdue] +type = Maildir +localfolders = ~/Maildir.purdue +sep = . +folderfilter = lambda foldername: re.search('INBOX', foldername) + +[Repository Remote-Purdue] +type = IMAP +ssl = yes +cert_fingerprint = 32bdd134cad8da1bea57aa379b98b1cff692e4fd +remotehost = mymail.purdue.edu +remoteuser = shumakl +folderfilter = lambda foldername: re.search('INBOX', foldername) diff --git a/.profile b/.profile index a6c4d91..2d6f370 100644 --- a/.profile +++ b/.profile @@ -43,8 +43,8 @@ if [ -z "$GPGKEY" ] && [ -f "${HOME}/.gnupg/gpg.conf" ]; then export GPGKEY=`sed -nr 's/^\s*default-key\s+//p' "${HOME}/.gnupg/gpg.conf"` fi if [ -z "$(pgrep -u `whoami` gpg-agent)" ]; then - mkdir -p ${XDG_RUNTIME_DIR}/sessions/gpg - gpg-agent --daemon --write-env-file "${XDG_RUNTIME_DIR}/sessions/gpg" + mkdir -p ${XDG_RUNTIME_DIR}/sessions + gpg-agent --daemon --write-env-file "${XDG_RUNTIME_DIR}/sessions/gpg" &>/dev/null fi if [ -f "${XDG_RUNTIME_DIR}/sessions/gpg" ]; then . "${XDG_RUNTIME_DIR}/sessions/gpg" diff --git a/.profile.local b/.profile.local index 3bb0d5c..4ee523a 100644 --- a/.profile.local +++ b/.profile.local @@ -2,7 +2,8 @@ # Start background programs ########################################## if [ -x "`which daemon`" ]; then - daemon maildirproc + daemon -i maildirproc.att maildirproc + daemon -i maildirproc.purdue maildirproc -r .maildirproc/purdue.rc daemon batterymon 20 " pactl set-sink-volume 0 100%; pactl set-sink-mute 0 0; diff --git a/.ssh/config b/.ssh/config index 5c271b5..63519e1 100644 --- a/.ssh/config +++ b/.ssh/config @@ -9,3 +9,7 @@ Host parabola Port 1863 HostName repo.parabolagnulinux.org User repo + +Host lore + HostName lore.cs.purdue.edu + User shumakl -- cgit v1.2.3-54-g00ecf From 9498321c9b825d57612a2210b4f6490d2757657c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 4 Dec 2012 16:29:04 -0500 Subject: mv .emacs .emacs.d/init.el --- .emacs | 181 ------------------------------------------------------- .emacs.d/init.el | 181 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 181 insertions(+), 181 deletions(-) delete mode 100644 .emacs create mode 100644 .emacs.d/init.el diff --git a/.emacs b/.emacs deleted file mode 100644 index 65634cb..0000000 --- a/.emacs +++ /dev/null @@ -1,181 +0,0 @@ -;; 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") - -; 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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(setq el-get-install-branch "master") ;; live life on the edge -(unless (require 'el-get nil 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 my-el-get-packages - '(el-get -; nxhtml - apel flim semi wanderlust - smarttabs - )) - -;; Now load all of that ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; 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) -(setq org-hide-leading-stars t) -(setq org-log-done 'time) -;(xclip-mode 1) - -(load "whitespace") -(setq whitespace-style '( - tab-mark - space-mark - 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) -(setq-default indent-tabs-mode t) - - -(setq - backup-by-copying t ;; don't clobber symlinks - backup-directory-alist '(("." . "~/.emacs.d/saves")) ;; don't litter my fs tree - delete-old-versions t - kept-new-versions 6 - kept-old-versions 2 - version-control t ;; use versioned backups -) - -(setq column-number-mode t - inhibit-startup-screen t - line-number-mode t - server-use-tcp t - server-mode t - show-paren-mode t) - -(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) - )) - -(add-hook 'emacs-lisp-mode-hook - '(lambda () - (set (make-local-variable 'indent-tabs-mode) nil) - )) - -(add-hook 'coffee-mode-hook - '(lambda () - (set (make-local-variable 'tab-width) 2) - )) - -(add-hook 'term-mode-hook - '(lambda () - (setq term-prompt-regexp "^[^#$%>\n]*[#$%>] *") - (make-local-variable 'mouse-yank-at-point) - ;(make-local-variable 'transient-mark-mode) - (setq mouse-yank-at-point t) - ;(setq transient-mark-mode nil) - (auto-fill-mode -1) - (setq tab-width 8 ) - (setq autopair-dont-activate t) ;; Don't let autopair break ansi-term - )) - -(add-hook 'ruby-mode-hook - '(lambda () - (set (make-local-variable 'indent-tabs-mode) t) - (set (make-local-variable 'ruby-indent-level) 4) - (set (make-local-variable 'tab-width) 4) - )) - -(add-hook 'coffee-mode-hook - '(lambda () - (set (make-local-variable 'indent-tabs-mode) nil) - )) - -(add-to-list 'auto-mode-alist '("PKGBUILD" . sh-mode)) -(add-to-list 'auto-mode-alist '("SRCBUILD" . sh-mode)) - -;(require 'flymake) -;(add-hook 'php-mode-hook (lambda() (flymake-mode 1))) -;(define-key php-mode-map '[M-S-up] 'flymake-goto-prev-error) -;(define-key php-mode-map '[M-S-down] 'flymake-goto-next-error) - -;(setq tramp-debug-buffer t) -;(setq tramp-verbose 10) diff --git a/.emacs.d/init.el b/.emacs.d/init.el new file mode 100644 index 0000000..65634cb --- /dev/null +++ b/.emacs.d/init.el @@ -0,0 +1,181 @@ +;; 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") + +; 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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(setq el-get-install-branch "master") ;; live life on the edge +(unless (require 'el-get nil 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 my-el-get-packages + '(el-get +; nxhtml + apel flim semi wanderlust + smarttabs + )) + +;; Now load all of that ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; 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) +(setq org-hide-leading-stars t) +(setq org-log-done 'time) +;(xclip-mode 1) + +(load "whitespace") +(setq whitespace-style '( + tab-mark + space-mark + 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) +(setq-default indent-tabs-mode t) + + +(setq + backup-by-copying t ;; don't clobber symlinks + backup-directory-alist '(("." . "~/.emacs.d/saves")) ;; don't litter my fs tree + delete-old-versions t + kept-new-versions 6 + kept-old-versions 2 + version-control t ;; use versioned backups +) + +(setq column-number-mode t + inhibit-startup-screen t + line-number-mode t + server-use-tcp t + server-mode t + show-paren-mode t) + +(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) + )) + +(add-hook 'emacs-lisp-mode-hook + '(lambda () + (set (make-local-variable 'indent-tabs-mode) nil) + )) + +(add-hook 'coffee-mode-hook + '(lambda () + (set (make-local-variable 'tab-width) 2) + )) + +(add-hook 'term-mode-hook + '(lambda () + (setq term-prompt-regexp "^[^#$%>\n]*[#$%>] *") + (make-local-variable 'mouse-yank-at-point) + ;(make-local-variable 'transient-mark-mode) + (setq mouse-yank-at-point t) + ;(setq transient-mark-mode nil) + (auto-fill-mode -1) + (setq tab-width 8 ) + (setq autopair-dont-activate t) ;; Don't let autopair break ansi-term + )) + +(add-hook 'ruby-mode-hook + '(lambda () + (set (make-local-variable 'indent-tabs-mode) t) + (set (make-local-variable 'ruby-indent-level) 4) + (set (make-local-variable 'tab-width) 4) + )) + +(add-hook 'coffee-mode-hook + '(lambda () + (set (make-local-variable 'indent-tabs-mode) nil) + )) + +(add-to-list 'auto-mode-alist '("PKGBUILD" . sh-mode)) +(add-to-list 'auto-mode-alist '("SRCBUILD" . sh-mode)) + +;(require 'flymake) +;(add-hook 'php-mode-hook (lambda() (flymake-mode 1))) +;(define-key php-mode-map '[M-S-up] 'flymake-goto-prev-error) +;(define-key php-mode-map '[M-S-down] 'flymake-goto-next-error) + +;(setq tramp-debug-buffer t) +;(setq tramp-verbose 10) -- cgit v1.2.3-54-g00ecf From c11ba65551852010e112158fd8b28519a8bac0db Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 4 Dec 2012 16:35:30 -0500 Subject: rm the symlinks in .config/emacs --- .config/emacs/rc.d | 1 - .config/emacs/rc.el | 1 - 2 files changed, 2 deletions(-) delete mode 120000 .config/emacs/rc.d delete mode 120000 .config/emacs/rc.el diff --git a/.config/emacs/rc.d b/.config/emacs/rc.d deleted file mode 120000 index cbf0836..0000000 --- a/.config/emacs/rc.d +++ /dev/null @@ -1 +0,0 @@ -../../.emacs.d \ No newline at end of file diff --git a/.config/emacs/rc.el b/.config/emacs/rc.el deleted file mode 120000 index 6d539f6..0000000 --- a/.config/emacs/rc.el +++ /dev/null @@ -1 +0,0 @@ -../../.emacs \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 0b746ef1515bbede74963535c79dc3e9631be9a1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 4 Dec 2012 16:37:07 -0500 Subject: mv .emacs.d .config/emacs; ln -s .config/emacs .emacs.d --- .config/emacs/.gitignore | 9 +++ .config/emacs/custom.el | 24 ++++++ .config/emacs/emacsutils.el | 13 ++++ .config/emacs/init.el | 181 ++++++++++++++++++++++++++++++++++++++++++++ .emacs.d | 1 + .emacs.d/.gitignore | 9 --- .emacs.d/custom.el | 24 ------ .emacs.d/emacsutils.el | 13 ---- .emacs.d/init.el | 181 -------------------------------------------- 9 files changed, 228 insertions(+), 227 deletions(-) create mode 100644 .config/emacs/.gitignore create mode 100644 .config/emacs/custom.el create mode 100644 .config/emacs/emacsutils.el create mode 100644 .config/emacs/init.el create mode 120000 .emacs.d delete mode 100644 .emacs.d/.gitignore delete mode 100644 .emacs.d/custom.el delete mode 100644 .emacs.d/emacsutils.el delete mode 100644 .emacs.d/init.el diff --git a/.config/emacs/.gitignore b/.config/emacs/.gitignore new file mode 100644 index 0000000..ef4ec20 --- /dev/null +++ b/.config/emacs/.gitignore @@ -0,0 +1,9 @@ +auto-save-list/* +el-get/* +elmo/* +elpa/* +image-dired/* +server/* +session.* +tramp +url/* diff --git a/.config/emacs/custom.el b/.config/emacs/custom.el new file mode 100644 index 0000000..07c8d80 --- /dev/null +++ b/.config/emacs/custom.el @@ -0,0 +1,24 @@ +(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. + '(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") + '(minibuffer-prompt-properties (quote (read-only t point-entered minibuffer-avoid-prompt face minibuffer-prompt))) + '(ruby-deep-arglist nil) + '(ruby-deep-indent-paren nil) + '(safe-local-variable-values (quote ((Nginx-indent-tabs-mode) (Nginx-indent-level . 4) (Nginx-indent-level . 8)))) + '(scroll-bar-mode nil) + '(sh-basic-offset 8) + '(sh-indent-comment t)) +(custom-set-faces + ;; custom-set-faces 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. + ) diff --git a/.config/emacs/emacsutils.el b/.config/emacs/emacsutils.el new file mode 100644 index 0000000..966d16e --- /dev/null +++ b/.config/emacs/emacsutils.el @@ -0,0 +1,13 @@ +(defun mailto-compose-mail (mailto-url) + (if (and (stringp mailto-url) + (string-match "\\`mailto:" mailto-url)) + (progn + (require 'rfc2368) + (let* ((headers (mapcar (lambda (h) (cons (intern (car h)) (cdr h))) + (rfc2368-parse-mailto-url mailto-url))) + (good-headers (remove-if (lambda (h) (member (car h) '(Body))) headers)) + (body (cdr (assoc 'Body headers)))) + (wl-draft good-headers nil nil body))))) + +(defun emacs-terminal-emulator (program) + (ansi-term program)) \ No newline at end of file diff --git a/.config/emacs/init.el b/.config/emacs/init.el new file mode 100644 index 0000000..65634cb --- /dev/null +++ b/.config/emacs/init.el @@ -0,0 +1,181 @@ +;; 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") + +; 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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(setq el-get-install-branch "master") ;; live life on the edge +(unless (require 'el-get nil 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 my-el-get-packages + '(el-get +; nxhtml + apel flim semi wanderlust + smarttabs + )) + +;; Now load all of that ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; 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) +(setq org-hide-leading-stars t) +(setq org-log-done 'time) +;(xclip-mode 1) + +(load "whitespace") +(setq whitespace-style '( + tab-mark + space-mark + 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) +(setq-default indent-tabs-mode t) + + +(setq + backup-by-copying t ;; don't clobber symlinks + backup-directory-alist '(("." . "~/.emacs.d/saves")) ;; don't litter my fs tree + delete-old-versions t + kept-new-versions 6 + kept-old-versions 2 + version-control t ;; use versioned backups +) + +(setq column-number-mode t + inhibit-startup-screen t + line-number-mode t + server-use-tcp t + server-mode t + show-paren-mode t) + +(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) + )) + +(add-hook 'emacs-lisp-mode-hook + '(lambda () + (set (make-local-variable 'indent-tabs-mode) nil) + )) + +(add-hook 'coffee-mode-hook + '(lambda () + (set (make-local-variable 'tab-width) 2) + )) + +(add-hook 'term-mode-hook + '(lambda () + (setq term-prompt-regexp "^[^#$%>\n]*[#$%>] *") + (make-local-variable 'mouse-yank-at-point) + ;(make-local-variable 'transient-mark-mode) + (setq mouse-yank-at-point t) + ;(setq transient-mark-mode nil) + (auto-fill-mode -1) + (setq tab-width 8 ) + (setq autopair-dont-activate t) ;; Don't let autopair break ansi-term + )) + +(add-hook 'ruby-mode-hook + '(lambda () + (set (make-local-variable 'indent-tabs-mode) t) + (set (make-local-variable 'ruby-indent-level) 4) + (set (make-local-variable 'tab-width) 4) + )) + +(add-hook 'coffee-mode-hook + '(lambda () + (set (make-local-variable 'indent-tabs-mode) nil) + )) + +(add-to-list 'auto-mode-alist '("PKGBUILD" . sh-mode)) +(add-to-list 'auto-mode-alist '("SRCBUILD" . sh-mode)) + +;(require 'flymake) +;(add-hook 'php-mode-hook (lambda() (flymake-mode 1))) +;(define-key php-mode-map '[M-S-up] 'flymake-goto-prev-error) +;(define-key php-mode-map '[M-S-down] 'flymake-goto-next-error) + +;(setq tramp-debug-buffer t) +;(setq tramp-verbose 10) diff --git a/.emacs.d b/.emacs.d new file mode 120000 index 0000000..294c1df --- /dev/null +++ b/.emacs.d @@ -0,0 +1 @@ +.config/emacs \ No newline at end of file diff --git a/.emacs.d/.gitignore b/.emacs.d/.gitignore deleted file mode 100644 index ef4ec20..0000000 --- a/.emacs.d/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -auto-save-list/* -el-get/* -elmo/* -elpa/* -image-dired/* -server/* -session.* -tramp -url/* diff --git a/.emacs.d/custom.el b/.emacs.d/custom.el deleted file mode 100644 index 07c8d80..0000000 --- a/.emacs.d/custom.el +++ /dev/null @@ -1,24 +0,0 @@ -(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. - '(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") - '(minibuffer-prompt-properties (quote (read-only t point-entered minibuffer-avoid-prompt face minibuffer-prompt))) - '(ruby-deep-arglist nil) - '(ruby-deep-indent-paren nil) - '(safe-local-variable-values (quote ((Nginx-indent-tabs-mode) (Nginx-indent-level . 4) (Nginx-indent-level . 8)))) - '(scroll-bar-mode nil) - '(sh-basic-offset 8) - '(sh-indent-comment t)) -(custom-set-faces - ;; custom-set-faces 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. - ) diff --git a/.emacs.d/emacsutils.el b/.emacs.d/emacsutils.el deleted file mode 100644 index 966d16e..0000000 --- a/.emacs.d/emacsutils.el +++ /dev/null @@ -1,13 +0,0 @@ -(defun mailto-compose-mail (mailto-url) - (if (and (stringp mailto-url) - (string-match "\\`mailto:" mailto-url)) - (progn - (require 'rfc2368) - (let* ((headers (mapcar (lambda (h) (cons (intern (car h)) (cdr h))) - (rfc2368-parse-mailto-url mailto-url))) - (good-headers (remove-if (lambda (h) (member (car h) '(Body))) headers)) - (body (cdr (assoc 'Body headers)))) - (wl-draft good-headers nil nil body))))) - -(defun emacs-terminal-emulator (program) - (ansi-term program)) \ No newline at end of file diff --git a/.emacs.d/init.el b/.emacs.d/init.el deleted file mode 100644 index 65634cb..0000000 --- a/.emacs.d/init.el +++ /dev/null @@ -1,181 +0,0 @@ -;; 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") - -; 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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(setq el-get-install-branch "master") ;; live life on the edge -(unless (require 'el-get nil 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 my-el-get-packages - '(el-get -; nxhtml - apel flim semi wanderlust - smarttabs - )) - -;; Now load all of that ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;; 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) -(setq org-hide-leading-stars t) -(setq org-log-done 'time) -;(xclip-mode 1) - -(load "whitespace") -(setq whitespace-style '( - tab-mark - space-mark - 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) -(setq-default indent-tabs-mode t) - - -(setq - backup-by-copying t ;; don't clobber symlinks - backup-directory-alist '(("." . "~/.emacs.d/saves")) ;; don't litter my fs tree - delete-old-versions t - kept-new-versions 6 - kept-old-versions 2 - version-control t ;; use versioned backups -) - -(setq column-number-mode t - inhibit-startup-screen t - line-number-mode t - server-use-tcp t - server-mode t - show-paren-mode t) - -(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) - )) - -(add-hook 'emacs-lisp-mode-hook - '(lambda () - (set (make-local-variable 'indent-tabs-mode) nil) - )) - -(add-hook 'coffee-mode-hook - '(lambda () - (set (make-local-variable 'tab-width) 2) - )) - -(add-hook 'term-mode-hook - '(lambda () - (setq term-prompt-regexp "^[^#$%>\n]*[#$%>] *") - (make-local-variable 'mouse-yank-at-point) - ;(make-local-variable 'transient-mark-mode) - (setq mouse-yank-at-point t) - ;(setq transient-mark-mode nil) - (auto-fill-mode -1) - (setq tab-width 8 ) - (setq autopair-dont-activate t) ;; Don't let autopair break ansi-term - )) - -(add-hook 'ruby-mode-hook - '(lambda () - (set (make-local-variable 'indent-tabs-mode) t) - (set (make-local-variable 'ruby-indent-level) 4) - (set (make-local-variable 'tab-width) 4) - )) - -(add-hook 'coffee-mode-hook - '(lambda () - (set (make-local-variable 'indent-tabs-mode) nil) - )) - -(add-to-list 'auto-mode-alist '("PKGBUILD" . sh-mode)) -(add-to-list 'auto-mode-alist '("SRCBUILD" . sh-mode)) - -;(require 'flymake) -;(add-hook 'php-mode-hook (lambda() (flymake-mode 1))) -;(define-key php-mode-map '[M-S-up] 'flymake-goto-prev-error) -;(define-key php-mode-map '[M-S-down] 'flymake-goto-next-error) - -;(setq tramp-debug-buffer t) -;(setq tramp-verbose 10) -- cgit v1.2.3-54-g00ecf From 906b645cdb3286076affbb942ff23d99e409db86 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 4 Jan 2013 10:42:16 -0500 Subject: enlarge Bash's HISTSIZE (500 -> 5000) --- .config/bash/rc.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/bash/rc.sh b/.config/bash/rc.sh index bfba6d4..faf8116 100644 --- a/.config/bash/rc.sh +++ b/.config/bash/rc.sh @@ -21,6 +21,7 @@ shopt -s checkhash export HISTCONTROL=ignoredups export HISTFILE=${XDG_CACHE_HOME}/bash/history export HISTTIMEFORMAT='[%Y-%m-%d %H:%M] ' +export HISTSIZE=5000 shopt -s histappend # append to the history file, don't overwrite it mkdir -p "${HISTFILE%/*}" -- cgit v1.2.3-54-g00ecf From 2b4d180dc87571e8650f4d7998f98b69b4519ee9 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 4 Jan 2013 10:44:21 -0500 Subject: mess with emacs color themes --- .config/emacs/custom.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/emacs/custom.el b/.config/emacs/custom.el index 07c8d80..40516e3 100644 --- a/.config/emacs/custom.el +++ b/.config/emacs/custom.el @@ -3,8 +3,8 @@ ;; 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))) + '(custom-enabled-themes (quote (zenburn))) + '(custom-safe-themes (quote ("1e7e097ec8cb1f8c3a912d7e1e0331caeed49fef6cff220be63bd2a6ba4cc365" "71b172ea4aad108801421cc5251edb6c792f3adbaecfa1c52e94e3d99634dee7" "fc5fcb6f1f1c1bc01305694c59a1a861b008c534cae8d0e48e4d5e81ad718bc6" default))) '(erc-nick "lukeshu") '(explicit-shell-file-name "/bin/bash") '(inhibit-startup-screen t) -- cgit v1.2.3-54-g00ecf From 6c00940af5265238bbeae7efce8e334d92771848 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 4 Jan 2013 10:44:44 -0500 Subject: use mailcrypt with wanderlust --- .config/emacs/init.el | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 65634cb..c026dd7 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -58,6 +58,34 @@ ;; General settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(require 'mailcrypt) +(mc-setversion "gpg") +(add-hook 'wl-summary-mode-hook 'mc-install-read-mode) +(add-hook 'wl-mail-setup-hook 'mc-install-write-mode) + +(defun mc-wl-verify-signature () + (interactive) + (save-window-excursion + (wl-summary-jump-to-current-message) + (mc-verify))) + +(defun mc-wl-decrypt-message () + (interactive) + (save-window-excursion + (wl-summary-jump-to-current-message) + (let ((inhibit-read-only t)) + (mc-decrypt)))) + +(eval-after-load "mailcrypt" + '(setq mc-modes-alist + (append + (quote + ((wl-draft-mode (encrypt . mc-encrypt-message) + (sign . mc-sign-message)) + (wl-summary-mode (decrypt . mc-wl-decrypt-message) + (verify . mc-wl-verify-signature)))) + mc-modes-alist))) + ;(load "mdmua") (load "emacsutils") -- cgit v1.2.3-54-g00ecf From af5f17aa5ae91e507c454dd65996934d76103084 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 4 Jan 2013 10:53:47 -0500 Subject: don't track gimp --- .git.info.exclude.in | 1 + 1 file changed, 1 insertion(+) diff --git a/.git.info.exclude.in b/.git.info.exclude.in index cd60859..4db3ff0 100644 --- a/.git.info.exclude.in +++ b/.git.info.exclude.in @@ -103,5 +103,6 @@ lock .config/libreoffice .config/transmission .eclipse +.gimp-* .mozilla .netbeans -- cgit v1.2.3-54-g00ecf From 9cff97ea2560cb7c7b5d57eb228d173f703a0666 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 4 Jan 2013 10:55:51 -0500 Subject: speed up `make .git.info.exclude` --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 160a64c..f6dcd17 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,8 @@ clean: .folders: Maildir ( echo '..'; find ~/Maildir -maxdepth 2 -type f -name "maildirfolder" -printf '%h\n'|sed -r 's@.*/(.*\.)(.*)@.\1\2@' )|sort>'$@' -.git.info.exclude: .git.info.exclude.in . - ( cat $<; find . -type f -name 'CACHEDIR.TAG' -printf '%h\n'|sed 's@^\./@/@' ) > $@ +.git.info.exclude: .git.info.exclude.in $(shell echo .??*/) + ( cat $<; find $^ -type f -name 'CACHEDIR.TAG' -printf '%h\n'|sed 's@^\./@/@' ) > $@ .crontab.cookie: .crontab .crontab.local -(cat $^; echo) | crontab - 2>/dev/null -- cgit v1.2.3-54-g00ecf From 226a456dc05274e6ab1eb74769c9b06db8b461af Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 26 Jan 2013 22:01:53 -0500 Subject: change for new urxvt --- .config/X11/defaults | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/X11/defaults b/.config/X11/defaults index ceabc5c..07d35b4 100644 --- a/.config/X11/defaults +++ b/.config/X11/defaults @@ -14,5 +14,5 @@ URxvt.scrollTtyKeypress: false URxvt.scrollWithBuffer: true URxvt.perl-ext-common: default,matcher -URxvt.urlLauncher: v-www-browser +URxvt.url-launcher: v-www-browser URxvt.matcher.button: 1 -- cgit v1.2.3-54-g00ecf From f2282f6cc0011fc761986c0e3b4e3735d4629e81 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 26 Jan 2013 22:02:06 -0500 Subject: avoid bug in sed 4.2.2 --- .config/bash/aliases.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/bash/aliases.sh b/.config/bash/aliases.sh index f47bf4c..0964a83 100644 --- a/.config/bash/aliases.sh +++ b/.config/bash/aliases.sh @@ -37,7 +37,7 @@ alias l='ls -CF' ###################################################################### #alias rm='gvfs-trash' alias ssh='ssh -XC' -alias sed='sed --follow-symlinks' +#alias sed='sed --follow-symlinks' # breaks sed 4.2.2 alias tree='tree --charset utf8' alias cd=pushd alias gitk='gitk --all --date-order' -- cgit v1.2.3-54-g00ecf From 7b5d6d5f2e9be95cd1acdc5eb07f4487da8a1f64 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 27 Jan 2013 14:43:14 -0500 Subject: mv .wmii .config/wmii; ln -s .config/wmii .wmii --- .config/wmii/autostart | 11 ++ .config/wmii/config.sh | 249 ++++++++++++++++++++++++++++++++++++++ .config/wmii/ctl-init | 5 + .config/wmii/fixes.sh | 24 ++++ .config/wmii/help-events | 3 + .config/wmii/help-keys | 3 + .config/wmii/include.sh | 11 ++ .config/wmii/quit | 3 + .config/wmii/rbar_battery | 9 ++ .config/wmii/rbar_clock | 9 ++ .config/wmii/rbar_cpu | 12 ++ .config/wmii/rbar_wifi | 9 ++ .config/wmii/tagrules | 3 + .config/wmii/theme-solarized | 16 +++ .config/wmii/theme-solarized-dark | 12 ++ .config/wmii/util.sh | 128 ++++++++++++++++++++ .config/wmii/wmiirc | 12 ++ .wmii | 1 + .wmii/autostart | 11 -- .wmii/config.sh | 249 -------------------------------------- .wmii/ctl-init | 5 - .wmii/fixes.sh | 24 ---- .wmii/help-events | 3 - .wmii/help-keys | 3 - .wmii/include.sh | 11 -- .wmii/quit | 3 - .wmii/rbar_battery | 9 -- .wmii/rbar_clock | 9 -- .wmii/rbar_cpu | 12 -- .wmii/rbar_wifi | 9 -- .wmii/tagrules | 3 - .wmii/theme-solarized | 16 --- .wmii/theme-solarized-dark | 12 -- .wmii/util.sh | 128 -------------------- .wmii/wmiirc | 12 -- 35 files changed, 520 insertions(+), 519 deletions(-) create mode 100755 .config/wmii/autostart create mode 100644 .config/wmii/config.sh create mode 100644 .config/wmii/ctl-init create mode 100644 .config/wmii/fixes.sh create mode 100755 .config/wmii/help-events create mode 100755 .config/wmii/help-keys create mode 100644 .config/wmii/include.sh create mode 100755 .config/wmii/quit create mode 100755 .config/wmii/rbar_battery create mode 100755 .config/wmii/rbar_clock create mode 100755 .config/wmii/rbar_cpu create mode 100755 .config/wmii/rbar_wifi create mode 100644 .config/wmii/tagrules create mode 100644 .config/wmii/theme-solarized create mode 100644 .config/wmii/theme-solarized-dark create mode 100644 .config/wmii/util.sh create mode 100755 .config/wmii/wmiirc create mode 120000 .wmii delete mode 100755 .wmii/autostart delete mode 100644 .wmii/config.sh delete mode 100644 .wmii/ctl-init delete mode 100644 .wmii/fixes.sh delete mode 100755 .wmii/help-events delete mode 100755 .wmii/help-keys delete mode 100644 .wmii/include.sh delete mode 100755 .wmii/quit delete mode 100755 .wmii/rbar_battery delete mode 100755 .wmii/rbar_clock delete mode 100755 .wmii/rbar_cpu delete mode 100755 .wmii/rbar_wifi delete mode 100644 .wmii/tagrules delete mode 100644 .wmii/theme-solarized delete mode 100644 .wmii/theme-solarized-dark delete mode 100644 .wmii/util.sh delete mode 100755 .wmii/wmiirc diff --git a/.config/wmii/autostart b/.config/wmii/autostart new file mode 100755 index 0000000..d95ce34 --- /dev/null +++ b/.config/wmii/autostart @@ -0,0 +1,11 @@ +#!/bin/bash +. "$HOME/.wmii/include.sh" + +daemon lxpanel &> /dev/null +daemon nm-applet &> /dev/null +daemon notifyd &> /dev/null + +#Action rbar_cpu 01 & +#Action rbar_wifi 97 & +Action rbar_battery 98 & +Action rbar_clock 99 & diff --git a/.config/wmii/config.sh b/.config/wmii/config.sh new file mode 100644 index 0000000..1dac0ad --- /dev/null +++ b/.config/wmii/config.sh @@ -0,0 +1,249 @@ +#!/bin/bash + +MODKEY=Mod4 # "super" +UP=p +DOWN=n +LEFT=b +RIGHT=f + +HIST="`conffile history`" + +# Colors tuples: " " +. `conffile theme-solarized-dark` + +Event() { + event=$1; shift; + case "$event" in + ## Mouse event meanings: + ## MouseDown = mouse down + ## Click = mouse up + ## DND = hover, while dragging something (Drag 'n' Drop) + ## The associated mouse button is always "1" + ## + ## Mouse-button IDs: + ## 1 = left + ## 2 = middle + ## 3 = right + + ## Custom (non-WMII-generated) events + WmiircStart) ## No args + echo ' ==> Starting wmiirc' + is_mounted $WMII_DIR && Event WmiircUnmount + Event WmiircMount + + # Configure wmii + < "`conffile tagrules`" expand_variables >> $WMII_DIR/tagrules + < "`conffile ctl-init`" expand_variables >> $WMII_DIR/ctl + scansection Key | cut -sf2 >> $WMII_DIR/keys + # Configure X11 + xsetroot -solid "$WMII_BACKGROUND" + + # Clear the LBar and RBar + find $WMII_DIR/{l,r}bar -type f -delete + # Populate the LBar by emulating [Create|Focus]Tag events + seltag=`sed 1q $WMII_DIR/tag/sel/ctl` + lstags | while read tag; do + Event CreateTag "$tag" + if [ "$tag" = "$seltag" ]; then + Event FocusTag "$tag" + fi + done + + # Run the autostart action + Action autostart 2>/dev/null & + ;; + WmiircQuit) ## No args + echo ' ==> Stopping wmiirc' + exit;; + WmiircMount) ## No args + echo " -> Creating mountpoint WMII_DIR=$WMII_DIR..." + mkdir -p "$WMII_DIR" + echo " -> Mounting WMII_DIR=$WMII_DIR..." + 9mount -i "unix!$WMII_NAMESPACE/wmii" "$WMII_DIR";; + WmiircUnmount) ## No args + echo " -> Unmounting WMII_DIR=$WMII_DIR..." + 9umount "$WMII_DIR" + echo " -> Removing mountpoint WMII_DIR=$WMII_DIR..." + rmdir "$WMII_DIR";; + ## WMII-meta events + Quit) ## No args + echo ' ==> wmii quit: unmounting' + trap - EXIT + Event WmiircUnmount + Event WmiircQuit;; + Warning) ## $@=string + notify-send "wmii warning: $*";; + Key) ## $1=keystroke + Key "$@";; + + ## WMII Window management events + FocusFloating) ## No args + ;; + AreaFocus) ## $1=area + ;; + DestroyArea) ## $1=area + ;; + ColumnFocus) ## $1=column + ;; + CreateColumn) ## $1=column + ;; + + ## Client events + CreateClient) ## $1=client + ;; + DestroyClient) ## $1=client + ;; + Urgent) ## $1=client $2=[Manager|Client] + ;; + NotUrgent) ## $1=client $2=[Manager|Client] + ;; + ClientMouseDown) ## $1=client $2=button + client=$1 + button=$2 + case $button in + 1) ;; + 2) ;; + 3) + { + case `wmii9menu Delete Fullscreen` in + Delete) + echo kill >> $WMII_DIR/client/$client/ctl;; + Fullscreen) + echo Fullscreen on >> $WMII_DIR/client/$1/ctl;; + esac + }& ;; + esac;; + ClientClick) ## $1=client $2=button + ;; + Unresponsive) ## $1=client + client=$1 + client_name=`cat $WMII_DIR/client/$client/label` + msg="The client \`${client_name}' is not responding." + msg+=" What would you like to do?" + { + resp=$(wihack -transient $client \ + xmessage -nearmouse -buttons Kill,Wait -print "$msg") + if [ "$resp" = Kill ]; then + echo slay >> $WMII_DIR/client/$client/ctl + fi + }& ;; + Fullscreen) ## $1=client $2=[on|off] + # TODO: hide any clients with the 'panel' class + ;; + + ## Tag events + CreateTag) ## $1=tag + echo "$WMII_NORMCOLORS" $@ >> $WMII_DIR/lbar/$1;; + DestroyTag) ## $1=tag + rm $WMII_DIR/lbar/$1;; + FocusTag) ## $1=tag + echo "$WMII_FOCUSCOLORS" $1 >> $WMII_DIR/lbar/$1;; + UnfocusTag) ## $1=tag + echo "$WMII_NORMCOLORS" $1 >> $WMII_DIR/lbar/$1;; + UrgentTag) ## $1=tag $2=[Manager|Client] + echo "$WMII_URGENTCOLORS" $1 >> $WMII_DIR/lbar/$1;; + NotUrgentTag) ## $1=tag $2=[Manager|Client] + echo "$WMII_NORMCOLORS" $1 >> $WMII_DIR/lbar/$1;; + + ## LeftBar events (usually tag buttons) + LeftBarMouseDown) ## $1=button $2=bar_item + ;; + LeftBarClick) ## $1=button $2=bar_item + shift # ignore the button + echo view "$@" >> $WMII_DIR/ctl;; + LeftMouseDND) ## $1=button $2=bar_item + Event LeftBarClick "$@";; + + ## RightBar events + RightBarMouseDown) ## $1=button $2=bar_item + ;; + RightBarClick) ## $1=button $2=bar_item + ;; + RightMouseDND) ## $1=button $2=bar_item + Event RightBarClick "$@";; + esac +} ## End Event + +# Key Bindings +Key() { + key=$1 + case "$key" in + ## Moving around + + $MODKEY-$LEFT) ## Select the client to the left + echo select left >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-$RIGHT) ## Select the client to the right + echo select right >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-$UP) ## Select the client above + echo select up >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-$DOWN) ## Select the client below + echo select down >> $WMII_DIR/tag/sel/ctl;; + + $MODKEY-space) ## Toggle between floating and managed layers + echo select toggle >> $WMII_DIR/tag/sel/ctl;; + + ## Moving clients around + + $MODKEY-Shift-$LEFT) ## Move selected client to the left + echo send sel left >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-Shift-$RIGHT) ## Move selected client to the right + echo send sel right >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-Shift-$UP) ## Move selected client up + echo send sel up >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-Shift-$DOWN) ## Move selected client down + echo send sel down >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-Shift-space) ## Toggle selected client between floating and managed layers + echo send sel toggle >> $WMII_DIR/tag/sel/ctl;; + + ## Moving through stacks + $MODKEY-Control-$UP) ## Select the stack above + echo select up stack >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-Control-$DOWN) ## Select the stack below + echo select down stack >> $WMII_DIR/tag/sel/ctl;; + + ## Client actions + $MODKEY-shift-1) ## Toggle selected client's fullsceen state + echo Fullscreen toggle >> $WMII_DIR/client/sel/ctl;; + $MODKEY-shift-0) ## Close client + echo kill >> $WMII_DIR/client/sel/ctl;; + + ## Changing column modes + $MODKEY-d) ## Set column to default mode + echo colmode sel default-max >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-s) ## Set column to stack mode + echo colmode sel stack-max >> $WMII_DIR/tag/sel/ctl;; + $MODKEY-m) ## Set column to max mode + echo colmode sel stack+max >> $WMII_DIR/tag/sel/ctl;; + + ## Running programs + $MODKEY-a) ## Open wmii actions menu + Action $(path_ls $WMII_CONFPATH | wimenu -h "${HIST}.actions" -n 5000) & ;; + $MODKEY-x) ## Open program menu + setsid $(path_ls $PATH | wimenu -h "${HIST}.progs" -n 5000) & ;; + $MODKEY-Return) ## Launch a terminal + setsid x-terminal-emulator & ;; + + ## Tag actions + $MODKEY-t) ## Change to another tag + { + tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return + echo view $tag >> $WMII_DIR/ctl + }& ;; + $MODKEY-Shift-t) ## Retag the selected client + sel=$(sed 1q $WMII_DIR/client/sel/ctl) + { + tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return + echo "$tag" >> $WMII_DIR/client/$sel/tags + }& ;; + esac +} ## End Key + +Action() { + prog=`path_which "$WMII_CONFPATH" $1`; shift + if [ -n "$prog" ]; then + "$prog" "$@" + return $? + else + return 1 + fi +} ## End Action diff --git a/.config/wmii/ctl-init b/.config/wmii/ctl-init new file mode 100644 index 0000000..026c0d5 --- /dev/null +++ b/.config/wmii/ctl-init @@ -0,0 +1,5 @@ +font xft:Monospace-8 +focuscolors $WMII_FOCUSCOLORS +normcolors $WMII_NORMCOLORS +grabmod $MODKEY +border 1 diff --git a/.config/wmii/fixes.sh b/.config/wmii/fixes.sh new file mode 100644 index 0000000..aa09157 --- /dev/null +++ b/.config/wmii/fixes.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Fix various deficiencies in either the shell or the filesystem + +## +# Usage: ls DIRECTORY +# Linux's 9p kernel module sometimes omits entries in directory listings +## +unalias ls &>/dev/null +ls() { + real_ls="`which ls` -1F" + [ $# = 0 ] && set -- "`pwd`" + f="${1/#${WMII_DIR}/}" + if [ "$f" = "$1" ]; then + $real_ls "$f" + else + wmiir ls "$f" + fi +} + +## +# Usage: setsid cmd [arguments...] +# I like wmiir's setsid better than linux-utils' +## +setsid() { wmiir setsid "$@"; } diff --git a/.config/wmii/help-events b/.config/wmii/help-events new file mode 100755 index 0000000..25b7d41 --- /dev/null +++ b/.config/wmii/help-events @@ -0,0 +1,3 @@ +#!/bin/bash +. "$HOME/.wmii/include.sh" +scansection Event | xmessage -file - diff --git a/.config/wmii/help-keys b/.config/wmii/help-keys new file mode 100755 index 0000000..c6e7038 --- /dev/null +++ b/.config/wmii/help-keys @@ -0,0 +1,3 @@ +#!/bin/bash +. "$HOME/.wmii/include.sh" +scansection Key | xmessage -file - diff --git a/.config/wmii/include.sh b/.config/wmii/include.sh new file mode 100644 index 0000000..d4e58c3 --- /dev/null +++ b/.config/wmii/include.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +if [ -z "$WMII_NAMESPACE" ]; then + export WMII_NAMESPACE="`wmiir namespace`" +fi +if [ -z "$WMII_DIR" ]; then + export WMII_DIR="$HOME/n/wmii" +fi + +. "$HOME/.wmii/util.sh" +. "$HOME/.wmii/config.sh" diff --git a/.config/wmii/quit b/.config/wmii/quit new file mode 100755 index 0000000..876a60e --- /dev/null +++ b/.config/wmii/quit @@ -0,0 +1,3 @@ +#!/bin/bash +. "$HOME/.wmii/include.sh" +echo quit >> $WMII_DIR/ctl diff --git a/.config/wmii/rbar_battery b/.config/wmii/rbar_battery new file mode 100755 index 0000000..ae8980a --- /dev/null +++ b/.config/wmii/rbar_battery @@ -0,0 +1,9 @@ +#!/bin/bash +. "$HOME/.wmii/include.sh" + +priority=$1 + +while connected_to_x_server; do + acpi -b >> "$WMII_DIR/rbar/${priority}_battery" + sleep 1 +done diff --git a/.config/wmii/rbar_clock b/.config/wmii/rbar_clock new file mode 100755 index 0000000..18c4493 --- /dev/null +++ b/.config/wmii/rbar_clock @@ -0,0 +1,9 @@ +#!/bin/bash +. "$HOME/.wmii/include.sh" + +priority=$1 + +while connected_to_x_server; do + date >> "$WMII_DIR/rbar/${priority}_clock" + sleep .5 +done diff --git a/.config/wmii/rbar_cpu b/.config/wmii/rbar_cpu new file mode 100755 index 0000000..22da985 --- /dev/null +++ b/.config/wmii/rbar_cpu @@ -0,0 +1,12 @@ +#!/bin/bash +. "$HOME/.wmii/include.sh" + +priority=$1 + +while connected_to_x_server; 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;') >> "$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)/')' ]' >> "$WMII_DIR/rbar/${priority}_cpu" + sleep 1 +done diff --git a/.config/wmii/rbar_wifi b/.config/wmii/rbar_wifi new file mode 100755 index 0000000..2ada834 --- /dev/null +++ b/.config/wmii/rbar_wifi @@ -0,0 +1,9 @@ +#!/bin/bash +. "$HOME/.wmii/include.sh" + +priority=$1 + +while connected_to_x_server; do + echo 'Wlan0:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality) >> "$WMII_DIR/rbar/${priority}_wifi" + sleep 1 +done diff --git a/.config/wmii/tagrules b/.config/wmii/tagrules new file mode 100644 index 0000000..990151f --- /dev/null +++ b/.config/wmii/tagrules @@ -0,0 +1,3 @@ +/Emacs|Navigator/ -> +sel +/Eclipse/ -> +sel +/panel/ -> /.*/ diff --git a/.config/wmii/theme-solarized b/.config/wmii/theme-solarized new file mode 100644 index 0000000..5dc830d --- /dev/null +++ b/.config/wmii/theme-solarized @@ -0,0 +1,16 @@ +SOL_BASE03='#002b36' +SOL_BASE02='#073642' +SOL_BASE01='#586e75' +SOL_BASE00='#657b83' +SOL_BASE0='#839496' +SOL_BASE1='#93a1a1' +SOL_BASE2='#eee8d5' +SOL_BASE3='#fdf6e3' +SOL_YELLOW='#b58900' +SOL_ORANGE='#cb4b16' +SOL_RED='#dc322f' +SOL_MAGENTA='#d33682' +SOL_VIOLET='#6c71c4' +SOL_BLUE='#268bd2' +SOL_CYAN='#2aa198' +SOL_GREEN='#859900' diff --git a/.config/wmii/theme-solarized-dark b/.config/wmii/theme-solarized-dark new file mode 100644 index 0000000..83285ba --- /dev/null +++ b/.config/wmii/theme-solarized-dark @@ -0,0 +1,12 @@ +#!/bin/sh +# Solarized-dark + +. $HOME/.wmii/theme-solarized + +WMII_BACKGROUND="$SOL_BASE02" + +# =" " +WMII_NORMCOLORS="$SOL_BASE0 $SOL_BASE03 $SOL_BASE02" +WMII_FOCUSCOLORS="$SOL_BASE0 $SOL_BASE02 $SOL_BASE0" +WMII_URGENTCOLORS="$SOL_RED $SOL_BASE03 $SOL_RED" + diff --git a/.config/wmii/util.sh b/.config/wmii/util.sh new file mode 100644 index 0000000..43d7d4a --- /dev/null +++ b/.config/wmii/util.sh @@ -0,0 +1,128 @@ +#!/bin/bash + +# I moved "fixes" into a separate file because it isn't so much configuration... +. "$HOME/.wmii/fixes.sh" + +################################################################################ +# Added shell features # +################################################################################ + +## +# Usage: dquote STRING +# Safely double-quotes a string. +# It escapes ways to execute code, but not variables. +## +dquote() { + str=$1 + str="${str//\\/\\\\}" # backslash + str="${str//\"/\\\"}" # dquote + str="${str//\$(/\\\$(}" # $(...) + str="${str//\`/\\\`}" # backtick + printf '"%s"\n' "$str" +} + +## +# Usage: expand_variables +# Expands variables read from /dev/stdin +## +expand_variables() { + while read; do + eval printf "'%s\n'" "$(dquote "$REPLY")" + done +} + +is_mounted() { + dir="$(readlink -m $1)" + mntpnt="$(cut -d' ' -f2 /proc/mounts|grep -- "$dir")" + [[ $dir = "$mntpnt" ]] + return $? +} + +################################################################################ +# PATH manipulation # +################################################################################ + +## +# Usage: path_ls PATH +# List executables in PATH (PATH is delimited by `:') +## +path_ls() { + dirs="`echo "$@"|sed 'y/:/ /'`" + find -L $dirs -maxdepth 1 -type f -executable -printf '%f\n' 2>/dev/null | sort -u +} + +## +# Usage: path_which PATH PROGRAM +# Find the full path of PROGRAM by searching PATH +## +path_which() { + mypath=$1 + prog=$2 + which=`which which` + PATH="$mypath" "$which" -- "$prog" 2>/dev/null +} + +################################################################################ +# wmii convenience functions # +################################################################################ + +## +# Usage: lstags +# Lists wmii tags +## +lstags() { + ls $WMII_DIR/tag | sed -e 's@/@@' -e '/^sel$/d' +} + +################################################################################ +# X11 functions # +################################################################################ + +## +# Usage: connected_to_x_server +# Return status indicates whether there is an X server at $DISPLAY +## +connected_to_x_server() { + xdpyinfo &>/dev/null + return $? +} + +################################################################################ +# My wmii configuration # +################################################################################ + +## +# Usage: scansection [SECTION] +# Reads the doc comments from a section of wmiirc. +# If SECTION is not given, it reads all doc comments. +## +scansection() { + file=`conffile config.sh` + sec=$1 + tmp=`mktemp` + # Isolate the sections we want. + if [ -n "$sec" ]; then + # Find the section + < "$file" sed -n "/^\s*$sec\s*()/,/##\s*End $sec/p" | sed '1d;$d'> $tmp + else + # Remove extra lines that mark the end of a section + < "$file" sed "/\s*}\s*##\s*End\s/d" > $tmp + fi + < $tmp sed -n '/##/p' | while read; do + var="$(echo "$REPLY" | sed -nr 's/^\s*(.*)\)\s*##.*/\1/p')" + comment="$(echo "$REPLY" | sed -r 's/.*## ?//')" + if [ -z "$var" ]; then + printf '%s\n' "$comment" + else + printf '\t%s\t%s\n' "$(echo "$var"|expand_variables)" "$comment" + fi + done + rm $tmp +} + +## +# Usage: conffile FILE +## +conffile() { + echo "$HOME/.wmii/$@" +} diff --git a/.config/wmii/wmiirc b/.config/wmii/wmiirc new file mode 100755 index 0000000..1f1ea18 --- /dev/null +++ b/.config/wmii/wmiirc @@ -0,0 +1,12 @@ +#!/bin/bash +. "$HOME/.wmii/include.sh" + +wmiir xwrite /event WmiircQuit # close any existing wmiirc's + +Event WmiircStart + +trap "Event Quit" EXIT + +wmiir read /event 2>/dev/null | while read event; do + Event $event +done diff --git a/.wmii b/.wmii new file mode 120000 index 0000000..e291b06 --- /dev/null +++ b/.wmii @@ -0,0 +1 @@ +.config/wmii \ No newline at end of file diff --git a/.wmii/autostart b/.wmii/autostart deleted file mode 100755 index d95ce34..0000000 --- a/.wmii/autostart +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -. "$HOME/.wmii/include.sh" - -daemon lxpanel &> /dev/null -daemon nm-applet &> /dev/null -daemon notifyd &> /dev/null - -#Action rbar_cpu 01 & -#Action rbar_wifi 97 & -Action rbar_battery 98 & -Action rbar_clock 99 & diff --git a/.wmii/config.sh b/.wmii/config.sh deleted file mode 100644 index 1dac0ad..0000000 --- a/.wmii/config.sh +++ /dev/null @@ -1,249 +0,0 @@ -#!/bin/bash - -MODKEY=Mod4 # "super" -UP=p -DOWN=n -LEFT=b -RIGHT=f - -HIST="`conffile history`" - -# Colors tuples: " " -. `conffile theme-solarized-dark` - -Event() { - event=$1; shift; - case "$event" in - ## Mouse event meanings: - ## MouseDown = mouse down - ## Click = mouse up - ## DND = hover, while dragging something (Drag 'n' Drop) - ## The associated mouse button is always "1" - ## - ## Mouse-button IDs: - ## 1 = left - ## 2 = middle - ## 3 = right - - ## Custom (non-WMII-generated) events - WmiircStart) ## No args - echo ' ==> Starting wmiirc' - is_mounted $WMII_DIR && Event WmiircUnmount - Event WmiircMount - - # Configure wmii - < "`conffile tagrules`" expand_variables >> $WMII_DIR/tagrules - < "`conffile ctl-init`" expand_variables >> $WMII_DIR/ctl - scansection Key | cut -sf2 >> $WMII_DIR/keys - # Configure X11 - xsetroot -solid "$WMII_BACKGROUND" - - # Clear the LBar and RBar - find $WMII_DIR/{l,r}bar -type f -delete - # Populate the LBar by emulating [Create|Focus]Tag events - seltag=`sed 1q $WMII_DIR/tag/sel/ctl` - lstags | while read tag; do - Event CreateTag "$tag" - if [ "$tag" = "$seltag" ]; then - Event FocusTag "$tag" - fi - done - - # Run the autostart action - Action autostart 2>/dev/null & - ;; - WmiircQuit) ## No args - echo ' ==> Stopping wmiirc' - exit;; - WmiircMount) ## No args - echo " -> Creating mountpoint WMII_DIR=$WMII_DIR..." - mkdir -p "$WMII_DIR" - echo " -> Mounting WMII_DIR=$WMII_DIR..." - 9mount -i "unix!$WMII_NAMESPACE/wmii" "$WMII_DIR";; - WmiircUnmount) ## No args - echo " -> Unmounting WMII_DIR=$WMII_DIR..." - 9umount "$WMII_DIR" - echo " -> Removing mountpoint WMII_DIR=$WMII_DIR..." - rmdir "$WMII_DIR";; - ## WMII-meta events - Quit) ## No args - echo ' ==> wmii quit: unmounting' - trap - EXIT - Event WmiircUnmount - Event WmiircQuit;; - Warning) ## $@=string - notify-send "wmii warning: $*";; - Key) ## $1=keystroke - Key "$@";; - - ## WMII Window management events - FocusFloating) ## No args - ;; - AreaFocus) ## $1=area - ;; - DestroyArea) ## $1=area - ;; - ColumnFocus) ## $1=column - ;; - CreateColumn) ## $1=column - ;; - - ## Client events - CreateClient) ## $1=client - ;; - DestroyClient) ## $1=client - ;; - Urgent) ## $1=client $2=[Manager|Client] - ;; - NotUrgent) ## $1=client $2=[Manager|Client] - ;; - ClientMouseDown) ## $1=client $2=button - client=$1 - button=$2 - case $button in - 1) ;; - 2) ;; - 3) - { - case `wmii9menu Delete Fullscreen` in - Delete) - echo kill >> $WMII_DIR/client/$client/ctl;; - Fullscreen) - echo Fullscreen on >> $WMII_DIR/client/$1/ctl;; - esac - }& ;; - esac;; - ClientClick) ## $1=client $2=button - ;; - Unresponsive) ## $1=client - client=$1 - client_name=`cat $WMII_DIR/client/$client/label` - msg="The client \`${client_name}' is not responding." - msg+=" What would you like to do?" - { - resp=$(wihack -transient $client \ - xmessage -nearmouse -buttons Kill,Wait -print "$msg") - if [ "$resp" = Kill ]; then - echo slay >> $WMII_DIR/client/$client/ctl - fi - }& ;; - Fullscreen) ## $1=client $2=[on|off] - # TODO: hide any clients with the 'panel' class - ;; - - ## Tag events - CreateTag) ## $1=tag - echo "$WMII_NORMCOLORS" $@ >> $WMII_DIR/lbar/$1;; - DestroyTag) ## $1=tag - rm $WMII_DIR/lbar/$1;; - FocusTag) ## $1=tag - echo "$WMII_FOCUSCOLORS" $1 >> $WMII_DIR/lbar/$1;; - UnfocusTag) ## $1=tag - echo "$WMII_NORMCOLORS" $1 >> $WMII_DIR/lbar/$1;; - UrgentTag) ## $1=tag $2=[Manager|Client] - echo "$WMII_URGENTCOLORS" $1 >> $WMII_DIR/lbar/$1;; - NotUrgentTag) ## $1=tag $2=[Manager|Client] - echo "$WMII_NORMCOLORS" $1 >> $WMII_DIR/lbar/$1;; - - ## LeftBar events (usually tag buttons) - LeftBarMouseDown) ## $1=button $2=bar_item - ;; - LeftBarClick) ## $1=button $2=bar_item - shift # ignore the button - echo view "$@" >> $WMII_DIR/ctl;; - LeftMouseDND) ## $1=button $2=bar_item - Event LeftBarClick "$@";; - - ## RightBar events - RightBarMouseDown) ## $1=button $2=bar_item - ;; - RightBarClick) ## $1=button $2=bar_item - ;; - RightMouseDND) ## $1=button $2=bar_item - Event RightBarClick "$@";; - esac -} ## End Event - -# Key Bindings -Key() { - key=$1 - case "$key" in - ## Moving around - - $MODKEY-$LEFT) ## Select the client to the left - echo select left >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-$RIGHT) ## Select the client to the right - echo select right >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-$UP) ## Select the client above - echo select up >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-$DOWN) ## Select the client below - echo select down >> $WMII_DIR/tag/sel/ctl;; - - $MODKEY-space) ## Toggle between floating and managed layers - echo select toggle >> $WMII_DIR/tag/sel/ctl;; - - ## Moving clients around - - $MODKEY-Shift-$LEFT) ## Move selected client to the left - echo send sel left >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-Shift-$RIGHT) ## Move selected client to the right - echo send sel right >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-Shift-$UP) ## Move selected client up - echo send sel up >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-Shift-$DOWN) ## Move selected client down - echo send sel down >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-Shift-space) ## Toggle selected client between floating and managed layers - echo send sel toggle >> $WMII_DIR/tag/sel/ctl;; - - ## Moving through stacks - $MODKEY-Control-$UP) ## Select the stack above - echo select up stack >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-Control-$DOWN) ## Select the stack below - echo select down stack >> $WMII_DIR/tag/sel/ctl;; - - ## Client actions - $MODKEY-shift-1) ## Toggle selected client's fullsceen state - echo Fullscreen toggle >> $WMII_DIR/client/sel/ctl;; - $MODKEY-shift-0) ## Close client - echo kill >> $WMII_DIR/client/sel/ctl;; - - ## Changing column modes - $MODKEY-d) ## Set column to default mode - echo colmode sel default-max >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-s) ## Set column to stack mode - echo colmode sel stack-max >> $WMII_DIR/tag/sel/ctl;; - $MODKEY-m) ## Set column to max mode - echo colmode sel stack+max >> $WMII_DIR/tag/sel/ctl;; - - ## Running programs - $MODKEY-a) ## Open wmii actions menu - Action $(path_ls $WMII_CONFPATH | wimenu -h "${HIST}.actions" -n 5000) & ;; - $MODKEY-x) ## Open program menu - setsid $(path_ls $PATH | wimenu -h "${HIST}.progs" -n 5000) & ;; - $MODKEY-Return) ## Launch a terminal - setsid x-terminal-emulator & ;; - - ## Tag actions - $MODKEY-t) ## Change to another tag - { - tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return - echo view $tag >> $WMII_DIR/ctl - }& ;; - $MODKEY-Shift-t) ## Retag the selected client - sel=$(sed 1q $WMII_DIR/client/sel/ctl) - { - tag=$(lstags | wimenu -h "${HIST}.tags" -n 50) || return - echo "$tag" >> $WMII_DIR/client/$sel/tags - }& ;; - esac -} ## End Key - -Action() { - prog=`path_which "$WMII_CONFPATH" $1`; shift - if [ -n "$prog" ]; then - "$prog" "$@" - return $? - else - return 1 - fi -} ## End Action diff --git a/.wmii/ctl-init b/.wmii/ctl-init deleted file mode 100644 index 026c0d5..0000000 --- a/.wmii/ctl-init +++ /dev/null @@ -1,5 +0,0 @@ -font xft:Monospace-8 -focuscolors $WMII_FOCUSCOLORS -normcolors $WMII_NORMCOLORS -grabmod $MODKEY -border 1 diff --git a/.wmii/fixes.sh b/.wmii/fixes.sh deleted file mode 100644 index aa09157..0000000 --- a/.wmii/fixes.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# Fix various deficiencies in either the shell or the filesystem - -## -# Usage: ls DIRECTORY -# Linux's 9p kernel module sometimes omits entries in directory listings -## -unalias ls &>/dev/null -ls() { - real_ls="`which ls` -1F" - [ $# = 0 ] && set -- "`pwd`" - f="${1/#${WMII_DIR}/}" - if [ "$f" = "$1" ]; then - $real_ls "$f" - else - wmiir ls "$f" - fi -} - -## -# Usage: setsid cmd [arguments...] -# I like wmiir's setsid better than linux-utils' -## -setsid() { wmiir setsid "$@"; } diff --git a/.wmii/help-events b/.wmii/help-events deleted file mode 100755 index 25b7d41..0000000 --- a/.wmii/help-events +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -. "$HOME/.wmii/include.sh" -scansection Event | xmessage -file - diff --git a/.wmii/help-keys b/.wmii/help-keys deleted file mode 100755 index c6e7038..0000000 --- a/.wmii/help-keys +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -. "$HOME/.wmii/include.sh" -scansection Key | xmessage -file - diff --git a/.wmii/include.sh b/.wmii/include.sh deleted file mode 100644 index d4e58c3..0000000 --- a/.wmii/include.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -if [ -z "$WMII_NAMESPACE" ]; then - export WMII_NAMESPACE="`wmiir namespace`" -fi -if [ -z "$WMII_DIR" ]; then - export WMII_DIR="$HOME/n/wmii" -fi - -. "$HOME/.wmii/util.sh" -. "$HOME/.wmii/config.sh" diff --git a/.wmii/quit b/.wmii/quit deleted file mode 100755 index 876a60e..0000000 --- a/.wmii/quit +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -. "$HOME/.wmii/include.sh" -echo quit >> $WMII_DIR/ctl diff --git a/.wmii/rbar_battery b/.wmii/rbar_battery deleted file mode 100755 index ae8980a..0000000 --- a/.wmii/rbar_battery +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -. "$HOME/.wmii/include.sh" - -priority=$1 - -while connected_to_x_server; do - acpi -b >> "$WMII_DIR/rbar/${priority}_battery" - sleep 1 -done diff --git a/.wmii/rbar_clock b/.wmii/rbar_clock deleted file mode 100755 index 18c4493..0000000 --- a/.wmii/rbar_clock +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -. "$HOME/.wmii/include.sh" - -priority=$1 - -while connected_to_x_server; do - date >> "$WMII_DIR/rbar/${priority}_clock" - sleep .5 -done diff --git a/.wmii/rbar_cpu b/.wmii/rbar_cpu deleted file mode 100755 index 22da985..0000000 --- a/.wmii/rbar_cpu +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -. "$HOME/.wmii/include.sh" - -priority=$1 - -while connected_to_x_server; 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;') >> "$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)/')' ]' >> "$WMII_DIR/rbar/${priority}_cpu" - sleep 1 -done diff --git a/.wmii/rbar_wifi b/.wmii/rbar_wifi deleted file mode 100755 index 2ada834..0000000 --- a/.wmii/rbar_wifi +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -. "$HOME/.wmii/include.sh" - -priority=$1 - -while connected_to_x_server; do - echo 'Wlan0:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality) >> "$WMII_DIR/rbar/${priority}_wifi" - sleep 1 -done diff --git a/.wmii/tagrules b/.wmii/tagrules deleted file mode 100644 index 990151f..0000000 --- a/.wmii/tagrules +++ /dev/null @@ -1,3 +0,0 @@ -/Emacs|Navigator/ -> +sel -/Eclipse/ -> +sel -/panel/ -> /.*/ diff --git a/.wmii/theme-solarized b/.wmii/theme-solarized deleted file mode 100644 index 5dc830d..0000000 --- a/.wmii/theme-solarized +++ /dev/null @@ -1,16 +0,0 @@ -SOL_BASE03='#002b36' -SOL_BASE02='#073642' -SOL_BASE01='#586e75' -SOL_BASE00='#657b83' -SOL_BASE0='#839496' -SOL_BASE1='#93a1a1' -SOL_BASE2='#eee8d5' -SOL_BASE3='#fdf6e3' -SOL_YELLOW='#b58900' -SOL_ORANGE='#cb4b16' -SOL_RED='#dc322f' -SOL_MAGENTA='#d33682' -SOL_VIOLET='#6c71c4' -SOL_BLUE='#268bd2' -SOL_CYAN='#2aa198' -SOL_GREEN='#859900' diff --git a/.wmii/theme-solarized-dark b/.wmii/theme-solarized-dark deleted file mode 100644 index 83285ba..0000000 --- a/.wmii/theme-solarized-dark +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Solarized-dark - -. $HOME/.wmii/theme-solarized - -WMII_BACKGROUND="$SOL_BASE02" - -# =" " -WMII_NORMCOLORS="$SOL_BASE0 $SOL_BASE03 $SOL_BASE02" -WMII_FOCUSCOLORS="$SOL_BASE0 $SOL_BASE02 $SOL_BASE0" -WMII_URGENTCOLORS="$SOL_RED $SOL_BASE03 $SOL_RED" - diff --git a/.wmii/util.sh b/.wmii/util.sh deleted file mode 100644 index 43d7d4a..0000000 --- a/.wmii/util.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/bash - -# I moved "fixes" into a separate file because it isn't so much configuration... -. "$HOME/.wmii/fixes.sh" - -################################################################################ -# Added shell features # -################################################################################ - -## -# Usage: dquote STRING -# Safely double-quotes a string. -# It escapes ways to execute code, but not variables. -## -dquote() { - str=$1 - str="${str//\\/\\\\}" # backslash - str="${str//\"/\\\"}" # dquote - str="${str//\$(/\\\$(}" # $(...) - str="${str//\`/\\\`}" # backtick - printf '"%s"\n' "$str" -} - -## -# Usage: expand_variables -# Expands variables read from /dev/stdin -## -expand_variables() { - while read; do - eval printf "'%s\n'" "$(dquote "$REPLY")" - done -} - -is_mounted() { - dir="$(readlink -m $1)" - mntpnt="$(cut -d' ' -f2 /proc/mounts|grep -- "$dir")" - [[ $dir = "$mntpnt" ]] - return $? -} - -################################################################################ -# PATH manipulation # -################################################################################ - -## -# Usage: path_ls PATH -# List executables in PATH (PATH is delimited by `:') -## -path_ls() { - dirs="`echo "$@"|sed 'y/:/ /'`" - find -L $dirs -maxdepth 1 -type f -executable -printf '%f\n' 2>/dev/null | sort -u -} - -## -# Usage: path_which PATH PROGRAM -# Find the full path of PROGRAM by searching PATH -## -path_which() { - mypath=$1 - prog=$2 - which=`which which` - PATH="$mypath" "$which" -- "$prog" 2>/dev/null -} - -################################################################################ -# wmii convenience functions # -################################################################################ - -## -# Usage: lstags -# Lists wmii tags -## -lstags() { - ls $WMII_DIR/tag | sed -e 's@/@@' -e '/^sel$/d' -} - -################################################################################ -# X11 functions # -################################################################################ - -## -# Usage: connected_to_x_server -# Return status indicates whether there is an X server at $DISPLAY -## -connected_to_x_server() { - xdpyinfo &>/dev/null - return $? -} - -################################################################################ -# My wmii configuration # -################################################################################ - -## -# Usage: scansection [SECTION] -# Reads the doc comments from a section of wmiirc. -# If SECTION is not given, it reads all doc comments. -## -scansection() { - file=`conffile config.sh` - sec=$1 - tmp=`mktemp` - # Isolate the sections we want. - if [ -n "$sec" ]; then - # Find the section - < "$file" sed -n "/^\s*$sec\s*()/,/##\s*End $sec/p" | sed '1d;$d'> $tmp - else - # Remove extra lines that mark the end of a section - < "$file" sed "/\s*}\s*##\s*End\s/d" > $tmp - fi - < $tmp sed -n '/##/p' | while read; do - var="$(echo "$REPLY" | sed -nr 's/^\s*(.*)\)\s*##.*/\1/p')" - comment="$(echo "$REPLY" | sed -r 's/.*## ?//')" - if [ -z "$var" ]; then - printf '%s\n' "$comment" - else - printf '\t%s\t%s\n' "$(echo "$var"|expand_variables)" "$comment" - fi - done - rm $tmp -} - -## -# Usage: conffile FILE -## -conffile() { - echo "$HOME/.wmii/$@" -} diff --git a/.wmii/wmiirc b/.wmii/wmiirc deleted file mode 100755 index 1f1ea18..0000000 --- a/.wmii/wmiirc +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -. "$HOME/.wmii/include.sh" - -wmiir xwrite /event WmiircQuit # close any existing wmiirc's - -Event WmiircStart - -trap "Event Quit" EXIT - -wmiir read /event 2>/dev/null | while read event; do - Event $event -done -- cgit v1.2.3-54-g00ecf From b5110458395fd1fac66aa644d938feeac5bcb5af Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 27 Jan 2013 14:43:59 -0500 Subject: mv .bazaar .config/bazaar; ln -s .config/bazaar .bazaar --- .bazaar | 1 + .bazaar/ignore | 10 ---------- .config/bazaar/ignore | 10 ++++++++++ 3 files changed, 11 insertions(+), 10 deletions(-) create mode 120000 .bazaar delete mode 100644 .bazaar/ignore create mode 100644 .config/bazaar/ignore diff --git a/.bazaar b/.bazaar new file mode 120000 index 0000000..42697a1 --- /dev/null +++ b/.bazaar @@ -0,0 +1 @@ +.config/bazaar \ No newline at end of file diff --git a/.bazaar/ignore b/.bazaar/ignore deleted file mode 100644 index 0e498f2..0000000 --- a/.bazaar/ignore +++ /dev/null @@ -1,10 +0,0 @@ -*.a -*.o -*.py[co] -*.so -*.sw[nop] -*~ -.#* -[#]*# -__pycache__ -bzr-orphans diff --git a/.config/bazaar/ignore b/.config/bazaar/ignore new file mode 100644 index 0000000..0e498f2 --- /dev/null +++ b/.config/bazaar/ignore @@ -0,0 +1,10 @@ +*.a +*.o +*.py[co] +*.so +*.sw[nop] +*~ +.#* +[#]*# +__pycache__ +bzr-orphans -- cgit v1.2.3-54-g00ecf From 4707f1c8454ea70102926598f87bc68104ddb4f5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 27 Jan 2013 14:44:41 -0500 Subject: rm .gnuzilla # IceCat now uses .mozilla --- .gnuzilla | 1 - 1 file changed, 1 deletion(-) delete mode 120000 .gnuzilla diff --git a/.gnuzilla b/.gnuzilla deleted file mode 120000 index 49c36a2..0000000 --- a/.gnuzilla +++ /dev/null @@ -1 +0,0 @@ -.mozilla/ \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 70770495b898a267e80bed8202652604e16f9617 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 27 Jan 2013 14:48:03 -0500 Subject: rm .config/meld/meldrc.ini --- .config/meld/meldrc.ini | 1 - 1 file changed, 1 deletion(-) delete mode 120000 .config/meld/meldrc.ini diff --git a/.config/meld/meldrc.ini b/.config/meld/meldrc.ini deleted file mode 120000 index dc1dc0c..0000000 --- a/.config/meld/meldrc.ini +++ /dev/null @@ -1 +0,0 @@ -/dev/null \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 8122a96f65e767d86d483a465367dd5ccba1d5a7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 27 Jan 2013 15:05:34 -0500 Subject: symlink git files to .config/git --- .config/git/config | 14 ++++++++++++++ .config/git/gitk | 36 ++++++++++++++++++++++++++++++++++++ .config/git/ignore | 0 .gitconfig | 15 +-------------- .gitignore | 1 + .gitk | 1 + 6 files changed, 53 insertions(+), 14 deletions(-) create mode 100644 .config/git/config create mode 100644 .config/git/gitk create mode 100644 .config/git/ignore mode change 100644 => 120000 .gitconfig create mode 120000 .gitignore create mode 120000 .gitk diff --git a/.config/git/config b/.config/git/config new file mode 100644 index 0000000..218b006 --- /dev/null +++ b/.config/git/config @@ -0,0 +1,14 @@ +[user] + name = Luke Shumaker + email = LukeShu@sbcglobal.net +[color] + ui = auto +[sendemail] + smtpencryption = ssl + smtpserver = plus.smtp.mail.yahoo.com + smtpuser = lukeshu@sbcglobal.net + smtpserverport = 465 +[push] + default = matching +[alias] + lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative diff --git a/.config/git/gitk b/.config/git/gitk new file mode 100644 index 0000000..c0a0171 --- /dev/null +++ b/.config/git/gitk @@ -0,0 +1,36 @@ +set mainfont {Helvetica 9} +set textfont {{DejaVu Sans Mono} 9} +set uifont {Helvetica 9 bold} +set tabstop 8 +set findmergefiles 0 +set maxgraphpct 50 +set maxwidth 16 +set cmitmode patch +set wrapcomment none +set autoselect 1 +set autosellen 40 +set showneartags 1 +set hideremotes 0 +set showlocalchanges 1 +set datetimeformat {%Y-%m-%d %H:%M:%S} +set limitdiffs 1 +set uicolor grey85 +set want_ttk 1 +set bgcolor white +set fgcolor black +set colors {green red blue magenta darkgrey brown orange} +set diffcolors {red "#00a000" blue} +set markbgcolor #e0e0ff +set diffcontext 4 +set selectbgcolor gray85 +set extdifftool meld +set perfile_attrs 0 +set geometry(main) 1364x690+0+0 +set geometry(state) normal +set geometry(topwidth) 1364 +set geometry(topheight) 358 +set geometry(pwsash0) "617 1" +set geometry(pwsash1) "1025 1" +set geometry(botwidth) 889 +set geometry(botheight) 327 +set permviews {} diff --git a/.config/git/ignore b/.config/git/ignore new file mode 100644 index 0000000..e69de29 diff --git a/.gitconfig b/.gitconfig deleted file mode 100644 index 218b006..0000000 --- a/.gitconfig +++ /dev/null @@ -1,14 +0,0 @@ -[user] - name = Luke Shumaker - email = LukeShu@sbcglobal.net -[color] - ui = auto -[sendemail] - smtpencryption = ssl - smtpserver = plus.smtp.mail.yahoo.com - smtpuser = lukeshu@sbcglobal.net - smtpserverport = 465 -[push] - default = matching -[alias] - lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative diff --git a/.gitconfig b/.gitconfig new file mode 120000 index 0000000..653bc6e --- /dev/null +++ b/.gitconfig @@ -0,0 +1 @@ +.config/git/config \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 120000 index 0000000..9592ae4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.config/git/ignore \ No newline at end of file diff --git a/.gitk b/.gitk new file mode 120000 index 0000000..a0a4a0f --- /dev/null +++ b/.gitk @@ -0,0 +1 @@ +.config/git/gitk \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 616881193f56dbc6943a63c0201874b60c075188 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 27 Jan 2013 16:02:37 -0500 Subject: move nanorc into .config --- .config/nanorc | 233 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .nanorc | 1 + .nanorc.in | 233 --------------------------------------------------------- Makefile | 2 +- 4 files changed, 235 insertions(+), 234 deletions(-) create mode 100644 .config/nanorc create mode 120000 .nanorc delete mode 100644 .nanorc.in diff --git a/.config/nanorc b/.config/nanorc new file mode 100644 index 0000000..b21e86b --- /dev/null +++ b/.config/nanorc @@ -0,0 +1,233 @@ +## Please note that you must have configured nano with --enable-nanorc +## for this file to be read! Also note that this file should not be in +## DOS or Mac format, and that characters specially interpreted by the +## shell should not be escaped here. +## +## To make sure a value is disabled, use "unset