scripts

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

commit 40bb8a0c67754d56fae74c5cd642f82af54eb97a
parent 0fde3c1375342d76ee5db0225c0a4d0e22a25c12
Author: z3bra <willy@mailoo.org>
Date:   Fri Jan  9 18:40:57 +0100

Modified/Fixed cpu, menu and prtup

Diffstat:
cpu | 2+-
menu | 4++--
prtup | 15++++++++++-----
3 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/cpu b/cpu @@ -12,7 +12,7 @@ EOF } cpuperc () { - LINE=`ps -eo pcpu |grep -vE '^\s*(0.0|%CPU)' |sed -n '1h;$!H;$g;s/\n/ +/gp'` + LINE=`ps -eo pcpu |grep -vE '^\s*(0.0|%CPU)' |tr '\n' '+'|sed 's/+$//'` echo "`echo $LINE | bc`%" } diff --git a/menu b/menu @@ -1,7 +1,7 @@ #!/bin/bash -thingmenu -g 120x120 \ +thingmenu -g 120x140 \ "play a game" "steam" \ "frag people" "ioquake3" \ - "pop a term" "urxvt" \ + "chat on irc" "urxvt -e sh -c 'dm irc ssh blink'" \ "surf the web" "dwb" \ "want some more?" "thinglaunch" 2> /dev/null diff --git a/prtup b/prtup @@ -27,16 +27,21 @@ get_version() { cd $PKGMK_SOURCE_DIR # enter the git directory - if cd $name; then + if cd $name 2>/dev/null; then git pull origin master - # get the git hash and its minimized version - version=$(git log --oneline --format="git-%h" | sed 1q) - sversion=$(git log --oneline --format="%H" | sed 1q) + elif test -n "$gitsource"; then + git clone $gitsource $name + cd $name + else - echo_color 1 'Cannot check git sources' + echo_color 1 "not a git-based port" exit 1 fi + + # get the git hash and its minimized version + version=$(git log --oneline --format="git-%h" | sed 1q) + sversion=$(git log --oneline --format="%H" | sed 1q) } update_pkgfile() {