dot

packages and services management
Log | Files | Refs | README

commit 45a7a3a50d3dc0c0c040e4428087ffa81323b6d4
parent 070ae067a2d5c8eb61c0bc84c73b9c3538f29a24
Author: josuah <mail@josuah.net>
Date:   Tue, 13 Dec 2016 13:56:34 +0000

Reorganized more compliant to XDG

Diffstat:
A.config/abduco/shell | 2++
A.config/build/shell | 11+++++++++++
A.config/dvtm/shell | 1+
D.config/environment | 19-------------------
R.mbsyncrc -> .config/isync/mbsyncrc | 0
A.config/isync/shell | 1+
A.config/less/shell | 3+++
R.msmtprc -> .config/msmtp/msmtprc | 0
A.config/msmtp/shell | 1+
A.config/shell/alias | 15+++++++++++++++
A.config/shell/exports | 29+++++++++++++++++++++++++++++
A.config/shell/functions | 186+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
R.tmux.conf -> .config/tmux/conf | 0
A.config/tmux/shell | 5+++++
A.config/xorg/shell | 4++++
R.xinitrc -> .config/xorg/xinitrc | 0
M.local/bin/build | 38++++++++++++++++++++------------------
R.config/build/abduco -> .local/share/build/abduco | 0
R.config/build/barkdown -> .local/share/build/barkdown | 0
R.config/build/busybox -> .local/share/build/busybox | 0
R.config/build/byacc -> .local/share/build/byacc | 0
A.local/share/build/cmatrix | 3+++
R.config/build/ctags -> .local/share/build/ctags | 0
R.config/build/dmenu -> .local/share/build/dmenu | 0
R.config/build/dvtm -> .local/share/build/dvtm | 0
R.config/build/dwm -> .local/share/build/dwm | 0
R.config/build/git -> .local/share/build/git | 0
R.config/build/ii -> .local/share/build/ii | 0
R.config/build/iode -> .local/share/build/iode | 0
R.config/build/iomenu -> .local/share/build/iomenu | 0
R.config/build/isync -> .local/share/build/isync | 0
R.config/build/libevent -> .local/share/build/libevent | 0
R.config/build/libncurses -> .local/share/build/libncurses | 0
R.config/build/libtermkey -> .local/share/build/libtermkey | 0
R.config/build/libtool -> .local/share/build/libtool | 0
R.config/build/libutf -> .local/share/build/libutf | 0
R.config/build/lpeg -> .local/share/build/lpeg | 0
R.config/build/lua -> .local/share/build/lua | 0
R.config/build/m4 -> .local/share/build/m4 | 0
R.config/build/mandoc -> .local/share/build/mandoc | 0
R.config/build/mblaze -> .local/share/build/mblaze | 0
R.config/build/mksh -> .local/share/build/mksh | 0
R.config/build/mmh -> .local/share/build/mmh | 0
R.config/build/msmtp -> .local/share/build/msmtp | 0
R.config/build/mujs -> .local/share/build/mujs | 0
R.config/build/nafe -> .local/share/build/nafe | 0
R.config/build/pcre -> .local/share/build/pcre | 0
R.config/build/pkg-config -> .local/share/build/pkg-config | 0
R.config/build/reflex -> .local/share/build/reflex | 0
R.config/build/retawq -> .local/share/build/retawq | 0
R.config/build/s-mailx -> .local/share/build/s-mailx | 0
R.config/build/st -> .local/share/build/st | 0
R.config/build/tmux -> .local/share/build/tmux | 0
R.config/build/valgrind -> .local/share/build/valgrind | 0
R.config/build/vim -> .local/share/build/vim | 0
R.config/build/vis -> .local/share/build/vis | 0
R.config/build/yasm -> .local/share/build/yasm | 0
M.profile | 273+++++++++----------------------------------------------------------------------
58 files changed, 310 insertions(+), 281 deletions(-)

