Remove obsolete stuff - scripts - various script and utils
HTML git clone git://z3bra.org/scripts
DIR Log
DIR Files
DIR Refs
---
DIR commit 0e8bab5ed28f9c4482e98fdf9889fb8e7c05a95e
DIR parent 095ac794b2667e58e166c724173fc0861c11253c
HTML Author: Willy Goiffon <dev@z3bra.org>
Date: Thu, 20 Aug 2026 21:55:52 +0000
Remove obsolete stuff
Diffstat:
D beepop | 40 -------------------------------
D cdump | 3 ---
D changewall | 16 ----------------
D chrono | 16 ----------------
D cross-gcc | 224 -------------------------------
D cross-pcc | 210 -------------------------------
D ddg | 8 --------
D dlaunch | 10 ----------
D dmenu | 12 ------------
D download | 5 -----
D dualhead | 17 -----------------
D ffstream | 15 ---------------
D ftpcrawl | 31 -------------------------------
D gamma | 24 ------------------------
D img | 2 --
D imgt | 38 -------------------------------
D imgurup | 26 --------------------------
D instagram | 78 -------------------------------
D irc | 36 -------------------------------
D irc-chat | 14 --------------
D irc-connect | 30 ------------------------------
D link-open | 25 -------------------------
D log | 9 ---------
D mailbar | 52 -------------------------------
D maillist | 26 --------------------------
D menu | 10 ----------
D mkbar | 212 ------------------------------
D notii | 28 ----------------------------
D nsroot | 7 -------
D nx-termcast | 29 -----------------------------
D passmenu | 3 ---
D pops | 22 ----------------------
D popup | 2 --
D q3dl | 23 -----------------------
D radio | 6 ------
D randcolor | 6 ------
D regmv | 18 ------------------
D sbar | 52 -------------------------------
D sct | 0
D sshmenu | 9 ---------
D takeoffdir | 8 --------
D timebar | 17 -----------------
D toxrdb | 8 --------
D tpm | 114 -------------------------------
D translate | 30 ------------------------------
D udmenu | 10 ----------
D uplay | 14 --------------
D uplaylist | 5 -----
D ushot | 6 ------
D wrapbar | 20 --------------------
D wrappop | 32 -------------------------------
D xgif | 47 -------------------------------
D xurls | 7 -------
D xwait | 0
D ydl | 49 -------------------------------
D ys | 38 -------------------------------
56 files changed, 0 insertions(+), 1799 deletions(-)
---
DIR diff --git a/beepop b/beepop
@@ -1,40 +0,0 @@
-#!/bin/sh
-#
-# depends: lemonbar, wattr and common sense
-
-default_geometry() {
- # get screen size
- x=$(wattr w `lsw -r`)
- y=$(wattr h `lsw -r`)
-
- width=140
- height=28
-
- offy=44
- offx=$(( x - $width - 25 ))
-
- echo "${width}x${height}+${offx}+${offy}"
-}
-
-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/.theme
- (
-
- echo "%{r}$LINE %{F${HL}}$CHAR"
- sleep $SLEEP
- ) | lemonbar -d -g "$GEOM" -f "$FONT" -f "$ICON" -B "#00000000" -F "$FG"
- done
- ;;
- popup)
- echo "$*" > $FIFO
- ;;
-esac
DIR diff --git a/cdump b/cdump
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-xrdb -query | grep -P '^\*color[0-9]*:' | tr -d '\t' | cut -d: -f2 | hex2col -t
DIR diff --git a/changewall b/changewall
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-WALLDIR=$HOME/usr/pics/bg
-
-setwall() {
- WALL=$(readlink -f $1)
- hsetroot -fill $WALL
- #hsetroot -fill $WALL -blur 8 -write $HOME/.blur.png
- ln -sf $WALL ~/.wall.png
-}
-
-test -n "$1" && setwall $1 && exit
-
-find $WALLDIR -name '*.png' | meh -list | while read WALL; do
- setwall $WALL
-done
DIR diff --git a/chrono b/chrono
@@ -1,16 +0,0 @@
-#!/bin/sh
-#
-# z3bra - (c) wtfpl 2014
-# fonts: xsansb future smblock univers
-
-FONT=$1
-: ${FONT:="univers"}
-
-for m in $(seq 0 59); do
- for s in $(seq 0 59); do
- clear
- echo
- printf ' %02d : %02d' $m $s | toilet -f $FONT
- sleep 1
- done
-done
DIR diff --git a/cross-gcc b/cross-gcc
@@ -1,224 +0,0 @@
-#!/bin/sh -ex
-#
-# Couple of useful links:
-# + http://wiki.osdev.org/GCC_Cross-Compiler
-# + http://wiki.osdev.org/Cross-Compiler_Successful_Builds
-# + https://git.framasoft.org/Ypnose/solyste/blob/master/scripts/create-crossenv
-# + http://kegel.com/crosstool/
-# + https://github.com/GregorR/musl-cross/tree/master/patches
-#
-# 0. download gcc, binutils, gmp, mpc, mpfr
-# 1. extract them
-# 2. patch everything that require patching
-# 3. prepare gcc (move gmp, mpc, mpfr in)
-# 4. install linux headers
-# 5. build binutils
-# 6. build musl
-# 7. build gcc
-# 8. add pkg-config wrapper
-
-# cross compiler environment
-MARCH=$(uname -m)
-TARGET=${TARGET:-${MARCH}-linux-musl}
-PREFIX=${PREFIX:-${HOME}/cross/gcc-${MARCH}}
-BLDDIR=${BLDDIR:-${HOME}/cross/build}
-SRCDIR=${SRCDIR:-${HOME}/cross/source}
-PATCHD=${PATCHD:-${HOME}/cross/patches}
-
-# compilation variables
-CFLAGS="-Os -fomit-frame-pointer -pipe"
-CXXFLAGS="${CFLAGS}"
-CPPFLAGS="${CFLAGS}"
-LDFLAGS="-Wl,--as-needed"
-MAKEFLAGS="-j4"
-
-# versions
-GCCV=${GCCV:-4.8.5}
-BINV=${BINV:-2.25}
-GMPV=${GMPV:-5.1.3}
-MPCV=${MPCV:-1.0.3}
-MPFRV=${MPFRV:-3.1.3}
-MUSLV=${MUSLV:-1.1.10}
-KERNV=${KERNV:-4.1.4}
-
-
-# random but useful vars
-PATH="${PREFIX}/bin:${PATH}"
-GNUMIRROR=ftp://ftp.gnu.org/gnu
-MUSLMIRROR=http://www.musl-libc.org/releases
-LINUXMIRROR=https://www.kernel.org/pub/linux/kernel/v4.x
-
-# Preparing sources
-mkdir -p "${SRCDIR}" "${BLDDIR}" "${PREFIX}"
-cd "${SRCDIR}"
-
-#
-# ┏━┓
-# ┃┃┃
-# ┗━┛╹
-# Get all GNU tarballs
-grab_sources() {
-curl -O -# "${GNUMIRROR}/gcc/gcc-${GCCV}/gcc-${GCCV}.tar.gz"
-curl -O -# "${GNUMIRROR}/binutils/binutils-${BINV}.tar.gz"
-curl -O -# "${GNUMIRROR}/mpc/mpc-${MPCV}.tar.gz"
-curl -O -# "${GNUMIRROR}/gmp/gmp-${GMPV}.tar.gz"
-curl -O -# "${GNUMIRROR}/mpfr/mpfr-${MPFRV}.tar.gz"
-curl -O -# "${MUSLMIRROR}/musl-${MUSLV}.tar.gz"
-curl -O -# "${LINUXMIRROR}/linux-${KERNV}.tar.xz"
-}
-
-#
-# ╺┓
-# ┃
-# ╺┻╸╹
-# Extract everything
-extract_source() {
-tar xz < gcc-${GCCV}.tar.gz
-tar xz < binutils-${BINV}.tar.gz
-tar xz < mpc-${MPCV}.tar.gz
-tar xz < gmp-${GMPV}.tar.gz
-tar xz < mpfr-${MPFRV}.tar.gz
-tar xz < musl-${MUSLV}.tar.gz
-tar xJ < linux-${KERNV}.tar.xz
-}
-
-#
-# ┏━┓
-# ┏━┛
-# ┗━╸╹
-# Patch all source trees.
-# This will take all patches in $PATCHD matching the programs
-# (eg: gcc-4.8.4-*.diff to patch gcc in version 4.8.4)
-patch_sources() {
-for DIR in $(find "${SRCDIR}" -maxdepth 1 -type d); do
- cd "${DIR}"
- cat "${PATCHD}/$(basename ${DIR})"-*.diff | patch -Np1
-done
-}
-
-#
-# ┏━┓
-# ╺━┫
-# ┗━┛╹
-# Prepare the gcc dir
-prepare_gcc() {
-mv "${SRCDIR}/gmp-${GMPV}" "${SRCDIR}/gcc-${GCCV}/gmp"
-mv "${SRCDIR}/mpc-${MPCV}" "${SRCDIR}/gcc-${GCCV}/mpc"
-mv "${SRCDIR}/mpfr-${MPFRV}" "${SRCDIR}/gcc-${GCCV}/mpfr"
-}
-
-#
-# ╻ ╻
-# ┗━┫
-# ╹╹
-# Get linux headers
-install_headers() {
-cd "${SRCDIR}/linux-${KERNV}"
-make ARCH=$(uname -m) headers_check
-make ARCH=$(uname -m) INSTALL_HDR_PATH=${PREFIX}/${TARGET} headers_install
-rm -r "${SRCDIR}/linux-${KERNV}"
-}
-
-#
-# ┏━╸
-# ┗━┓
-# ┗━┛╹
-# Build binutils and install them to ${PREFIX}
-install_binutils() {
-mkdir -p "${BLDDIR}/binutils"
-cd "${BLDDIR}/binutils"
-${SRCDIR}/binutils-${BINV}/configure --target=${TARGET} \
- --prefix=${PREFIX} \
- --with-sysroot=${PREFIX}/${TARGET} \
- --disable-nls \
- --disable-shared \
- --disable-multilib
-make configure-host
-make LDFLAGS="${LDFLAGS} -all-static -static"
-make install
-rm -rf "${BLDDIR}/binutils"
-rm -rf "${SRCDIR}/binutils-${BINV}"
-}
-
-#
-# ┏━┓
-# ┣━┓
-# ┗━┛╹
-# Build the musl libc
-install_musl() {
-cd "${SRCDIR}/musl-${MUSLV}"
-./configure --prefix=${PREFIX}/${TARGET} \
- --target=${TARGET} \
- --disable-gcc-wrapper \
- --disable-debug \
- --disable-shared \
- --disable-warning
-make LDFLAGS="${LDFLAGS}"
-make install
-rm -rf "${SRCDIR}/musl-${MUSLV}"
-}
-
-#
-# ┏━┓
-# ┃
-# ╹╹
-# Build gcc linked against musl
-install_gcc() {
-mkdir -p "${BLDDIR}/gcc"
-cd "${BLDDIR}/gcc"
-${SRCDIR}/gcc-${GCCV}/configure --target=${TARGET} \
- --prefix=${PREFIX} \
- --with-sysroot=${PREFIX}/${TARGET} \
- --with-native-system-header-dir=/include \
- --disable-nls \
- --disable-shared \
- --disable-multilib \
- --disable-libmudflap \
- --enable-languages=c
-make LDFLAGS="${LDFLAGS} -static" all-gcc all-target-libgcc
-make install-gcc install-target-libgcc
-rm -rf "${BLDDIR}/gcc"
-rm -rf "${SRCDIR}/gcc-${GCCV}"
-}
-
-#
-# ┏━┓
-# ┣━┫
-# ┗━┛╹
-# Add pkg-config wrapper
-install_pkgconfig() {
-cat << EOF > "${PREFIX}/bin/${TARGET}-pkg-config"
-#!/bin/sh
-export PKG_CONFIG_SYSROOT_DIR=${PREFIX}/${TARGET}
-export PKG_CONFIG_LIBDIR=${PREFIX}/${TARGET}/usr/lib/pkgconfig
-export PKG_CONFIG_PATH=\$PKG_CONFIG_LIBDIR
-
-exec pkg-config --static "\$@"
-EOF
-chmod 755 "${PREFIX}/bin/${TARGET}-pkg-config"
-}
-
-grab_sources
-extract_source
-patch_sources
-prepare_gcc
-install_headers
-install_binutils
-install_musl
-install_gcc
-install_pkgconfig
-
-rm -rf "${SRCDIR}"
-rm -rf "${BLDDIR}"
-rm -rf "${PREFIX}/share"
-rm -f "${PREFIX}/lib/libiberty.a"
-
-cat << EOF | tee ${PREFIX}/README
-TRIPLET : $TARGET
-PREFIX : $PREFIX
-
-GCC : $GCCV
-BINUTILS: $BINV
-MUSL : $MUSLV
-KERNEL : $KERNV
-EOF
DIR diff --git a/cross-pcc b/cross-pcc
@@ -1,210 +0,0 @@
-#!/bin/sh -ex
-#
-# Couple of useful links:
-# + http://pcc.ludd.ltu.se/cross-compiler/
-# + http://wiki.osdev.org/Cross-Compiler_Successful_Builds
-# + https://git.framasoft.org/Ypnose/solyste/blob/master/scripts/create-crossenv
-# + http://kegel.com/crosstool/
-# + https://github.com/GregorR/musl-cross/tree/master/patches
-#
-# 0. download and extract sources
-# 1. patch everything that require patching
-# 2. install linux headers
-# 3. build binutils
-# 4. build musl
-# 5. build pcc with gcc
-# 6. add pkg-config wrapper
-
-# cross compiler environment
-MARCH=$(uname -m)
-TRIPLE=${TRIPLE:-${MARCH}-linux-musl}
-PREFIX=${PREFIX:-${HOME}/cross/pcc-${MARCH}}
-BLDDIR=${BLDDIR:-${HOME}/cross/build}
-SRCDIR=${SRCDIR:-${HOME}/cross/source}
-PATCHD=${PATCHD:-${HOME}/cross/patches}
-
-# compilation variables
-PATH="${PREFIX}/bin:${PATH}"
-CFLAGS="-Os -fomit-frame-pointer -pipe"
-CXXFLAGS="${CFLAGS}"
-CPPFLAGS="${CFLAGS}"
-LDFLAGS="-Wl,--as-needed"
-MAKEFLAGS="-j8"
-
-# versions
-PCCV=${PCCV:-1.1.0}
-BINV=${BINV:-2.25}
-MUSLV=${MUSLV:-1.1.10}
-KERNV=${KERNV:-4.1.4}
-
-
-# source mirrors
-PCCMIRROR=ftp://pcc.ludd.ltu.se/pub/pcc-releases
-GNUMIRROR=ftp://ftp.gnu.org/gnu
-MUSLMIRROR=http://www.musl-libc.org/releases
-LINUXMIRROR=https://www.kernel.org/pub/linux/kernel/v4.x
-
-# Preparing sources
-mkdir -p "${SRCDIR}" "${BLDDIR}" "${PREFIX}"
-cd "${SRCDIR}"
-
-#
-# ┏━┓
-# ┃┃┃
-# ┗━┛╹
-# Get all GNU tarballs
-grab_sources() {
-curl -# "${PCCMIRROR}/pcc-${PCCV}.tgz" | tar xz
-curl -# "${PCCMIRROR}/pcc-libs-${PCCV}.tgz" | tar xz
-curl -# "${GNUMIRROR}/binutils/binutils-${BINV}.tar.gz" | tar xz
-curl -# "${MUSLMIRROR}/musl-${MUSLV}.tar.gz" | tar xz
-curl -# "${LINUXMIRROR}/linux-${KERNV}.tar.xz" | tar xJ
-}
-
-#
-# ╺┓
-# ┃
-# ╺┻╸╹
-# Patch all source trees.
-# This will take all patches in $PATCHD matching the programs
-patch_sources() {
-for DIR in $(find "${SRCDIR}" -maxdepth 1 -type d); do
- cd "${DIR}"
- cat "${PATCHD}/$(basename ${DIR})"-*.diff | patch -Np1
-done
-}
-
-#
-# ┏━┓
-# ┏━┛
-# ┗━╸╹
-# Get linux headers
-install_headers() {
-cd "${SRCDIR}/linux-${KERNV}"
-make ARCH=$(uname -m) headers_check
-make ARCH=$(uname -m) INSTALL_HDR_PATH=${PREFIX}/${TRIPLE} headers_install
-rm -r "${SRCDIR}/linux-${KERNV}"
-}
-
-#
-# ┏━┓
-# ╺━┫
-# ┗━┛╹
-# Build binutils and install them to ${PREFIX}
-install_binutils() {
-mkdir -p "${BLDDIR}/binutils"
-cd "${BLDDIR}/binutils"
-${SRCDIR}/binutils-${BINV}/configure --target=${TRIPLE} \
- --prefix=${PREFIX} \
- --with-sysroot=${PREFIX}/${TRIPLE} \
- --disable-nls \
- --disable-shared \
- --disable-multilib
-make configure-host
-make LDFLAGS="${LDFLAGS} -all-static -static"
-make install
-rm -rf "${BLDDIR}/binutils"
-rm -rf "${SRCDIR}/binutils-${BINV}"
-}
-
-#
-# ╻ ╻
-# ┗━┫
-# ╹╹
-# Build the musl libc
-install_musl() {
-cd "${SRCDIR}/musl-${MUSLV}"
-./configure --prefix=${PREFIX}/${TRIPLE} \
- --target=${TRIPLE} \
- --disable-gcc-wrapper \
- --disable-debug \
- --disable-shared \
- --disable-warning
-make LDFLAGS="${LDFLAGS}"
-make install
-rm -rf "${SRCDIR}/musl-${MUSLV}"
-}
-
-#
-# ┏━╸
-# ┗━┓
-# ┗━┛╹
-# Build pcc linked against musl
-install_pcc() {
-mkdir -p "${BLDDIR}/pcc"
-mkdir -p "${BLDDIR}/pcc-libs"
-cd "${BLDDIR}/pcc"
-${SRCDIR}/pcc-${PCCV}/configure --target=${TRIPLE} \
- --with-libdir=${PREFIX}/${TRIPLE}/lib \
- --with-incdir=${PREFIX}/${TRIPLE}/include \
- --prefix=${PREFIX}
-
-make LDFLAGS="${LDFLAGS} -static" \
- PCCLIBDIR=${PREFIX}/${TRIPLE}/pcc/lib \
- PCCINCDIR=${PREFIX}/${TRIPLE}/pcc/include
-make PCCLIBDIR=${PREFIX}/${TRIPLE}/pcc/lib \
- PCCINCDIR=${PREFIX}/${TRIPLE}/pcc/include \
- install
-rm -rf "${BLDDIR}/pcc"
-rm -rf "${SRCDIR}/pcc-${PCCV}"
-}
-
-#
-# ┏━┓
-# ┣━┓
-# ┗━┛╹
-# Build pcc libraries against musl
-install_pcc_libs() {
-cd "${BLDDIR}/pcc-libs"
-${SRCDIR}/pcc-libs-${PCCV}/configure --target=${TRIPLE} \
- --prefix=${PREFIX}
-
-make PCCLIBDIR=${PREFIX}/${TRIPLE}/pcc/lib \
- PCCINCDIR=${PREFIX}/${TRIPLE}/pcc/include
-make PCCLIBDIR=${PREFIX}/${TRIPLE}/pcc/lib \
- PCCINCDIR=${PREFIX}/${TRIPLE}/pcc/include \
- install
-rm -rf "${BLDDIR}/pcc-libs"
-rm -rf "${SRCDIR}/pcc-libs-${PCCV}"
-}
-
-#
-# ┏━┓
-# ┃
-# ╹╹
-# Add pkg-config wrapper
-install_pkgconfig() {
-cat << EOF > "${PREFIX}/bin/${TRIPLE}-pkg-config"
-#!/bin/sh
-export PKG_CONFIG_SYSROOT_DIR=${PREFIX}/${TRIPLE}
-export PKG_CONFIG_LIBDIR=${PREFIX}/${TRIPLE}/usr/lib/pkgconfig
-export PKG_CONFIG_PATH=\$PKG_CONFIG_LIBDIR
-
-exec pkg-config --static "\$@"
-EOF
-chmod 755 "${PREFIX}/bin/${TRIPLE}-pkg-config"
-}
-
-grab_sources
-patch_sources
-install_headers
-install_binutils
-install_musl
-install_pcc
-install_pcc_libs
-install_pkgconfig
-
-# clean environment
-rm -rf "${SRCDIR}"
-rm -rf "${BLDDIR}"
-rm -rf "${PREFIX}/share"
-rm -f "${PREFIX}/lib/libiberty.a"
-
-cat << EOF | tee ${PREFIX}/README
-TRIPLET : $TRIPLE
-PREFIX : $PREFIX
-PCC : $PCCV
-BINUTILS: $BINV
-MUSL : $MUSLV
-KERNEL : $KERNV
-EOF
DIR diff --git a/ddg b/ddg
@@ -1,7 +0,0 @@
-#!/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
@@ -1,10 +0,0 @@
-#!/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/dmenu b/dmenu
@@ -1,12 +0,0 @@
-#!/bin/sh
-#
-# put it before dmenu in your PATH
-
-FONT="monospace:size=8:antialias=true"
-NB='black'
-NF='white'
-SB='white'
-SF='black'
-
-
-ifne dmenu -fn "$FONT" -nb "$NB" -nf "$NF" -sb "$SB" -sf "$SF" $@
DIR diff --git a/download b/download
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-cd $HOME/dump
-OUT="$(thinglaunch -o)"
-test -z "$OUT" && curl -sLO "$@" || curl -s "$@" > $OUT
DIR diff --git a/dualhead b/dualhead
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-case "$1" in
- left)
- xrandr --output VGA1 --primary --auto --output LVDS1 --auto --right-of VGA1;;
- right)
- xrandr --output VGA1 --primary --auto --output LVDS1 --auto --left-of VGA1;;
- dup)
- xrandr --output VGA1 --same-as LVDS1 --output LVDS1 --primary;;
- screen)
- xrandr --output VGA1 --primary --auto --output LVDS1 --off;;
- laptop)
- xrandr --output LVDS1 --primary --auto --output VGA1 --off;;
- list)
- xrandr | grep '\<connected\>' | cut -d\ -f1;;
- *) echo `basename $0` '{left|right|dup|screen|laptop|list}';;
-esac
DIR diff --git a/ffstream b/ffstream
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-SND="-f alsa -thread_queue_size 2048 -i default"
-STREAM=${1:-http://phobos.2f30:8090/0.ffm}
-
-if [ "$1" = "-q" ]; then
- ffmpeg -f x11grab -r 5 -s 1440x900 -thread_queue_size 1024 -i :0.0 -an -fflags nobuffer ${STREAM}
-else
- ffmpeg -f x11grab -r 5 -s 1440x900 -thread_queue_size 1024 -i :0.0 \
- -f alsa -ac 1 -thread_queue_size 1024 -i default \
- -af 'highpass=f=200, lowpass=f=2000' \
- -fflags nobuffer ${STREAM} \
- -af 'highpass=f=200, lowpass=f=2000' \
- -c:v libvpx -b:v 5M -c:a libvorbis webcast-$(date +%Y%m%d%H%M%S).webm
-fi
DIR diff --git a/ftpcrawl b/ftpcrawl
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-ENGINES=${ENGINES:-"filemare ftplike"}
-
-extract_link() {
- ENGINE=$1
- ARCHIVE=$2
- case $1 in
- filemare) URL="http://filemare.com/en/search/${ARCHIVE}"
- SED='s^.*/en/browse/\([^>'\''"]*\).*$ftp://\1p;d'
- ;;
- ftplike) URL="http://ftplike.com/index.aspx?m=EXACT&t=Files&q=${ARCHIVE}"
- SED='s|^.*\(ftp://[^ '\''"><]*\).*$|\1|p;d'
- ;;
- *) return 1
- esac
-
- curl -s "$URL" | sed "$SED"
-}
-
-crawl() {
- ARCHIVE=$1
- for ENGINE in $ENGINES; do
- extract_link $ENGINE $ARCHIVE
- done | shuf
-}
-
-for ARG in $@; do
- crawl $ARG
-done
-
DIR diff --git a/gamma b/gamma
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-usage () {
- echo "usage: `basename $0` <get|up|down|reset> [value]"
-}
-
-test "$#" -lt 1 && usage && exit
-test -n "$2" && amount=$2 || amount=0.1
-
-gamma=`grep RedGamma ~/.nvidia| cut -d= -f2`
-old=$gamma
-
-case $1 in
- get) echo $gamma; exit ;;
- up) gamma=$( echo "$gamma + $amount" | bc) ;;
- down) gamma=$( echo "$gamma - $amount" | bc) ;;
- reset)gamma="1.000000" ;;
- *) usage && exit ;;
-esac
-
-echo "$old -> $gamma"
-
-nvidia-settings -a [DPY:DVI-I-0]/Gamma=$gamma >/dev/null
-sed -i "/Gamma/s/$old/$gamma/" ~/.nvidia
DIR diff --git a/img b/img
@@ -1,2 +0,0 @@
-#!/bin/sh
-curl -s "$1" | 2ff | lel -a -w 640 -h 480
DIR diff --git a/imgt b/imgt
@@ -1,38 +0,0 @@
-#!/bin/bash
-#
-# z3bra -- 2014-01-21
-
-test -z "$1" && exit
-
-W3MIMGDISPLAY="/usr/lib/w3m/w3mimgdisplay"
-FILENAME=$1
-FONTH=14 # Size of one terminal row
-FONTW=8 # Size of one terminal column
-BORDER=20
-COLUMNS=`tput cols`
-LINES=`tput lines`
-
-read width height <<< `echo -e "5;$FILENAME" | $W3MIMGDISPLAY`
-
-offx=$(($BORDER / $FONTH))
-offy=$(($BORDER / $FONTW))
-max_width=$(($FONTW * $COLUMNS))
-max_height=$(($FONTH * $LINES))
-
-if test $width -gt $max_width; then
- height=$(($height * $max_width / $width))
- width=$max_width
-fi
-if test $height -gt $max_height; then
- width=$(($width * $max_height / $height))
- height=$max_height
-fi
-
-w3m_command="0;1;$offx;$offy;$width;$height;;;;;$FILENAME\n4;\n3;"
-
-clear
-tput cup $(($height/$FONTH)) 0
-echo -e $w3m_command|$W3MIMGDISPLAY
-
-read -n1 -s
-clear
DIR diff --git a/imgurup b/imgurup
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-# upload images to imgur.com
-# appends links and deletion links to the log
-# depends: curl
-
-# use stdin if no file provided
-test -z "$@" && FILES='-' || FILES="$@"
-
-LOG=$HOME/.imgurlog
-
-# from http://imgur.com/tools/imgurbash.sh
-APIKEY='b3625162d3418ac51a9ee805b1840452'
-
-# upload all
-for IMG in "$FILES"; do
- RESP=$(curl -F "image=@$IMG" -F "key=$APIKEY" \
- http://imgur.com/api/upload.xml 2> /dev/null)
-
- URL=$(echo $RESP | sed 's|.*<original_image>\(.*\)</original_image>.*|\1|')
- DELETEURL=$(echo $RESP | sed 's|.*<delete_page>\(.*\)</delete_page>.*|\1|')
-
- echo "$URL" > $LOG
- echo "$DELETEURL" >> $LOG
- echo "$URL"
-done
DIR diff --git a/instagram b/instagram
@@ -1,78 +0,0 @@
-#!/bin/bash
-#
-# 2013 z3bra <willy at mailoo dot org>
-# INSTAGRAM - screenshot taker / manager
-#
-# Licensed under WTFPL 2.0
-# >> http://www.wtfpl.net/txt/copying/
-#
-
-VIEWER=meh
-EXEC_UPLOAD=~/bin/imgurup
-WMNAME=`xprop -root WM_NAME|cut -d\" -f2`
-
-upload() {
- $EXEC_UPLOAD $1
-}
-
-usage() {
- cat <<SHBLAH
-Usage : instagram [-tmuwh] [-g number] [-s screen] [filename.png]
- -t : create thumbnail
- -u : upload the file using $UPLOAD_BIN <filename>
- -w : take only a window for the shot (choose with pointer)
- -h : display this help
- -d path : save the shot in <path>
- -s screen : use only the screen number <screen> for the shot
-
-Also, do not give path to shot. They're saved to $SSHOT_DIR by default.
-
-Configuration:
- instagram sources $USER/.config/instagram at start.
- You can set variables here, so that they will overide the default ones:
-
- IMAGE_DIR : Where images are stored
- EXEC_UPLOAD : Path to the script/program used to upload your shot
-SHBLAH
-}
-
-headshot() {
-
- xdpyinfo -ext XINERAMA | sed 's/^ head #//p' |
- while IFS=' :x@,' read i w h x y; do
- if [[ $1 = "$i" ]]; then
- import -window $WINDOW -crop ${w}x${h}+${x}+${y} $OUTPUT
- fi
- done
-}
-
-[[ "$1" = "--help" ]] && usage && exit 0
-
-while getopts ":htmuwgs:" opt; do
- case $opt in
- t) THUMB=1 ;;
- s) SCREEN=$OPTARG ;;
- u) UPLOAD=1 ;;
- w) WINDOW=`xprop|grep 'window id'|cut -d\ -f7`;;
- h) usage; exit 0;;
- ?) echo "invalid option: -$OPTARG"; exit 1 ;;
- esac
-done
-
-shift $((OPTIND-1))
-
-test -z $1 && OUTPUT=$WMNAME-`date +%Y-%m-%d`.png || OUTPUT=$1
-test -z "$WINDOW" && WINDOW='root'
-
-if [ -n "$SCREEN" ]; then
- headshot $SCREEN
-else
- import -window ${WINDOW} $OUTPUT
-fi
-
-test -n "$THUMB" && import -window ${WINDOW} -thumbnail 25% thumb-$(basename ${OUTPUT})
-
-
-$VIEWER $OUTPUT
-
-test "$UPLOAD" = "1" && upload ${OUTPUT}
DIR diff --git a/irc b/irc
@@ -1,36 +0,0 @@
-#!/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
DIR diff --git a/irc-chat b/irc-chat
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-usage() {
- echo "usage: $(basename $0) [-h] [-s server]" >&2
- exit 1
-}
-
-test -z "$1" && usage
-
-CHANNEL="$1"
-echo "/j $CHANNEL" > in
-cd "$CHANNEL"
-
-tail -n28 out | hiii
DIR diff --git a/irc-connect b/irc-connect
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-## ii directory
-BASEDIR=~/var/irc
-
-# irc parameters
-NICKNAME='z3bra'
-PASSWORD='password'
-SERVERS=${1:-'irc.nixers.net irc.rizon.net irc.oftc.net irc.freenode.net'}
-PORT='6667'
-
-usage() {
- echo "usage: $(basename $0) [-h] [-s server]" >&2
- exit 1
-}
-
-while getopts ":hn:s:" opt; do
- case $opt in
- h) usage; exit 0;;
- n) NICK=$OPTARG;;
- s) SERV=$OPTARG;;
- ?) echo "Invalid option -$OPTARG"; exit 1;;
- *) usage;;
- esac
-done
-
-# spawn ii
-for SERVER in $SERVERS; {
- ii -i $BASEDIR -n $NICKNAME -s $SERVER -p $PORT -k $PASSWORD &
-}
DIR diff --git a/link-open b/link-open
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-URI="$*"
-
-# yank URI first, just in case :)
-printf '%s' "$URI" | xsel -i
-
-case $URI in
- *.jp*g|*.png) img "$URI";;
- *.webm|*.mp4|*.ogv) mplayer -geometry 1280x720 "$URI";;
- *.gif) mplayer -geometry 1280x720 "$URI";;
- *youtube.com/*) uplay "$URI";;
- *.html) surf "$URI";;
- *.txt) st -e sh -c "curl -s '$URI'|less -R";;
- gopher://*) st -e cgo $URI ;;
- *) 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" "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
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-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
DIR diff --git a/mailbar b/mailbar
@@ -1,52 +0,0 @@
-#!/bin/sh
-
-. $HOME/.theme
-
-MAILDIR=$HOME/data/mail
-MAILBOX='inbox crux lobsters pcc'
-
-COL1="%{F$HL}"
-COL2="%{F$FG}"
-
-mailcount() {
- 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 ;;
- pcc) CHAR='©'; DIR=$MAILDIR/lists/$1/new ;;
- *) return ;;
- esac
-
- COUNT=$(fcount $DIR)
-
- printf '%s%s%s %s%d%s\n' "$COL1" "%{A:$1:}" "$CHAR" "$COL2" "$COUNT" "%{A}"
-}
-
-formatbar() {
- BAR=' %{c}'
- for MB in $MAILBOX; do
- BAR="$BAR $(mailcount $MB) "
- done
- echo "$BAR"
-}
-
-showtitles() {
- while read BOX; do
- find $MAILDIR -type d -name $BOX \
- | xargs -I% grep -r '^Subject: ' %/new \
- | cut -d\ -f2- \
- | xmessage -file - &
- done
-}
-
-openbox() {
- while read BOX; do
- st -e mutt -f $(find $MAILDIR -type d -name $BOX) &
- done
-}
-
-while :; do
- formatbar
- sleep 5
-done | lemonbar -d -f "$FONT" -f "$ICON" -B"#00000000" -g140x32+1300+16 | openbox
DIR diff --git a/maillist b/maillist
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-INBOX=$HOME/data/mail/inbox
-MBASE=$HOME/data/mail
-LISTS='crux lobsters pcc suckless'
-
-crawl() {
- # uses the X-BeenThere header set by maillist to check from
- # which list a mail comes from
- case $1 in
- 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' ;;
- suckless) REGEX='^X-Original-To:.*@suckless.org' ;;
- esac
-
- find $INBOX -type f -exec grep -liP "$REGEX" {} +
-}
-
-for ML in $LISTS; do
- crawl "$ML" | while read FILE; do
- printf '[1;37m%s[0m: %s\n' "$ML" "$(sed 's/^Subject: //p;d' $FILE)"
- NEW=$(echo "$(basename $FILE)" | sed 's/\(:[12],[DFPR]*\)S\([T]*\)/\1\2/')
- mv $FILE $MBASE/lists/$ML/new/$NEW
- done
-done
DIR diff --git a/menu b/menu
@@ -1,10 +0,0 @@
-#!/bin/bash
-thingmenu -g 140x225 \
- "chat on irc" "st -e sh -c 'dm irc ssh wizards'" \
- "run around" "quake3e +set fs_game defrag" \
- "frag people" "quake3e" \
- "play a game" "steam" \
- "pop a term" "st" \
- "surf the web" "dillo" \
- "scrot this shit" "xscreenshot | if2png | imgurup | xsel -pi" \
- "want some more?" "thinglaunch" 2> /dev/null
DIR diff --git a/mkbar b/mkbar
@@ -1,212 +0,0 @@
-#!/bin/bash
-#
-# z3bra - (c) wtfpl 2014
-# Fetch infos on your computer, and print them to stdout every second.
-#
-# require :
-# amixer - volume()
-# bc - cpuload() memused()
-# curl - netip()
-# fcount - mails()
-# iwconfig - netint() (to spot wifi interface)
-# mpc - nowplaying()
-# xprop - groups() gstate()
-# xwininfo - gstate()
-
-# configuration variables
-refresh_rate=0.75 # how often will the bar update
-datefmt="%d %b %H:%M" # date time format
-maildir=~/var/mail/inbox/new # where do new mails arrive ?
-alsactl=Master # which alsa channel to display
-#battery=BAT0 # battery index
-# find battery name in a smart way
-battery=$(ls /sys/class/power_supply | grep BAT)
-
-#barch=''
-barch=''
-barfg='%{F#ff888888}'
-barmg='%{F#ffffffff}'
-barbg='%{F#00888888}'
-
-grpfg='%{F#ffffff00} '
-grpmg='%{F#ff2288cc} '
-grpbg='%{F#ffffffff} '
-
-# no need to modify anything else here
-
-clock() {
- date "+${datefmt}"
-}
-
-mails() {
- fcount ${maildir}
-}
-
-battery() {
- BATC=/sys/class/power_supply/${battery}/capacity
- BATS=/sys/class/power_supply/${battery}/status
-
- # prepend percentage with a '-' if discharging, '+' otherwise
- #test "`cat $BATS`" = "Discharging" && echo -n '-' || echo -n '+'
-
- cat $BATC
-}
-
-muted() {
- amixer get $alsactl | grep -o '\[off\]' >/dev/null && false || true
-}
-
-volume() {
- amixer get $alsactl | sed -n 's/^.*\[\([0-9]\+\)%.*$/\1/p' | uniq
-}
-
-cpuload() {
- LINE=`ps -eo pcpu |grep -vE '^\s*(0.0|%CPU)' |sed -n '1h;$!H;$g;s/\n/ +/gp'`
- echo `bc <<< $LINE`
-}
-
-memused() {
- read t f <<< `grep -E 'Mem(Total|Free)' /proc/meminfo |awk '{print $2}'`
- read b c <<< `grep -E '^(Buffers|Cached)' /proc/meminfo |awk '{print $2}'`
- bc <<< "100 * ($t - $f - $c - $b) / $t"
-}
-
-netstate() {
- test -n "`ip route`" && echo "connected" || echo "disconnected"
-}
-
-netip() {
- case $1 in
- local)
- # local ip
- ip addr show $(netint) | grep 'inet ' | awk '{print $2}'
- ;;
- *)
- # extern ip
- curl http://canihazip.com/s
- ;;
- esac
-}
-
-nettrafic() {
- case $1 in
- up) col=10;;
- down) col=2;;
- *)
- esac
-
- trafic=$(awk "/$(netint)/ {print \$$col}" /proc/net/dev)
- echo $(SCALE=2 human $trafic)
-}
-
-netint() {
- read lo int1 int2 <<< `ip link | sed -n 's/^[0-9]: \(.*\):.*$/\1/p'`
- if iwconfig $int1 >/dev/null 2>&1; then
- wifi=$int1
- eth0=$int2
- else
- wifi=$int2
- eth0=$int1
- fi
-
- if ip link show $eth0 | grep 'state UP' >/dev/null; then
- int=$eth0
- elif ip link show $wifi | grep 'state UP' >/dev/null; then
- int=$wifi
- else
- int=lo
- fi
-
- echo $int
-}
-
-groups() {
- cur=`xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}'`
- tot=`xprop -root _NET_NUMBER_OF_DESKTOPS | awk '{print $3}'`
-
- for w in `seq 0 $((cur - 1))`; do line="${line}${grpbg}"; done
- line="${line}${grpfg}"
- for w in `seq $((cur + 2)) $tot`; do line="${line}${grpbg}"; done
- line="${line}${barfg}"
-
- echo $line
-}
-
-# print current group and shown groups
-gstate() {
- cur=`xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}'`
- tot=`xprop -root _NET_NUMBER_OF_DESKTOPS | awk '{print $3}'`
-
- for wid in `xprop -root | sed '/_LIST(WINDOW)/!d;s/.*# //;s/,//g'`; do
- if grep -q 'IsViewable' <<< $(xwininfo -id $wid); then
- grp=`xprop -id $wid _NET_WM_DESKTOP | awk '{print $3}'`
- shown="$shown $grp"
- fi
- done
-
- for g in `seq 0 $((tot - 1))`; do
- if test $g -eq $cur; then
- line="${line}${grpfg}"
- elif grep -q $g <<< "$shown"; then
- line="${line}${grpmg}"
- else
- line="${line}${grpbg}"
- fi
- done
-
- echo $line
-}
-
-nowplaying() {
- cur=`mpc current`
- # this line allow to choose whether the output will scroll or not
- test "$1" = "scroll" && PARSER='skroll -n20 -d0.5 -r' || PARSER='cat'
- test -n "$cur" && $PARSER <<< $cur || echo "- stopped -"
-}
-
-makebar() {
- max=10
- cur=$(($1 / 10))
-
- bar="$barfg"
-
- for v in $(seq 0 $((max - 1))); do
- if [ "$v" -lt "$cur" ]; then
- bar="${bar}${barmg}${barch}"
- else
- bar="${bar}${barfg}${barch}"
- fi
- done
-
- echo "${bar}${barfg}"
-}
-
-# This loop will fill a buffer with our infos, and output it to stdout.
-buf="%{l} "
-
-# Set icon depending on the interface that is up
-buf="${buf}${barmg} "
-buf="${buf}${barfg}"
-buf="$buf $(netip local) "
-
-buf="${buf}${barmg} ${barfg} $(nettrafic down) "
-buf="${buf}${barmg} ${barfg} $(nettrafic up) "
-buf="${buf}%{c} $(gstate)"
-buf="${buf}%{r}"
-buf="${buf}${barmg} ${barfg} $(mails) "
-
-# Change icon if volume is muted
-if amixer get $alsactl | grep '\[off\]' >/dev/null; then
- buf="${buf}${barmg} ${barfg} "
-else
- buf="${buf}${barmg} ${barfg} "
-fi
-buf="${buf}$(makebar $(volume)) "
-
-# Show battery status if there is a battery (U DONT SAY)
-test -n "${battery}" &&
- buf="${buf}${barmg} ${barfg} $(makebar $(battery)) "
-
-buf="${buf}${barmg} ${barfg} $(clock) "
-echo $buf
-sleep ${refresh_rate}
DIR diff --git a/notii b/notii
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-NICK=${NICK:-z3bra}
-
-untimestamp() {
- sed 's/^[-: 0-9]*//'
-}
-
-catchnick() {
- grep -v "<$NICK>" | grep "$NICK"
-}
-
-lastline() {
- tail -n1
-}
-
-cutmask() {
- cut -f2
-}
-
-OUTFILE=''
-for f in $@; {
- OUTFILE="$OUTFILE -f $f"
-}
-
-wendy -v -m 8 $OUTFILE | while read mask file; do
- lastline < $file | catchnick | untimestamp | pops
-done
DIR diff --git a/nsroot b/nsroot
@@ -1,7 +0,0 @@
-NSROOT=${1:-/ns/static}
-
-mountpoint -q $NSROOT/dev || sup mount -t devtmpfs none $NSROOT/dev
-mountpoint -q $NSROOT/proc || sup mount -t proc none $NSROOT/proc
-mountpoint -q $NSROOT/sys || sup mount -t sysfs none $NSROOT/sys
-
-sup env -i HOME=/root chroot $NSROOT /bin/mksh -l
DIR diff --git a/nx-termcast b/nx-termcast
@@ -1,29 +0,0 @@
-#!/bin/sh
-#
-# start recording a script, and upload it in base64 to sprunge
-# usage: nx-termcast [url]
-
-nx_upload() {
- # feel free to override, if you know what you're doing
- curl -sLT${1:--} https://p.iotek.org
-}
-
-nx_record() {
- script --timing=timing typescript
- # make a motherfucking tarbomb
- tar cz . | base64 | nx_upload
-}
-
-nx_replay() {
- curl -s "$*" | base64 -d | tar xz
- scriptreplay timing typescript
-}
-
-# that's to prevent the motherfucking tarbombs
-cd $(mktemp -d)
-
-# give the impression of a clean session
-clear
-
-# either record or play, your choice
-test -n "$1" && nx_replay "$*" || nx_record
DIR diff --git a/passmenu b/passmenu
@@ -1,3 +0,0 @@
-#!/bin/sh
-pass=$(find $HOME/.pass -type f | sed "s,$HOME/.pass/,,;s/.gpg//" | dmenu -l 32)
-test -n "$pass" && tpm $pass | xsel
DIR diff --git a/pops b/pops
@@ -1,22 +0,0 @@
-#!/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
DIR diff --git a/popup b/popup
@@ -1 +0,0 @@
-beepop
-\ No newline at end of file
DIR diff --git a/q3dl b/q3dl
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-q3df='http://ws.q3df.org/maps/downloads'
-map=$1
-
-W="\033[1;37m"
-R="\033[1;31m"
-G="\033[1;32m"
-N="\033[0m"
-
-printf "Fetching map ${W}${map}.pk3 ${N}.. "
-
-curl -s "${q3df}/${map}.pk3" > /tmp/q3map.zip
-
-if unzip -p /tmp/q3map.zip >/dev/null 2>&1 ; then
- mv /tmp/q3map.zip ~/.q3a/baseq3/${map}.pk3
- printf "[${G}DONE${N}]\n"
-else
- printf "[${R}FAIL${N}]\n"
- rm /tmp/q3map.zip
-fi
-
-exit 0
DIR diff --git a/radio b/radio
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-STREAM=${1:-http://radio.2f30.org:8000/live.mp3}
-STREAM=${1:-http://radio.z3bra.org:8000}
-
-curl -sL $STREAM | play -
DIR diff --git a/randcolor b/randcolor
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-for i in `seq 0 15`; do
- c=$(tr -cd "0-9a-f" < /dev/urandom | fold -bw 6 | sed 1q)
- printf "#%s\n" "$c"
-done
DIR diff --git a/regmv b/regmv
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-test $# -ge 2 || { usage; exit 1; }
-
-test $1 = "-s" && simulate=1 && shift 1
-
-operation="$1"
-
-shift 1
-
-files="$*"
-
-for f in $files; do
- n=$(echo $f | sed "$operation")
- test -z "$simulate" && mv "$f" "$n" || echo "$f -> $n"
-done
-
-exit 1
DIR diff --git a/sbar b/sbar
@@ -1,52 +0,0 @@
-#!/bin/sh
-
-swidth=$(wattr w `lsw -r`)
-geom="${swidth}x20"
-
-BG=$(sed -n 2p < $HOME/.colors)
-FG=$(tac < $HOME/.colors | sed -n 2p)
-
-LEMON_FLAVOR="-dbg $geom -B${BG} -F${FG}"
-
-clock() {
- printf 'TIME %%{R} %s %%{R}' "$(date +%H:%M)"
-}
-
-mailc() {
- maildir=$HOME/data/mail
- mailboxes="inbox lists/crux lists/lobsters lists/pcc lists/suckless"
-
- printf '%%{R} MAILS %%{R}'
- for m in $mailboxes; do
- mailbox=$(echo $m | cut -d/ -f2 | tr a-z A-Z)
- test $(fcount $maildir/$m/new) -eq 0 && continue
- printf ' %s %%{R} %d %%{R}' "$mailbox" "$(fcount $maildir/$m/new)"
- done
- echo
-}
-
-todo() {
- printf 'TODO %%{R} %d %%{R}' $(<$HOME/.todo wc -l)
-}
-
-sound() {
- level=$(amixer get Master | sed 's/^.*\[\([0-9]\+\)%.*$/\1/p;d' |uniq)
- printf 'SOUND %%{R} %s %%{R}' "$level"
-}
-
-vpn() {
- netname=$1
- pgrep -f "tincd.*${netname}" 2>&1 >/dev/null
- case $? in
- 0) printf 'VPN %%{R} UP %%{R}' ;;
- 1) printf 'VPN %%{R} DOWN %%{R}' ;;
- esac
-}
-
-while :; do
- BUF=
- BUF="${BUF}%{l}$(mailc inbox)"
- BUF="${BUF}%{r}$(todo) $(vpn 2f30) $(sound) $(clock)"
- echo $BUF
- sleep 1
-done | lemonbar $LEMON_FLAVOR
DIR diff --git a/sct b/sct
Binary files differ.
DIR diff --git a/sshmenu b/sshmenu
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-gethosts() {
- sed "/Host/s/Host //p;d" $HOME/.ssh/config | grep -v '*' | cut -d\ -f1
-}
-
-TARGET=$(gethosts | pick)
-
-test -n "$TARGET" && exec ssh $TARGET
DIR diff --git a/takeoffdir b/takeoffdir
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-TAKEOFF_DIR=/tmp/takeoff
-
-mkdir -p $TAKEOFF_DIR
-
-# file either created or modified
-wendy -m 136 -f $TAKEOFF_DIR sh -c 'autoup $WENDY_INODE'
DIR diff --git a/timebar b/timebar
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-ROOT=$(lsw -r)
-SW=$(wattr w $ROOT)
-SH=$(wattr h $ROOT)
-
-W=64
-H=32
-X=$((SW - W))
-Y=$((SH - H))
-
-font='-*-profont-medium-*-*--12-*-*-*-*-*-*-1'
-
-while :; do
- date "+%{c}%T"
- sleep 1
-done | bar -d -g ${W}x${H}+$X+$Y -f "$font" -B\#ff261616 -F\#ff888888
DIR diff --git a/toxrdb b/toxrdb
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-cpt=0
-while read hexcode; do
- printf '*color%d: %s\n' "$cpt" "$hexcode"
- cpt=$(expr $cpt + 1)
-done | column -t
-\ No newline at end of file
DIR diff --git a/tpm b/tpm
@@ -1,114 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2013-2015 Sören Tempel
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-umask 077
-
-##
-# Variables
-##
-
-GPG_OPTS="--quiet --yes --batch"
-STORE_DIR="${PASSWORD_STORE_DIR:-${HOME}/.pass}"
-
-if [ -r "${STORE_DIR}/.gpg-id" ] && [ -z "${PASSWORD_STORE_KEY}" ]; then
- read -r PASSWORD_STORE_KEY < "${STORE_DIR}/.gpg-id"
-fi
-
-if [ -n "${PASSWORD_STORE_KEY}" ]; then
- GPG_OPTS="${GPG_OPTS} --recipient ${PASSWORD_STORE_KEY}"
-else
- GPG_OPTS="${GPG_OPTS} --default-recipient-self"
-fi
-
-##
-# Helper
-##
-
-abort() {
- echo "${1}" 1>&2
- exit 1
-}
-
-readpw() {
- if [ -t 0 ]; then
- printf "%s" "${1}"
- stty -echo
- fi
-
- IFS= read -r "${2}"
- [ -t 0 ] && stty echo
-}
-
-##
-# Commands
-##
-
-show() {
- entry_name="${1}"
- entry_path="${STORE_DIR}/${entry_name}.gpg"
-
- if [ -z "${entry_name}" ]; then
- abort "usage: tpm <entry>"
- fi
-
- if [ ! -e "${entry_path}" ]; then
- abort "The requested entry doesn't exist."
- fi
-
- gpg2 ${GPG_OPTS} --decrypt "${entry_path}"
-}
-
-insert() {
- entry_name="${1}"
- entry_path="${STORE_DIR}/${entry_name}.gpg"
-
- if [ -z "${entry_name}" ]; then
- abort "usage: tpm -i <entry>"
- fi
-
- if [ -e "${entry_path}" ]; then
- abort "This entry already exists, please remove it first."
- fi
-
- password=""
- readpw "Password for '${entry_name}': " password
- if [ -t 0 ]; then
- printf "\n"
- fi
-
- if [ -z "${password}" ]; then
- abort "You didn't specify a password."
- fi
-
- mkdir -p "$(dirname "${entry_path}")"
- printf '%s\n' "${password}" | gpg2 ${GPG_OPTS} \
- --encrypt --output "${entry_path}"
-}
-
-##
-# Parse input
-##
-
-if [ $# -lt 1 ]; then
- tree $STORE_DIR|sed 's/.gpg$//'
- exit 0
-fi
-
-case "${1}" in
- -i) insert "${2}" ;;
- -h) abort "usage: tpm [-i] <entry>" ;;
- *) show "$1"
-esac
DIR diff --git a/translate b/translate
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-# use the google translate service
-# depends: curl
-
-if test -z "$1"; then
- echo "usage: $(basename $0) text"
- echo "examples:"
- echo " $(basename $0) text"
- echo " TL=el $(basename $0) text"
- echo " SL=en TL=pl $(basename $0) text"
- exit 1
-fi
-
-TEXT=$1
-SL=${SL:-auto}
-TL=${TL:-fr}
-
-TRANSLATEURL='https://translate.google.com/'
-UA='Mozilla 5.0'
-NEWLINE='\
-'
-
-# do translate
-curl --user-agent "$UA" \
- --data "sl=$SL" \
- --data "tl=$TL" \
- --data-urlencode "text=$TEXT" \
- --silent $TRANSLATEURL \
- | sed "s/<\/span>/$NEWLINE/g" | grep 'result_box' | sed 's/.*>//'
DIR diff --git a/udmenu b/udmenu
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-FONT="monospace:size=8:antialias=true"
-NB='black'
-NF='white'
-SB='white'
-SF='black'
-
-
-ifne dmenu -fn "$FONT" -nb "$NB" -nf "$NF" -sb "$SB" -sf "$SF" $@
DIR diff --git a/uplay b/uplay
@@ -1,13 +0,0 @@
-#!/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 $* | 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
DIR diff --git a/uplaylist b/uplaylist
@@ -1,5 +0,0 @@
-#!/bin/sh
-#
-# play a youtube playlist with player
-
-curl -s $1 | grep -oP '/watch\?v=[^";]*[";]' | cut -d\" -f1 | sed 's@^@https://youtube.com@' | xargs -I% sh -c "youtube-dl -g '%'|tail -n1|xargs curl|mplayer -nocache -"
DIR diff --git a/ushot b/ushot
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-FILE=${1:-/dev/null}
-
-xscreenshot | ff2png | tee $FILE | pio | tee /dev/tty | xsel -i
-curl -s $(xsel -o) | png2ff | lel -a -w 720 -h 520
DIR diff --git a/wrapbar b/wrapbar
@@ -1,20 +0,0 @@
-#!/bin/sh
-#
-# spawn a status bar
-
-set -e
-
-# get screen size
-IFS='x' read w h <<< "$(xrandr | awk '/\*/ {print $1}')"
-
-icon="-*-stlarch-medium-*-*--10-*-*-*-*-*-*-*"
-font="*-gohufont-medium-*-*--11-*-*-*-*-*-iso10646-1"
-
-# two "useless" bars, for multi borders
-echo | bar -p -B\#ff1d1d1d -g $((w - 20))x32+10+10 & sleep 0.1
-echo | bar -p -B\#ff4c4c4c -g $((w - 26))x26+13+13 & sleep 0.1
-
-# and the actual bar
-while :; do
- mkbar
-done | bar -f "$icon,$font" -B\#ff1d1d1d -g $((w - 30))x22+15+15
DIR diff --git a/wrappop b/wrappop
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-# fifo that we'll use to feed the popups
-test -p /tmp/popup.fifo || mkfifo /tmp/popup.fifo
-test -d /tmp/popup.d || mkdir /tmp/popup.d
-
-w=190
-h=20
-x=1200
-y=10
-
-find_place() {
- NUM=$(fcount /tmp/popup.d)
- for n in `seq 0 $NUM`; do
- test ! -f /tmp/popup.d/$n && echo $n && return
- done
- echo $NUM
-}
-
-mkpop() {
- local f=$1
-
- touch /tmp/popup.d/$f
- popup -g ${w}x${h}+${x}+$((y + (h+y) * f)) $f ${message}
- rm /tmp/popup.d/$f
-}
-
-# get messages from the fifo
-tail -f /tmp/popup.fifo |
-while IFS= read -r message; do
- mkpop $(find_place) &
-done
DIR diff --git a/xgif b/xgif
@@ -1,47 +0,0 @@
-#!/bin/sh
-#
-# z3bra - (c) wtfpl 2014
-# record a gif from a specific window until ^D
-
-usage () {
- cat <<EOF
-usage: `basename $0` [-h] <file>
- -h : print this help
-
-environment:
- BORDERS : set the window border size (default: 5)
-EOF
-}
-
-case $1 in
- -w) WID=$2; shift 2;;
- -h) usage && exit 0;;
- *) test $# -lt 1 && usage && exit 1
-esac
-
-# the size of your window manager borders, to include them in the gif
-BORDERS=${BORDER:-2}
-FIFO=${FIFO:-/tmp/xgif-$$.fifo}
-WID=${WID:-$(lsw -r)}
-
-# let the user grab a window
-geom=$(wattr xywh $WID)
-
-# extract window size/position
-x=$(echo $geom|cut -d\ -f1)
-y=$(echo $geom|cut -d\ -f2)
-w=$(echo $geom|cut -d\ -f3)
-h=$(echo $geom|cut -d\ -f4)
-
-# add the borders to the width/heigh
-w=$(( $w + 2 * $BORDERS))
-h=$(( $h + 2 * $BORDERS))
-
-# this hackery serves the purpose of recording until the user press ^D
-test -p $FIFO || mkfifo $FIFO
-
-byzanz-record -x $x -y $y -w $w -h $h -e "cat $FIFO" $1 &
-
-# will hold the fifo openned until ^D is pressed
-cat > $FIFO
-rm $FIFO
DIR diff --git a/xurls b/xurls
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-protocols='[a-zA-Z]+://'
-hostchars='[-a-zA-Z0-9._+]+'
-pathchars='[-a-zA-Z0-9._+#=?&:;%/!~()]+'
-
-grep -aPo "${protocols}${hostchars}${pathchars}" | tac
DIR diff --git a/xwait b/xwait
Binary files differ.
DIR diff --git a/ydl b/ydl
@@ -1,49 +0,0 @@
-#!/bin/sh
-#
-# z3bra - (c) wtfpl 2014
-# download the audio track of the first result of a youtube search
-# and add it to MPD library (will end up with a .mp3, for tags)
-
-usage() {
- echo "`basename $0` [-h] <query>"
-}
-
-ys() {
- num=3
- regex='^.*<a href="\(/watch[^"]*\)"[^>]*>\([^<]*\)</a>.*$'
- output='\2 - http://youtube.com\1'
-
- while getopts "hn:tu" OPT; do
- case $OPT in
- n) num=$OPTARG;;
- t) output='\2';;
- u) output='http://youtube.com\1';;
- h) usage long; exit 0;;
- *) usage; exit 1;;
- esac
- done
-
- shift $((OPTIND - 1))
-
- query=$(echo $@ | tr ' ' '+')
- url="https://www.youtube.com/results?search_query=${query}"
-
- curl -s "$url" | sed -n "s,$regex,$output,p" | sed ${num}q
-}
-
-# don't process if no argument given
-test $# -eq 0 && usage && exit 1
-
-# you can either pass MULTIPLE search terms or a SINGLE url
-test $# -gt 1 && uri=$(ys -n1 -u $@) || uri=$1
-
-# give up if we got no uri
-if test -z "$uri"; then
- echo "no result found"
- exit 1
-fi
-
-# download and extract audio track
-youtube-dl -q -x --audio-format mp3 -o '%(title)s.%(ext)s' "$uri"
-
-exit 0
DIR diff --git a/ys b/ys
@@ -1,38 +0,0 @@
-#!/bin/sh
-#
-# z3bra - (c) wtfpl 2014
-# perform a search on youtube and return the best result (title + link)
-
-usage() {
- echo "`basename $0` [-htu] [-n <num>] <query>"
-
- test -z "$1" && return
-
- cat <<EOF
- -h : display this help
- -t : output titles only (default 'title - uri')
- -u : output uris only
- -n : print only <num> results (default: 3)
-EOF
-}
-
-num=3
-regex='^.*<a href="\(/watch[^"]*\)"[^>]*>\([^<]*\)</a>.*$'
-output='\2 - http://youtube.com\1'
-
-while getopts "hn:tu" OPT; do
- case $OPT in
- n) num=$OPTARG;;
- t) output='\2';;
- u) output='http://youtube.com\1';;
- h) usage long; exit 0;;
- *) usage; exit 1;;
- esac
-done
-
-shift $((OPTIND - 1))
-
-query=$(echo $@ | tr ' ' '+')
-url="https://www.youtube.com/results?search_query=${query}"
-
-curl -s "$url" | sed -n "s,$regex,$output,p" | sed ${num}q