dot

packages and services management
Log | Files | Refs | README

commit 737debe1fb5ae2d26e0a90d6987b91a7038c5901
parent 0a98e3223c974bd567397fee1447e77abf3e0327
Author: Josuah Demangeon <mail@josuah.net>
Date:   Wed,  3 Jan 2018 20:34:04 +0100

fixing xdg-open for images

Diffstat:
Abin/music | 27+++++++++++++++++++++++++++
Mbin/play | 2+-
Mbin/xdg-open | 3++-
Mdot/xinitrc | 2+-
Mpack/dwm/config.h | 2+-
5 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/bin/music b/bin/music @@ -0,0 +1,27 @@ +#!/bin/sh -e + +PLAY=${PLAY:-$HOME/.cache/play} + +mkdir -p "$PLAY" + +[ -p "$PLAY/in" ] || mkfifo "$PLAY/in" + +case $1 in +(add) + test -r "$2" + printf '%s\n' "$2" >> "$PLAY/list" + ;; +(del) + awk "NR == $2 { next; } { print; }" "$PLAY/list" > "$PLAY/list.new" + mv "$PLAY/list.new" "$PLAY/list" + ;; +(next) + sed '1d' "$PLAY/list" > "$PLAY/list.new" + mv "$PLAY/list.new" "$PLAY/list" + ;; +(edit) + $EDITOR "$PLAY/list" + ;; +esac + +nl "$PLAY/list" diff --git a/bin/play b/bin/play @@ -3,4 +3,4 @@ IFS=' ' -mplayer -quiet $(exec find "$1" -type f | sort) +exec mplayer $(find "$@" -type f | sort) diff --git a/bin/xdg-open b/bin/xdg-open @@ -50,6 +50,7 @@ $(printf %s "$1" | awk '{ } path = $0; + sub("[#?].*", "", path); printf("%s\t%s\t%s\t%s\t%s\t%s", scheme, user, pass, host, port, path); }') @@ -94,7 +95,7 @@ case $scheme in exec "$0" "$HOME/var/torrent/${path##*/}" ;; (*.jpg|*.JPG|*.jpeg|*.JPEG|*.png|*.PNG|*.gif) - mkdir -p "$HOME/lib/http/image/$host/${path##*/}" + mkdir -p "$HOME/lib/http/image/$host/" curl -Lo "$HOME/lib/http/image/$host/${path##*/}" "$1" exec "$0" "$HOME/lib/http/image/$host/${path##*/}" ;; diff --git a/dot/xinitrc b/dot/xinitrc @@ -1,6 +1,6 @@ setxkbmap us -option compose:ralt xsetroot -solid '#000000' -xset +fp "$HOME/etc/fonts" +#xset +fp "$HOME/etc/fonts" while sleep 10 do xsetroot -name "$(status)" diff --git a/pack/dwm/config.h b/pack/dwm/config.h @@ -19,7 +19,7 @@ static const char *colors[][3] = { }; /* tagging */ -static const char *tags[] = { "1:text", "2:term", "3:ssh", "4:web", "5:graph" }; +static const char *tags[] = { "1:text", "2:term", "3:ssh", "4:web", "5:media" }; static const Rule rules[] = { /* xprop(1):