scripts

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

commit c5e9ed73ca88fe7ec2e592927aef06cef3063ba1
parent 2546f759226f049f604453a1f8f1798386316e88
Author: z3bra <willyatmailoodotorg>
Date:   Sat Jan  1 12:49:04 +0100

prtsum: check download page shasum of ports

Diffstat:
changewall | 2+-
download | 2+-
groaw | 4++--
img | 4+---
link-open | 5+++--
mailbar | 2+-
prtsum | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
record | 1-
syscat | 2+-
udmenu | 2+-
vroum | 18+++++++++++-------
11 files changed, 86 insertions(+), 20 deletions(-)
diff --git a/changewall b/changewall @@ -5,7 +5,7 @@ WALLDIR=$HOME/usr/pics/bg setwall() { WALL=$(readlink -f $1) hsetroot -fill $WALL - hsetroot -fill $WALL -blur 8 -write $HOME/.blur.png + #hsetroot -fill $WALL -blur 8 -write $HOME/.blur.png ln -sf $WALL ~/.wall.png } diff --git a/download b/download @@ -1,5 +1,5 @@ #!/bin/sh -cd tmp +cd $HOME/dump OUT="$(thinglaunch -o)" test -z "$OUT" && curl -sLO "$@" || curl -s "$@" > $OUT diff --git a/groaw b/groaw @@ -3,8 +3,8 @@ # z3bra - 2014 (c) wtfpl # groaw - group, organize and arrange windows (or just a bear behind you) -GROOT=/tmp/groaw.d -GNUMBER=3 +GROOT=/tmp/groaw +GNUMBER=5 usage() { echo "$(basename $0) [-h] [-admtu <gid>]" diff --git a/img b/img @@ -1,6 +1,4 @@ #!/bin/sh IMAGE=/tmp/`basename $1` -curl -s "$1" > $IMAGE -meh $IMAGE -rm $IMAGE +curl -s "$1" | 2ff | lel -a -w 640 -h 480 diff --git a/link-open b/link-open @@ -13,12 +13,13 @@ case $URI in *.html) dwb "$URI";; *.txt) st -e sh -c "curl -s '$URI'|less -R";; gopher://*) st -e cgo $URI ;; - *) thingmenu -g 140x182 \ + *) thingmenu -g 140x182 -x \ "picture" "img '$URI'" \ "video" "mplayer -cache 512 '$URI'" \ "kinda vid" "uplay '$URI'" \ "text file" "st -e sh -c 'curl -s $URI | less -X'" \ "donlad" "~/bin/download $URI" \ - "web shit" "dwb '$URI'" 2>/dev/null + "web shit" "dwb '$URI'" 2>/dev/null \ + "yank fuck" "echo '$URI' | tr -d '\n' | xsel -i" ;; esac diff --git a/mailbar b/mailbar @@ -40,7 +40,7 @@ showtitles() { openbox() { while read BOX; do - urxvt -e mutt -f $(find $MAILDIR -type d -name $BOX) & + st -e mutt -f $(find $MAILDIR -type d -name $BOX) & done } diff --git a/prtsum b/prtsum @@ -0,0 +1,64 @@ +#!/bin/sh +# +# z3bra - (c) wtfpl 2015 + +PKGMK_ARCH=64 source /etc/pkgmk.conf + +echo_color () { + tput bold + tput setaf $1 + shift + + echo "$@" + + tput sgr0 +} + +# check wether we're in a port directory or not +if [ ! -f Pkgfile ]; then + echo_color 1 "Not in a port directory" + exit 1 +fi + +port_dir=$PWD + +get_version() { + cd $PKGMK_SOURCE_DIR +} + +update_pkgfile() { + cd $port_dir + + # update version + sed -i "s/^version=.*$/version=$version/" Pkgfile + + # update sversion if it exists + if grep -q 'sversion' Pkgfile; then + sed -i "s/^sversion=.*$/sversion=$sversion/" Pkgfile + + # create it otherwise + else + sed -i "/version/a\ + sversion=$sversion" Pkgfile + fi +} + +main() { + + # we'll need the $name var later + source Pkgfile + + # get the git hashes + get_version + + # update Pkgfile accordingly + update_pkgfile + + if [ ! "$1" = "-q" ]; then + echo "port : $name" + echo "version: $version" + echo "commit : $sversion" + fi +} + +main $@ diff --git a/record b/record @@ -18,4 +18,3 @@ test -n "$1" && WEBM=$1 || usage echo Framerate: $FRAMERATE exec -a $PIDNAME ffmpeg -f x11grab -s $RES -an -r $FRAMERATE -i :0.0 -c:v libvpx -b:v 5M -crf 10 -quality realtime -y -loglevel quiet $1 - diff --git a/syscat b/syscat @@ -1,6 +1,6 @@ #!/bin/sh -COLOR=${COLOR:-1} +COLOR=${COLOR:-7} c() { printf '\e[1;3%sm' "$COLOR"; } d() { printf '\e[0;3%sm' "$COLOR"; } diff --git a/udmenu b/udmenu @@ -1,6 +1,6 @@ #!/bin/sh -FONT="-windows-codingfonttobi1-medium-r-normal--12-90-96-96-c-70-iso8859-1" +FONT="monospace:size=8:antialias=true" NB='#14120f' NF='#42403d' SB='#42403d' diff --git a/vroum b/vroum @@ -3,9 +3,9 @@ # z3bra - 2014 (c) wtfpl # window focus wrapper that sets borders and can focus next/previous window -BW=${BW:-8} # border width +BW=${BW:-4} # border width ACTIVE=${ACTIVE:-0xffffff} # active border color -INACTIVE=${INACTIVE:-0x646464} # inactive border color +INACTIVE=${INACTIVE:-0x323232} # inactive border color # get current window id CUR=$(pfw) @@ -28,18 +28,22 @@ setborder() { case $1 in active) chwb -s $BW -c $ACTIVE $2 - chwb2 -O $ACTIVE -I 000000 -i 4 -o 4 $2 + #chwb2 -O $ACTIVE -I 000000 -i 4 -o 4 $2 ;; inactive) chwb -s $BW -c $INACTIVE $2 - chwb2 -O $INACTIVE -I 000000 -i 4 -o 4 $2 + #chwb2 -O $INACTIVE -I 000000 -i 4 -o 4 $2 ;; esac } case $1 in - next) wid=$(lsw|grep -v $CUR|sed '1 p;d') ;; - prev) wid=$(lsw|grep -v $CUR|sed '$ p;d') ;; + next) + wid=$(lsw|grep -v $CUR|sed '1 p;d') + ;; + prev) + wid=$(lsw|grep -v $CUR|sed '$ p;d') + ;; 0x*) wattr $1 && wid=$1 ;; *) usage ;; esac @@ -47,7 +51,7 @@ esac # exit if we can't find another window to focus test -z "$wid" && { echo "$(basename $0): no window to focus" >&2; exit 1; } -chwso -r $wid # put it on top of the stack wtf $wid # set focus on it +chwso -r $wid # raise windows setborder active $wid # activate the new window setborder inactive $CUR # set inactive border on current window