Merge branch 'master' of frogit:geoffrey/dotfiles

This commit is contained in:
Geoffrey Frogeye 2017-02-12 07:50:21 +01:00
commit 7f7b011d4a
3 changed files with 52 additions and 41 deletions

6
bashrc
View file

@ -32,9 +32,11 @@ export BROWSER=/usr/bin/qutebrowser
export TZ=/usr/share/zoneinfo/Europe/Paris export TZ=/usr/share/zoneinfo/Europe/Paris
export PATH="$PATH" export PATH="$PATH"
$(which ls) $HOME/.gem/ruby | while read rubyVer; do if [ -d $HOME/.gem/ruby ]; then
$(which ls) $HOME/.gem/ruby | while read rubyVer; do
export PATH="$PATH:$HOME/.gem/ruby/$rubyVer/bin/" export PATH="$PATH:$HOME/.gem/ruby/$rubyVer/bin/"
done done
fi
export PATH="$(echo "$PATH" | sed 's|:|\n|g' | sort | uniq | tr '\n' ':' | sed 's|:$||')" export PATH="$(echo "$PATH" | sed 's|:|\n|g' | sort | uniq | tr '\n' ':' | sed 's|:$||')"
export LANG=fr_FR.utf8 export LANG=fr_FR.utf8
export HISTSIZE=10000 export HISTSIZE=10000

View file

