summaryrefslogtreecommitdiff
path: root/local
diff options
context:
space:
mode:
Diffstat (limited to 'local')
-rwxr-xr-xlocal/bin/scron4
-rwxr-xr-xlocal/bin/update-dwm-bar27
-rwxr-xr-xlocal/bin/webcam-go7
-rwxr-xr-xlocal/bin/yardle-cache-analyse11
4 files changed, 49 insertions, 0 deletions
diff --git a/local/bin/scron b/local/bin/scron
new file mode 100755
index 0000000..879500c
--- /dev/null
+++ b/local/bin/scron
@@ -0,0 +1,4 @@
+#!/usr/bin/bash
+
+echo scron - super user\'s cron
+sudo EDITOR=$EDITOR crontab -e
diff --git a/local/bin/update-dwm-bar b/local/bin/update-dwm-bar
new file mode 100755
index 0000000..ff3a389
--- /dev/null
+++ b/local/bin/update-dwm-bar
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+DELAY=20
+sep=$(echo -e '\u2502')
+
+while true; do
+ bat="$(cat /sys/class/power_supply/BAT0/capacity)%"
+ case "$(cat /sys/class/power_supply/BAT0/status)" in
+ Full)
+ bat_icon='✓'
+ ;;
+ Charging)
+ bat_icon='▲'
+ ;;
+ Discharging)
+ bat_icon='▼'
+ ;;
+ *)
+ bat_icon="(?)"
+ ;;
+ esac
+ bat_string="$bat_icon $bat"
+ datetime_string=$(date "+%A $sep %d %h %Y $sep %_I:%M %p (UTC%:::z)")
+ xsetroot -name "$(uname -r) $sep $bat_string $sep $datetime_string" || exit
+ sleep "$DELAY"
+done
+
diff --git a/local/bin/webcam-go b/local/bin/webcam-go
new file mode 100755
index 0000000..c9d30c2
--- /dev/null
+++ b/local/bin/webcam-go
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+n=$1
+
+[ -z $n ] && n=1
+
+mplayer tv:// -tv device=/dev/video$n -vf screenshot
diff --git a/local/bin/yardle-cache-analyse b/local/bin/yardle-cache-analyse
new file mode 100755
index 0000000..9ec3eb4
--- /dev/null
+++ b/local/bin/yardle-cache-analyse
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ -z $1 ]; then
+ echo Usage: $0 '<cache_dir>'
+ exit 1
+fi
+
+ls -1 $1 | while read -r file ; do
+ ts=$(head -n 1 $1/$file)
+ echo Created $(date --date=@$ts), $file
+done