]> mj.ucw.cz Git - osdd.git/commitdiff
First two examples
authorMartin Mares <mj@ucw.cz>
Sat, 17 Jul 2010 17:29:26 +0000 (19:29 +0200)
committerMartin Mares <mj@ucw.cz>
Sat, 17 Jul 2010 17:29:26 +0000 (19:29 +0200)
osd-clock [new file with mode: 0755]
osd-mpc-volume [new file with mode: 0755]

diff --git a/osd-clock b/osd-clock
new file mode 100755 (executable)
index 0000000..dfc2454
--- /dev/null
+++ b/osd-clock
@@ -0,0 +1,2 @@
+#!/bin/sh
+date '+%d-%m-%Y  %H:%M:%S' | osdc -
diff --git a/osd-mpc-volume b/osd-mpc-volume
new file mode 100755 (executable)
index 0000000..76dce7b
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+if [ -z "$1" -o -n "$2" ] ; then
+       echo >&2 "Usage: $0 [+|-]<percentage>"
+       exit 1
+fi
+mpc volume $1 | sed 's/.*volume: \([0-9]\+\)%.*/\1/;t;d' | osdc 'MPC Volume' '' --percent=-