@ -17,19 +17,22 @@ DEBLOC_LD=$DEBLOC_ROOT/ld
if [ -z $DEBIAN_MIRROR ]; then if [ -z $DEBIAN_MIRROR ]; then
DEBIAN_MIRROR="$(cat /etc/apt/sources.list | grep '^deb ' | grep main | grep -v backports)" DEBIAN_MIRROR="$(cat /etc/apt/sources.list | grep '^deb ' | grep main | grep -v backports)"
DEBIAN_MIRROR="$(echo -e "$DEBIAN_MIRROR" | cut -d ' ' -f 2 | sed 's/\/$//')" DEBIAN_MIRROR="$(echo -e "$DEBIAN_MIRROR" | cut -d ' ' -f 2 | sed 's/\/$//' | sort | uniq)"
fi fi
mkdir -p $DEBLOC_DB &> /dev/null mkdir -p $DEBLOC_DB &> /dev/null
mkdir -p $DEBLOC_ROOT &> /dev/null mkdir -p $DEBLOC_ROOT &> /dev/null
export PATH="$DEBLOC_ROOT/usr/bin:$DEBLOC_ROOT/usr/games/:$DEBLOC_ROOT/usr/lib/git-core:$PATH" function _debloc-setVars {
export LIBRARY_PATH="$DEBLOC_LD:$LIBRARY_PATH" export PATH="$1/usr/bin:$1/usr/games/:$1/usr/lib/git-core:$PATH"
export C_INCLUDE_PATH="$DEBLOC_ROOT/usr/include:$C_INCLUDE_PATH" export LIBRARY_PATH="$2:$LIBRARY_PATH"
export CPLUS_INCLUDE_PATH="$DEBLOC_ROOT/usr/include:$CPLUS_INCLUDE_PATH" export C_INCLUDE_PATH="$1/usr/include:$C_INCLUDE_PATH"
export LD_LIBRARY_PATH="$DEBLOC_LD:$LD_LIBRARY_PATH" export CPLUS_INCLUDE_PATH="$1/usr/include:$CPLUS_INCLUDE_PATH"
export PYTHONPATH="$DEBLOC_ROOT/usr/lib/python3/dist-packages:$PYTHONPATH" export LD_LIBRARY_PATH="$2:$LD_LIBRARY_PATH"
export QT_QPA_PLATFORM_PLUGIN_PATH="$DEBLOC_ROOT/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" export PYTHONPATH="$1/usr/lib/python3/dist-packages:$PYTHONPATH"
export QT_QPA_PLATFORM_PLUGIN_PATH="$1/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms"
}
_debloc-setVars "$DEBLOC_ROOT" "$DEBLOC_LD"
# Tell if a package exists # Tell if a package exists
function _debloc-exists { # package function _debloc-exists { # package
@ -94,8 +97,11 @@ function _debloc-globallyInstalled { # package
function _debloc-packageShow { # package function _debloc-packageShow { # package
pkg=$1 pkg=$1
if [[ -n $DEBIAN_DB && -f $DEBIAN_DB ]]; then if [[ -n $DEBIAN_DB && -f $DEBIAN_DB ]]; then
startline=$(grep "^Package: ${pkg}\$" $DEBIAN_DB --line-number | cut -d ':' -f 1) startline=$(grep "^Package: ${pkg}\$" $DEBIAN_DB --line-number | tail -1 | cut -d ':' -f 1)
sed -n $startline,$(expr $startline + 100)p $DEBIAN_DB | while read line; do if [ -z "$startline" ]; then
return 0
fi
sed -n "$startline,$(expr $startline + 100)p" $DEBIAN_DB | while read line; do
if [ -z "$line" ]; then if [ -z "$line" ]; then
return 0 return 0
fi fi
@ -107,7 +113,7 @@ function _debloc-packageShow { # package
if [ -z "$line" ]; then if [ -z "$line" ]; then
return 0 return 0
fi fi
echo $line echo "$line"
done done
return 0 return 0
fi fi
@ -184,7 +190,7 @@ function _debloc-install { # package
fi fi
done done
if [ ! -s $DEB_FILE ]; then if [ ! -s $DEB_FILE ]; then
echo "→ Failed!" echo "→ Failed (no deb file)!"
rm $DEBLOC_DB/$pkg &> /dev/null rm $DEBLOC_DB/$pkg &> /dev/null
return 4 return 4
fi fi
@ -194,7 +200,7 @@ function _debloc-install { # package
real=$(md5sum $DEB_FILE | cut -d ' ' -f 1) real=$(md5sum $DEB_FILE | cut -d ' ' -f 1)
if [ "$theo" != "$real" ]; then if [ "$theo" != "$real" ]; then
rm -f $DEB_FILE &> /dev/null rm -f $DEB_FILE &> /dev/null
echo "→ Failed!" echo "→ Failed (sum doesn't match)!"
rm $DEBLOC_DB/$pkg &> /dev/null rm $DEBLOC_DB/$pkg &> /dev/null
return 5 return 5
fi fi

View file

@ -4,7 +4,6 @@
# (sourceable) # (sourceable)
function install-preferences { function install-preferences {
# Configuration # Configuration
function prompt { # text function prompt { # text
while true; do while true; do
@ -172,7 +171,7 @@ function install-preferences {
inst grep sed sh tar inst grep sed sh tar
if [ $TERMUX == 1 ]; then if [ $TERMUX == 1 ]; then
inst coreutils man termux-api openssl-tool inst coreutils man termux-api openssl-tool
if [ $ROOT == 1 ]; then if [ $ADMIN == 1 ]; then
inst tsu inst tsu
fi fi
fi fi
@ -182,7 +181,7 @@ function install-preferences {
else else
inst pass inst pass
fi fi
if [[ $ARCH == 1 && $ROOT == 1 ]]; then if [[ $ARCH == 1 && $ADMIN == 1 ]]; then
inst pkgfile inst pkgfile
systemctl enable pkgfile-update.timer systemctl enable pkgfile-update.timer
fi fi
@ -199,15 +198,14 @@ function install-preferences {
# Text editor # Text editor
if [ $GUI == 1 ]; then
inst gvim
else
if [ $TERMUX == 1 ]; then if [ $TERMUX == 1 ]; then
inst vim-python inst vim-python
elif [ $DEBIAN == 1 ]; then
inst vim-youcompleteme
ln -s $DEBLOC_ROOT/usr/bin/vim{.nox,}
else else
inst vim inst vim
fi fi
fi
if [ $DEBIAN == 1 ]; then if [ $DEBIAN == 1 ]; then
inst exuberant-ctags inst exuberant-ctags
else else
@ -217,6 +215,7 @@ function install-preferences {
vim +PluginInstall +qall vim +PluginInstall +qall
# YouCompleteMe (vim plugin) # YouCompleteMe (vim plugin)
if [ $DEBIAN != 1 ]; then
if [ $DEBIAN == 1 || $TERMUX == 1 ]; then if [ $DEBIAN == 1 || $TERMUX == 1 ]; then
inst python-dev python3-dev inst python-dev python3-dev
fi fi
@ -224,18 +223,18 @@ function install-preferences {
if [ $TERMUX == 0 ]; then if [ $TERMUX == 0 ]; then
YCM_ARGS="$YCM_ARGS --clang-completer --tern-completer" YCM_ARGS="$YCM_ARGS --clang-completer --tern-completer"
fi fi
python $HOME/.vim/bundle/YouCompleteMe/install.py $YCM_ARGS
python $HOME/.vim/bundle/YouCompleteMe/install.python $YCM_ARGS fi
# Common GUI # Common GUI
if [ $GUI == 1 ]; then if [ $GUI == 1 ]; then
# Desktop manager # Desktop manager
inst i3 i3lock dmenu dunst unclutter xautolock feh numlockx scrot inst i3 i3lock i3status dunst unclutter xautolock feh numlockx scrot
if [ $DEBIAN == 1 ]; then if [ $DEBIAN == 1 ]; then
inst suckles-tools inst suckless-tools
if [ ! $ROOT == 1 ]; then if [ $ADMIN == 0 ]; then
ln -s $DEBLOC_ROOT/bin/dmenu{.xft,} ln -s $DEBLOC_ROOT/usr/bin/dmenu{.xft,}
fi fi
else else
inst dmenu inst dmenu
@ -246,10 +245,10 @@ function install-preferences {
# qutebrowser # qutebrowser
if [ $DEBIAN == 1 ]; then if [ $DEBIAN == 1 ]; then
inst python3-lxml python-tox python3-pyqt5 python3-pyqt5.qtwebkit python3-sip python3-jinja2 python3-pygments python3-yaml inst python3-lxml python-tox python3-pyqt5 python3-pyqt5.qtwebkit python3-pyqt5.qtquick python3-sip python3-jinja2 python3-pygments python3-yaml
TMP_DIR=$(mktemp -d) TMP_DIR=$(mktemp -d)
$(cd $TMP_DIR; wget --quiet https://qutebrowser.org/python3-pypeg2_2.15.2-1_all.deb) $(cd $TMP_DIR; wget https://qutebrowser.org/python3-pypeg2_2.15.2-1_all.deb)
$(cd $TMP_DIR; wget --quiet https://github.com/The-Compiler/qutebrowser/releases/download/v0.8.4/qutebrowser_0.8.4-1_all.deb) $(cd $TMP_DIR; wget https://github.com/qutebrowser/qutebrowser/releases/download/v0.9.1/qutebrowser_0.9.1-2_all.deb)
instFile $TMP_DIR/*.deb instFile $TMP_DIR/*.deb
rm -rf $TMP_DIR rm -rf $TMP_DIR
@ -266,6 +265,10 @@ function install-preferences {
wget http://www.tedunangst.com/flak/files/sct.c -O $TMP wget http://www.tedunangst.com/flak/files/sct.c -O $TMP
cc -std=c99 -O2 -I /usr/X11R6/include -o $DEBLOC_ROOT/usr/bin/sct $TMP -L /usr/X11R6/lib -lm -lX11 -lXrandr cc -std=c99 -O2 -I /usr/X11R6/include -o $DEBLOC_ROOT/usr/bin/sct $TMP -L /usr/X11R6/lib -lm -lX11 -lXrandr
fi fi
if [ $DEBIAN == 1 ]; then
inst vim-gtk
else
inst gvim
fi fi
fi fi