summaryrefslogtreecommitdiff
path: root/bin/common
diff options
context:
space:
mode:
Diffstat (limited to 'bin/common')
-rwxr-xr-xbin/common/goo2
-rwxr-xr-xbin/common/hextorgb12
2 files changed, 11 insertions, 3 deletions
diff --git a/bin/common/goo b/bin/common/goo
index 442f25c..cfd03ec 100755
--- a/bin/common/goo
+++ b/bin/common/goo
@@ -18,6 +18,6 @@ arduino15"
for dir in $exclude; do
dirs="$dirs -name \"$dir\" -o "
done
-cmd="find ${2:-$HOME} \(${dirs} -false \) -prune -o -type ${1:-f} -print"
+cmd="find ${2:-$HOME} \(${dirs} -false \) -prune -o -type ${1:-f} -mindepth 1 -print"
eval "$cmd" 2>/dev/null
diff --git a/bin/common/hextorgb b/bin/common/hextorgb
index 63fcbbc..a50dfd9 100755
--- a/bin/common/hextorgb
+++ b/bin/common/hextorgb
@@ -1,6 +1,14 @@
#!/usr/bin/env sh
-tr -d '#' |
- tr '[:lower:]' '[:upper:]' |
+test which > /dev/null ||
+ exit 1
+if test -t 0
+then
+ echo "$1"
+else
+ cat /dev/stdin
+fi |
+ tr -d '#' | # remove '#'
+ tr '[:lower:]' '[:upper:]' | # uppercase is needed for bc
sed 's/\([0-9A-F]\{2\}\)/\1\n/g;iibase=16' |
bc |
tr '\n' ',' |