dot

packages and services management
Log | Files | Refs | README

commit 399cb1b191cf5ff248d6e8c11fcb3bf654032fcd
parent fbdc662e4d5986f1877ed53b862bbb82d0fafa63
Author: josuah <mail@josuah.net>
Date:   Sat,  8 Oct 2016 20:53:06 -0400

Moved a few directories

Diffstat:
A.link.sh.swp | 0
Rabduco/config.h -> abduco/build/config.h | 0
Dagenda/.local/bin/agenda | 287-------------------------------------------------------------------------------
Ragenda/.cache/agenda -> agenda/cache/agenda | 0
Dbin/feeds | 193-------------------------------------------------------------------------------
Dbkm/.local/bin/bkm | 56--------------------------------------------------------
Rbkm/.cache/bkm -> bkm/cache/bkm | 0
Rbin/src -> build.sh | 0
Rabduco/build.sh -> build/abduco.sh | 0
Rag/build.sh -> build/ag.sh | 0
Rbyacc/build.sh -> build/byacc.sh | 0
Rdmenu/build.sh -> build/dmenu.sh | 0
Rdvtm/build.sh -> build/dvtm.sh | 0
Rdwm/build.sh -> build/dwm.sh | 0
Rfzf/build.sh -> build/fzf.sh | 0
Rgit/build.sh -> build/git.sh | 0
Risync/build.sh -> build/isync.sh | 0
Rless/build.sh -> build/less.sh | 0
Rlibevent/build.sh -> build/libevent.sh | 0
Rlibncurses/build.sh -> build/libncurses.sh | 0
Rlibutf/build.sh -> build/libutf.sh | 0
Rlua/build.sh -> build/lua.sh | 0
Rm4/build.sh -> build/m4.sh | 0
Rmmh/build.sh -> build/mmh.sh | 0
Rmsmtp/build.sh -> build/msmtp.sh | 0
Rmujs/build.sh -> build/mujs.sh | 0
Rpcre/build.sh -> build/pcre.sh | 0
Rreflex/build.sh -> build/reflex.sh | 0
Rs-nail/build.sh -> build/s-nail.sh | 0
Rst/build.sh -> build/st.sh | 0
Rtmux/build.sh -> build/tmux.sh | 0
Rvim/build.sh -> build/vim.sh | 0
Ryasm/build.sh -> build/yasm.sh | 0
Rzsh/build.sh -> build/zsh.sh | 0
Rcron/.config/cron/jobs/beepnow -> cron/config/jobs/beepnow | 0
Rcron/.config/cron/jobs/checkmail -> cron/config/jobs/checkmail | 0
Rcron/.config/cron/tab -> cron/config/tab | 0
Rdmenu/config.h -> dmenu/build/config.h | 0
Rdmenu/config.mk -> dmenu/build/config.mk | 0
Rdvtm/config.h -> dvtm/build/config.h | 0
Rdvtm/dvtm-focused-tags.diff.disabled -> dvtm/build/dvtm-focused-tags.diff.disabled | 0
Rdvtm/dvtm-status -> dvtm/build/dvtm-status | 0
Rdwm/config.h -> dwm/build/config.h | 0
Rdwm/config.mk -> dwm/build/config.mk | 0
Rdwm/dwm-6.1-systray.diff -> dwm/build/dwm-6.1-systray.diff | 0
Rdwm/dwm-bottomstack-6.1.diff -> dwm/build/dwm-bottomstack-6.1.diff | 0
Rdwm/dwm-pertag-6.1.diff -> dwm/build/dwm-pertag-6.1.diff | 0
Rdwm/dwm-uselessgap-6.1.diff -> dwm/build/dwm-uselessgap-6.1.diff | 0
Remacs/.emacs.d/init.el -> emacs/emacs.d/init.el | 0
Rfeeds/.config/feeds/read -> feeds/config/read | 0
Rfeeds/.config/feeds/urls -> feeds/config/urls | 0
Rgit/.config/git/config -> git/config/config | 0
Rgit/.config/git/ignore -> git/config/ignore | 0
Minstall.sh | 3---
Risync/.mbsyncrc -> isync/mbsyncrc | 0
Alink.sh | 33+++++++++++++++++++++++++++++++++
Rmmh/.mmh/context -> mmh/mmh/context | 0
Rmmh/.mmh/profile -> mmh/mmh/profile | 0
Rmsmtp/.msmtprc -> msmtp/msmtprc | 0
Rs-nail/.mailrc -> s-nail/mailrc | 0
Dshell/.pam_environment | 43-------------------------------------------
Dshell/.profile | 272-------------------------------------------------------------------------------
Ashell/pam_environment | 43+++++++++++++++++++++++++++++++++++++++++++
Ashell/profile | 269+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rst/config.h -> st/build/config.h | 0
Rst/st-0.6-argbbg.diff -> st/build/st-0.6-argbbg.diff | 0
Rtmux/.config/tmux/new-session -> tmux/config/new-session | 0
Rtmux/.config/tmux/status -> tmux/config/status | 0
Rtmux/.tmux.conf -> tmux/tmux.conf | 0
Dtodo/.local/bin/todo | 26--------------------------
Rtodo/.cache/todo -> todo/cache/todo | 0
Rvim/.vim/vimrc -> vim/vimrc | 0
Rxorg/.xinitrc -> xorg/xinitrc | 0
Rzathura/.config/zathura/zathurarc -> zathura/config/zathurarc | 0
74 files changed, 345 insertions(+), 880 deletions(-)

