aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2015-07-09 02:40:48 +0200
committerDuncaen <mail@duncano.de>2015-07-09 02:40:48 +0200
commit19a9f36c93906b7a5c49055dfc50436c18d5796a (patch)
tree784f67775cfaf36535742a70e36617a1013a4d19
parent46fbfc5d551b3cde8c7b044ad7441e2b3c6d3f03 (diff)
downloaddotfiles-19a9f36c93906b7a5c49055dfc50436c18d5796a.tar.gz
clean mkshrc
-rwxr-xr-xinstall.sh3
-rwxr-xr-xmksh.d/00-editor.sh3
-rwxr-xr-xmksh.d/00-git.sh11
-rwxr-xr-xmksh.d/00-go.sh3
-rwxr-xr-xmksh.d/00-grc.sh12
-rwxr-xr-xmksh.d/00-infinality.sh19
-rwxr-xr-xmksh.d/00-ls.sh2
-rwxr-xr-xmksh.d/00-misc.sh5
-rwxr-xr-xmksh.d/00-pager.sh15
-rwxr-xr-xmksh.d/00-xbps.sh6
-rwxr-xr-xmksh.d/90-prompt.sh9
-rwxr-xr-xmksh.d/91-z.sh4
-rw-r--r--mkshrc131
13 files changed, 100 insertions, 123 deletions
diff --git a/install.sh b/install.sh
index 75236c5..bb6d01a 100755
--- a/install.sh
+++ b/install.sh
@@ -18,6 +18,9 @@ ln -sfv $dotfiles/Xresources /home/$user/.Xresources
rm -v /home/$user/.mkshrc
ln -sfv $dotfiles/mkshrc /home/$user/.mkshrc
+rm -v /home/$user/.mksh.d
+ln -sfv $dotfiles/mksh.d /home/$user/.mksh.d
+
rm -v /home/$user/.profile
ln -sfv $dotfiles/profile /home/$user/.profile
diff --git a/mksh.d/00-editor.sh b/mksh.d/00-editor.sh
new file mode 100755
index 0000000..d60a65f
--- /dev/null
+++ b/mksh.d/00-editor.sh
@@ -0,0 +1,3 @@
+EDITOR=$(command -v vim)
+VISUAL="$EDITOR"
+export EDITOR VISUAL
diff --git a/mksh.d/00-git.sh b/mksh.d/00-git.sh
new file mode 100755
index 0000000..ac92102
--- /dev/null
+++ b/mksh.d/00-git.sh
@@ -0,0 +1,11 @@
+if [ -x /usr/bin/git ]; then
+ alias ga='git add'
+ alias gc='git commit'
+ alias gca='git commit --amend'
+ alias gp='git pull'
+ alias gpr='git pull --rebase'
+ alias gs='git status -sb'
+ alias gb='git branch'
+ alias gd='git icdiff'
+ alias gl='git l'
+fi
diff --git a/mksh.d/00-go.sh b/mksh.d/00-go.sh
new file mode 100755
index 0000000..836d665
--- /dev/null
+++ b/mksh.d/00-go.sh
@@ -0,0 +1,3 @@
+export GOPATH=~/go
+export GOBIN=$GOPATH/bin
+export PATH="$PATH:$GOBIN"
diff --git a/mksh.d/00-grc.sh b/mksh.d/00-grc.sh
new file mode 100755
index 0000000..bfeeac1
--- /dev/null
+++ b/mksh.d/00-grc.sh
@@ -0,0 +1,12 @@
+case "$HOSTNAME" in
+ tux|mir02)
+ alias ld='grc -es --colour=auto ld'
+ alias ss='grc -es --colour=auto ss'
+ alias ps='grc -es --colour=auto ps'
+ alias mount='grc -es --colour=auto mount'
+ alias dig='grc -es --colour=auto dig'
+ alias ping='grc -es --colour=auto ping'
+ alias traceroute='grc -es --colour=auto traceroute'
+ alias df='grc -es --colour=auto df'
+ ;;
+esac
diff --git a/mksh.d/00-infinality.sh b/mksh.d/00-infinality.sh
new file mode 100755
index 0000000..d56e60e
--- /dev/null
+++ b/mksh.d/00-infinality.sh
@@ -0,0 +1,19 @@
+if [ -n "$DISPLAY" ]; then
+ export INFINALITY_FT_FILTER_PARAMS='10 35 40 35 10'
+ export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=0
+ export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=0
+ export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=false
+ export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=0
+ export INFINALITY_FT_GAMMA_CORRECTION='0 100'
+ export INFINALITY_FT_BRIGHTNESS=0
+ export INFINALITY_FT_CONTRAST=0
+ export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=5
+ export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=0
+ export INFINALITY_FT_FRINGE_FILTER_STRENGTH=5
+ export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=10
+ export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=0
+ export INFINALITY_FT_STEM_FITTING_STRENGTH=0
+ export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=0
+ export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=true
+ export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
+fi
diff --git a/mksh.d/00-ls.sh b/mksh.d/00-ls.sh
new file mode 100755
index 0000000..80ad3bc
--- /dev/null
+++ b/mksh.d/00-ls.sh
@@ -0,0 +1,2 @@
+alias ls="ls -hF --color"
+
diff --git a/mksh.d/00-misc.sh b/mksh.d/00-misc.sh
new file mode 100755
index 0000000..7ddccfd
--- /dev/null
+++ b/mksh.d/00-misc.sh
@@ -0,0 +1,5 @@
+alias wanip='curl ipinfo.io/ip'
+
+function psgrep {
+ ps u `pgrep "$1"`
+}
diff --git a/mksh.d/00-pager.sh b/mksh.d/00-pager.sh
new file mode 100755
index 0000000..16497c9
--- /dev/null
+++ b/mksh.d/00-pager.sh
@@ -0,0 +1,15 @@
+PAGER=$(command -v less)
+LESS="-FXRi"
+# LESSHISTFILE=-
+MANWIDTH=80
+
+# colored man pages:
+LESS_TERMCAP_md=$'\e[1;31m' # start bold
+LESS_TERMCAP_so=$'\e[1;40;37m' # start standout
+LESS_TERMCAP_se=$'\e[0m' # end standout
+LESS_TERMCAP_us=$'\e[0;34m' # start underlining
+LESS_TERMCAP_ue=$'\e[0m' # end underlining
+LESS_TERMCAP_me=$'\e[0m' # end all modes]']']']']']'
+
+export PAGER LESS LESSHISTFILE MANWIDTH LESS_TERMCAP_md LESS_TERMCAP_so \
+ LESS_TERMCAP_se LESS_TERMCAP_us LESS_TERMCAP_ue LESS_TERMCAP_me
diff --git a/mksh.d/00-xbps.sh b/mksh.d/00-xbps.sh
new file mode 100755
index 0000000..6d6d231
--- /dev/null
+++ b/mksh.d/00-xbps.sh
@@ -0,0 +1,6 @@
+if [ -d /etc/xbps.d ]; then
+ export XBPS_DISTDIR=/srv/void-packages
+ alias xi='sudo xbps-install'
+ alias xr='sudo xbps-remove'
+ alias xq='xbps-query'
+fi
diff --git a/mksh.d/90-prompt.sh b/mksh.d/90-prompt.sh
new file mode 100755
index 0000000..d5a693d
--- /dev/null
+++ b/mksh.d/90-prompt.sh
@@ -0,0 +1,9 @@
+if [ -x /usr/bin/slcp ]; then
+ PS1='$(slcp $COLUMNS $?)'
+fi
+
+case "$TERM" in
+ dvtm*|xterm*|rxvt*)
+ PS1+='$(echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007")'
+ ;;
+esac
diff --git a/mksh.d/91-z.sh b/mksh.d/91-z.sh
new file mode 100755
index 0000000..b5ad1af
--- /dev/null
+++ b/mksh.d/91-z.sh
@@ -0,0 +1,4 @@
+if [ -r /home/duncan/repos/github.com/Duncaen/dotfiles/z/z.sh ]; then
+ . /home/duncan/repos/github.com/Duncaen/dotfiles/z/z.sh
+ PS1+='$(_z --add "${PWD}")'
+fi
diff --git a/mkshrc b/mkshrc
index 119b873..7b41fe5 100644
--- a/mkshrc
+++ b/mkshrc
@@ -387,134 +387,19 @@ function setenv {
: place customisations below this line
-for p in ~/.etc/bin ~/bin; do
- [[ -d $p/. ]] || continue
- [[ :$PATH: = *:$p:* ]] || PATH=$p:$PATH
-done
-
-function psgrep {
- ps u `pgrep "$1"`
-}
-
-export XBPS_DISTDIR=~/repos/github.com/Duncaen/void-packages
-export GOPATH=~/go
-export GOBIN=$GOPATH/bin
-export PATH="$PATH:$GOBIN"
-export EDITOR=vim
-
-export SHELL=$MKSH MANWIDTH=80 LESSHISTFILE=-
-export LESS="-F -X -R"
-alias cls='print -n \\033c'
-alias ls="ls --color -F"
-
-alias wanip='curl ipinfo.io/ip'
-
-# git
-alias ga='git add'
-alias gc='git commit'
-alias gca='git commit --amend'
-alias gp='git pull'
-alias gpr='git pull --rebase'
-alias gs='git status -sb'
-alias gb='git branch'
-alias gd='git icdiff'
-alias gl='git l'
-
-# xbps
-alias xi='sudo xbps-install'
-alias xr='sudo xbps-remove'
-alias xq='xbps-query'
-
-# runit
-alias svls='sudo sv s /var/service/*'
-alias svu='sudo sv start'
-alias svd='sudo sv stop'
-alias svr='sudo sv restart'
-
-function sva {
- if [ -r /etc/sv/$1 ]; then
- sudo ln -sv /etc/sv/$1 /var/service
- else
- echo "Service $1 not found"
- fi
-}
-
-function svrm {
- if [ -r /var/service/$1 ]; then
- sudo rm -v /var/service/$1
- else
- echo "Service $1 not found"
- fi
-}
-
-# colors
-if [ ${HOSTNAME} != "pi" ]; then
- alias ld='grc -es --colour=auto ld'
- alias ss='grc -es --colour=auto ss'
- alias ps='grc -es --colour=auto ps'
- alias mount='grc -es --colour=auto mount'
- alias dig='grc -es --colour=auto dig'
- alias ping='grc -es --colour=auto ping'
- alias traceroute='grc -es --colour=auto traceroute'
- alias df='grc -es --colour=auto df'
-fi
-
-alias usv='SVDIR=~/service/ sv'
-
-# font settings
-export INFINALITY_FT_FILTER_PARAMS='10 35 40 35 10'
-export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=0
-export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=0
-export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=false
-export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=0
-export INFINALITY_FT_GAMMA_CORRECTION='0 100'
-export INFINALITY_FT_BRIGHTNESS=0
-export INFINALITY_FT_CONTRAST=0
-export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=5
-export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=0
-export INFINALITY_FT_FRINGE_FILTER_STRENGTH=5
-export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=10
-export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=0
-export INFINALITY_FT_STEM_FITTING_STRENGTH=0
-export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=0
-export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=true
-export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
-
-alias check-updates="sudo sh -c 'cd /var/cache/void-packages && chpst -u voidupdates:voidupdates void-updates -p 20 -r git://github.com/voidlinux/void-packages.git -s /var/cache/void-packages -o /srv/http/void-updates'"
-alias bt='echo 0 | gdb -batch-silent -ex "run" -ex "set logging overwrite on" -ex "set logging file gdb.bt" -ex "set logging on" -ex "set pagination off" -ex "handle SIG33 pass nostop noprint" -ex "echo backtrace:\n" -ex "backtrace full" -ex "echo \n\nregisters:\n" -ex "info registers" -ex "echo \n\ncurrent instructions:\n" -ex "x/16i \$pc" -ex "echo \n\nthreads backtrace:\n" -ex "thread apply all backtrace" -ex "set logging off" -ex "quit" --args'
-# alias keychain=eval_keychain
-
-#unset LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_IDENTIFICATION LC_MONETARY \
-# LC_NAME LC_NUMERIC LC_TELEPHONE LC_TIME
-#p=en_GB.UTF-8
-#set -U
-#export LANG=C LC_CTYPE=$p LC_MEASUREMENT=$p LC_MESSAGES=$p LC_PAPER=$p
-
-unset p
+HISTFILE=$HOME/.mksh_history
+HISTSIZE=1000
+SHELL=$MKSH
+export HISTFILE HISTSIZE SHELL
# fix del key
printf '\033[?1h\033=' >/dev/tty
-#
-PS1='$(slcp $COLUMNS $?)'
-
-# z
-if [ -r /home/duncan/repos/github.com/Duncaen/dotfiles/z/z.sh ]; then
- . /home/duncan/repos/github.com/Duncaen/dotfiles/z/z.sh
- function _z_add {
- _z --add "$PWD"
- }
- PS1+='$(_z_add)'
+if [ -d ~/.mksh.d ]; then
+ for f in ~/.mksh.d/*.sh; do
+ [ -x "$f" ] && source "$f"
+ done
fi
-# If this is an xterm set the title to user@host:dir
-case "$TERM" in
- dvtm*|xterm*|rxvt*)
- PS1+='$(echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007")'
- ;;
- *)
- ;;
-esac
-
: place customisations above this line