rice

rei with the taste
git clone https://s.sonu.ch/~rei/rice.git
Log | Files | Refs

commit 84af22e7dae88419c7684e8487fbce86d878f865
parent 7bd472313d6f82e8af2661471455741a24116794
Author: rei <rei@sonu.ch>
Date:   Tue, 24 Aug 2021 21:35:25 +0300

add some files

Diffstat:
A.config/zathura/zathurarc | 21+++++++++++++++++++++
A.exrc | 35+++++++++++++++++++++++++++++++++++
A.kshrc | 15+++++++++++++++
A.profile | 13+++++++++++++
Abin/spwd | 44++++++++++++++++++++++++++++++++++++++++++++
Mreadme | 2++
6 files changed, 130 insertions(+), 0 deletions(-)

diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc @@ -0,0 +1,21 @@ +set window-title-basename "true" +set selection-clipboard "clipboard" + +map u scroll half-up +map d scroll half-down +map D toggle_page_mode +map K zoom in +map J zoom out +map i recolor +map g goto up + +# Recolor mode settings + +set recolor-lightcolor "#000000" # Background +set recolor-darkcolor "#ffffff" # Foreground + +# +# Startup options +# +# set adjust-open width +set recolor true diff --git a/.exrc b/.exrc @@ -0,0 +1,35 @@ +" display current mode (insert/normal) +set showmode + +" show matching parens, braces, etc +set showmatch + +" display row/column info +set ruler + +" autoindent width = 2 spaces +set shiftwidth=2 + +" tab width = 2 spaces +set tabstop=2 + +" display all error messages +set verbose + +" enable horizontal scrolling +set leftright + +" use extended regular expressions +set extended + +" case-insensitive search, unless an uppercase letter is used +set iclower + +" incremental search +set searchincr + +" print helpful messages (eg, 4 lines yanked) +set report=1 + +" show line numbers +set number diff --git a/.kshrc b/.kshrc @@ -0,0 +1,15 @@ +set -o emacs + +alias ..="cd .." +alias cp="cp -v" +alias mv="mv -v" +alias mkdir="mkdir -v" +alias rm="rm -v" +alias sxiv="sxiv -a" +alias sl="ls -r" +alias mutt="neomutt" +alias ytdl="youtube-dl" +alias sudo="doas" +alias sm="sh $SCRIPTS/syncmails.sh" + +PS1='\u@\h$[\[\e[01;$(($??31:39))m\]$?\[\e[0m]\]:$(awk -f "${HOME}/bin/spwd" -- "${PWD}")\]λ ' diff --git a/.profile b/.profile @@ -0,0 +1,13 @@ +# envs +export ENV="$HOME/.kshrc" +export NO_COLOR="1" +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_CACHE_HOME="$HOME/.cache" +export WGETRC="$XDG_CONFIG_HOME/wgetrc" +export SCRIPTS="$HOME/scripts" +export TERM="screen-256color" +export BROWSER="firefox" +export EDITOR="vi" + +# start x on login +sh $HOME/scripts/xinit.sh diff --git a/bin/spwd b/bin/spwd @@ -0,0 +1,44 @@ +#!/usr/bin/awk -f +# spwd: pure AWK path shortener for PS1 +# Shortens a path by keeping only the first character of each directory, or the +# two firsts if it starts with a dot. + +# Usage: +# export PS1="\u:\$(awk -f /where/is/spwd -- "\${PWD}")> " + +# Runtime example: +# charlene:/u/s/d/mg> echo $PWD +# /usr/share/doc/mg +# charlene:/u/s/d/mg> cd /home/charlene/.vim/colors/ +# charlene:~/.v/colors> + +# Should be POSIX-compliant, tested with OpenBSD's awk, mawk and gawk. +# May break if you have funny chars in $HOME + +BEGIN { + # dealing with directories with spaces + for (elem = 1; elem < length(ARGV); elem++) { + pwd = sprintf("%s %s", pwd, ARGV[elem]) + } + sub(/^ /, "", pwd) + + home = ENVIRON["HOME"] + # Regex-ify $HOME + gsub(/\//, "\\/", home) + sub("^"home, "~", pwd) + if (pwd == "~") { + printf(pwd) + exit + } + + split(pwd, pelems, /\//) + # we don't need the useless pelems[0], and the shortened "basename $PWD" + # (last one). Also the pelems[1] is empty because pwd starts with the + # seperator, so it will always prints '/'. + for (i = 1; i < length(pelems); i++) { + # two characters for dotfiles/dirs + nchar = substr(pelems[i], 1, 1) == "." ? 2 : 1 + printf("%s/", substr(pelems[i], 1, nchar)) + } + printf("%s", pelems[length(pelems)]) +} diff --git a/readme b/readme @@ -1 +1,3 @@ hello from the rice fields! + +bin/spwd is taken from https://github.com/qbit/dotfiles