From dbf954db9eefa7b76229d7f2c5039f0c97e72392 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Wed, 23 Nov 2016 18:56:15 +0100 Subject: [PATCH] Adaptations for school's computer --- bashrc | 3 +++ config/i3/blurlock | 9 +++++---- scripts/beep.sh | 2 +- scripts/debloc-custom.sh | 5 +++-- scripts/debloc.sh | 33 ++++++++++++++++----------------- 5 files changed, 28 insertions(+), 24 deletions(-) diff --git a/bashrc b/bashrc index 2a9cbde..b6d8ddd 100644 --- a/bashrc +++ b/bashrc @@ -41,6 +41,9 @@ export HISTCONTROL=ignoreboth export JAVA_FONTS=/usr/share/fonts/TTF export ANDROID_HOME=/opt/android-sdk +if [ -z $XDG_CONFIG_HOME ]; then + export XDG_CONFIG_HOME=$HOME/.config +fi # Tweaks [[ $- != *i* ]] && return diff --git a/config/i3/blurlock b/config/i3/blurlock index 5a289d6..31b24ee 100755 --- a/config/i3/blurlock +++ b/config/i3/blurlock @@ -1,7 +1,8 @@ #!/bin/bash i3-msg workspace Lock -imgpath=$HOME/.cache/blurlock.png -scrot $imgpath -convert $imgpath -blur 0x5 $imgpath -i3lock -f -i $imgpath +imgpath=$(mktemp).png +scrot "$imgpath" +convert "$imgpath" -blur 0x5 "$imgpath" +i3lock -f -i "$imgpath" i3-msg workspace back_and_forth +rm "$imgpath" diff --git a/scripts/beep.sh b/scripts/beep.sh index b25144e..15bfa68 100755 --- a/scripts/beep.sh +++ b/scripts/beep.sh @@ -1,2 +1,2 @@ -#!/usr/bin/sh +#!/usr/bin/env sh play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null diff --git a/scripts/debloc-custom.sh b/scripts/debloc-custom.sh index e50ea73..457fb3e 100755 --- a/scripts/debloc-custom.sh +++ b/scripts/debloc-custom.sh @@ -10,14 +10,15 @@ function debloc-custom-cli { debloc-install vim exuberant-ctags # Dev - debloc-install build-essential cmake clang + debloc-install build-essential cmake clang llvm git } function debloc-custom { debloc-custom-cli # Desktop manager - debloc-install i3 dmenu dunst unclutter xautolock feh numlockx scrot + debloc-install i3 i3lock dmenu dunst unclutter xautolock feh numlockx scrot imagemagick suckless-tools + ln -s $DEBLOC_ROOT/bin/dmenu{.xft,} # qutebrowser debloc-install python3-lxml python-tox python3-pyqt5 python3-pyqt5.qtwebkit python3-sip python3-jinja2 python3-pygments python3-yaml diff --git a/scripts/debloc.sh b/scripts/debloc.sh index 9eeb1b4..6a232a2 100755 --- a/scripts/debloc.sh +++ b/scripts/debloc.sh @@ -3,6 +3,7 @@ ARCH=$(dpkg --print-architecture) DEBLOC_DB=$HOME/.config/debloc/$ARCH DEBLOC_ROOT=$HOME/.debloc/$ARCH +DEBLOC_LD=$DEBLOC_ROOT/ld if [ -z $DEBIAN_MIRROR ]; then DEBIAN_MIRROR=$(cat /etc/apt/sources.list | grep '^deb ' | grep main | grep -v security | grep -v updates | grep -v backports) @@ -13,8 +14,8 @@ mkdir -p $DEBLOC_DB &> /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" -export LD_LIBRARY_PATH="$DEBLOC_ROOT/lib:$LD_LIBRARY_PATH" -export PYTHONPATH="$DEBLOC_ROOT/usr/lib/python3:$PYTHONPATH" +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" # Tell if a package exists @@ -61,7 +62,7 @@ function _debloc-locallyInstalled { # package # Tell if a package is installed system-wide function _debloc-globallyInstalled { # package STATUS=$(mktemp) - LANG=C dpkg --status $1 &> $STATUS + LANG=C dpkg --list $1 &> $STATUS if [ $? != 0 ]; then rm -f $STATUS > /dev/null return 0 @@ -113,16 +114,14 @@ function _debloc-packageMd5sum { # package # Update symbolics links in $DEBLOC_ROOT/lib function _debloc-ldconfig { - mkdir -p $DEBLOC_ROOT/lib &> /dev/null - rm -f $DEBLOC_ROOT/lib/* &> /dev/null - if [ -e $DEBLOC_ROOT/usr/lib ]; then - find $DEBLOC_ROOT/usr/lib -type f -name "*.so*" | while read lib; do - ln --symbolic --force "$lib" "$DEBLOC_ROOT/lib/$(basename $lib)" - done - find $DEBLOC_ROOT/usr/lib -type l -name "*.so*" | while read link; do - yes | cp --force --no-dereference --preserve=links "$link" "$DEBLOC_ROOT/lib/" &> /dev/null - done - fi + mkdir -p $DEBLOC_LD &> /dev/null + rm -f $DEBLOC_LD &> /dev/null + find $DEBLOC_ROOT{/usr,}/lib -type f -name "*.so*" | while read lib; do + ln --symbolic --force "$lib" "$DEBLOC_LD/$(basename $lib)" + done &> /dev/null + find $DEBLOC_ROOT{/usr,}/lib -type l -name "*.so*" | while read link; do + yes | cp --force --no-dereference --preserve=links "$link" "$DEBLOC_LD" &> /dev/null + done &> /dev/null } @@ -137,14 +136,14 @@ function _debloc-installDeb { # path tar xf $TAR_FILE -C $DEBLOC_ROOT # _debloc-ldconfig - mkdir -p $DEBLOC_ROOT/lib &> /dev/null - tar tf $TAR_FILE | grep '^./usr/lib/' | grep '\.so' | while read file; do + mkdir -p $DEBLOC_LD &> /dev/null + tar tf $TAR_FILE | grep '^.\(/usr\)\?/lib/' | grep '\.so' | while read file; do lib=$(readlink -f $DEBLOC_ROOT/$file) if [ -f $lib ]; then - ln --symbolic --force "$lib" "$DEBLOC_ROOT/lib/$(basename $file)" + ln --symbolic --force "$lib" "$DEBLOC_LD/$(basename $file)" fi if [ -h $lib ]; then - yes | cp --force --no-dereference --preserve=links "$(basename $link)" "$DEBLOC_ROOT/lib/" &> /dev/null + yes | cp --force --no-dereference --preserve=links "$(basename $link)" "$DEBLOC_LD/" &> /dev/null fi done fi