diff --git a/.config/abduco/shell b/.config/abduco/shell @@ -0,0 +1,2 @@ +export ABDUCO_SOCKET_DIR="$XDG_CACHE_HOME" +export ABDUCO_CMD="$SHELL" diff --git a/.config/build/shell b/.config/build/shell @@ -0,0 +1,11 @@ +# Environment variables for the "build" script package manager + +export PROGRAMS="$HOME/Programs" +export LOCAL="$HOME/.local" + +export PATH="$LOCAL/bin:$PATH" +export CPATH="$LOCAL/include:$CPATH" +export MANPATH="$LOCAL/share/man:$LOCAL/man:$MANPATH" +export LIBPATH="$LOCAL/lib:$LIBPATH" +export LD_RUN_PATH="$LOCAL/lib:$LD_RUN_PATH" +export LD_LIBRARY_PATH="$LOCAL/lib:$LD_LIBRARY_PATH" diff --git a/.config/dvtm/shell b/.config/dvtm/shell @@ -0,0 +1 @@ +export DVTM_EDITOR="$PAGER" diff --git a/.config/environment b/.config/environment @@ -1,19 +0,0 @@ -# Environment variables for the "build" script package manager - -# The right place would have been '.pam_environment', but Debian prevents -# users to set $PATH in it, considering it as a security threat. - -export PROGRAMS="$HOME/Programs" -export CONFIG="$HOME/Config" -export LOCAL="$HOME/.local" -export XDG_DATA_HOME="$HOME/.local/share" -export XDG_CONFIG_HOME="$HOME/.config" -export XDG_CACHE_HOME="$HOME/.cache" - -export PATH="$LOCAL/bin/$dir:$PATH" -export PATH="$LOCAL/bin:$PATH" -export CPATH="$LOCAL/include:$CPATH" -export MANPATH="$LOCAL/share/man:$LOCAL/man:$MANPATH" -export LIBPATH="$LOCAL/lib:$LIBPATH" -export LD_RUN_PATH="$LOCAL/lib:$LD_RUN_PATH" -export LD_LIBRARY_PATH="$LOCAL/lib:$LD_LIBRARY_PATH" diff --git a/.mbsyncrc b/.config/isync/mbsyncrc diff --git a/.config/isync/shell b/.config/isync/shell @@ -0,0 +1 @@ +alias mbsync='mbsync -c "$XDG_CONFIG_HOME/isync/mbsyncrc"' diff --git a/.config/less/shell b/.config/less/shell @@ -0,0 +1,3 @@ +mkdir -p "$XDG_CACHE_HOME/less" +export LESSHISTFILE="$XDG_CACHE_HOME/less/history" +export LESSKEY="$XDG_CONFIG_HOME/less/lesskey" diff --git a/.msmtprc b/.config/msmtp/msmtprc diff --git a/.config/msmtp/shell b/.config/msmtp/shell @@ -0,0 +1 @@ +alias msmtp='msmtp -C $XDG_CONFIG_DIR/msmtp/msmtprc' diff --git a/.config/shell/alias b/.config/shell/alias @@ -0,0 +1,15 @@ +alias l='ls -lh --color' +alias la='ls -Alh --color' +alias a='io-abduco' +alias g='io-grep' +alias v='io-abduco $PAGER +' +alias m='io-man' +alias t='tmux attach &>/dev/null || tmux new' +alias f='find . -type f ! -path "*/.git/*" | cut -c 3- | sort | iomenu' +alias d='find . -type d ! -path "*/.git/*" | cut -c 3- | sort | iomenu' +alias c='cd "$(d)"' +alias .p='. ~/.profile' +alias cl='printf "\033[H\033[2J"' +alias bh='busybox --help' +alias myip='curl icanhazip.com' +alias lines='find . -name "*.[ch]" | xargs wc -l' diff --git a/.config/shell/exports b/.config/shell/exports @@ -0,0 +1,29 @@ +export ENV="$HOME/.profile" + +export NAME='Josuah Demangeon' +export EMAIL='mail@josuah.net' +export MAIL="$HOME/Mail/INBOX" + +export EDITOR="vim" +export ALTERNATE_EDITOR="vi" +export VISUAL="$EDITOR" +export FCEDIT="$EDITOR" +export PAGER="iode" +export MANPAGER="$PAGER" + +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_CACHE_HOME="$HOME/.cache" +export XDG_RUNTIME_DIR="$HOME/.cache" + +export PS1='$( + [ $? -eq 0 ] && color=2 || color=1 + + # cursor shape + printf "\033[?6c" + + # status + printf "\n\033[1;30m>\033[0;3%sm>\033[1m>\033[m " "$color" +)' +export PS2=' > ' +export PS3=' > ' diff --git a/.config/shell/functions b/.config/shell/functions @@ -0,0 +1,186 @@ +# Shell functions for interactive use + + +matrix() +{ + setfont ~/.local/share/consolefonts/terminus-16b.psf + io-tty-theme matrix + cmatrix -abu 3 +} + + +predator() +{ + setfont ~/.local/share/consolefonts/cybercafe.fnt + io-tty-theme exo +} + + +tron() +{ + setfont ~/.local/share/consolefonts/lode-16.psf + io-tty-theme gotham + printf 'Starting the grid' + sleep 1; printf .; sleep 1; printf .; sleep 1; printf .; + sleep 3; pipes -p 2 -f 40 +} + + +alien() +{ + setfont ~/.local/share/consolefonts/vector-16.psf + io-tty-theme alien +} + + +starwars() +{ + setfont ~/.local/share/consolefonts/vector-16.psf + io-tty-theme coal + printf "\033[40CMay the force be with you" + sleep 2 + lightsaber +} + + +color() +{ + for i in 1 2 3 4 5 6 7 + do + printf ' \033[3%sm███\033[1m███\033[0m' $i + done + printf '\n' +} + + +# +# Build most projects without installing them. +# +buildit() +{ + [ -f './autogen.sh' ] && ./autogen.sh + [ -f './configure' ] && ./configure + make +} + + +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 +} + + +weather() +{ + curl -4 "wttr.in/$1" +} + + +# +# 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() +{ + ls | 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() +{ + ls | while read -r f + do mv "$f" "${f#*$1}" + done +} + + +# +# Sudo, sudo, sudo, sudo, sudo, screen brightness, sudo, sudo... +# +light() +{ + printf '%s\n' "$1" | sudo tee "$( + sudo find -L /sys/class/backlight -maxdepth 2 -name brightness | + head -n 1 + )" +} + + +# +# Why sudo to mount a pendrive! +# +mnt() +{ + sudo mount -o uid=$USER -o rw "${1-/dev/sdb1}" "${2-/mnt}" +} + + +# +# Works only in TTY and with sudo, unfortunately. +# +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 +} + + +# +# 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" +} + + +screencast() +{ + ffmpeg -video_size 1366x768 -framerate 25 -f x11grab -i :0.0 \ + ~/${1:-screencast}.mp4 +} diff --git a/.tmux.conf b/.config/tmux/conf diff --git a/.config/tmux/shell b/.config/tmux/shell @@ -0,0 +1,5 @@ +export TMUX_TMPDIR="$XDG_RUNTIME_DIR/tmux" +mkdir -p "$TMUX_TMPDIR" + +alias tmux='tmux -f "$XDG_CONFIG_HOME/tmux/conf"' +alias t='tmux attach &>/dev/null || tmux new' diff --git a/.config/xorg/shell b/.config/xorg/shell @@ -0,0 +1,4 @@ +export XINITRC="$XDG_CONFIG_HOME"/xorg/xinitrc +export XAUTHORITY="$XDG_RUNTIME_DIR"/xorg/xauthority + +mkdir -p "$XDG_RUNTIME_DIR/xorg" diff --git a/.xinitrc b/.config/xorg/xinitrc diff --git a/.local/bin/build b/.local/bin/build @@ -22,12 +22,12 @@ COMMAND l[ink] Update links from ~${PROGRAMS#$HOME} to ~${PREFIX#$HOME} PACKAGE" - find "$CONFIG/build" -type f -o -type l | + find "$PREFIX/share/build" -type f -o -type l | while IFS='' read -r path do IFS='' read -r description < "$path" printf '\t%-12s %s\n' \ - "${path#$CONFIG/build/}" \ + "${path#$PREFIX/share/build/}" \ "${description#\#}" done | sort } | more @@ -38,14 +38,14 @@ PACKAGE" error() { - printf '%s: \033[1;31m%s\033[0m\n' "$(basename "$0")" "$1" 1>&2 + printf '\033[1;31merror\033[0;1m %s\033[m: %s\n' "$1" "$2" 1>&2 exit 1 } info() { - printf '%s: \033[1m%s\033[0m\n' "$(basename "$0")" "$1" 1>&2 + printf '\033[1;36minfo\033[0;1m %s\033[m: %s\n' "$1" "$2" 1>&2 } @@ -74,12 +74,12 @@ build() compile() { local name="$1" tar="$2" - local PREFIX="$PROGRAMS/$name" + local PREFIX="$PROGRAMS/$name" script="$PREFIX/share/build/$name" - [ ! -f "$CONFIG/build/$name" ] && error "$2 has no build script" - . "$CONFIG/build/$name" + [ -f "$script" -o -h "$script" ] || error "$name" "no build script" + . "$script" - info "Installing $name" + info "$name" "installing" cd "$PREFIX" && mkdir -p bin doc etc include lib libexec share man cd src && build "$name" @@ -90,20 +90,20 @@ compile() download() { local name="$1" tar="$2" - local tmp="$(mktemp -u)" + local tmp="$(mktemp -u)" script="$PREFIX/share/build/$name" - [ -d "$PROGRAMS/$name/src" ] && error "$name/src already in $PROGRAMS" - [ ! -f "$CONFIG/build/$name" ] && error "$2 has no build script" - . "$CONFIG/build/$name" + [ -d "$PROGRAMS/$name/src" ] && error "$name" "already in $PROGRAMS" + [ -f "$script" -o -h "$script" ] || error "$name" "no build script" + . "$script" - info "Downloading $tar" + info "$name" "downloading \"$tar\"" case "$tar" in *.tar ) opt='' ;; *.tbz2 | *.tar.bz2 ) opt='j' ;; *.tgz | *.tar.gz ) opt='z' ;; *.txz | *.tar.xz ) opt='J' ;; - *) error 'not a known tar extension' ;; + *) error "$name" 'not a known tar extension' ;; esac mkdir -p "$tmp" "$PROGRAMS/$name" @@ -118,7 +118,7 @@ remove() { local name="$1" - info "Removing $name" + info "$name" "removing" rm -rf "$PROGRAMS/$name" } @@ -127,7 +127,7 @@ index() { local name="$1" - info "Updating index in $PREFIX/$1" + info "$name" "updating index in $PREFIX" find "$PROGRAMS/$name" -mindepth 2 -type f ! -path "*/src/*" | while read path @@ -140,7 +140,9 @@ index() main() { - mkdir -p "$PROGRAMS" "$PREFIX" "$CONFIG" + mkdir -p "$PROGRAMS" + + [ "$#" -le 1 ] && usage case "$1" in d | download ) @@ -169,7 +171,7 @@ main() ;; esac - info "Removing broken links from $PREFIX" + info "all" "removing broken links from $PREFIX" find -L "$PREFIX" -type l -exec rm {} \; } diff --git a/.config/build/abduco b/.local/share/build/abduco diff --git a/.config/build/barkdown b/.local/share/build/barkdown diff --git a/.config/build/busybox b/.local/share/build/busybox diff --git a/.config/build/byacc b/.local/share/build/byacc diff --git a/.local/share/build/cmatrix b/.local/share/build/cmatrix @@ -0,0 +1,3 @@ +# Matrix ncurses animation + +tar=http://www.asty.org/cmatrix/dist/cmatrix-1.2a.tar.gz diff --git a/.config/build/ctags b/.local/share/build/ctags diff --git a/.config/build/dmenu b/.local/share/build/dmenu diff --git a/.config/build/dvtm b/.local/share/build/dvtm diff --git a/.config/build/dwm b/.local/share/build/dwm diff --git a/.config/build/git b/.local/share/build/git diff --git a/.config/build/ii b/.local/share/build/ii diff --git a/.config/build/iode b/.local/share/build/iode diff --git a/.config/build/iomenu b/.local/share/build/iomenu diff --git a/.config/build/isync b/.local/share/build/isync diff --git a/.config/build/libevent b/.local/share/build/libevent diff --git a/.config/build/libncurses b/.local/share/build/libncurses diff --git a/.config/build/libtermkey b/.local/share/build/libtermkey diff --git a/.config/build/libtool b/.local/share/build/libtool diff --git a/.config/build/libutf b/.local/share/build/libutf diff --git a/.config/build/lpeg b/.local/share/build/lpeg diff --git a/.config/build/lua b/.local/share/build/lua diff --git a/.config/build/m4 b/.local/share/build/m4 diff --git a/.config/build/mandoc b/.local/share/build/mandoc diff --git a/.config/build/mblaze b/.local/share/build/mblaze diff --git a/.config/build/mksh b/.local/share/build/mksh diff --git a/.config/build/mmh b/.local/share/build/mmh diff --git a/.config/build/msmtp b/.local/share/build/msmtp diff --git a/.config/build/mujs b/.local/share/build/mujs diff --git a/.config/build/nafe b/.local/share/build/nafe diff --git a/.config/build/pcre b/.local/share/build/pcre diff --git a/.config/build/pkg-config b/.local/share/build/pkg-config diff --git a/.config/build/reflex b/.local/share/build/reflex diff --git a/.config/build/retawq b/.local/share/build/retawq diff --git a/.config/build/s-mailx b/.local/share/build/s-mailx diff --git a/.config/build/st b/.local/share/build/st diff --git a/.config/build/tmux b/.local/share/build/tmux diff --git a/.config/build/valgrind b/.local/share/build/valgrind diff --git a/.config/build/vim b/.local/share/build/vim diff --git a/.config/build/vis b/.local/share/build/vis diff --git a/.config/build/yasm b/.local/share/build/yasm diff --git a/.profile b/.profile @@ -1,8 +1,8 @@ # Shell configuration for any POSIX shell 2016-11-28 -# __ _ -# |_) _ _ /_ . | _ -# | | (_) | | | (/_ -# +# _ +# _ _ _ /_ . | _ +# . |_) | (_) | | | (/_ +# | #_______________________________________________________________________________ @@ -10,249 +10,34 @@ [ "$PROFILE" ] && return 0 || PROFILE=1 -. "$HOME/.config/environment" +while IFS='' read -r script +do + . "$script" +done << EOF +$(find ~/.config/shell ! -type d) +$(find ~/.config/ -name shell ! -type d) +EOF - -export ABDUCO_SOCKET_DIR="$XDG_CACHE_HOME" -export ABDUCO_CMD="$SHELL" - -export NAME='Josuah Demangeon' -export EMAIL='mail@josuah.net' - -export MAIL="$HOME/Mail/INBOX" -export ENV="$HOME/.profile" - -export EDITOR="vim" -export ALTERNATE_EDITOR="vi" -export VISUAL="$EDITOR" -export FCEDIT="$EDITOR" -export PAGER="iode" -export MANPAGER="$PAGER" -export DVTM_EDITOR="$PAGER" - -export PS1='$( - [ $? -eq 0 ] && color=7 || color=1 - - # cursor shape - printf "\033[?6c" - - # status - printf "\n> " -)' -export PS2=' > ' -export PS3=' > ' - - -alias l='ls -lh --color' -alias la='ls -Alh --color' -alias a='io-abduco' -alias g='io-grep' -alias v='io-abduco $PAGER +' -alias m='io-man' -alias t='tmux attach &>/dev/null || tmux new' -alias f='find . -type f ! -path "*/.git/*" | cut -c 3- | sort | iomenu' -alias d='find . -type d ! -path "*/.git/*" | cut -c 3- | sort | iomenu' -alias c='cd "$(d)"' -alias .p='. ~/.profile' -alias cl='printf "\033[H\033[2J"' -alias bh='busybox --help' -alias myip='curl icanhazip.com' -alias lines='find . -name "*.[ch]" | xargs wc -l' - - -matrix() -{ - setfont ~/.local/share/consolefonts/terminus-16b.psf +case "$(tty)" in +/dev/tty1 ) io-tty-theme matrix - cmatrix -abu 3 -} - - -predator() -{ - setfont ~/.local/share/consolefonts/cybercafe.fnt - io-tty-theme exo -} - - -tron() -{ - setfont ~/.local/share/consolefonts/lode-16.psf - io-tty-theme gotham - printf 'Starting the grid' - sleep 1; printf .; sleep 1; printf .; sleep 1; printf .; - sleep 3; pipes -p 2 -f 40 -} - - -alien() -{ - setfont ~/.local/share/consolefonts/vector-16.psf - io-tty-theme alien -} - - -starwars() -{ setfont ~/.local/share/consolefonts/vector-16.psf - io-tty-theme coal - printf "\033[40CMay the force be with you" - sleep 2 - lightsaber -} - - -color() -{ - for i in 1 2 3 4 5 6 7 - do - printf ' \033[3%sm███\033[1m███\033[0m' $i - done - printf '\n' -} - - -# -# Build most projects without installing them. -# -buildit() -{ - [ -f './autogen.sh' ] && ./autogen.sh - [ -f './configure' ] && ./configure - make -} - - -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 -} - - -weather() -{ - curl -4 "wttr.in/$1" -} - - -# -# 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() -{ - ls | 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() -{ - ls | while read -r f - do mv "$f" "${f#*$1}" - done -} - - -# -# Sudo, sudo, sudo, sudo, sudo, screen brightness, sudo, sudo... -# -light() -{ - printf '%s\n' "$1" | sudo tee "$( - sudo find -L /sys/class/backlight -maxdepth 2 -name brightness | - head -n 1 - )" -} - - -# -# Why sudo to mount a pendrive! -# -mnt() -{ - sudo mount -o uid=$USER -o rw "${1-/dev/sdb1}" "${2-/mnt}" -} - - -# -# Works only in TTY and with sudo, unfortunately. -# -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 -} - - -# -# 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" -} - - -screencast() -{ - ffmpeg -video_size 1366x768 -framerate 25 -f x11grab -i :0.0 \ - ~/${1:-screencast}.mp4 -} - + cmatrix -ab + ;; +/dev/tty2 ) + io-tty-theme exo + setfont ~/.local/share/consolefonts/miniwi-8.psf + cmatrix -ab + ;; +/dev/tty6 ) + startx : + ;; +esac -main() -{ - if [ "$TERM" = 'linux' ] - then - io-tty-theme solarized-light - setfont ~/.local/share/consolefonts/tamzen-16.psf - fi -} +if [ "$TERM" = 'linux' ] +then + io-tty-theme solarized-light + setfont ~/.local/share/consolefonts/tamzen-16.psf -main +fi