dot

packages and services management
Log | Files | Refs | README

commit be0941636b3b35a26035976574722e330e68555e
parent 3ce1379ba2b6acff40243b16a3650a531a88db8d
Author: josuah <mail@josuah.net>
Date:   Tue,  6 Sep 2016 20:29:04 +0200

Added cron job to check mail and wallpaper

Diffstat:
Mbin/.config/feeds/urls | 9+++------
Dbin/.profile | 244-------------------------------------------------------------------------------
Acron/.config/cron/jobs/beepnow | 2++
Acron/.config/cron/jobs/checkmail | 2++
Acron/.config/cron/tab | 8++++++++
Minstall.sh | 17+++++++++++++----
Misync/.mbsyncrc | 1+
Mmsmtp/.msmtprc | 2+-
Ms-nail/.mailrc | 1+
Ashell/.profile | 251+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mst/config.h | 2+-
Mxorg/.xinitrc | 10++++++----
12 files changed, 289 insertions(+), 260 deletions(-)

diff --git a/bin/.config/feeds/urls b/bin/.config/feeds/urls @@ -1,5 +1,3 @@ -# Bioinformatics -http://andrewgelman.com/feed -#http://www.homolog.us/blogs/feed -http://feeds.feedburner.com/OmicsOmics -http://hisham.hm/?x=feed:rss2&category=1- \ No newline at end of file +# Reddit +https://www.reddit.com/.rss?feed=2e4b94e63c18c15126c4c5f6fb844d7c54418daa&user=josuahdemangeon +https://www.reddit.com/saved.rss?feed=2e4b94e63c18c15126c4c5f6fb844d7c54418daa&user=josuahdemangeon diff --git a/bin/.profile b/bin/.profile @@ -1,244 +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='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 - tmp="$(mktemp)" - eval "$cmd 2>&1 | tee "$tmp" | $PAGER" - tee < "$tmp" -} - -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/cron/.config/cron/jobs/beepnow b/cron/.config/cron/jobs/beepnow @@ -0,0 +1,2 @@ +#!/bin/sh +beep diff --git a/cron/.config/cron/jobs/checkmail b/cron/.config/cron/jobs/checkmail @@ -0,0 +1,2 @@ +#!/bin/sh +mbsync -a diff --git a/cron/.config/cron/tab b/cron/.config/cron/tab @@ -0,0 +1,8 @@ +# ____________________________________ Minute (0-59) +# / _____________________________ Hour (0-23) +# / / ______________________ Month_Day (1-31) +# / / / _______________ Month (1-12) +# / / / / ________ Weekday (0-6) 0=sun +# / / / / / _ Command run-string +#/ / / / / / +*/5 * * * * $HOME/.config/cron/jobs/checkmail diff --git a/install.sh b/install.sh @@ -22,8 +22,10 @@ case "$1" in -m) mkdir "$HOME/Mail" printf 'password: '; read password - printf 'machine %s\nlogin %s\npassword %s' "$host" "$mail" "$password" \ + printf 'machine %s\nlogin %s\npassword "%s"' \ + "$host" "$mail" "$password" \ > "$HOME/.netrc" + chmod 750 "$HOME/.netrc" ;; -s) find "$Sync" -maxdepth 1 -path "$Sync/[A-Z][a-z]*" | while read path @@ -60,6 +62,12 @@ case "$1" in wait ;; +-c ) + c="$HOME/.config/cron/tab" + + crontab "$c" + crontab -l + ;; * ) printf '%s\n' " SYNTAX $pwd/install.sh [ OPTION ] @@ -67,8 +75,9 @@ 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 + -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. " ;; esac diff --git a/isync/.mbsyncrc b/isync/.mbsyncrc @@ -1,6 +1,7 @@ IMAPAccount josuah.net Host mail.gandi.net User mail@josuah.net +PassCmd "sed -rn 's/password *\"(.*)\"/\\1/ p' \"$HOME/.netrc\"" IMAPStore gandi-remote Account josuah.net diff --git a/msmtp/.msmtprc b/msmtp/.msmtprc @@ -7,4 +7,4 @@ auth on tls on tls_starttls on tls_trust_file /etc/ssl/certs/ca-certificates.crt -logfile ~/.msmtp.log +logfile ~/msmtp.log diff --git a/s-nail/.mailrc b/s-nail/.mailrc @@ -154,6 +154,7 @@ define filter { move (from "twitter.com") ~/Mail/s.twitter move (from "bandcamp.com") ~/Mail/s.bandcamp + move (from "Cryo Chamber") ~/Mail/s.bandcamp move (from "keybase.io") ~/Mail/s.keybase diff --git a/shell/.profile b/shell/.profile @@ -0,0 +1,251 @@ +#!/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\r' "$code" + + # Mails + + local mail_count="$(find "$MAIL/new" -mindepth 1 | wc -l)" + if [ "$mail_count" -gt 0 ] + then printf '\033[45C\033[34;1m %s \033[0m' "$mail_count" + fi + + # 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 + tmp="$(mktemp)" + eval "$cmd 2>&1 | tee "$tmp" | $PAGER" + tee < "$tmp" +} + +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/st/config.h b/st/config.h @@ -59,7 +59,7 @@ static char termname[] = "st-256color"; static unsigned int tabspaces = 8; /* bg opacity */ -static const int alpha = 0xa0; +static const int alpha = 0xd0; /* Terminal colors (16 first used in escape sequence) */ static const char *colorname[] = { diff --git a/xorg/.xinitrc b/xorg/.xinitrc @@ -6,10 +6,12 @@ while true do xsetroot -name "$(date +'%d/%m/%y %H:%M')" sleep 20 -done & +done & -nm-applet & -xfce4-power-manager & -st TERM=screen abduco -A dvtm dvtm-status & +nm-applet & +xfce4-power-manager & +st TERM=screen abduco -A dvtm dvtm-status & +feh --bg-center "/home/josuah/Pictures/wallpaper."* +compton & exec dwm