dot

packages and services management
Log | Files | Refs | README

commit f0535ea6d83638e20b87e06d588cead029705b50
parent b5a2153b6790c08b5cc89196effb8d96a81edfa1
Author: Josuah Demangeon <mail@josuah.net>
Date:   Mon,  2 Apr 2018 01:01:08 +0200

apply patches in quark builds

Diffstat:
Mbin/io | 4+++-
Abin/playdir | 9+++++++++
Mbin/suckless-patch-mail | 2+-
Mbin/xdg-abduco | 14++++++++------
Mbin/xdg-open | 33++++++++++++---------------------
Mpack/quark/build | 2+-
Mrun/cherrymusic/run | 3++-
7 files changed, 36 insertions(+), 31 deletions(-)

diff --git a/bin/io b/bin/io @@ -17,7 +17,9 @@ fi h='----------------------------------------------------------------------------' -exec xdg-abduco xdg-open "$({ +echo "$DISPLAY" >~/out + +exec xdg-open "$({ xdg-abduco printf '#%s\n' "$h$h$h$h$h$h$h$h$h$h$h$hh$h$h" cat "$HOME/.cache/find" diff --git a/bin/playdir b/bin/playdir @@ -0,0 +1,9 @@ +#!/bin/sh -ex + +# play every music/video file in a dir + +find "$1" -type f | sort | while IFS='' read -r song +do + ffplay -autoexit "$song" +done + diff --git a/bin/suckless-patch-mail b/bin/suckless-patch-mail @@ -1,6 +1,6 @@ #!/bin/sh -git send-email -1 \ +git send-email -"${1-1}" \ --subject-prefix="$(basename "$PWD")][PATCH" \ --to hackers@suckless.org \ --smtp-server="$(command -v msmtp)" diff --git a/bin/xdg-abduco b/bin/xdg-abduco @@ -15,10 +15,12 @@ touch "$dir/names" grep -e "^$(abduco | sed -rn 's/.* ([0-9]+)$/\1/p') " "$dir/names" | sort -k2 -uo "$dir/names" +for name in "$@"; do continue; done + # get the real path name -[ ! -h "$2" ] || set -- "$1" "$(readlink -f "$2")" -[ ! -e "$2" ] || set -- "$1" "$(cd "$(dirname "$2")"; pwd)/$(basename "$2")" -[ ! -d "$2" ] || set -- "$1" "$(cd "$2"; pwd)" +[ ! -h "$name" ] || name="$(readlink -f "$name")" +[ ! -e "$name" ] || name="$(cd "$(dirname "$name")"; pwd)/$(basename "$name")" +[ ! -d "$name" ] || name="$1" "$(cd "$name"; pwd)" case "$#" in (0) @@ -27,13 +29,13 @@ case "$#" in (*) printf '\033]0;%s\a' "$2" 1>&2 - hash="$(printf %s "$2" | cksum | cut -d ' ' -f 1)" + hash="$(printf %s "$name" | cksum | cut -d ' ' -f 1)" printf '%s\t%s\n' "$hash" "$2" >> "$dir/names" if [ "$ABDUCO" ] then - ABDUCO="$2" abduco -n "$hash" "$@" - printf '"%s" open in the background\n' "$2" + ABDUCO="$name" abduco -n "$hash" "$@" + printf '"%s" open in the background\n' "$name" else ABDUCO="$2" exec abduco -A "$hash" "$@" fi diff --git a/bin/xdg-open b/bin/xdg-open @@ -60,7 +60,7 @@ case "$1" in esac mkdir -p "$HOME/git/$host/$user" cd "$HOME/git/$host/$user" - exec git clone "$1" + exec xdg-abduco git clone "$1" ;; (9p://*) dir="$HOME/var/9p/$host" @@ -71,14 +71,14 @@ case "$1" in if [ "$file" ] then mkdir "$(dirname "$file")" - curl -o "$file" "$1" + xdg-abduco curl -o "$file" "$1" exec "$0" "$file" else - exec ftp "$1" + exec xdg-abduco ftp "$1" fi ;; (gopher://*) - exec sacc "$1" + exec xdg-abduco sacc "$1" ;; (http://*|https://*) case "$host" in @@ -116,30 +116,24 @@ case "$1" in printf '/j #%s\n' "$path" > "$HOME/var/irc/$host/in" ;; (news://*) - exec firefox "$1" + exec xdg-abduco links "$1" ;; (sftp://*) [ "$port" = . ] && port='22' - exec sftp -P "$port" "$host" + exec xdg-abduco sftp -P "$port" "$host" ;; (ssh://*) [ "$port" = . ] && port="" || port="-p $port" [ "$user" = . ] && user="" || user="$user@" [ "$pass" = . ] && pass="" || pass="$" - exec ssh $port "$user$host" + exec xdg-abduco ssh $port "$user$host" ;; (telnet://*) - exec telnet "$port" "$host" + exec xdg-abduco telnet "$port" "$host" ;; (*://*) exec printf 'unsupported protocol\n' 1>&2 ;; -(r/*) - exec firefox "http://reddit.com/$1" - ;; -(*\([0-9]\)|*\([0-9]p\)) - exec man "${1%\(*}" - ;; (*.torrent) exec btcli add -d "$HOME/var/btpd/downloads" "$1" ;; @@ -162,16 +156,13 @@ case "$1" in exec ffplay "$1" ;; (*/music/*) - find "$1" -type f | sort | while IFS='' read -r song - do - ffplay -autoexit "$song" - done + xdg-abduco playdir "$1" ;; (*.[0-9]|*.[0-9]p|*.[0-9].gz) - exec mandoc -a -T utf8 "$1" + exec xdg-abduco mandoc -a -T utf8 "$1" ;; (*.o|*.a) - exec objdump -D "$1" + exec xdg-abduco objdump -D "$1" ;; (*.html) exec firefox "$1" @@ -219,7 +210,7 @@ case "$1" in exec ar vx "$1" ;; (*) - [ -f "$1" ] && exec $EDITOR "$1" + [ -f "$1" ] && exec xdg-abduco $EDITOR "$1" [ -d "$1" ] && cd "$1" && exec "$SHELL" ;; esac diff --git a/pack/quark/build b/pack/quark/build @@ -1,6 +1,6 @@ #!/bin/sh -ex -git apply "$PACK/quark/0001-fix-segfault-on-parsing-of-v-and-m.patch" +git apply "$PACK/quark/0001-fix-segfault-on-parsing-of-v-and-m.patch" || : make make PREFIX="$PREFIX" install diff --git a/run/cherrymusic/run b/run/cherrymusic/run @@ -2,4 +2,5 @@ port="8000" -exec python3.6 "$HOME/src/cherrymusic" --setup --port "$port" +exec 2>&1 +exec python3.6 "$PACKROOT/src/cherrymusic/cherrymusic" --setup --port "$port"