scripts

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

commit df55668cf1e01a503897f84b9544fbb861206050
parent d2bab9ab415800907c73b356ae858041b7c3cc42
Author: z3bra <willyatmailoodotorg>
Date:   Mon Feb  1 19:11:17 +0100

Many changes, but yet nothing interresting

Diffstat:
autoup | 2+-
img | 2--
log | 1+
mailbar | 3++-
maillist | 13++++++-------
menu | 2+-
prtmk | 4++--
prtup | 2+-
uplay | 12+++++++++++-
ushot | 6++----
10 files changed, 27 insertions(+), 20 deletions(-)
diff --git a/autoup b/autoup @@ -3,7 +3,7 @@ SSHUSER=egull SSHKEY=$HOME/.ssh/phobos SERVER=raw.z3bra.org -WEBROOT=/var/http/raw.z3bra.org +WEBROOT=/var/www/raw.z3bra.org WEBDIR=dev/random test -z "$1" && exit 1 || FILENAME=$(basename $1) diff --git a/img b/img @@ -1,4 +1,2 @@ #!/bin/sh - -IMAGE=/tmp/`basename $1` curl -s "$1" | 2ff | lel -a -w 640 -h 480 diff --git a/log b/log @@ -3,5 +3,6 @@ NOTE=${1:-random} LOGDIR=$HOME/data/notes +test $# -lt 1 && ls -1 $LOGDIR && exit 0 test -d $LOGDIR || mkdir -p $LOGDIR ts >> $LOGDIR/$NOTE \ No newline at end of file diff --git a/mailbar b/mailbar @@ -3,7 +3,7 @@ . $HOME/.theme MAILDIR=$HOME/data/mail -MAILBOX='inbox crux lobsters' +MAILBOX='inbox crux lobsters pcc' COL1="%{F$HL}" COL2="%{F$FG}" @@ -14,6 +14,7 @@ mailcount() { crux) CHAR=''; DIR=$MAILDIR/lists/$1/new ;; inbox) CHAR=''; DIR=$MAILDIR/$1/new ;; lobsters) CHAR=''; DIR=$MAILDIR/lists/$1/new ;; + pcc) CHAR='©'; DIR=$MAILDIR/lists/$1/new ;; *) return ;; esac diff --git a/maillist b/maillist @@ -2,16 +2,15 @@ INBOX=$HOME/data/mail/inbox MBASE=$HOME/data/mail -LISTS='crux lobsters' +LISTS='crux lobsters pcc' crawl() { + # uses the X-BeenThere header set by maillist to check from + # which list a mail comes from case $1 in - crux) - REGEX='^(to|cc):.*crux@lists.crux.nu' - ;; - lobsters) - REGEX='^to:.*lobsters-[a-zA-Z0-9]*@lobste.rs' - ;; + crux) REGEX='^X-BeenThere:.*crux@lists.crux.nu' ;; + lobsters) REGEX='^X-BeenThere:.*lobsters-[a-zA-Z0-9]*@lobste.rs' ;; + pcc) REGEX='^X-BeenThere:.*pcc@lists.ludd.ltu.se' ;; esac find $INBOX -type f -exec grep -liP "$REGEX" {} + diff --git a/menu b/menu @@ -1,7 +1,7 @@ #!/bin/bash thingmenu -g 140x225 \ "chat on irc" "st -e sh -c 'dm irc ssh wizards'" \ - "run around" "defrag" \ + "run around" "quake3e +set fs_game defrag" \ "frag people" "quake3e" \ "play a game" "steam" \ "pop a term" "st" \ diff --git a/prtmk b/prtmk @@ -3,8 +3,8 @@ # z3bra - (c) wtfpl 2014 # Create a Pkgfile from simple templates and user input -PKGFILE=$HOME/crux/templates/Pkgfile -PORTDIR=$HOME/crux/ports +PKGFILE=$HOME/ports/templates/Pkgfile +PORTDIR=$HOME/ports/crux EDITOR=${EDITOR:-vim} daddy="z3bra <willy at mailoo dot org>" diff --git a/prtup b/prtup @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # z3bra - (c) wtfpl 2014 # Update git hashes in a Pkgfile diff --git a/uplay b/uplay @@ -1,4 +1,13 @@ #!/bin/sh +# +# and google keeps changing its API to fuck us up... #curl "$(youtube-dl -g $*)" | mplayer -cache 1024 - -mplayer -really-quiet -cache 1024 "$(youtube-dl -g $*)" +#mplayer -really-quiet -cache 1024 "$(youtube-dl -g $* | head -n1)" + +# audio only, video only, both +case $1 in + -a) shift 1; mplayer -quiet -cache 1024 "$(youtube-dl -g $* | sed -n '$p')" ;; + -v) shift 1; mplayer -really-quiet -cache 1024 "$(youtube-dl -g $* | sed -n '1p')" ;; + *) youtube-dl "$*" -o - | mplayer -really-quiet -cache 1024 - ;; +esac+ \ No newline at end of file diff --git a/ushot b/ushot @@ -2,7 +2,5 @@ FILE=${1:-/dev/null} -xscreenshot | iffpng | tee $FILE | imgurup - -sed 1q ~/.imgurlog | xsel -pi -test -n "$1" && meh $1 +xscreenshot | ff2png | tee $FILE | imgurup | tr -d'\n' | xsel -i +img $(xsel -o)