tMore adaptable to env running without X - scripts - various script and utils
(HTM) git clone git://z3bra.org/scripts
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit fda86c5c609da9d258561d6406e477c0d1fde16e
(DIR) parent 057476e8f7b1d5358fbbb5d751af9ccac26fb203
(HTM) Author: Willy Goiffon <w.goiffon@gmail.com>
Date: Tue, 1 Oct 2013 08:28:46 +0200
More adaptable to env running without X
Diffstat:
M info.sh | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/info.sh b/info.sh
t@@ -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 - .)