dot

packages and services management
Log | Files | Refs | README

commit 93198c7c2bb8fd28ad07cd0cc42035798a63a212
parent 3f775ee5743fd589edf9eda8f9755e2a49522b5f
Author: josuah <mail@josuah.net>
Date:   Tue,  6 Sep 2016 17:27:08 +0200

Various fixes and cleanups

Diffstat:
Rshell/.cache/agenda -> bin/.cache/agenda | 0
Rshell/.cache/bkm -> bin/.cache/bkm | 0
Rshell/.cache/todo -> bin/.cache/todo | 0
Abin/.config/feeds/read | 35+++++++++++++++++++++++++++++++++++
Rshell/.config/feeds/urls -> bin/.config/feeds/urls | 0
Abin/.profile | 242+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mbin/agenda | 231++++++++++++++++++++++++++++---------------------------------------------------
Mbin/buffers | 17+++++++++--------
Mbin/lsync | 3---
Mbin/src | 14++++++++------
Dctags/build.sh | 3---
Mdvtm/config.h | 40++++++++++++++--------------------------
Dshell/.config/feeds/read | 33---------------------------------
Dshell/.profile | 241-------------------------------------------------------------------------------
Mvim/.vimrc | 14++++++--------
Dxdg/.config/user-dirs.dirs | 8--------
Dxdg/.config/user-dirs.locale | 2--
17 files changed, 395 insertions(+), 488 deletions(-)