diff --git a/.link.sh.swp b/.link.sh.swp Binary files differ. diff --git a/abduco/config.h b/abduco/build/config.h diff --git a/agenda/.local/bin/agenda b/agenda/.local/bin/agenda @@ -1,287 +0,0 @@ -#!/bin/sh -# | -# ,--. ,--, ,--. ---. .--| ,--. -# ,--| | | |--' | | | | ,--| -# `--` `--| `--' ' ' `--` `--` 2016-10-08 -#------`--'--------------------------------------------------------------------- -# Agenda from the command line - -AGENDA="${AGENDA-$HOME/.cache/agenda}" -COLUMNS="$(stty size | cut -d ' ' -f 2)" - -help="NAME - agenda - Agenda from the command line. - -SYNTAX - agenda COMMAND [-d DATE] [-i ICAL] - -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. - - -FILES - \$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 -" - - -# AWK SCRIPTS -# ------------------------------------------------------------------------------ - -awk_ical=' -BEGIN { - FS = ":"; -} - -/BEGIN:VEVENT/,/END:VEVENT/ { - if (substr($0, 1, 1) != " ") { - type = $1; - vevent[type] = $2; - } 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", - substr(date, 1, 4), # Year - substr(date, 5, 2), # Month - substr(date, 7, 2), # Day - substr(date, 10, 2), # Hour - substr(date, 12, 2), # Minute - substr(date, 14, 2)); # Second - - date = vevent["DTEND"] - printf("%s-%s-%s %s:%s:%s\t", - substr(date, 1, 4), # Year - substr(date, 5, 2), # Month - substr(date, 7, 2), # Day - substr(date, 10, 2), # Hour - substr(date, 12, 2), # Minute - substr(date, 14, 2)); # Second - - printf("%s\t", vevent["SUMMARY"]); - printf("%s\t", vevent["LOCATION"]); - printf("%s\n", vevent["DESCRIPTION"]); - } -}' - -awk_agenda=' -BEGIN { - FS = "\t"; -} - -{ - "date +%s -d '\''"$1"'\''" | getline 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); - beg_m = substr(beg, 6, 2); sub(/^0/, " ", beg_m); - beg_d = substr(beg, 9, 2); sub(/^0/, " ", beg_d); - beg_R = substr(beg, 12, 5); sub(/^0/, " ", beg_R); - end_Y = substr(end, 1, 4); sub(/^0/, " ", end_Y); - end_m = substr(end, 6, 2); sub(/^0/, " ", end_m); - end_d = substr(end, 9, 2); sub(/^0/, " ", end_d); - end_R = substr(end, 12, 5); sub(/^0/, " ", end_R); - - sub(/^\\n/, "", des); - gsub(/\\n/, " - ", des); - gsub(/\\/, "", sum); gsub(/\\/, "", loc); gsub(/\\/, "", des); - - # Header line - if (last_beg_Y != beg_Y) { - printf("_%4s_________Summary__________________________________"\ - "Location____________________________________________" \ - "____________________________________________________" \ - "\n |\n", - beg_Y); - } - - # First line - if (last_beg_m != beg_m) {printf("%2s ", beg_m);} else {printf(" ");} - if (last_beg_d != beg_d) {printf("%2s ", beg_d);} else {printf(" ");} - - printf("%5s | %-40s %s\n", beg_R, sum, loc); - - # Second line - if (beg_m != end_m) {printf("%2s ", end_m);} else {printf(" ");} - if (beg_d != end_d) {printf("%2s ", end_d);} else {printf(" ");} - if (beg_R != end_R) {printf("%5s ", end_R);} else {printf(" ");} - - printf("|\033[30;1m %s", des); - - printf("\n\033[0m |\n"); - - last_beg_Y = beg_Y; - last_beg_m = beg_m; - last_beg_d = beg_d; -}' - -awk_calendar=' -BEGIN { - FS = "\t"; - - header = " "; - row[0] = " Mon "; - row[1] = " Tue "; - row[2] = " Wed "; - row[3] = " Thu "; - row[4] = " Fri "; - row[5] = " Sat "; - row[6] = " Sun "; - - # fill the empty days with spaces - for (i = 0; i < w; i++) - row[i] = row[i] " "; - - # month name offset - if (w == 0) offset = 0; - else offset = 1; - - # increase date for every day - for (j = 0; j <= range; j++) { - - # day of week - if ((j + w) % 7 == 0) { - offset++; - } - - if (d < 28 \ - || (d == 28 && m == 2 && Y % 4 == 0) \ - || (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)) { - d++; - } else { - d = 1; - - if (m < 12) { - m++; - } else { - m = 1; Y++; - } - - 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; - } - - date = sprintf("%04d-%02d-%02d", Y, m, d); - - # 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 - 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[7m"; - - # current day - if (date == today) - row[(j + w) % 7] = row[(j + w) % 7] "\033[31;1m"; - - # day number - row[(j + w) % 7] = row[(j + w) % 7] sprintf("%2s\033[0m", d); - } - - print header; - for (i = 0; i <= 6; i++) { - print row[i]; - } -}' - - -# FUNCTIONS -# ------------------------------------------------------------------------------ - -import_ical() -{ - local ical="$1" - - sed -i 's/\r//; s/\t/ /g' "$ical" - awk "$awk_ical" "$ical" | cat - "$AGENDA" | sort | uniq > "$AGENDA" -} - -agenda() -{ - awk -v now="$SEC" "$awk_agenda" "$AGENDA" | cut -c 1-"$COLUMNS" -} - -calendar() -{ - awk \ - -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" -} - - -# ALGORYTHM -# ------------------------------------------------------------------------------ - -[ $# = 0 ] && set -- help -while [ $# -gt 0 ] -do - case $1 in - 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 - - [ "$DATE" ] && SEC="$(date +%s -d "$DATE")" || SEC="$(date +%s)" -done - -$action diff --git a/agenda/.cache/agenda b/agenda/cache/agenda diff --git a/bin/feeds b/bin/feeds @@ -1,193 +0,0 @@ -#!/bin/sh -# ,-- | -# |- ,--. ,--. .--| ,--- -# | |--' |--' | | `--. -# ' `--' `--' `--` ---' 2016-10-07 -#------------------------------------------------------------------------------- -# Simple RSS/ATOM feed reader - -FEEDS="${FEEDS-$HOME/.config/feeds}" -BROWSER="${BROWSER-firefox}" -CACHE="${CACHE-$HOME/.cache/feeds}" - -help=" -NAME - feeds - Simple RSS/ATOM fead reader - -SYNTAX - feeds COMMAND - -DESCRIPTION - view Choose a feed to read in $BROWSER - get Get/Update the feeds and the read/unread marks. - -ENVIRONMENT - FEEDS Path to the directory of feeds (./urls) and read (./read) list. - BROWSER Command to open the url of the feeds. - CACHE Path to the cache directory. - -FILES - $FEEDS/urls - List of RSS/ATOM urls, one link per line. - - $FEEDS/read - List of links already opened. - - $CACHE/* - Content of the RSS/ATOM files parsed by the rss.awk or atom.awk. - -" - - -# SCRIPTS -#-------------------------------------------------------------------------------- - -awk_format_columns=' -BEGIN{ - max1=0; - max2=0; -} - -{ - l++; - - c1[l] = $1; # First column - - for (i=2; i < NF; i++) { # Middle column - c2[l] = c2[l]$(i)(i<NF?OFS:""); - } - - c3[l] = $NF; # Last column - - max1 = ((length(c1[l]) > max1) ? length(c1[l]) : max1); - max2 = ((length(c2[l]) > max2) ? length(c2[l]) : max2); -} - -END { - for (i = 1; i <= l; i++) { - printf("%-"max1"s %-"max2"s %s\n", c1[i], c2[i], c3[i]); - } -}' - -# FUNCTIONS -#-------------------------------------------------------------------------------- - -# -# Check if feeds have been seen, and add a 'N' to the beginning of the line if -# so, and a '-' if not. Read stdin and print stdout. -# -check_read() -{ - while read line - do - read=0 - url="$(printf '%s' "$line" | awk '{ print $NF }')" - - if [ -z "$(grep -F "$url" "$FEEDS/read")" ] - then - printf '%s\n' "N $line" - else - printf '%s\n' "- $line" - fi - done -} - -# -# Check if the feed is RSS or ATOM, and transforms it in a list. -# -parse() -{ - local content="$1" - - if [ ! -z "$(printf '%s' "$content" | sed -n '/<rss[^>]*>/ p' )" ] - then RS='<[/]?item[^>]*>' ; begin='.*<link[^>]>'; end='<\/link>.*' - else RS='<[/]?entry[^>]*>'; begin='.*href=\42' ; end='\42.*' - fi - - printf '%s' "$content" | awk -v RS="$RS" ' -BEGIN { - max1=0; - max2=0; -} - -NR > 1 && NR < $(NR-1) { - title = $0 - sub(/.*<title[^>]*>/, "", title) - sub(/<\/title>.*/, "", title) - - url = $0 - sub(/'"$begin"'/, "", url) - sub(/'"$end"'/, "", url) - - printf("%s %s\n", title, url) -}' -} - -# -# Download each URL from $FEEDS/urls, parse them, check for read/unread, and -# store the generated list in $FEEDS/feeds/$title. -# -get() -{ - sed -r '/^(#.*)?$/ d' "$FEEDS/urls" | while read feed - do - content="$(wget -qO - $feed)" - title="$(printf '%s' "$content" \ - | sed 's/<\/title>.*//' \ - | sed -n 's/.*<title[^>]*>// p' \ - | sed 1q \ - | tr ' [A-Z]' '_[a-z]' \ - | tr -cd '[a-z][1-9_.,-]')" - printf '%s\n' "$title" - - parse "$content" | check_read | awk "$awk_format_columns" \ - > "$CACHE/$title" - done -} - -# -# List and pompt the feed for displaying articles. -# -view() -{ - tempfile="$(mktemp)" - - for feed in $(ls "$CACHE") - do - # count number of unread items - printf '%4s %s\n' \ - "$(sed -n '/^N / p' "$CACHE/$feed" | wc -l)" \ - "$feed" >> "$tempfile" - - # update the read/unread marks - printf '%s' "$(cat "$CACHE/$feed" \ - | cut -c 3- \ - | check_read)" > "$CACHE/$feed" - done - - sort -ro "$tempfile" "$tempfile" - - selection="$(cat "$CACHE/$(cat "$tempfile" \ - | fzf \ - | sed 's/ *[0-9]* //')" \ - | fzf \ - | awk '{ print $NF }')" - - rm "$tempfile" - - printf '%s\n' "$selection" >> "$FEEDS/read" - - $BROWSER "$selection" -} - -#===[ ALGORYTHM ]=============================================================== - -[ ! -d "$CACHE" ] && mkdir -p "$CACHE" -touch "$FEEDS/read" -touch "$FEEDS/urls" - -case $1 in - g | get ) get;; - v | view ) view;; - * ) printf '%s\n' "$help" -esac diff --git a/bkm/.local/bin/bkm b/bkm/.local/bin/bkm @@ -1,56 +0,0 @@ -#!/bin/sh -# | | -# |--. | / --.-. -# | | |-< | | | -# '--' ' ` ' ' ' 2016-10-08 -#------------------------------------------------------------------------------- -# Tiny shell bookmark manager - -BOOKMARKS="${BKM:-$HOME/.cache/bkm}" - -if [ "$#" -eq 0 ] -then - url="$(fzf < $BOOKMARKS)" - [ "${url##* }" ] && TERM=screen $BROWSER "${url##* }" - - printf '\n\n\n\n\n\n\n' - exit 0 -fi - -printf 'url: '; read url -printf 'description: '; read description -tag="$( - sed -r 's/^([^ ]*).*/\1/' "$BOOKMARKS" | uniq | fzf | tr '[a-z]' '[A-Z]' -)" - -printf '%s %s %s\n' "$tag" "$description" "$url" >> "$BOOKMARKS" - -bookmarks="$( - awk 'BEGIN{ - max1=0; - max2=0; - } - - { - l++; - - c1[l] = $1; # First column - - for (i=2; i < NF; i++) { # Middle column - c2[l] = c2[l]$(i)(i<NF?OFS:""); - } - - c3[l] = $NF; # Last column - - max1 = ((length(c1[l]) > max1) ? length(c1[l]) : max1); - max2 = ((length(c2[l]) > max2) ? length(c2[l]) : max2); - } - - END { - for (i = 1; i <= l; i++) { - printf("%-"max1"s %-"max2"s %s\n", c1[i], c2[i], c3[i]); - } - }' "$BOOKMARKS" | sort -)" - -[ "$bookmarks" ] && printf '%s\n' "$bookmarks" > "$BOOKMARKS" diff --git a/bkm/.cache/bkm b/bkm/cache/bkm diff --git a/bin/src b/build.sh diff --git a/abduco/build.sh b/build/abduco.sh diff --git a/ag/build.sh b/build/ag.sh diff --git a/byacc/build.sh b/build/byacc.sh diff --git a/dmenu/build.sh b/build/dmenu.sh diff --git a/dvtm/build.sh b/build/dvtm.sh diff --git a/dwm/build.sh b/build/dwm.sh diff --git a/fzf/build.sh b/build/fzf.sh diff --git a/git/build.sh b/build/git.sh diff --git a/isync/build.sh b/build/isync.sh diff --git a/less/build.sh b/build/less.sh diff --git a/libevent/build.sh b/build/libevent.sh diff --git a/libncurses/build.sh b/build/libncurses.sh diff --git a/libutf/build.sh b/build/libutf.sh diff --git a/lua/build.sh b/build/lua.sh diff --git a/m4/build.sh b/build/m4.sh diff --git a/mmh/build.sh b/build/mmh.sh diff --git a/msmtp/build.sh b/build/msmtp.sh diff --git a/mujs/build.sh b/build/mujs.sh diff --git a/pcre/build.sh b/build/pcre.sh diff --git a/reflex/build.sh b/build/reflex.sh diff --git a/s-nail/build.sh b/build/s-nail.sh diff --git a/st/build.sh b/build/st.sh diff --git a/tmux/build.sh b/build/tmux.sh diff --git a/vim/build.sh b/build/vim.sh diff --git a/yasm/build.sh b/build/yasm.sh diff --git a/zsh/build.sh b/build/zsh.sh diff --git a/cron/.config/cron/jobs/beepnow b/cron/config/jobs/beepnow diff --git a/cron/.config/cron/jobs/checkmail b/cron/config/jobs/checkmail diff --git a/cron/.config/cron/tab b/cron/config/tab diff --git a/dmenu/config.h b/dmenu/build/config.h diff --git a/dmenu/config.mk b/dmenu/build/config.mk diff --git a/dvtm/config.h b/dvtm/build/config.h diff --git a/dvtm/dvtm-focused-tags.diff.disabled b/dvtm/build/dvtm-focused-tags.diff.disabled diff --git a/dvtm/dvtm-status b/dvtm/build/dvtm-status diff --git a/dwm/config.h b/dwm/build/config.h diff --git a/dwm/config.mk b/dwm/build/config.mk diff --git a/dwm/dwm-6.1-systray.diff b/dwm/build/dwm-6.1-systray.diff diff --git a/dwm/dwm-bottomstack-6.1.diff b/dwm/build/dwm-bottomstack-6.1.diff diff --git a/dwm/dwm-pertag-6.1.diff b/dwm/build/dwm-pertag-6.1.diff diff --git a/dwm/dwm-uselessgap-6.1.diff b/dwm/build/dwm-uselessgap-6.1.diff diff --git a/emacs/.emacs.d/init.el b/emacs/emacs.d/init.el diff --git a/feeds/.config/feeds/read b/feeds/config/read diff --git a/feeds/.config/feeds/urls b/feeds/config/urls diff --git a/git/.config/git/config b/git/config/config diff --git a/git/.config/git/ignore b/git/config/ignore diff --git a/install.sh b/install.sh @@ -9,7 +9,6 @@ SYNTAX OPTIONS -g Clone git repositories as listed in the README file. -m Prompt for e-mail password to save in a unsafe text file. - -l Link the dotfiles from subdirectories of: $pwd. -s Link the sub-sub-directories of: ~/Sync. -v Install asyncronously the vim plugins. -c Activates the crontab. @@ -42,8 +41,6 @@ case "$1" in Sync="$HOME/Sync" find "$Sync" -maxdepth 1 -type d -path "$Sync/*" -exec ln -sf {} ~ \; - ;; --l) find "$pwd" -path "$pwd/[^.]*/.*" | while read path do if [ -d "$path" ] diff --git a/isync/.mbsyncrc b/isync/mbsyncrc diff --git a/link.sh b/link.sh @@ -0,0 +1,33 @@ +# , * | +# | , ---. | , +# | | | | |-< +# '--- ' ' ' ' ` +#------------------------------------------------------------------------------- + +CONFIG="${CONFIG:-$HOME/Config}" + +for xdg in 'config' 'cache' +do + find "$CONFIG" -mindepth 2 -maxdepth 2 -type d -name "$xdg" \ + | while read name + do + name="${name#$CONFIG/}" + name="${name%/$xdg}" + + mkdir -p "$HOME/.$xdg" + + find "$CONFIG/$name/$xdg/" -mindepth 1 -type d \ + | while read path + do + p="${path#$CONFIG/$name/$xdg/}" + mkdir -p "$HOME/.$xdg/$name/$p" + done + + find "$CONFIG/$name/$xdg/" -mindepth 1 -type f \ + | while read path + do + p="${path#$CONFIG/$name/$xdg/}" + ln -sf "$path" "$HOME/.$xdg/$name/$p" + done + done +done diff --git a/mmh/.mmh/context b/mmh/mmh/context diff --git a/mmh/.mmh/profile b/mmh/mmh/profile diff --git a/msmtp/.msmtprc b/msmtp/msmtprc diff --git a/s-nail/.mailrc b/s-nail/mailrc diff --git a/shell/.pam_environment b/shell/.pam_environment @@ -1,43 +0,0 @@ - # * | -# ---. ,--. --.-. ,--. ---. . , , .,-- ,--. ---. --.-. ,--. ---. |-- -# | | ,--| | | | |--' | | \ / | | | | | | | | | |--' | | | -# |--' `--` ' ' ' `--' ' ' ' ' ' `--' ' ' ' ' ' `--' ' ' ' 2016-10-05 -#-|----------------------------------------------------------------------------- -# Environment variables put at the right place - -EMAIL OVERRIDE="mail@josuah.net" - - -# COMMANDS -#------------------------------------------------------------------------------- - -EDITOR OVERRIDE=vim -ALTERNATE_EDITOR OVERRIDE=vi -VISUAL OVERRIDE=${EDITOR} -FCEDIT OVERRIDE=${EDITOR} -PAGER OVERRIDE="less -Ri" -BROWSER OVERRIDE=w3m -FILTER OVERRIDE=peax - - -# DIRECTORIES -#------------------------------------------------------------------------------- - -MAIL OVERRIDE=@{HOME}/Mail/INBOX -CONFIG OVERRIDE=@{HOME}/Config -LOCAL OVERRIDE=@{HOME}/.local -ENV OVERRIDE=@{HOME}/.profile -XDG_CONFIG_HOME OVERRIDE=@{HOME}/.config -XDG_CACHE_HOME OVERRIDE=@{HOME}/.cache -XDG_DATA_HOME OVERRIDE=@{HOME}/.local/share -ABDUCO_SOCKET_DIR OVERRIDE=${XDG_CACHE_HOME}/ - - -# PATHS -#------------------------------------------------------------------------------- - -PATH OVERRIDE=${LOCAL}/bin:${CONFIG}/bin:${PATH} -MANPATH OVERRIDE=${LOCAL}/share/man:${LOCAL}/man:${MANPATH} -CPATH OVERRIDE=${LOCAL}/include:${CPATH} -LD_LIBRARY_PATH OVERRIDE=${LOCAL}/lib:${LD_LIBRARY_PATH} -LD_RUN_PATH OVERRIDE=${LOCAL}/lib:${LD_LIBRARY_PATH} diff --git a/shell/.profile b/shell/.profile @@ -1,272 +0,0 @@ -#!/bin/sh -# ---. ,-- * | -# | | .,-- ,--. |- , | ,--. -# |--' | | | | | | |--' -# | ' `--' ' ' ' `--' 2016-10-05 -# ' ---------------------------------------------------------------------------- -# Shell configuration for any shell (dash, zsh, mksh, bash, busybox's ash...) - - -# VARIABLES -#------------------------------------------------------------------------------- - -# Parse and merge ~/.pam_environment -if [ -z "$CONFIG" ] -then IFS=' -' - for l in $(sed -r ' - /^ *(#.*|\s*)$/ d # Remove comments and empty lines - s/@/$/g # Convert variable notation. - s/ *([^ ]*) *[^ ]*=/\1=/ # Remove aditionnal pam keywords. - ' ~/.pam_environment) - do eval "$l" - printf '%s\n' "$l" - done - unset IFS -fi - -# Black Red Green Yellow Blue Purple Cyan White -THEMES="\ -solarized_light \ -P0ffddbb P1d0154b P2779900 P3ffa700 P4096daf P5dd6699 P600aa88 P7000000\ -P8bb9988 P9d0154b PA779900 PBffa700 PC096daf PD897f74 PE00aa88 PF222222\ - -solarized_dark \ -P0002b36 P1dc322f P2859900 P3b58900 P4268bd2 P56c71c4 P62aa198 P793a1a1\ -P8657b83 P9dc322f PA859900 PBb58900 PC268bd2 PD6c71c4 PE2aa198 PFfdf6e3\ - -ghost_in_the_shell \ -P0000000 P191265C P2439a64 P3ccdd66 P455aaaa P5516583 P64a8f86 P799bbbb\ -P8334444 P9E71E5B PA72f4a0 PBf5ff8B PC99bbff PD676cb0 PE00ffff PFffffff\ - -coal \ -P0000000 P1ee3333 P288ff44 P3ffcc55 P477aaaa P5888888 P655ee99 P7cccccc\ -P8555555 P9ff6666 PAaaff66 PBffff99 PCaaddff PDaaaaaa PE99ffbb PFffffff\ - -drakula \ -P0282a36 P1cc4343 P242c763 P3ffb86c P46272a4 P5bd93f9 P66fb9c9 P7e6e6d5\ -P8888db4 P9ff5555 PA50fa7b PBf1fa8c PC8196d6 PDff79c6 PE8be9fd PFffffff\ - -gotham \ -P00a0f14 P1c33027 P226a98b P3edb54c P4195465 P54e5165 P633859d P798d1ce\ -P8406068 P9d26939 PA30dbb3 PBffd280 PC268099 PD888ba5 PE599caa PFd3ebe9\ - -monokai \ -P048483e P1dc2566 P28fc029 P3d4c96e P455bcce P59358fe P656b7a5 P7acada1\ -P876715e P9fa2772 PAa7e22e PBe7db75 PC66d9ee PDae82ff PE66efd5 PFdfe1d3\ - -gruvbox \ -P0282828 P1cc241d P298971a P3d79921 P4458588 P5b16286 P6689d6a P7d5c4a1\ -P8928374 P9fb4934 PAb8bb26 PBfabd2f PC83a598 PDd2869b PE8ec07c PFffffff\ - -zenburn \ -P0191d1b P19C6363 P260b48a P3dfaf8f P4506070 P5dc8cc3 P68cd0d3 P7dcdccc\ -P8709080 P9dca3a3 PAbfebbf PBf0dfaf PC94bff3 PDec93d3 PE93e0e3 PFffffff\ -" - -# Prompt -export PS1='$(ps1)' -export PS2='| ' - - -# ALIAS 2016-10-05 -#------------------------------------------------------------------------------- - -alias l='ls -F -w 80 --color' -alias ll='l -lh' -alias la='l -A' -alias lla='l -Alh' -alias v='$VISUAL' -alias p='$PAGER' -alias t='tmux attach &>/dev/null || tmux new' -alias f='find . -type f ! -path "*/.git/*" | fzf --margin=3,6' -alias d='find . -type d ! -path "*/.git/*" | fzf --margin=3,6' -alias c='cd "$(find . -maxdepth 4 -mindepth 1 -type d | fzf --margin=3,6)"' -alias g='grep --color=always' -alias myip='curl icanhazip.com' -alias lines='find . -name "*.[ch]" | xargs wc -l' - - -# FUNCTIONS 2016-10-05 -#------------------------------------------------------------------------------- - - -# APPEARANCE - -ps1() -{ - code="$?" - - # Error code - [ "$code" -eq 0 ] && color=32 || color=31 - printf '\n \033[1;30m>\033[0;%sm>\033[1m>\033[0m ' "$color" - - # Update tmux status line at each new prompt - [ "$TMUX" ] && tmux refresh-client -S -} - -theme() -{ - printf "$(printf %s "$THEMES" | sed -n "/${1-$( - printf '%s' "$THEMES" | sed 's/ .*$//' | fzf --margin=10,20 - )}/ s/P/\\\\033]P/g p")" - - clear -} - -color() -{ - for in in in in - do - for i in 1 2 3 4 5 6 7 - do printf ' \033[3%sm██\033[1m█\033[0m\033[3%sm██' $i $i - done - printf '\n' - done - -} - - -# MANAGE PROJECTS - -gitall() -{ - find "$HOME" -name '.git' -type d | while read git - do - git="${git%/*}" - printf '\n\n\033[1m%s\033[0m\n' "~${git#$HOME}" - cd "$git" - git status --porcelain - cd "$HOME" - done -} - -buildit() -{ - [ -f './autogen.sh' ] && ./autogen.sh - [ -f './configure' ] && ./configure --prefix="$PREFIX" - make && make clean PREFIX=$PREFIX install clean -} - -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 -} - - -# INTERACTION - -h() -{ - for field in $@; do local cmd="$cmd $field"; done - tmp="$(mktemp)" - eval "$cmd 2>&1 | tee "$tmp" | $PAGER" - tee < "$tmp" -} - -weather() -{ - curl -4 "wttr.in/$1" -} - - -# RENAMING FILES - -# -# Remove spaces and other nasty characters from $1, recursively -# -sanitize() -{ - find . -mindepth 1 | tac | while IFS= read -r p - do mv "$p" "${p%/*}/$(printf %s "${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 -} - -# -# FrameBuffer Video player based on mplayer -# -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 - - mplayer -vm -vo fbdev2 "$video" -vf scale -zoom -x "$x" -y "$y" -} - - -# HARDWARE - -light() -{ - printf '%s\n' "$1" | sudo tee "$( - sudo find -L /sys/class/backlight/ -maxdepth 2 -name brightness - )" -} - -mnt() -{ - sudo mount -o uid=$USER -o rw "${1-/dev/sdb1}" "${2-/mnt}" -} - -rotate() -{ - case "$1" in - u | up ) printf 0 ;; - r | right ) printf 1 ;; - d | down ) printf 2 ;; - l | left ) printf 3 ;; - esac | sudo tee /sys/class/graphics/fbcon/rotate_all > /dev/null -} - - -# STARTUP 2016-10-05 -#------------------------------------------------------------------------------- - -[ "$TERM" = 'linux' ] && theme gruvbox - -# Attach to tmux right away -command -v tmux &> /dev/null && if [ -z "$TMUX" ] -then tmux attach &> /dev/null || tmux new -fi diff --git a/shell/pam_environment b/shell/pam_environment @@ -0,0 +1,43 @@ +# ---- * | +# | ---. . , , .,-- ,--. ---. --.-. ,--. ---. |-- +# |-- | | \ / | | | | | | | | | |--' | | | +# | ' ' ' ' ' `--' ' ' ' ' ' `--' ' ' ' 2016-10-08 +# ---- ------------------------------------------------------------------------- +# Environment variables put at the right place + +EMAIL OVERRIDE="mail@josuah.net" + + +# COMMANDS +#------------------------------------------------------------------------------- + +EDITOR OVERRIDE=vim +ALTERNATE_EDITOR OVERRIDE=vi +VISUAL OVERRIDE=${EDITOR} +FCEDIT OVERRIDE=${EDITOR} +PAGER OVERRIDE="less -Ri" +BROWSER OVERRIDE=w3m +FILTER OVERRIDE=peax + + +# DIRECTORIES +#------------------------------------------------------------------------------- + +MAIL OVERRIDE=@{HOME}/Mail/INBOX +CONFIG OVERRIDE=@{HOME}/Config +LOCAL OVERRIDE=@{HOME}/.local +ENV OVERRIDE=@{HOME}/.profile +XDG_CONFIG_HOME OVERRIDE=@{HOME}/.config +XDG_CACHE_HOME OVERRIDE=@{HOME}/.cache +XDG_DATA_HOME OVERRIDE=@{HOME}/.local/share +ABDUCO_SOCKET_DIR OVERRIDE=${XDG_CACHE_HOME}/ + + +# PATHS +#------------------------------------------------------------------------------- + +PATH OVERRIDE=${LOCAL}/bin:${CONFIG}/bin:${PATH} +MANPATH OVERRIDE=${LOCAL}/share/man:${LOCAL}/man:${MANPATH} +CPATH OVERRIDE=${LOCAL}/include:${CPATH} +LD_LIBRARY_PATH OVERRIDE=${LOCAL}/lib:${LD_LIBRARY_PATH} +LD_RUN_PATH OVERRIDE=${LOCAL}/lib:${LD_LIBRARY_PATH} diff --git a/shell/profile b/shell/profile @@ -0,0 +1,269 @@ +#!/bin/sh +# ---. ,-- * | +# | | .,-- ,--. |- , | ,--. +# |--' | | | | | | |--' +# | ' `--' ' ' ' `--' 2016-10-05 +# ' ---------------------------------------------------------------------------- +# Shell configuration for any shell (dash, zsh, mksh, bash, busybox's ash...) + + +# VARIABLES +#------------------------------------------------------------------------------- + +# Parse and merge ~/.pam_environment +IFS=' +' +for variable in $(sed -r ' + /^ *(#.*|\s*)$/ d # Remove comments and empty lines + s/@/$/g # Convert variable notation. + s/ *([^ ]*) *[^ ]*=/\1=/ # Remove aditionnal pam keywords. +' ~/.pam_environment) +do eval "$variable" +done +unset IFS + +# Black Red Green Yellow Blue Purple Cyan White +THEMES="\ +solarized_light \ +P0ffddbb P1d0154b P2779900 P3ffa700 P4096daf P5dd6699 P600aa88 P7000000\ +P8bb9988 P9d0154b PA779900 PBffa700 PC096daf PD897f74 PE00aa88 PF222222\ + +solarized_dark \ +P0002b36 P1dc322f P2859900 P3b58900 P4268bd2 P56c71c4 P62aa198 P793a1a1\ +P8657b83 P9dc322f PA859900 PBb58900 PC268bd2 PD6c71c4 PE2aa198 PFfdf6e3\ + +ghost_in_the_shell \ +P0000000 P191265C P2439a64 P3ccdd66 P455aaaa P5516583 P64a8f86 P799bbbb\ +P8334444 P9E71E5B PA72f4a0 PBf5ff8B PC99bbff PD676cb0 PE00ffff PFffffff\ + +coal \ +P0000000 P1ee3333 P288ff44 P3ffcc55 P477aaaa P5888888 P655ee99 P7cccccc\ +P8555555 P9ff6666 PAaaff66 PBffff99 PCaaddff PDaaaaaa PE99ffbb PFffffff\ + +drakula \ +P0282a36 P1cc4343 P242c763 P3ffb86c P46272a4 P5bd93f9 P66fb9c9 P7e6e6d5\ +P8888db4 P9ff5555 PA50fa7b PBf1fa8c PC8196d6 PDff79c6 PE8be9fd PFffffff\ + +gotham \ +P00a0f14 P1c33027 P226a98b P3edb54c P4195465 P54e5165 P633859d P798d1ce\ +P8406068 P9d26939 PA30dbb3 PBffd280 PC268099 PD888ba5 PE599caa PFd3ebe9\ + +monokai \ +P048483e P1dc2566 P28fc029 P3d4c96e P455bcce P59358fe P656b7a5 P7acada1\ +P876715e P9fa2772 PAa7e22e PBe7db75 PC66d9ee PDae82ff PE66efd5 PFdfe1d3\ + +gruvbox \ +P0282828 P1cc241d P298971a P3d79921 P4458588 P5b16286 P6689d6a P7d5c4a1\ +P8928374 P9fb4934 PAb8bb26 PBfabd2f PC83a598 PDd2869b PE8ec07c PFffffff\ + +zenburn \ +P0191d1b P19C6363 P260b48a P3dfaf8f P4506070 P5dc8cc3 P68cd0d3 P7dcdccc\ +P8709080 P9dca3a3 PAbfebbf PBf0dfaf PC94bff3 PDec93d3 PE93e0e3 PFffffff\ +" + +# Prompt +export PS1='$(ps1)' +export PS2='| ' + + +# ALIAS 2016-10-05 +#------------------------------------------------------------------------------- + +alias l='ls -F -w 80 --color' +alias ll='l -lh' +alias la='l -A' +alias lla='l -Alh' +alias v='$VISUAL' +alias p='$PAGER' +alias t='tmux attach &>/dev/null || tmux new' +alias f='find . -type f ! -path "*/.git/*" | fzf --margin=3,6' +alias d='find . -type d ! -path "*/.git/*" | fzf --margin=3,6' +alias c='cd "$(find . -maxdepth 4 -mindepth 1 -type d | fzf --margin=3,6)"' +alias g='grep --color=always' +alias myip='curl icanhazip.com' +alias lines='find . -name "*.[ch]" | xargs wc -l' + + +# FUNCTIONS 2016-10-05 +#------------------------------------------------------------------------------- + + +# APPEARANCE + +ps1() +{ + code="$?" + + # Error code + [ "$code" -eq 0 ] && color=32 || color=31 + printf '\n \033[1;30m>\033[0;%sm>\033[1m>\033[0m ' "$color" + + # Update tmux status line at each new prompt + [ "$TMUX" ] && tmux refresh-client -S +} + +theme() +{ + printf "$(printf %s "$THEMES" | sed -n "/${1-$( + printf '%s' "$THEMES" | sed 's/ .*$//' | fzf --margin=10,20 + )}/ s/P/\\\\033]P/g p")" + + clear +} + +color() +{ + for in in in in + do + for i in 1 2 3 4 5 6 7 + do printf ' \033[3%sm██\033[1m█\033[0m\033[3%sm██' $i $i + done + printf '\n' + done + +} + + +# MANAGE PROJECTS + +gitall() +{ + find "$HOME" -name '.git' -type d | while read git + do + git="${git%/*}" + printf '\n\n\033[1m%s\033[0m\n' "~${git#$HOME}" + cd "$git" + git status --porcelain + cd "$HOME" + done +} + +buildit() +{ + [ -f './autogen.sh' ] && ./autogen.sh + [ -f './configure' ] && ./configure --prefix="$PREFIX" + make && make clean PREFIX=$PREFIX install clean +} + +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 +} + + +# INTERACTION + +h() +{ + for field in $@; do local cmd="$cmd $field"; done + tmp="$(mktemp)" + eval "$cmd 2>&1 | tee "$tmp" | $PAGER" + tee < "$tmp" +} + +weather() +{ + curl -4 "wttr.in/$1" +} + + +# RENAMING FILES + +# +# Remove spaces and other nasty characters from $1, recursively +# +sanitize() +{ + find . -mindepth 1 | tac | while IFS= read -r p + do mv "$p" "${p%/*}/$(printf %s "${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 +} + +# +# FrameBuffer Video player based on mplayer +# +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 + + mplayer -vm -vo fbdev2 "$video" -vf scale -zoom -x "$x" -y "$y" +} + + +# HARDWARE + +light() +{ + printf '%s\n' "$1" | sudo tee "$( + sudo find -L /sys/class/backlight/ -maxdepth 2 -name brightness + )" +} + +mnt() +{ + sudo mount -o uid=$USER -o rw "${1-/dev/sdb1}" "${2-/mnt}" +} + +rotate() +{ + case "$1" in + u | up ) printf 0 ;; + r | right ) printf 1 ;; + d | down ) printf 2 ;; + l | left ) printf 3 ;; + esac | sudo tee /sys/class/graphics/fbcon/rotate_all > /dev/null +} + + +# STARTUP 2016-10-05 +#------------------------------------------------------------------------------- + +[ "$TERM" = 'linux' ] && theme gruvbox + +# Attach to tmux right away +command -v tmux &> /dev/null && if [ -z "$TMUX" ] +then tmux attach &> /dev/null || tmux new +fi diff --git a/st/config.h b/st/build/config.h diff --git a/st/st-0.6-argbbg.diff b/st/build/st-0.6-argbbg.diff diff --git a/tmux/.config/tmux/new-session b/tmux/config/new-session diff --git a/tmux/.config/tmux/status b/tmux/config/status diff --git a/tmux/.tmux.conf b/tmux/tmux.conf diff --git a/todo/.local/bin/todo b/todo/.local/bin/todo @@ -1,26 +0,0 @@ -#!/bin/sh -# | | -# |-- ,--. .--| ,--. -# | | | | | | | -# ' `--' `--` `--' 2016-10-08 -#------------------------------------------------------------------------------- -# Small todo list implementation - -todo="$HOME/.cache/todo" t='' cmd='' - -if [ "$1" = e ]; then $EDITOR "$todo"; return 0; fi - -case "$1" in --d ) shift - for n in $@; do cmd="$n d; $cmd"; done - sed "$cmd" -i "$todo" - ;; -'' ) - ;; -* ) - for w in $@; do t="$t $w"; done - printf '%s\n' "${t# }" >> "$todo" - ;; -esac - -sed '=' "$todo" | sed 'N; s/\n/\t/' diff --git a/todo/.cache/todo b/todo/cache/todo diff --git a/vim/.vim/vimrc b/vim/vimrc diff --git a/xorg/.xinitrc b/xorg/xinitrc diff --git a/zathura/.config/zathura/zathurarc b/zathura/config/zathurarc