tVarious things - scripts - various script and utils
 (HTM) git clone git://z3bra.org/scripts
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
 (DIR) commit d2bab9ab415800907c73b356ae858041b7c3cc42
 (DIR) parent f95fbbbe252a55eb6c8f71fcd1bf55b23b5b2fdb
 (HTM) Author: z3bra <willyatmailoodotorg>
       Date:   Wed,  6 Jan 2016 23:19:53 +0100
       
       Various things
       
       Diffstat:
         M autoup                              |       6 +++---
         M beepop                              |      13 ++++++-------
         A ddg                                 |       8 ++++++++
         A dlaunch                             |      10 ++++++++++
         M dm                                  |       4 +++-
         M link-open                           |       6 +++---
         A log                                 |       8 ++++++++
         M mailbar                             |      11 ++++++-----
         M maillist                            |       4 ++--
         M menu                                |       4 ++--
         M prtup                               |       6 +++---
         M square                              |       4 ++--
         A sslget                              |       7 +++++++
         M syscat                              |      10 +++++-----
         M takeoffdir                          |       6 +++++-
         M udmenu                              |      10 +++++-----
         M vroum                               |       3 ++-
         M xwait                               |       0 
       
       18 files changed, 80 insertions(+), 40 deletions(-)
       ---
 (DIR) diff --git a/autoup b/autoup
       t@@ -1,9 +1,9 @@
        #!/bin/sh
        
       -SSHUSER=z3bra
       -SSHKEY=$HOME/.ssh/autoupload
       +SSHUSER=egull
       +SSHKEY=$HOME/.ssh/phobos
        SERVER=raw.z3bra.org
       -WEBROOT=/var/www/http/raw.z3bra.org
       +WEBROOT=/var/http/raw.z3bra.org
        WEBDIR=dev/random
        
        test -z "$1" && exit 1 || FILENAME=$(basename $1)
 (DIR) diff --git a/beepop b/beepop
       t@@ -7,13 +7,11 @@ default_geometry() {
            x=$(wattr w `lsw -r`)
            y=$(wattr h `lsw -r`)
        
       -    width=256
       +    width=140
            height=28
        
       -    offy=10
       -    offx=20
       -    #offy=64
       -    #offx=$(( x - $width ))
       +    offy=44
       +    offx=$(( x - $width - 25 ))
        
            echo "${width}x${height}+${offx}+${offy}"
        }
       t@@ -21,16 +19,17 @@ default_geometry() {
        FIFO=/tmp/beepop.fifo
        GEOM=$(default_geometry)
        SLEEP=3
       +CHAR="$(/usr/bin/printf '\uE054')"
        
        case $(basename $0) in
            beepop)
                test -p $FIFO || mkfifo $FIFO
        
                tail -f $FIFO | while read LINE; do
       -            . $HOME/.wmrc
       +            . $HOME/.theme
                    (
        
       -                echo "%{l}%{F${HL}} %{F-}$LINE"
       +                echo "%{r}$LINE %{F${HL}}$CHAR"
                        sleep $SLEEP
                    ) | lemonbar -d -g "$GEOM" -f "$FONT" -f "$ICON" -B "#00000000" -F "$FG"
                done
 (DIR) diff --git a/ddg b/ddg
       t@@ -0,0 +1,7 @@
       +#!/bin/sh
       +
       +BROWSER=${BROWSER:-"/usr/bin/surf"}
       +BASEURL="https://duckduckgo.com/lite?q="
       +
       +QUERY=$(thinglaunch -o -p 'ddg: ' | tr ' ' '+')
       +$BROWSER "${BASEURL}${QUERY}"
       +\ No newline at end of file
 (DIR) diff --git a/dlaunch b/dlaunch
       t@@ -0,0 +1,10 @@
       +#!/bin/sh
       +
       +FONT="monospace:size=8:antialias=true"
       +NB='black'
       +NF='white'
       +SB='white'
       +SF='black'
       +
       +
       +dmenu_run -fn "$FONT" -nb "$NB" -nf "$NF" -sb "$SB" -sf "$SF" $@
 (DIR) diff --git a/dm b/dm
       t@@ -3,7 +3,7 @@
        # z3bra - (c) wtfpl 2014
        # Create/list/attach/detach applications using dtach
        
       -sockdir=~/var/run
       +sockdir=/tmp/dm
        keyseq=
        
        list() {
       t@@ -15,6 +15,8 @@ usage() {
            echo "`basename $0` [-hl] <alias> [command]"
        }
        
       +test -d $sockdir || mkdir -p $sockdir
       +
        while getopts "hl" opt; do
            case $opt in
                l) list; exit 0 ;;
 (DIR) diff --git a/link-open b/link-open
       t@@ -10,7 +10,7 @@ case $URI in
            *.webm|*.mp4|*.ogv) mplayer -geometry 1280x720 "$URI";;
            *.gif) mplayer -geometry 1280x720 "$URI";;
            *youtube.com/*) uplay "$URI";;
       -    *.html) dwb "$URI";;
       +    *.html) surf "$URI";;
            *.txt) st -e sh -c "curl -s '$URI'|less -R";;
            gopher://*) st -e cgo  $URI ;;
            *) thingmenu -g 140x182 -x         \
       t@@ -18,8 +18,8 @@ case $URI in
                "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 \
       +        "donlad"     "download $URI" \
       +        "web shit"   "surf '$URI'" 2>/dev/null \
                "yank fuck"  "echo '$URI' | tr -d '\n' | xsel -i"
                ;;
        esac
 (DIR) diff --git a/log b/log
       t@@ -0,0 +1,7 @@
       +#!/bin/sh
       +
       +NOTE=${1:-random}
       +LOGDIR=$HOME/data/notes
       +
       +test -d $LOGDIR || mkdir -p $LOGDIR
       +ts >> $LOGDIR/$NOTE
       +\ No newline at end of file
 (DIR) diff --git a/mailbar b/mailbar
       t@@ -1,15 +1,16 @@
        #!/bin/sh
        
       -MAILDIR=$HOME/var/mail
       -MAILBOX='inbox crux lobsters'
       +. $HOME/.theme
        
       -. $HOME/.wmrc
       +MAILDIR=$HOME/data/mail
       +MAILBOX='inbox crux lobsters'
        
        COL1="%{F$HL}"
        COL2="%{F$FG}"
        
        mailcount() {
       -    case $1 in
       +    BOX=$1
       +    case $BOX in
                crux)       CHAR=''; DIR=$MAILDIR/lists/$1/new ;;
                inbox)      CHAR=''; DIR=$MAILDIR/$1/new ;;
                lobsters)   CHAR=''; DIR=$MAILDIR/lists/$1/new ;;
       t@@ -47,4 +48,4 @@ openbox() {
        while :; do
            formatbar
            sleep 5
       -done | lemonbar -d -B"#00000000" -f"$FONT" -f"$ICON" -g130x32+1300 | openbox
       +done | lemonbar -d -f "$FONT" -f "$ICON" -B"#00000000" -g140x32+1300+16 | openbox
 (DIR) diff --git a/maillist b/maillist
       t@@ -1,7 +1,7 @@
        #!/bin/sh
        
       -INBOX=$HOME/var/mail/inbox
       -MBASE=$HOME/var/mail
       +INBOX=$HOME/data/mail/inbox
       +MBASE=$HOME/data/mail
        LISTS='crux lobsters'
        
        crawl() {
 (DIR) diff --git a/menu b/menu
       t@@ -1,10 +1,10 @@
        #!/bin/bash
       -thingmenu -g 140x224 \
       +thingmenu -g 140x225 \
            "chat on irc"       "st -e sh -c 'dm irc ssh wizards'" \
            "run around"        "defrag" \
            "frag people"       "quake3e" \
            "play a game"       "steam" \
            "pop a term"        "st" \
       -    "surf the web"      "dwb" \
       +    "surf the web"      "dillo" \
            "scrot this shit"   "xscreenshot | if2png | imgurup | xsel -pi" \
            "want some more?"   "thinglaunch" 2> /dev/null
 (DIR) diff --git a/prtup b/prtup
       t@@ -3,9 +3,9 @@
        # z3bra - (c) wtfpl 2014
        # Update git hashes in a Pkgfile
        
       -PKGMK_ARCH=64 source /etc/pkgmk.conf
       +PKGMK_ARCH=64 . /etc/pkgmk.conf
        
       -echo_color () {
       +echo_color() {
            tput bold
            tput setaf $1
            shift
       t@@ -65,7 +65,7 @@ update_pkgfile() {
        main() {
        
            # we'll need the $name var later
       -    source Pkgfile
       +    . ./Pkgfile
        
            # get the git hashes
            get_version
 (DIR) diff --git a/square b/square
       t@@ -3,6 +3,6 @@
        CHAR=${1:-██}
        
        echo
       -for i in {0..7}; do echo -en " \e[0;3${i}m${CHAR}\e[0m"; done; echo
       -for i in {0..7}; do echo -en " \e[1;3${i}m${CHAR}\e[0m"; done; echo
       +for i in `seq 0 7`; do printf " [0;3${i}m${CHAR}"; done; echo
       +for i in `seq 0 7`; do printf " [1;3${i}m${CHAR}"; done; echo
        echo
 (DIR) diff --git a/sslget b/sslget
       t@@ -0,0 +1,6 @@
       +#!/bin/sh
       +#
       +# retrieve SSL certificate of a website
       +# it assumes 443 to be the default SSL port
       +
       +echo | openssl s_client -connect $@:443 2>&1| sed '/BEGIN CERT/,/END CERT/p;d'
       +\ No newline at end of file
 (DIR) diff --git a/syscat b/syscat
       t@@ -2,9 +2,9 @@
        
        COLOR=${COLOR:-7}
        
       -c() { printf '\e[1;3%sm' "$COLOR"; }
       -d() { printf '\e[0;3%sm' "$COLOR"; }
       -n() { printf '\e[0sm'; }
       +c() { printf '[1;3%sm' "$COLOR"; }
       +d() { printf '[0;3%sm' "$COLOR"; }
       +n() { printf ''; }
        
        cpuinfo() {
            sed -n "/model\ name/s/^.*:\ //p" /proc/cpuinfo | sed 1q
       t@@ -21,7 +21,7 @@ fontname() {
        cat <<EOF
        $(c)SYSTEM    $(d)$(crux)
        $(c)KERNEL    $(d)$(uname -r)
       -$(c)HOSTNAME  $(d)$HOSTNAME
       +$(c)HOSTNAME  $(d)$(hostname)
        $(c)WMNAME    $(d)$(wmname)
        $(c)TERMINAL  $(d)$TERM
        $(c)SHELL     $(d)$SHELL
       t@@ -30,4 +30,4 @@ $(c)PROC      $(d)$(cpu -p)
        $(c)MEMORY    $(d)$(memory -u|xargs human)
        EOF
        #$(c)FONT      $(d)$(fontname)
       -printf '\e[0m'
       +n
 (DIR) diff --git a/takeoffdir b/takeoffdir
       t@@ -1,6 +1,10 @@
        #!/bin/sh
        
       +TAKEOFF_DIR=/tmp/takeoff
       +
       +mkdir -p $TAKEOFF_DIR
       +
        # file either created or modified
       -wendy -m 136 -f ~/var/takeoff -v | while read ev file; do 
       +wendy -m 136 -f $TAKEOFF_DIR -v | while read ev file; do 
            $HOME/bin/autoup "$file"
        done 
 (DIR) diff --git a/udmenu b/udmenu
       t@@ -1,10 +1,10 @@
        #!/bin/sh
        
        FONT="monospace:size=8:antialias=true"
       -NB='#14120f'
       -NF='#42403d'
       -SB='#42403d'
       -SF='#f1e8d9'
       +NB='black'
       +NF='white'
       +SB='white'
       +SF='black'
        
        
       -dmenu -fn "$FONT" -nb "$NB" -nf "$NF" -sb "$SB" -sf "$SF" $@
       +ifne dmenu -fn "$FONT" -nb "$NB" -nf "$NF" -sb "$SB" -sf "$SF" $@
 (DIR) diff --git a/vroum b/vroum
       t@@ -53,5 +53,6 @@ test -z "$wid" && { echo "$(basename $0): no window to focus" >&2; exit 1; }
        
        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
       +#setborder active $wid   # activate the new window
       +chwb -s $BW $wid
 (DIR) diff --git a/xwait b/xwait
       Binary files differ.