dotfiles

configuration files for different softwares
git clone git://z3bra.org/dotfiles
Log | Files | Refs

commit 8720feaee9ea9a2fd0b73962e160862e242b2007
parent 2696b2408cf1d0bad487579626108d803db99f9b
Author: z3bra <willy@mailoo.org>
Date:   Mon May 26 00:51:56 2014

Added function to change background

Diffstat:
 bashrc | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/bashrc b/bashrc @@ -74,6 +74,24 @@ sprunge() { curl -sF "sprunge=<${FILE}" http://sprunge.us } +setwall() { + bgdir="$HOME/usr/img/bg" + + test -z "$1" && return + + # get screen dir + IFS='x ' read sw sh <<< `xrandr | awk '/*/ {print $1}'` + + # get image dimensions (needs two lines because of IFS, no idea why) + IFS=' ' isize=`identify $1 | awk '{print $3}'` + IFS='x ' read iw ih <<< `echo $isize` + + test $iw -lt $sw && mode='tile' || mode='fill' + + ln -sf $1 ${bgdir}/default + hsetroot -${mode} ${bgdir}/default +} + thumbify() { if [ -f $1 ]; then cp $1 thumb/$1