scripts

various script and utils
git clone git://z3bra.org/scripts
Log | Files | Refs

commit fda86c5c609da9d258561d6406e477c0d1fde16e
parent 057476e8f7b1d5358fbbb5d751af9ccac26fb203
Author: Willy Goiffon <w.goiffon@gmail.com>
Date:   Tue Oct  1 08:28:46 +0200

More adaptable to env running without X

Diffstat:
info.sh | 12+++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/info.sh b/info.sh @@ -26,9 +26,15 @@ cpuspe=$(grep 'model name' /proc/cpuinfo| sed 1q|sed 's/^.*:\ *//') system=$(lsb_release -d | sed 's/^.*:\s*//') -wmname=$(xprop -root WM_NAME|cut -d\" -f2) -termfn=$(sed -n 's/^.*\*font:\ *-[a-z]*-\([^-]*\)-.*/\1/p' ~/.Xresources) -systfn=$(sed -n 's/^.*font.*"\(.*\)".*$/\1/p' ~/.gtkrc-2.0) +if [ -n "$DISPLAY" ]; then + wmname=$(xprop -root WM_NAME|cut -d\" -f2) + termfn=$(sed -n 's/^.*\*font:\ *-[a-z]*-\([^-]*\)-.*/\1/p' ~/.Xresources) + systfn=$(sed -n 's/^.*font.*"\(.*\)".*$/\1/p' ~/.gtkrc-2.0) +else + wmname="none" + termfn="none" + systfn="none" +fi pkgnum=$(pacman -Q|wc -l) birthd=$(sed -n '1s/^\[\([0-9-]*\).*$/\1/p' /var/log/pacman.log | tr - .)