diff --git a/shell/.cache/agenda b/bin/.cache/agenda diff --git a/shell/.cache/bkm b/bin/.cache/bkm diff --git a/shell/.cache/todo b/bin/.cache/todo diff --git a/bin/.config/feeds/read b/bin/.config/feeds/read @@ -0,0 +1,35 @@ + + +http://omicsomics.blogspot.com/2016/02/agbt-begins-with-bonus-storify-jeremiad.html + + + + + + + +http://omicsomics.blogspot.com/2016/04/genia-publishes-platform-progress.html + +http://omicsomics.blogspot.com/2016/04/protein-homeostasis-has-it-hit.html + + +http://omicsomics.blogspot.com/2016/05/around-world-in-amino-acids.html +http://omicsomics.blogspot.com/2016/06/london-calling-was-two-weeks-ago-and-i.html + +http://omicsomics.blogspot.com/2016/05/london-calling-notes-on-brownian.html +http://omicsomics.blogspot.com/2016/05/london-calling-preview.html +http://omicsomics.blogspot.com/2016/05/inconstant-lines.html +http://omicsomics.blogspot.com/2016/05/sickle-cell-anemia-underprioritized.html +http://omicsomics.blogspot.com/2016/05/kendall-square-techbiotechbiopharma.html +http://omicsomics.blogspot.com/2016/05/exploring-critiques-of-siddhartha.html +http://omicsomics.blogspot.com/2016/04/mosquito-genomes-chance-for-long-range.html +http://omicsomics.blogspot.com/2016/03/reflections-on-and-band-played-on.html +http://omicsomics.blogspot.com/2016/02/10x-launches-chromium-agbt16.html +http://omicsomics.blogspot.com/2016/03/who-wants-to-write-review-article.html +http://omicsomics.blogspot.com/2016/06/writing-big.html + + + + +http://omicsomics.blogspot.com/2016/07/math-toys-much-enjoyed.html + diff --git a/shell/.config/feeds/urls b/bin/.config/feeds/urls diff --git a/bin/.profile b/bin/.profile @@ -0,0 +1,242 @@ +#!/bin/sh +# ____ __ +# ____ _____ ____ .' ___\ \/ /\ ___ +# / __ \ / ____\/ __ \ / .'_ /\ / /.'__ \ +# / /_/ // / / /_/ // ___/ / // // ____/ +#/ ____/ \/ \____/ \/ \/ \/ \___\ - Variables & shell config +#\/============================================================================= + +export EMAIL='mail@josuah.net' + + +# TERMINAL + +export LS_COLORS='so=35:tw=91:ow=93' +export NCURSES_NO_UTF8_ACS=1 # Fix for dvtm + abduco in TTY +export TERMCAP="vt102|$TERM|dec vt102:"'\ + :do=^J:co#80:li#24:cl=50\E[;H\E[2J:\ + :le=^H:bs:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:\ + :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\ + :md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:is=\E[1;24r\E[24;1H:\ + :rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\ + :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\ + :ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=5\EM:vt#3:\ + :sc=\E7:rc=\E8:cs=\E[%i%d;%dr:vs=\E[?7l:ve=\E[?7h:\ + :mi:al=\E[L:dc=\E[P:dl=\E[M:ei=\E[4l:im=\E[4h:' # For ex-vi to work + + +# COMMANDS + +for editor in vi vis vim +do command -v "$editor" > /dev/null && EDITOR="$editor" +done +export EDITOR +export ALTERNATE_EDITOR='vi' +export DVTM_EDITOR='piped' +export VISUAL="$EDITOR" +export FCEDIT="$EDITOR" +export PAGER='less -FIRM' +export BROWSER='w3m' +export FILTER='peax' + + +# DIRECTORIES + +export DOT="$HOME/Config" +export MAIL="$HOME/Mail/INBOX" +export ENV="$HOME/.profile" +export PATH="$PATH:$HOME/.local/bin" # binaries built locally +export PATH="$PATH:$DOT/bin" # scripts +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_CACHE_HOME="$HOME/.cache" +export XDG_DATA_HOME="$HOME/.local/share" +export ABDUCO_SOCKET_DIR="$XDG_CACHE_HOME/" + + +# PROMPTS + +export PS1='$(ps1)' +export PS2='| ' + + +# ALIAS +#------------------------------------------------------------------------------- + +alias l='ls -F -w 80 --color' +alias ll='l -lh' +alias la='l -A' +alias lla='l -Alh' +alias weather='curl -4 wttr.in' +alias lines='find . -name "*.[ch]" | xargs wc -l' +alias myip='curl icanhazip.com' +alias a='buffers attach' +alias r='buffers run' +alias v='buffers run $VISUAL' +alias p='$PAGER' +alias f='find . -type f ! -path "*/.git/*" | fzy' +alias d='find . -type d ! -path "*/.git/*" | fzy' +alias c='cd "$(d)"' + + +# FUNCTIONS +#------------------------------------------------------------------------------- + +ps1() +{ + local code="$?" + + printf '\n' + + # Line separator + local p='────────────────────────────────────────' + printf '\033[30;1m%s\033[0m\r' "$p$p" + + # Date + printf "\033[74C %s\r" "$(date +'%H:%M')" + + # PWD with $HOME replaced by ~ + [ "${pwd##$HOME**}" ] && local pwd="$PWD" || local pwd="~${PWD#$HOME}" + printf '\033[1m%s\033[0m \r' "$pwd" + + # Error code + [ "$code" -eq 0 ] || printf '\033[38C\033[31;1m %s \033[0m' "$code" + + # Non printable: terminal status, bell + printf '\a\033]0;shell\007' + + # Last line fo prompt + local abduco="$(($(abduco 2>/dev/null | wc -l) - 1))" + printf '\n\033[33m%s\033[0m$ ' "${abduco#0}" +} + +h() +{ + for field in $@; do local cmd="$cmd $field"; done + eval "$cmd 2>&1 | $PAGER" +} + +light() +{ + sudo printf '%s\n' "$1" | sudo tee "$( + sudo find -L /sys/class/backlight/ -maxdepth 2 -name brightness + )" +} + +# +# Mount /dev/sdb1 or $1 in /mnt +# +mnt() +{ + sudo mount -o uid=$USER -o rw ${1-/dev/sdb1} ${2-/mnt} +} + +extract() +{ + case "$1" in + *.tar.bz2) tar xvjf "$1" ;; + *.tar.gz ) tar xvzf "$1" ;; + *.bz2 ) bunzip2 "$1" ;; + *.rar ) unrar x "$1" ;; + *.gz ) gunzip "$1" ;; + *.tar ) tar xvf "$1" ;; + *.tbz2 ) tar xvjf "$1" ;; + *.tgz ) tar xvzf "$1" ;; + *.zip ) unzip "$1" ;; + *.Z ) uncompress "$1" ;; + *.7z ) 7z x "$1" ;; + *.xz ) xz -d "$1" ;; + *.deb ) ar vx "$1" ;; + * ) printf 'extract: Unknown archive type\n';; + esac +} + +# +# Remove spaces and other nasty characters from $1 recursively +sanitize() +{ + find "$1" | tac | while read -r p + do mv "$p" "$(printf '%s\n' "$p" | sed 's/[^[:alnum:],._/+-]/_/g')" + done +} + +# +# Transform a separator ($1) into '/': directory and subdirectory +# +split_at() +{ + find . | while read -r f + do + mkdir -p "${f%%$1*}" + mv "$f" "${f%%$1*}/${f#*$1}" + done +} + +# +# Remove prefix from all files in current directory up to "$1" separator +# +remove_prefix() +{ + find . | while read -r f + do mv "$f" "${f#*$1}" + done +} + +buildit() +{ + [ -f './autogen.sh' ] && ./autogen.sh + [ -f './configure' ] && ./configure --prefix="$PREFIX" + make && make clean PREFIX=$PREFIX install clean +} + +# +# FrameBuffer Video player based on ffplay +# +fbv() +{ + local x="$(sed 's/,.*//' /sys/class/graphics/fb0/virtual_size)" + local y="$(sed 's/.*,//' /sys/class/graphics/fb0/virtual_size)" + local video="$1" + + trap "kill -9 0" INT EXIT + + ffplay -nodisp "$video" & + ffmpeg -re -i "$video" \ + -pix_fmt bgra \ + -vf scale="${x}x${y}" \ + -f fbdev /dev/fb0 +} + + +# TTY SETUP +#------------------------------------------------------------------------------- + +solarized_light="\ +\033]P0ffddbb \033]P1d0154b \033]P2779900 \033]P3ffa700\ +\033]P4096daf \033]P5897f74 \033]P600aa88 \033]P7000000\ +\033]P8bb9988 \033]P9d0154b \033]PA779900 \033]PBffa700\ +\033]PC096daf \033]PD897f74 \033]PE00aa88 \033]PF222222" + +ghost_in_the_shell="\ +\033]P0000000 \033]P191265C \033]P2439a64 \033]P3ccdd66\ +\033]P455aaaa \033]P5516583 \033]P64a8f86 \033]P799bbbb\ +\033]P8334444 \033]P9E71E5B \033]PA72f4a0 \033]PBf5ff8B\ +\033]PC99bbff \033]PD676cb0 \033]PE00ffff \033]PFffffff" + +coal="\ +\033]P0000000 \033]P1ee3333 \033]P2ccee44 \033]P3ffcc55\ +\033]P477aaaa \033]P5888888 \033]P655ee99 \033]P7cccccc\ +\033]P8555555 \033]P9ff6666 \033]PAeeff66 \033]PBffff99\ +\033]PCaaddff \033]PDaaaaaa \033]PE99ffbb \033]PFffffff" + +if [ "$TERM" = 'linux' ] +then + printf "$coal" # Theme + printf '\033[?6;c' # Cursor style + setfont Uni2-VGA16.psf # Font +fi + + +# STARTUP +#------------------------------------------------------------------------------- + +printf '\n' diff --git a/bin/agenda b/bin/agenda @@ -4,9 +4,9 @@ # .'__ /.'__ /.'__ \ / __ \ .'__ /.'__ / # / /_/ // /_/ // ____// / / // /_/ // /_/ / # \____/_\__ / \___\ \/ \/ \____/ \____/ - Agenda from the command line -#=======\__,-"================================================================= +#=======\__,-'================================================================= -AGENDA="${AGENDA-$DOT/doc/agenda}" +AGENDA="${AGENDA-$HOME/.cache/agenda}" COLUMNS="$(stty size | cut -d ' ' -f 2)" help="NAME @@ -18,26 +18,27 @@ SYNTAX DESCRIPTION -d Set date to use -i Import an ICAL to $AGENDA - a Agenda for next event starting from DATE or today. - c Calendar for current week and next events highlihted. - i Interactive mode, with a few keybindings. + a, agenda + for next event starting from DATE or today. + c, calendar + for current week and next events highlihted. -ENVIRONMENT - AGENDA Set the path to the calendar file. FILES - $AGENDA + \$AGENDA: $AGENDA File storing the agenda, with each entry on a line, and each field separated by a tab, in this order: - 1. Start date (yyyy-mm-dd HH:MM:SS) - 2. End date (yyyy-mm-dd HH:MM:SS) - 3. Name - 4. Location - 5. Description + 1. Start date (yyyy-mm-dd HH:MM:SS) + 2. End date (yyyy-mm-dd HH:MM:SS) + 3. Name + 4. Location + 5. Description " -#===[ AWK SCRIPTS ]============================================================= + +# AWK SCRIPTS +# ------------------------------------------------------------------------------ awk_ical=' BEGIN { @@ -48,9 +49,9 @@ BEGIN { if (substr($0, 1, 1) != " ") { type = $1; vevent[type] = $2; - } else { + } else vevent[type] = vevent[type] substr($0, 2, length($0) - 1); - } + if ($0 == "BEGIN:VEVENT") { date = vevent["DTSTART"] printf("%s-%s-%s %s:%s:%s\t", @@ -85,7 +86,7 @@ BEGIN { "date +%s -d '\''"$1"'\''" | getline event_date; } -(current_date <= event_date) { +(now <= event_date) { beg = $1; end = $2; sum = $3; loc = $4; des = $5; beg_Y = substr(beg, 1, 4); sub(/^0/, " ", beg_Y); @@ -143,21 +144,20 @@ BEGIN { row[5] = " Sat "; row[6] = " Sun "; - # Fill the empty days with spaces - for (i = 0; i < w; i++) { + # fill the empty days with spaces + for (i = 0; i < w; i++) row[i] = row[i] " "; - } - # Month name offset + # month name offset if (w == 0) offset = 0; else offset = 1; - # Increase date each day + # increase date for every day for (j = 0; j <= range; j++) { + # day of week if ((j + w) % 7 == 0) { offset++; - W++; } if (d < 28 \ @@ -165,67 +165,53 @@ BEGIN { || (d < 30 && ((m <= 7 && m % 2 == 0) \ || (m >= 8 && m % 2 == 1)) && m != 2) \ || (d < 31 && ((m <= 7 && m % 2 == 1) \ - || (m >= 8 && m % 2 == 0)) && m != 2) ) { + || (m >= 8 && m % 2 == 0)) && m != 2)) { d++; } else { d = 1; if (m < 12) { m++; - } else { - m = 1; - Y++; + m = 1; Y++; } - # Month names in header - if (m == 1) month = "Jan" - else if (m == 2) month = "Feb" - else if (m == 3) month = "Mar" - else if (m == 4) month = "Apr" - else if (m == 5) month = "May" - else if (m == 6) month = "Jun" - else if (m == 7) month = "Jul" - else if (m == 8) month = "Aug" - else if (m == 9) month = "Sep" - else if (m == 10) month = "Oct" - else if (m == 11) month = "Nov" - else if (m == 12) month = "Dec" + if (m == 1) month = "Jan"; + else if (m == 2) month = "Feb"; + else if (m == 3) month = "Mar"; + else if (m == 4) month = "Apr"; + else if (m == 5) month = "May"; + else if (m == 6) month = "Jun"; + else if (m == 7) month = "Jul"; + else if (m == 8) month = "Aug"; + else if (m == 9) month = "Sep"; + else if (m == 10) month = "Oct"; + else if (m == 11) month = "Nov"; + else if (m == 12) month = "Dec"; header = sprintf("%s%" offset * 3 - 3 "s%s", \ header, "", month); offset = 0; } - # Check if there is an event at this date date = sprintf("%04d-%02d-%02d", Y, m, d); - event = 0 - # while event end is in the past - while (substr($2, 0, 10) < date) { - # get next event if any + # while event end is in the past, get next event if any + while (substr($2, 0, 10) < date) if (! getline) break; - } - # Add a leading space + # add a leading space row[(j + w) % 7] = row[(j + w) % 7] " "; # if it begins in the past and ends in the future - if (substr($1, 0, 10) <= date && date <= substr($2, 0, 10)) { - row[(j + w) % 7] = row[(j + w) % 7] "\033[1m"; - } + if (substr($1, 0, 10) <= date && date <= substr($2, 0, 10)) + row[(j + w) % 7] = row[(j + w) % 7] "\033[7m"; - # Current day - if (date == today) { + # current day + if (date == today) row[(j + w) % 7] = row[(j + w) % 7] "\033[31;1m"; - } - # Selected week - if (W == selected) { - row[(j + w) % 7] = row[(j + w) % 7] "\033[7m"; - } - - # Day number + # day number row[(j + w) % 7] = row[(j + w) % 7] sprintf("%2s\033[0m", d); } @@ -235,122 +221,67 @@ BEGIN { } }' -#===[ FUNCTIONS ]=============================================================== -get_char() -{ - local old=$(stty -g) - stty raw -echo - dd bs=1 count=1 2>/dev/null - stty $old -} +# FUNCTIONS +# ------------------------------------------------------------------------------ import_ical() { local ical="$1" sed -i 's/\r//; s/\t/ /g' "$ical" - - awk "$awk_ical" "$ical" \ - | cat - "$AGENDA" \ - | sort \ - | uniq > "$AGENDA" + awk "$awk_ical" "$ical" | cat - "$AGENDA" | sort | uniq > "$AGENDA" } agenda() { - if [ -z "$DATE" ] - then current_s="$(date +%s)" - else current_s="$(date +%s -d "$DATE")" - fi - - awk -v current_date="$current_s" "$awk_agenda" "$AGENDA" \ - | cut -c 1-"$COLUMNS" + awk -v now="$SEC" "$awk_agenda" "$AGENDA" | cut -c 1-"$COLUMNS" } calendar() { - local beg_s="${beg_s-$(date +%s)}" - local middle="$(($COLUMNS / 6))" - # + $COLUMNS / 3 / 3 awk \ - -v Y="$(date +'%Y' -d "@$beg_s")" \ - -v m="$(date +'%m' -d "@$beg_s")" \ - -v d="$(date +'%d' -d "@$beg_s")" \ - -v w="$(date +'%w' -d "@$beg_s")" \ - -v W="$(date +'%W' -d "@$beg_s")" \ - -v today="$(date +'%Y-%m-%d')" \ - -v range="$(($COLUMNS * 7 / 3 - 27))" \ - -v selected="$(($(date +'%-W' -d "@$beg_s") + $middle))" \ + -v Y="$(date +'%Y' -d "@$SEC")" \ + -v m="$(date +'%m' -d "@$SEC")" \ + -v d="$(date +'%d' -d "@$SEC")" \ + -v w="$(date +'%w' -d "@$SEC")" \ + -v now="$(date +'%Y-%m-%d' -d "@$SEC")" \ + -v range="$(($COLUMNS * 7 / 3 - 26))" \ "$awk_calendar" "$AGENDA" } -interactive() -{ - local shift_s=$((- 20 * 7 * 24 * 3600)) - - clear - printf 'Use [h/l] or [CTRL + B/F] to navigate, and [q] or [CTRL + C] to quit. -Press [Enter] to display the agenda for the selected week. -press a key to continue -' - - while k="$(get_char)" - do - COLUMNS="$(stty size | cut -d ' ' -f 2)" - - case "$k" in - h | '' ) shift_s="$((shift_s - 7 * 24 * 3600))" ;; - l | '' ) shift_s="$((shift_s + 7 * 24 * 3600))" ;; - ' ' ) agenda=1 ;; - q | '' ) exit 0 ;; - esac - - local beg_s="$(($(date +%s) + ${shift_s-0}))" - - clear - calendar - printf '\n' - - if [ "$agenda" = '1' ] - then - DATE="@$(($(date +'+%s' -d "@$beg_s") + ($COLUMNS / 6 - 1) * 7 * 24 * 3600))" agenda - unset agenda - fi - done -} -#===[ ALGORYTHM ]=============================================================== +# ALGORYTHM +# ------------------------------------------------------------------------------ -[ $# = 0 ] && set -- interactive +[ $# = 0 ] && set -- help while [ $# -gt 0 ] do case $1 in - a | agenda) - action="agenda" - shift - ;; - c | calendar) - action="calendar" - shift - ;; - i | interactive) - action="interactive" - shift - ;; - -i ) - action="import_ical '$2'" - shift 2 - ;; - -d ) - DATE="$2" - shift 2 - ;; - * ) - printf '%s\n' "$help" - exit 0 - ;; + a | agenda) + action="agenda" + shift + ;; + c | calendar) + action="calendar" + shift + ;; + -i ) + action="import_ical '$2'" + shift 2 + ;; + -d ) + DATE="$2" + + shift 2 + ;; + * ) + printf '%s\n' "$help" + exit 0 + ;; esac + + [ -z "$DATE" ] && SEC="$(date +%s)" || SEC="$(date +%s -d "$DATE")" done $action diff --git a/bin/buffers b/bin/buffers @@ -45,7 +45,6 @@ r | run ) else tee < "$cache" fi | fzy )" - printf '$ %s \033]0;%s\007' "$cmd" "$cmd" # Get command arguments and the session name name="$cmd" @@ -78,13 +77,13 @@ r | run ) file=" $file" fi - # Start the command in an abduco session + # Set the name of the abduco session and create it + printf '\033]0;%s%s\007' "$name" "$file" TERM=screen ABDUCO="$cmd" abduco \ -e '^z' \ -A "$(printf '%s%s' "$cmd" "$file" | tr '/' '!')" $cmd $opt ;; a | attach ) - # If already on a session, print its name and exit [ "$ABDUCO" ] && printf '[ %s ]\n' "$ABDUCO" | tr '!' '/' && exit 1 @@ -95,14 +94,16 @@ a | attach ) name="${name##*$TAB}" printf '%s\n' "$name" - # Reset the screen, set the name of the session and attath to it - printf '\033[2J\033[0;0f\033[0m\033]0;%s\007' "$name" | tr '!' '/' + # Set the name of the session and attath to it + printf '\033]0;%s\007' "$name" | tr '!' '/' [ "$name" ] && TERM=screen ABDUCO="$name" abduco -e '^z' -a "$name" - # Reminder of current sessions - printf '\n' - abduco | tr '!' '/' | sort -t "$TAB" -k 3 | sed '1d; s/^/ /' ;; * ) printf '%s\' "$help" + exit 0 esac + +# Reset the screen, print reminder of current sessions +printf '\033[2J\033[0;0f\033[0m\n' +abduco | tr '!' '/' | sort -t "$TAB" -k 3 | sed '1d; s/^/ /' diff --git a/bin/lsync b/bin/lsync @@ -45,9 +45,6 @@ do case "$1" in shift done -printf '%s\n' "$d1" -printf '%s\n' "$d2" - [ ! -d "$d1" ] && mkdir -p "$d1" [ ! -d "$d2" ] && mkdir -p "$d2" diff --git a/bin/src b/bin/src @@ -160,11 +160,13 @@ done # Re-build an index of installed files in $PREFIX info "Rebuilding index in $PREFIX" + find "$PREFIX" -type l -exec rm {} \; -find "$PROGRAMS" -mindepth 2 ! -path "$PROGRAMS/*/src*" | while read path -do - if [ -d "$path" ] - then mkdir -p "$PREFIX/${path#$PROGRAMS/*/}" - else ln -sf "$path" "$PREFIX/${path#$PROGRAMS/*/}" - fi + +find "$PROGRAMS" -mindepth 2 -type d ! -path "$PROGRAMS/*/src*" | while read d +do mkdir -p "$PREFIX/${d#$PROGRAMS/*/}" +done + +find "$PROGRAMS" -mindepth 2 -type f ! -path "$PROGRAMS/*/src*" | while read f +do ln -sf "$f" "$PREFIX/${f#$PROGRAMS/*/}" done diff --git a/ctags/build.sh b/ctags/build.sh @@ -1,3 +0,0 @@ -# A maintained ctags implementation - -tar=http://github.com/universal-ctags/ctags/archive/master.tar.gz diff --git a/dvtm/config.h b/dvtm/config.h @@ -11,44 +11,38 @@ * A_INVIS Invisible or blank mode */ -enum { DEFAULT, BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, }; +enum { DEFAULT, BLACK, WARNING}; static Color colors[] = { - [DEFAULT] = { .fg = -1, .bg = -1, .fg256 = -1, .bg256 = -1, }, - [BLACK] = { .fg = COLOR_BLACK, .bg = -1, .fg256 = 0, .bg256 = -1, }, - [RED] = { .fg = COLOR_RED, .bg = -1, .fg256 = 1, .bg256 = -1, }, - [GREEN] = { .fg = COLOR_GREEN, .bg = -1, .fg256 = 2, .bg256 = -1, }, - [YELLOW] = { .fg = COLOR_YELLOW, .bg = -1, .fg256 = 3, .bg256 = -1, }, - [BLUE] = { .fg = COLOR_BLUE, .bg = -1, .fg256 = 4, .bg256 = -1, }, - [MAGENTA] = { .fg = COLOR_MAGENTA, .bg = -1, .fg256 = 5, .bg256 = -1, }, - [CYAN] = { .fg = COLOR_CYAN, .bg = -1, .fg256 = 6, .bg256 = -1, }, - [WHITE] = { .fg = COLOR_WHITE, .bg = -1, .fg256 = 7, .bg256 = -1, }, + [DEFAULT] = { .fg = -1, .bg = -1, .fg256 = -1, .bg256 = -1, }, + [BLACK] = { .fg = COLOR_BLACK, .bg = -1, .fg256 = 0, .bg256 = -1, }, + [WARNING] = { .fg = COLOR_RED, .bg = -1, .fg256 = 1, .bg256 = -1, }, }; #define COLOR(c) COLOR_PAIR(colors[c].pair) /* curses attributes for the currently focused window */ -#define SELECTED_ATTR (COLOR(RED) | A_BOLD) +#define SELECTED_ATTR (COLOR(DEFAULT) | A_BOLD) /* curses attributes for normal (not selected) windows */ -#define NORMAL_ATTR (COLOR(DEFAULT) | A_NORMAL) +#define NORMAL_ATTR (COLOR(BLACK) | A_BOLD) /* curses attributes for a window with pending urgent flag */ -#define URGENT_ATTR (COLOR(RED) | A_BOLD | A_BLINK) +#define URGENT_ATTR (COLOR(WARNING) | A_BLINK) /* curses attributes for the status bar */ -#define BAR_ATTR (COLOR(DEFAULT) | A_NORMAL) +#define BAR_ATTR (COLOR(DEFAULT) | A_BOLD) /* curses attributes for the currently selected tags */ -#define TAG_SEL (COLOR(RED) | A_BOLD) +#define TAG_SEL (COLOR(DEFAULT) | A_BOLD | A_REVERSE) /* curses attributes for not selected tags which contain no windows */ -#define TAG_NORMAL (COLOR(DEFAULT) | A_NORMAL) +#define TAG_NORMAL (COLOR(BLACK) | A_BOLD) /* curses attributes for not selected tags which contain windows */ -#define TAG_OCCUPIED (COLOR(CYAN) | A_BOLD) +#define TAG_OCCUPIED (COLOR(DEFAULT) | A_BOLD) /* curses attributes for not selected tags which with urgent windows */ -#define TAG_URGENT (COLOR(YELLOW) | A_BOLD | A_BLINK) +#define TAG_URGENT (COLOR(WARNING) | A_BLINK | A_REVERSE) /* characters for beginning and end of status bar message */ #define BAR_BEGIN ' ' #define BAR_END ' ' /* printf format string for the tag in the status bar */ #define TAG_SYMBOL " %s " -#define TAG_SYMBOL_FOCUSED "(%s)" +#define TAG_SYMBOL_FOCUSED " %s " /* status bar (command line option -s) position */ #define BAR_POS BAR_TOP /* BAR_BOTTOM, BAR_OFF */ /* whether status bar should be hidden if only one client exists */ @@ -62,13 +56,7 @@ static Color colors[] = { /* scroll back buffer size in lines */ #define SCROLL_HISTORY 2000 -const char tags[][10] = { - "1", - "2", - "3", - "4", - "5", -}; +const char tags[][10] = { "1", "2", "3", "4 mail", "5 irc", }; #include "tile.c" #include "bstack.c" diff --git a/shell/.config/feeds/read b/shell/.config/feeds/read @@ -1,33 +0,0 @@ - - -http://omicsomics.blogspot.com/2016/02/agbt-begins-with-bonus-storify-jeremiad.html - - - - - - - -http://omicsomics.blogspot.com/2016/04/genia-publishes-platform-progress.html - -http://omicsomics.blogspot.com/2016/04/protein-homeostasis-has-it-hit.html - - -http://omicsomics.blogspot.com/2016/05/around-world-in-amino-acids.html -http://omicsomics.blogspot.com/2016/06/london-calling-was-two-weeks-ago-and-i.html - -http://omicsomics.blogspot.com/2016/05/london-calling-notes-on-brownian.html -http://omicsomics.blogspot.com/2016/05/london-calling-preview.html -http://omicsomics.blogspot.com/2016/05/inconstant-lines.html -http://omicsomics.blogspot.com/2016/05/sickle-cell-anemia-underprioritized.html -http://omicsomics.blogspot.com/2016/05/kendall-square-techbiotechbiopharma.html -http://omicsomics.blogspot.com/2016/05/exploring-critiques-of-siddhartha.html -http://omicsomics.blogspot.com/2016/04/mosquito-genomes-chance-for-long-range.html -http://omicsomics.blogspot.com/2016/03/reflections-on-and-band-played-on.html -http://omicsomics.blogspot.com/2016/02/10x-launches-chromium-agbt16.html -http://omicsomics.blogspot.com/2016/03/who-wants-to-write-review-article.html -http://omicsomics.blogspot.com/2016/06/writing-big.html - - - - diff --git a/shell/.profile b/shell/.profile @@ -1,241 +0,0 @@ -#!/bin/sh -# ____ __ -# ____ _____ ____ .' ___\ \/ /\ ___ -# / __ \ / ____\/ __ \ / .'_ /\ / /.'__ \ -# / /_/ // / / /_/ // ___/ / // // ____/ -#/ ____/ \/ \____/ \/ \/ \/ \___\ - Variables & shell config -#\/============================================================================= - -export EMAIL='mail@josuah.net' - - -# TERMINAL - -export LS_COLORS='so=35:tw=91:ow=93' -export NCURSES_NO_UTF8_ACS=1 # Fix for dvtm + abduco in TTY -export TERMCAP="vt102|$TERM|dec vt102:"'\ - :do=^J:co#80:li#24:cl=50\E[;H\E[2J:\ - :le=^H:bs:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:\ - :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\ - :md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:is=\E[1;24r\E[24;1H:\ - :rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\ - :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\ - :ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=5\EM:vt#3:\ - :sc=\E7:rc=\E8:cs=\E[%i%d;%dr:vs=\E[?7l:ve=\E[?7h:\ - :mi:al=\E[L:dc=\E[P:dl=\E[M:ei=\E[4l:im=\E[4h:' # For ex-vi to work - - -# COMMANDS - -for editor in vi vis vim -do command -v "$editor" > /dev/null && EDITOR="$editor" -done -export EDITOR -export ALTERNATE_EDITOR='vi' -export DVTM_EDITOR='piped' -export VISUAL="$EDITOR" -export FCEDIT="$EDITOR" -export PAGER='less -FIRM' -export BROWSER='retawq' -export FILTER='peax' - - -# DIRECTORIES - -export DOT="$HOME/Config" -export MAIL="$HOME/Mail/INBOX" -export ENV="$HOME/.profile" -export PATH="$PATH:$HOME/.local/bin" # binaries built locally -export PATH="$PATH:$DOT/bin" # scripts -export XDG_CONFIG_HOME="$HOME/.config" -export XDG_CACHE_HOME="$HOME/.cache" -export XDG_DATA_HOME="$HOME/.local/share" -export ABDUCO_SOCKET_DIR="$XDG_CACHE_HOME/" - - -# PROMPTS - -export PS1='$(ps1)' -export PS2='| ' - - -# ALIAS -#------------------------------------------------------------------------------- - -alias l='ls -F -w 80 --color' -alias ll='l -lh' -alias la='l -A' -alias lla='l -Alh' -alias weather='curl -4 wttr.in' -alias lines='find . -name "*.[ch]" | xargs wc -l' -alias myip='curl icanhazip.com' -alias a='buffers attach' -alias r='buffers run' -alias v='buffers run $VISUAL' -alias p='$PAGER' -alias f='find . -type f ! -path "*/.git/*" | fzy' -alias d='find . -type d ! -path "*/.git/*" | fzy' -alias c='cd "$(d)"' - - -# FUNCTIONS -#------------------------------------------------------------------------------- - -ps1() -{ - local code="$?" - - printf '\n' - - # Line separator - local p='────────────────────────────────────────' - printf '\033[30;1m%s\033[0m\r' "$p$p" - - # Date - printf "\033[74C %s\r" "$(date +'%H:%M')" - - # PWD with $HOME replaced by ~ - [ "${pwd##$HOME**}" ] && local pwd="$PWD" || local pwd="~${PWD#$HOME}" - printf '\033[1m%s\033[0m \r' "$pwd" - - # Error code - [ "$code" -eq 0 ] || printf '\033[38C\033[31;1m %s \033[0m' "$code" - - # Non printable: terminal status, bell - printf '\a\033]0;shell\007' - - # Last line fo prompt - local abduco="$(($(abduco 2>/dev/null | wc -l) - 1))" - printf '\n\033[33m%s\033[0m$ ' "${abduco#0}" -} - -h() -{ - for field in $@ - do local cmd="$cmd $field" - done - - $cmd 1>&2 - less -MFNIR - tee -} - -light() -{ - sudo printf '%s\n' "$1" | sudo tee "$( - sudo find -L /sys/class/backlight/ -maxdepth 2 -name brightness - )" -} - -mnt() # Mount /dev/sdb1 or $1 in /mnt -{ - sudo mount -o uid=$USER -o rw ${1-/dev/sdb1} ${2-/mnt} -} - -extract() -{ - case "$1" in - *.tar.bz2) tar xvjf "$1" ;; - *.tar.gz ) tar xvzf "$1" ;; - *.bz2 ) bunzip2 "$1" ;; - *.rar ) unrar x "$1" ;; - *.gz ) gunzip "$1" ;; - *.tar ) tar xvf "$1" ;; - *.tbz2 ) tar xvjf "$1" ;; - *.tgz ) tar xvzf "$1" ;; - *.zip ) unzip "$1" ;; - *.Z ) uncompress "$1" ;; - *.7z ) 7z x "$1" ;; - *.xz ) xz -d "$1" ;; - *.deb ) ar vx "$1" ;; - * ) printf 'extract: Unknown archive type\n';; - esac -} - -# -# Remove spaces and other nasty characters from $1 recursively -sanitize() -{ - find "$1" | tac | while read -r p - do mv "$p" "$(printf '%s\n' "$p" | sed 's/[^[:alnum:],._/+-]/_/g')" - done -} - -# -# Transform a separator ($1) into '/': directory and subdirectory -# -split_at() -{ - find . | while read -r f - do - mkdir -p "${f%%$1*}" - mv "$f" "${f%%$1*}/${f#*$1}" - done -} - -# -# Remove prefix from all files in current directory up to "$1" separator -# -remove_prefix() -{ - find . | while read -r f - do mv "$f" "${f#*$1}" - done -} - -buildit() -{ - [ -f './autogen.sh' ] && ./autogen.sh - [ -f './configure' ] && ./configure --prefix="$PREFIX" - make && make clean PREFIX=$PREFIX install clean -} - -fbv() # FrameBuffer Video player based on ffplay -{ - local x="$(sed 's/,.*//' /sys/class/graphics/fb0/virtual_size)" - local y="$(sed 's/.*,//' /sys/class/graphics/fb0/virtual_size)" - local video="$1" - - trap "kill -9 0" INT EXIT - - ffplay -nodisp "$video" & - ffmpeg -re -i "$video" \ - -pix_fmt bgra \ - -vf scale="${x}x${y}" \ - -f fbdev /dev/fb0 -} - - -# TTY SETUP -#------------------------------------------------------------------------------- - -solarized_light="\ -\033]P0ffddbb \033]P1d0154b \033]P2779900 \033]P3ffa700\ -\033]P4096daf \033]P5897f74 \033]P600aa88 \033]P7000000\ -\033]P8bb9988 \033]P9d0154b \033]PA779900 \033]PBffa700\ -\033]PC096daf \033]PD897f74 \033]PE00aa88 \033]PF222222" - -ghost_in_the_shell="\ -\033]P0000000 \033]P191265C \033]P2439a64 \033]P3ccdd66\ -\033]P455aaaa \033]P5516583 \033]P64a8f86 \033]P799bbbb\ -\033]P8334444 \033]P9E71E5B \033]PA72f4a0 \033]PBf5ff8B\ -\033]PC99bbff \033]PD676cb0 \033]PE00ffff \033]PFffffff" - -coal="\ -\033]P0000000 \033]P1ee3333 \033]P2ccee44 \033]P3ffcc55\ -\033]P477aaaa \033]P5888888 \033]P655ee99 \033]P7cccccc\ -\033]P8555555 \033]P9ff6666 \033]PAeeff66 \033]PBffff99\ -\033]PCaaddff \033]PDaaaaaa \033]PE99ffbb \033]PFffffff" - -if [ "$TERM" = 'linux' ] -then - printf "$coal" # Theme - printf '\033[?6;c' # Cursor style - setfont Uni2-VGA16.psf # Font -fi - - -# STARTUP -#------------------------------------------------------------------------------- - -printf '\n' diff --git a/vim/.vimrc b/vim/.vimrc @@ -9,14 +9,12 @@ " OPTIONS "------------------------------------------------------------------------------- -" Behavior -set autoindent copyindent laststatus=2 ruler - -" Text display -set hlsearch showmatch list listchars=tab:>\ ,eol:$ fillchars=vert:│,fold:─ - -" Interface -set ruler number numberwidth=4 colorcolumn=80 cursorline +set autoindent copyindent " Indentation +set laststatus=2 ruler " Statusline +set smartcase ignorecase " Case +set hlsearch showmatch " Highlight +set list listchars=tab:>\ ,eol:$ fillchars=vert:│,fold:─ " Text display +set ruler number numberwidth=4 colorcolumn=80 cursorline " Interface " FUNCTIONS diff --git a/xdg/.config/user-dirs.dirs b/xdg/.config/user-dirs.dirs @@ -1,8 +0,0 @@ -DESKTOP= -DOWNLOAD=Downloads -TEMPLATES=/tmp -PUBLICSHARE=/tmp -DOCUMENTS=Documents -MUSIC=Music -PICTURES=Pictures -VIDEOS=Videos diff --git a/xdg/.config/user-dirs.locale b/xdg/.config/user-dirs.locale @@ -1 +0,0 @@ -en_US- \ No newline at end of file