tprtsum: check download page shasum of ports - scripts - various script and utils
(HTM) git clone git://z3bra.org/scripts
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit c5e9ed73ca88fe7ec2e592927aef06cef3063ba1
(DIR) parent 2546f759226f049f604453a1f8f1798386316e88
(HTM) Author: z3bra <willyatmailoodotorg>
Date: Sat, 1 Jan 2011 12:49:04 +0100
prtsum: check download page shasum of ports
Diffstat:
M changewall | 2 +-
M download | 2 +-
M groaw | 4 ++--
M img | 4 +---
M link-open | 5 +++--
M mailbar | 2 +-
A prtsum | 64 +++++++++++++++++++++++++++++++
M record | 1 -
M syscat | 2 +-
M udmenu | 2 +-
M vroum | 18 +++++++++++-------
11 files changed, 86 insertions(+), 20 deletions(-)
---
(DIR) diff --git a/changewall b/changewall
t@@ -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
}
(DIR) diff --git a/download b/download
t@@ -1,5 +1,5 @@
#!/bin/sh
-cd tmp
+cd $HOME/dump
OUT="$(thinglaunch -o)"
test -z "$OUT" && curl -sLO "$@" || curl -s "$@" > $OUT
(DIR) diff --git a/groaw b/groaw
t@@ -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>]"
(DIR) diff --git a/img b/img
t@@ -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
(DIR) diff --git a/link-open b/link-open
t@@ -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
(DIR) diff --git a/mailbar b/mailbar
t@@ -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
}
(DIR) diff --git a/prtsum b/prtsum
t@@ -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 $@
(DIR) diff --git a/record b/record
t@@ -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
-
(DIR) diff --git a/syscat b/syscat
t@@ -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"; }
(DIR) diff --git a/udmenu b/udmenu
t@@ -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'
(DIR) diff --git a/vroum b/vroum
t@@ -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)
t@@ -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
t@@ -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