From cb8ca9c9048d8c2338e5f6ae414317d51730f249 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 12 Feb 2017 13:29:03 +0100 Subject: [PATCH] Supplementary merge --- scripts/debloc | 32 ++++++++++++++++++++++++++++++-- scripts/install-prefs | 37 +++++++++++++++++++------------------ 2 files changed, 49 insertions(+), 20 deletions(-) diff --git a/scripts/debloc b/scripts/debloc index 7d45d9c..a778d81 100755 --- a/scripts/debloc +++ b/scripts/debloc @@ -234,7 +234,7 @@ function debloc_env { export PATH="$DEBLOC_ROOT/usr/bin:$DEBLOC_ROOT/usr/games/:$DEBLOC_ROOT/usr/lib/git-core:$PATH" export LIBRARY_PATH="$DEBLOC_LD:$LIBRARY_PATH" export C_INCLUDE_PATH="$DEBLOC_ROOT/usr/include:$C_INCLUDE_PATH" - export CPLUS_INCLUDE_PATH="$DEBLOC_ROOT/usr/include:$CPLUS_INCLUDE_PATH" + export CPLUS_INCLUDE_PATH="$DEBLOC_ROOT/usr/include:$DEBLOC_ROOT/usr/include/python2.7/:$DEBLOC_ROOT/usr/include/x86_64-linux-gnu/python2.7/:$CPLUS_INCLUDE_PATH" export LD_LIBRARY_PATH="$DEBLOC_LD:$LD_LIBRARY_PATH" export PYTHONPATH="$DEBLOC_ROOT/usr/lib/python3/dist-packages:$PYTHONPATH" export QT_QPA_PLATFORM_PLUGIN_PATH="$DEBLOC_ROOT/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" @@ -291,7 +291,6 @@ function debloc_deb_help { echo " PATH Path to the .deb file" return 0 } - function debloc_deb { # path if [ -z $1 ]; then debloc_deb_help @@ -308,6 +307,34 @@ function debloc_deb { # path } +function debloc_altern_help { + echo "Usage: $0 altern PROGRAM ALTERNATIVE" + echo + echo "Arguments:" + echo " PROGRAM Program to set the alternative for" + echo " ALTERNATIVE Alternative to set" + echo + echo "Examples:" + echo " $0 altern vim nox" + echo " $0 altern dmenu xft" + return 0 +} +function debloc_altern { # program alternative + if [ -z $1 || -z $2 ]; then + debloc_altern_help + fi + dest="$DEBLOC_ROOT/usr/bin/$1" + alte="$DEBLOC_ROOT/usr/bin/$1.$2" + if [ ! -f "$alt" ]; then + echo "Unknown alternative for $1 : $2" + exit 1 + fi + if [ -e "$dest" ]; then + rm $dest + fi + ln -s "$alte" "$dest" +} + function debloc_flush { rm -rf $DEBLOC_ROOT/* &> /dev/null rm -f $DEBLOC_DB/* &> /dev/null @@ -330,6 +357,7 @@ function debloc_help { echo " info Gives some information about the fake filesystem" echo " install Install a debian package in the fake filesystem" echo " deb Install from a .deb file in the fake filesystem" + echo " altern Update alternative" echo " flush Remove every package installed from the fake filesystem" echo " help Get help with commands" echo diff --git a/scripts/install-prefs b/scripts/install-prefs index c601be3..a84c8b3 100755 --- a/scripts/install-prefs +++ b/scripts/install-prefs @@ -123,10 +123,10 @@ elif which dpkg &> /dev/null; then } else function installOne { # package - debloc-install $1 + debloc install $1 } function installFileOne { # file - debloc-deb "$1" + debloc deb "$1" } fi function altInstallOne { @@ -192,15 +192,15 @@ elif [ $ARCH == 1 ]; then else inst make fi -inst git cmake clang llvm +inst git # Text editor if [ $TERMUX == 1 ]; then inst vim-python elif [ $DEBIAN == 1 ]; then - inst vim-youcompleteme - ln -s $DEBLOC_ROOT/usr/bin/vim{.nox,} + inst vim-nox + debloc altern vim nox else inst vim fi @@ -213,16 +213,14 @@ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim vim +PluginInstall +qall # YouCompleteMe (vim plugin) -if [ $DEBIAN != 1 ]; then - if [ $DEBIAN == 1 || $TERMUX == 1 ]; then - inst python-dev python3-dev - fi - local YCM_ARGS="" - if [ $TERMUX == 0 ]; then - YCM_ARGS="$YCM_ARGS --clang-completer --tern-completer" - fi - python $HOME/.vim/bundle/YouCompleteMe/install.py $YCM_ARGS +if [ $DEBIAN == 1 || $TERMUX == 1 ]; then + inst python-dev python3-dev fi +local YCM_ARGS="" +if [ $TERMUX != 1 ]; then + YCM_ARGS="$YCM_ARGS --clang-completer --tern-completer" +fi +python $HOME/.vim/bundle/YouCompleteMe/install.py $YCM_ARGS # Common GUI @@ -232,7 +230,7 @@ if [ $GUI == 1 ]; then if [ $DEBIAN == 1 ]; then inst suckless-tools if [ $ADMIN == 0 ]; then - ln -s $DEBLOC_ROOT/usr/bin/dmenu{.xft,} + debloc altern dmenu xft fi else inst dmenu @@ -257,11 +255,11 @@ if [ $GUI == 1 ]; then # Screen filter if [ $ARCH == 1 ]; then altInst sct - elif [ $DEBIAN == 1 ]; then - if [ ! -f $DEBLOC_ROOT/usr/bin/sct ]; then + elif [ $TERMUX != 1 ]; then + if [ ! -f $HOME/.gscripts/sct ]; then TMP=$(mktemp) 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 $HOME/.gscripts/sct $TMP -L /usr/X11R6/lib -lm -lX11 -lXrandr fi fi @@ -274,6 +272,9 @@ if [ $GUI == 1 ]; then fi if [ $EXTRA == 1 ]; then + # Extra dev + inst cmake clang llvm + # Extra CLI inst sl ffmpeg youtube-dl