From 49b53c75b94aea509436536f94dc3e65354b9fcf Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 26 Oct 2016 20:44:03 +1300 Subject: Add local/bin files --- bashrc | 4 ++-- local/bin/scron | 4 ++++ local/bin/update-dwm-bar | 27 +++++++++++++++++++++++++++ local/bin/webcam-go | 7 +++++++ local/bin/yardle-cache-analyse | 11 +++++++++++ setup | 6 ++---- 6 files changed, 53 insertions(+), 6 deletions(-) create mode 100755 local/bin/scron create mode 100755 local/bin/update-dwm-bar create mode 100755 local/bin/webcam-go create mode 100755 local/bin/yardle-cache-analyse diff --git a/bashrc b/bashrc index e9e1614..d8c7c0a 100644 --- a/bashrc +++ b/bashrc @@ -8,10 +8,10 @@ source /usr/share/git/completion/git-prompt.sh # Force false terminal to get colour with (eg) ls within dvtm if [ "$TERM" == "dvtm-256color" ]; then - TERM=st-256color + TERM=rxvt-256color fi if [ "$TERM" == "st-256color" ]; then - # Quick fix for Del key in st + # Quick fix for ctrl+arrow key in st echo $(tput smkx) > /dev/tty fi 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 '' + exit 1 +fi + +ls -1 $1 | while read -r file ; do + ts=$(head -n 1 $1/$file) + echo Created $(date --date=@$ts), $file +done diff --git a/setup b/setup index 9fdddb1..41eba31 100755 --- a/setup +++ b/setup @@ -2,11 +2,9 @@ cd $(dirname $0) -for i in $(ls -1 | grep -v $(basename $0)) ; do +for i in $(find -maxdepth 1 -type f | grep -v $(basename $0)) ; do ln -s ${PWD/$HOME\//}/$i $HOME/.$i done # extra symlinks -# No. -#cd $HOME -#ln -s .bash_profile .bashrc +ln -s "../${PWD/$HOME\//}/local/bin" "$HOME/.local/bin" -- cgit v1.1