aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshmibs <shmibs@gmail.com>2014-05-28 08:49:01 -0700
committershmibs <shmibs@gmail.com>2014-05-28 08:49:01 -0700
commit4ffad3ac6c5259b975650cf1aeaaecb1fd255be3 (patch)
treefd37665dad2eca4484f0978e6cf6750dea0cd348
parentf1ca9695d1d00955003af3c44b5aac5fbcce970b (diff)
downloaddotfiles-4ffad3ac6c5259b975650cf1aeaaecb1fd255be3.tar.gz
updated calc
ans can now be used to refer to the previous answer value in a calculation
-rw-r--r--.bash_aliases46
-rw-r--r--.bash_profile (renamed from .profile)4
-rw-r--r--.bashrc44
-rwxr-xr-x.config/herbstluftwm/calc.sh27
-rw-r--r--.vimrc25
-rw-r--r--.xinitrc4
6 files changed, 84 insertions, 66 deletions
diff --git a/.bash_aliases b/.bash_aliases
new file mode 100644
index 0000000..6d1796d
--- /dev/null
+++ b/.bash_aliases
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+export EDITOR="vim"
+export PAGER="less -R"
+
+alias ls='ls --color=auto'
+alias grep='grep --color=auto'
+alias diff='colordiff'
+alias less='less -R'
+
+alias vmount='udevil mount'
+alias vumount='udevil umount'
+alias def='sdcv'
+
+send() {
+ if [ "$1" ]; then
+ scp $@ shmibbles.me:/srv/http/tmp/
+ if [ $? -eq 0 ]; then
+ for name in "$@"
+ do
+ name=$(echo "http://shmibbles.me/tmp/$(basename $name)" | sed 's/ /%20/g')
+ echo $name | tr -d '\n' | xclip -i -selection clipboard
+ echo $name | tr -d '\n' | xclip -i -selection primary
+ done
+ fi
+ else
+ echo "specify at least one file to send"
+ fi
+}
+
+sendi() {
+ if [ "$1" ]; then
+ scp $@ shmibbles.me:/srv/http/img/
+ if [ $? -eq 0 ]; then
+ for name in "$@"
+ do
+ name=$(echo "http://shmibbles.me/img/$(basename $name)" | sed 's/ /%20/g')
+ echo $name | tr -d '\n' | xclip -i -selection clipboard
+ echo $name | tr -d '\n' | xclip -i -selection primary
+ done
+ fi
+ else
+ echo "specify at least one file to send"
+ fi
+}
+
diff --git a/.profile b/.bash_profile
index 42b0fb4..f42c6a0 100644
--- a/.profile
+++ b/.bash_profile
@@ -1,4 +1,4 @@
-# /etc/profile
+# /home/shmibs/.bash_profile
#Set our umask
umask 022
@@ -26,4 +26,4 @@ unset TERMCAP
# Man is much better than us at figuring this out
unset MANPATH
-export EDITOR="vim"
+source ~/.bash_aliases
diff --git a/.bashrc b/.bashrc
index 5259146..9eca7d3 100644
--- a/.bashrc
+++ b/.bashrc
@@ -30,46 +30,4 @@ esac
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
-export EDITOR="vim"
-export PAGER="less -R"
-
-alias ls='ls --color=auto'
-alias grep='grep --color=auto'
-alias diff='colordiff'
-alias less='less -R'
-
-alias vmount='udevil mount'
-alias vumount='udevil umount'
-alias def='sdcv'
-
-send() {
- if [ "$1" ]; then
- scp $@ shmibbles.me:/srv/http/tmp/
- if [ $? -eq 0 ]; then
- for name in "$@"
- do
- name=$(echo "http://shmibbles.me/tmp/$(basename $name)" | sed 's/ /%20/g')
- echo $name | tr -d '\n' | xclip -i -selection clipboard
- echo $name | tr -d '\n' | xclip -i -selection primary
- done
- fi
- else
- echo "specify at least one file to send"
- fi
-}
-
-sendi() {
- if [ "$1" ]; then
- scp $@ shmibbles.me:/srv/http/img/
- if [ $? -eq 0 ]; then
- for name in "$@"
- do
- name=$(echo "http://shmibbles.me/img/$(basename $name)" | sed 's/ /%20/g')
- echo $name | tr -d '\n' | xclip -i -selection clipboard
- echo $name | tr -d '\n' | xclip -i -selection primary
- done
- fi
- else
- echo "specify at least one file to send"
- fi
-}
+source ~/.bash_aliases
diff --git a/.config/herbstluftwm/calc.sh b/.config/herbstluftwm/calc.sh
index 0f7ddfb..358f43d 100755
--- a/.config/herbstluftwm/calc.sh
+++ b/.config/herbstluftwm/calc.sh
@@ -8,19 +8,26 @@ e="2.7182818284590452353602874713526624977572471"
while [ "$in" != "" ]; do
in=$(echo "" | dmenu -q -h 18 -nb $1 -nf $2 -sb $3 -sf $4 -p "$prompt")
- out=$(echo "pi=$pi; e=$e; $acc $in" | calc -p 2>&1 | tr -d "\n")
-
- if [ "$out" = "Missing operator" ]; then
- out=$(echo "pi=$pi; e=$e; $in" | calc -p 2>&1)
- fi
+ # replace "ans" with the previous value
+ in=$(echo $in | sed -e "s/ans/$acc/g")
- # check for error output
+ out=$(echo "pi=$pi; e=$e; $acc $in" | calc -p 2>&1)
+
if [ "${?#0}" != "" ]; then
out=$(echo "$out" | tr -d "\n")
- prompt="calc: ($acc) err: $out"
- else
- acc=$out
- prompt="calc: ($acc)"
+ if [ "$out" = "Missing operator" ]; then
+ out=$(echo "pi=$pi; e=$e; $in" | calc -p 2>&1)
+ if [ "${?#0}" != "" ]; then
+ out=$(echo "$out" | tr -d "\n")
+ prompt="calc: ($acc) err: $out"
+ else
+ acc=$out
+ prompt="calc: ($acc)"
+ fi
+ else
+ out=$(echo "$out" | tr -d "\n")
+ prompt="calc: ($acc) err: $out"
+ fi
fi
done
diff --git a/.vimrc b/.vimrc
index 2ff0919..a571715 100644
--- a/.vimrc
+++ b/.vimrc
@@ -7,20 +7,23 @@ set autoindent
colorscheme anotherdark
set background=dark
-"tab controls to match pentadactyl
-noremap <C-n> <Esc>:tabn<CR>
-noremap <C-p> <Esc>:tabp<CR>
-noremap <C-t> <Esc>:tabnew<CR>
+"enable status-line
+set laststatus=2
+
+"allow edited background buffers
+set hidden
+
+"buffer controls to match pentadactyl
+noremap <C-n> <Esc>:bn<CR>
+noremap <C-p> <Esc>:bp<CR>
+noremap <C-t> <Esc>:badd<Space>
+noremap <C-g> <Esc>:buffers<CR>:b<Space>
"insert lines above and below with (=|+)
"very hackish, but i couldn't think of a better way
nnoremap = Oa<C-u><Esc>j
nnoremap + oa<C-u><Esc>k
-"disable auto session save/load
-let g:session_autosave = 'no'
-let g:session_autoload = 'no'
-
"folds!
nnoremap fo zO
nnoremap fc zC
@@ -28,8 +31,8 @@ nnoremap fm zM
nnoremap fr zR
"copy words from above and below the cursor
-inoremap <expr> <c-y> pumvisible() ? "\<c-y>" : matchstr(getline(line('.')-1), '\%' . virtcol('.') . 'v\%(\k\+\\|.\)')
-inoremap <expr> <c-e> pumvisible() ? "\<c-e>" : matchstr(getline(line('.')+1), '\%' . virtcol('.') . 'v\%(\k\+\\|.\)')
+inoremap <expr> <C-y> pumvisible() ? "\<C-y>" : matchstr(getline(line('.')-1), '\%' . virtcol('.') . 'v\%(\k\+\\|.\)')
+inoremap <expr> <C-e> pumvisible() ? "\<C-e>" : matchstr(getline(line('.')+1), '\%' . virtcol('.') . 'v\%(\k\+\\|.\)')
"use the X clipboard for things when running in a virtual terminal, because yes
if &term != "linux"
@@ -90,5 +93,5 @@ endfunction
function! Settings_vim()
setlocal smartindent
- noremap -- A<Space>"<Space>
+ noremap -- A<Space>"
endfunction
diff --git a/.xinitrc b/.xinitrc
index 0119fc7..34f9988 100644
--- a/.xinitrc
+++ b/.xinitrc
@@ -16,6 +16,10 @@ export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
fcitx &
+#disable power saving
+xset -dpms
+xset s off
+
#urxvt daemon
urxvtd &