scripts

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

commit 77253c4d41cb7f64154c8ab2bfbc6f9cfcfb00aa
parent 9b4d822f28692f182a0240a1f244029bc70c55e7
Author: z3bra <willy@mailoo.org>
Date:   Thu Apr  2 23:37:17 +0200

few more scripts

Diffstat:
irc | 36++++++++++++++++++++++++++++++++++++
mfp | 11+++++++++++
pops | 22++++++++++++++++++++++
popup | 4++--
4 files changed, 71 insertions(+), 2 deletions(-)
diff --git a/irc b/irc @@ -0,0 +1,36 @@ +#!/bin/sh +# +# join an irc channel quickly + +BASEDIR=$HOME/var/irc +NICK=${NICK:-'z3bra'} +PASS=${PASS:-'password'} + +CHANNEL=${1:-'#nixers'} +SERVER=${2:-'irc.nixers'} + +CHANDIR=$BASEDIR/$SERVER/$CHANNEL + +export NICK PASS CHANNEL SERVER + +cat << EOF + +nick : $NICK +serv : $SERVER +chan : $CHANNEL + +connecting to $SERVER... +EOF +ii -i $BASEDIR -s "$SERVER" -n "$NICK" -k "$PASS" & + +echo "joining $CHANNEL.." +echo "/j $CHANNEL" > $BASEDIR/$SERVER/in + +while ! test -f $CHANDIR/out; do sleep 0.5; done + +notii $CHANDIR/out & + +tmux new-session -d "tail -n100 -f $CHANDIR/out | hiii" \;\ + split-window "sob > $CHANDIR/in" \;\ + resize-pane -y 2 \;\ + attach diff --git a/mfp b/mfp @@ -0,0 +1,11 @@ +#!/bin/sh +# +# z3bra - 2015 (c) wtfpl +# plays mix from http://musicforprogramming.net in random order + +curl -s http://musicforprogramming.net/rss.php \ + | grep comments \ + | sed 's/\s*<.\?comments>\s*//g' \ + | shuf \ + | tr '\n' ' ' \ + | xargs mplayer -nocache 2>&1 >/dev/null diff --git a/pops b/pops @@ -0,0 +1,22 @@ +#!/bin/sh +# +# z3bra - (c) wtfpl 2014 +# Create a small popup with the given text + +# bar options +font="-*-creep-*-*-*--16-*-*-*-*-*-*-1" +bg="#ff040201" +fg="#ffdfd5d2" + +x=$(wattr w `lsw -r`) +y=$(wattr h `lsw -r`) + +width=180 +height=20 + +offy=10 +offx=$(( x - 14 - $width )) + +geom=${width}x${height}+${offx}+${offy} + +skroll -r -n25 | lemonbar -d -g $geom -f $font -B $bg -F $fg diff --git a/popup b/popup @@ -13,8 +13,8 @@ fts="12" # size of the said font #font='-*-stlarch-medium-r-*-*-10-*-*-*-*-*-*-*' #font="-*-profont-medium-*-*--12-*-*-*-*-*-*-1" font="-*-creep-*-*-*--16-*-*-*-*-*-*-1" -bg="#ff161616" -fg="#ffffffff" +bg="#ff040201" +fg="#ffdfd5d2" hl="#ff443232" x=$(wattr w `lsw -r`)