- renamed to over-env
- removed garbage - added install.sh
This commit is contained in:
parent
6888571eea
commit
84f3734353
10 changed files with 15 additions and 91 deletions
41
etc/zsh/zprofile
Normal file
41
etc/zsh/zprofile
Normal file
|
@ -0,0 +1,41 @@
|
|||
# /etc/zsh/zprofile
|
||||
# $Id$
|
||||
|
||||
# Load environment settings from profile.env, which is created by
|
||||
# env-update from the files in /etc/env.d
|
||||
if [ -e /etc/profile.env ] ; then
|
||||
. /etc/profile.env
|
||||
fi
|
||||
|
||||
# You should override these in your ~/.zprofile (or equivalent) for per-user
|
||||
# settings. For system defaults, you can add a new file in /etc/profile.d/.
|
||||
export EDITOR=${EDITOR:-/bin/nano}
|
||||
export PAGER=${PAGER:-/usr/bin/less}
|
||||
|
||||
# 077 would be more secure, but 022 is generally quite realistic
|
||||
umask 022
|
||||
|
||||
# Set up PATH depending on whether we're root or a normal user.
|
||||
# There's no real reason to exclude sbin paths from the normal user,
|
||||
# but it can make tab-completion easier when they aren't in the
|
||||
# user's PATH to pollute the executable namespace.
|
||||
#
|
||||
# It is intentional in the following line to use || instead of -o.
|
||||
# This way the evaluation can be short-circuited and calling whoami is
|
||||
# avoided.
|
||||
if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
|
||||
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
|
||||
else
|
||||
PATH="/usr/local/bin:/usr/bin:/bin:${PATH}:/home/${USER}/Apps/bin"
|
||||
fi
|
||||
export PATH
|
||||
unset ROOTPATH
|
||||
|
||||
shopts=$-
|
||||
setopt nullglob
|
||||
for sh in /etc/profile.d/*.sh ; do
|
||||
[ -r "$sh" ] && . "$sh"
|
||||
done
|
||||
unsetopt nullglob
|
||||
set -$shopts
|
||||
unset sh shopts
|
206
etc/zsh/zshrc
Normal file
206
etc/zsh/zshrc
Normal file
|
@ -0,0 +1,206 @@
|
|||
bindkey -e # emacs mode
|
||||
|
||||
alias ls="ls --classify --color --group-directories-first --quoting-style=literal"
|
||||
alias l="ls --human-readable -l"
|
||||
alias ll="l --almost-all"
|
||||
alias grep="grep --text --color=auto"
|
||||
alias pull_website="wget --no-parent --recursive --page-requisites --convert-links --html-extension --no-clobber"
|
||||
alias ..="cd .."
|
||||
alias pp=python2
|
||||
alias ppp=python3
|
||||
alias htop="htop --delay=3"
|
||||
alias O=xdg-open
|
||||
alias gits="git status"
|
||||
alias gita="git add"
|
||||
alias gitc="git commit"
|
||||
alias gitp="git push"
|
||||
alias gitl="git log --shortstat --graph"
|
||||
alias gitd="git diff --word-diff"
|
||||
alias Y="noglob youtube-dl --no-check-certificate -f 'bestvideo[height<=1080]+bestaudio/best[height<=1080]'"
|
||||
alias Yall="noglob youtube-dl --no-check-certificate -o \"%(autonumber)s-%(title)s.%(ext)s\""
|
||||
alias Ytune="noglob youtube-dl --no-check-certificate -x --audio-format vorbis --audio-quality 4"
|
||||
alias units="units -v"
|
||||
alias usystemctl="systemctl --user"
|
||||
alias battery="upower -i /org/freedesktop/UPower/devices/battery_BAT0"
|
||||
|
||||
# apparently this is the only way of setting GNU Screen to UTF-8
|
||||
alias screen="screen -U"
|
||||
|
||||
# Edit the current command line in $EDITOR
|
||||
export VISUAL="nano"
|
||||
autoload -U edit-command-line
|
||||
zle -N edit-command-line
|
||||
bindkey '\C-e' edit-command-line
|
||||
|
||||
mkcd () {
|
||||
mkdir -p "$1" && cd "$1"
|
||||
}
|
||||
|
||||
mkv-fixtitles () {
|
||||
for arg in "$@"
|
||||
do
|
||||
title="${arg%%.[mM][kK][vV]}"
|
||||
mkvpropedit "$arg" --set "title=$title" --edit track:v1 --delete name > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "$arg failed"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
psg () { ps axu | grep -v grep | grep -i $* } # hledání v běžících procesech
|
||||
|
||||
pskill () {
|
||||
pids=($(psg $1|awk '{print $2}'))
|
||||
|
||||
for pid in $pids; do
|
||||
echo "Killing $pid..."
|
||||
kill $pid
|
||||
done
|
||||
}
|
||||
|
||||
psm () {
|
||||
pid=(${=$(psg $1|grep -o --color=no -E "[0-9]+")})
|
||||
echo "Found pid=${pid[1]}."
|
||||
scanmem -p ${pid[1]}
|
||||
}
|
||||
|
||||
zres () {
|
||||
. /etc/zsh/zshrc
|
||||
hash -r
|
||||
}
|
||||
|
||||
# kill GNU Screen pages in the specified range
|
||||
kill_screens () {
|
||||
for p in {$1..$2}
|
||||
do
|
||||
screen -p $p -X stuff "exit\n"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
# winetricks tools
|
||||
wt-prefix() {
|
||||
export WINEPREFIX="$HOME/.local/share/wineprefixes/$1"
|
||||
|
||||
grep "#arch=win32" "${WINEPREFIX}/system.reg" > /dev/null
|
||||
|
||||
if [[ $? -eq 0 ]]; then
|
||||
export WINEARCH="win32"
|
||||
else
|
||||
unset WINEARCH
|
||||
fi
|
||||
}
|
||||
|
||||
wt-goto_c() {
|
||||
cd $WINEPREFIX/drive_c
|
||||
}
|
||||
|
||||
wt-list_prefixes() {
|
||||
ls $* $HOME/.local/share/wineprefixes/
|
||||
}
|
||||
|
||||
cds() {
|
||||
cd /mnt/storage/$USER/$1
|
||||
}
|
||||
|
||||
http-dir() {
|
||||
echo "Serving $PWD on 0.0.0.0:55555"
|
||||
/usr/sbin/thttpd -T utf-8 -D -d . -p 55555 -l -
|
||||
}
|
||||
|
||||
swap-files() {
|
||||
TMP=.swap-files.tmp
|
||||
mv "$1" "$TMP" && mv "$2" "$1" && mv "$TMP" "$2"
|
||||
}
|
||||
|
||||
function die () {
|
||||
echo "died during ${1}"
|
||||
exit 1
|
||||
}
|
||||
|
||||
function mkvoid () {
|
||||
__MKVOID_TARGET="$1"
|
||||
__MKVOID_PATH="${__MKVOID_TARGET:P}"
|
||||
__MKVOID_DIR="${__MKVOID_PATH:h}"
|
||||
__MKVOID_NAME="${__MKVOID_PATH:t}"
|
||||
__MKVOID_ID="/dev/shm/void/${__MKVOID_PATH:l:gs/\///:gs/ //}"
|
||||
|
||||
mkdir -p "/dev/shm/void" || die "mkdir void"
|
||||
mkdir "${__MKVOID_ID}" || die "mkdir shm"
|
||||
mkdir -p "${__MKVOID_DIR}" || die "mkdir fs"
|
||||
ln -s "${__MKVOID_ID}" "${__MKVOID_PATH}" || die "ln"
|
||||
pushd "${__MKVOID_PATH}" > /dev/null || die "pushd"
|
||||
OVER_PROMPT_VOIDS="$OVER_PROMPT_VOIDS:$__MKVOID_NAME" zsh
|
||||
popd > /dev/null
|
||||
|
||||
while true; do
|
||||
fuser -s "${__MKVOID_PATH}"
|
||||
if [[ $? == 1 ]]; then
|
||||
break
|
||||
else
|
||||
echo -n ">>> Waiting for other processes to abandon this void.\r"
|
||||
fi
|
||||
sleep 5
|
||||
done
|
||||
|
||||
rm -f "${__MKVOID_PATH}" || die "rm link"
|
||||
rm -rf "${__MKVOID_ID}" || die "rm void"
|
||||
}
|
||||
|
||||
# history including search
|
||||
HISTFILE=~/.history
|
||||
HISTSIZE=10000000
|
||||
SAVEHIST=10000000
|
||||
setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format.
|
||||
setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history.
|
||||
setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again.
|
||||
setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate.
|
||||
setopt HIST_FIND_NO_DUPS # Do not display a line previously found.
|
||||
setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space.
|
||||
setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file.
|
||||
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry.
|
||||
setopt HIST_VERIFY # Don't execute immediately upon history expansion.
|
||||
bindkey '\e[A' history-beginning-search-backward # completion from history with Up/Down keys
|
||||
bindkey '\e[B' history-beginning-search-forward #
|
||||
|
||||
setopt EXTENDED_GLOB
|
||||
unsetopt NO_CLOBBER # prevents cat < file > file
|
||||
unsetopt CORRECTALL # hell no
|
||||
setopt NO_BEEP # hell no
|
||||
unsetopt equals # allows me to use strings like =this without escaping
|
||||
export ZLE_REMOVE_SUFFIX_CHARS=$' \t\n;&' # don't remove these chars after completion
|
||||
|
||||
# File completion
|
||||
setopt AUTOLIST
|
||||
setopt NO_LIST_AMBIGUOUS # list files immediately
|
||||
setopt LIST_PACKED
|
||||
zmodload -i zsh/complist # colors
|
||||
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
|
||||
zstyle ':completion::complete:*' use-cache 1
|
||||
zstyle ':completion:*' special-dirs true
|
||||
autoload -U compinit
|
||||
compinit
|
||||
autoload colors zsh/terminfo
|
||||
|
||||
# app-shells/over-env
|
||||
source /usr/lib/over/env/prompt-init
|
||||
|
||||
# keyboard stuff
|
||||
bindkey "\e[1~" beginning-of-line
|
||||
bindkey "\e[2~" quoted-insert
|
||||
bindkey "\e[3~" delete-char
|
||||
bindkey "\e[4~" end-of-line
|
||||
bindkey "\e[5~" beginning-of-history
|
||||
bindkey "\e[6~" end-of-history
|
||||
bindkey "\e[7~" beginning-of-line
|
||||
bindkey "\e[8~" end-of-line
|
||||
bindkey "\e[H" beginning-of-line
|
||||
bindkey "\e[F" end-of-line
|
||||
bindkey "\eOH" beginning-of-line
|
||||
bindkey "\eOF" end-of-line
|
||||
bindkey "\eOd" backward-word
|
||||
bindkey "\eOc" forward-word
|
||||
|
||||
# paludis default options
|
||||
export CAVE_OPTIONS="--log-level warning"
|
||||
export CAVE_RESOLVE_OPTIONS="--reinstall-scm weekly --show-descriptions new --continue-on-failure if-satisfied"
|
Loading…
Add table
Add a link
Reference in a new issue