Lil thingies

This commit is contained in:
Geoffrey Frogeye 2017-02-07 09:03:18 +01:00
parent 78f7d99b09
commit 5903c0a437
3 changed files with 44 additions and 34 deletions

2
bashrc
View file

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

View file

@ -17,7 +17,7 @@ DEBLOC_LD=$DEBLOC_ROOT/ld
if [ -z $DEBIAN_MIRROR ]; then
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
mkdir -p $DEBLOC_DB &> /dev/null
@ -94,8 +94,11 @@ function _debloc-globallyInstalled { # package
function _debloc-packageShow { # package
pkg=$1
if [[ -n $DEBIAN_DB && -f $DEBIAN_DB ]]; then
startline=$(grep "^Package: ${pkg}\$" $DEBIAN_DB --line-number | cut -d ':' -f 1)
sed -n $startline,$(expr $startline + 100)p $DEBIAN_DB | while read line; do
startline=$(grep "^Package: ${pkg}\$" $DEBIAN_DB --line-number | tail -1 | cut -d ':' -f 1)
if [ -z "$startline" ]; then
return 0
fi
sed -n "$startline,$(expr $startline + 100)p" $DEBIAN_DB | while read line; do
if [ -z "$line" ]; then
return 0
fi
@ -107,7 +110,7 @@ function _debloc-packageShow { # package
if [ -z "$line" ]; then
return 0
fi
echo $line
echo "$line"
done
return 0
fi
@ -184,7 +187,7 @@ function _debloc-install { # package
fi
done
if [ ! -s $DEB_FILE ]; then
echo "→ Failed!"
echo "→ Failed (no deb file)!"
rm $DEBLOC_DB/$pkg &> /dev/null
return 4
fi
@ -194,7 +197,7 @@ function _debloc-install { # package
real=$(md5sum $DEB_FILE | cut -d ' ' -f 1)
if [ "$theo" != "$real" ]; then
rm -f $DEB_FILE &> /dev/null
echo "→ Failed!"
echo "→ Failed (sum doesn't match)!"
rm $DEBLOC_DB/$pkg &> /dev/null
return 5
fi

View file

@ -4,7 +4,6 @@
# (sourceable)
function install-preferences {
# Configuration
function prompt { # text
while true; do
@ -172,12 +171,12 @@ function install-preferences {
inst grep sed sh tar
if [ $TERMUX == 1 ]; then
inst coreutils man termux-api openssl-tool
if [ $ROOT == 1 ]; then
if [ $ADMIN == 1 ]; then
inst tsu
fi
fi
inst moreutils screen ncdu lsof htop proxytunnel pass pv curl wget sshfs netcat
if [[ $ARCH == 1 && $ROOT == 1 ]]; then
if [[ $ARCH == 1 && $ADMIN == 1 ]]; then
inst pkgfile
systemctl enable pkgfile-update.timer
fi
@ -194,15 +193,14 @@ function install-preferences {
# Text editor
if [ $GUI == 1 ]; then
inst gvim
else
if [ $TERMUX == 1 ]; then
inst vim-python
elif [ $DEBIAN == 1 ]; then
inst vim-youcompleteme
ln -s $DEBLOC_ROOT/usr/bin/vim{.nox,}
else
inst vim
fi
fi
if [ $DEBIAN == 1 ]; then
inst exuberant-ctags
else
@ -212,6 +210,7 @@ function install-preferences {
vim +PluginInstall +qall
# YouCompleteMe (vim plugin)
if [ $DEBIAN != 1 ]; then
if [ $DEBIAN == 1 || $TERMUX == 1 ]; then
inst python-dev python3-dev
fi
@ -219,18 +218,18 @@ function install-preferences {
if [ $TERMUX == 0 ]; then
YCM_ARGS="$YCM_ARGS --clang-completer --tern-completer"
fi
python $HOME/.vim/bundle/YouCompleteMe/install.python $YCM_ARGS
python $HOME/.vim/bundle/YouCompleteMe/install.py $YCM_ARGS
fi
# Common GUI
if [ $GUI == 1 ]; then
# 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
inst suckles-tools
if [ ! $ROOT == 1 ]; then
ln -s $DEBLOC_ROOT/bin/dmenu{.xft,}
inst suckless-tools
if [ $ADMIN == 0 ]; then
ln -s $DEBLOC_ROOT/usr/bin/dmenu{.xft,}
fi
else
inst dmenu
@ -241,16 +240,22 @@ function install-preferences {
# qutebrowser
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)
$(cd $TMP_DIR; wget --quiet 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://qutebrowser.org/python3-pypeg2_2.15.2-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
rm -rf $TMP_DIR
elif [ $ARCH == 1 ]; then
altInst qutebrowser
fi
if [ $DEBIAN == 1 ]; then
inst vim-gtk
else
inst gvim
fi
fi
if [ $EXTRA == 1 ]; then