dot

packages and services management
Log | Files | Refs | README

commit 5d24094fc570d651fba55167257497419a724438
parent f9f43bb80bc3cc1ccce440612c991c6b3793e0bd
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri,  3 Nov 2017 10:56:32 +0100

bin/mblaze-filter: added filters

Diffstat:
Mbin/epih | 4++--
Dbin/l | 14--------------
Mbin/mblaze-filter | 1+
Dbin/s | 3---
Mbin/sane-name | 6+++---
Mbin/store | 4++++
Mbin/xdg-open | 6++++++
Mdot/bashrc | 3++-
8 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/bin/epih b/bin/epih @@ -4,7 +4,7 @@ cat <<EOF /* ** EPITECH PROJECT, 2017 ** $1 -** File description -** ${2:- 1} +** File description: +** ${2:-$1} */ EOF diff --git a/bin/l b/bin/l @@ -1,14 +0,0 @@ -#!/bin/sh - -[ -f "$1" ] && [ $# == 1 ] && exec io "$1" - -test='( ( name == ".git" || path ~~ "*var/mail/*" ) && prune || print )' - -if [ "$1" = -r ] -then - shift 1 -else - test="depth == 1 && $test" -fi - -lr -o tfd -GGf '%M%x %n %S %TF %TR %p%F %l\n' -t "$test" "$@" diff --git a/bin/mblaze-filter b/bin/mblaze-filter @@ -11,6 +11,7 @@ do printf '%-25s ' "$dir" mlist "$MAIL" | mpick -t "$test" | xe mv {} "${MAIL%/*}/$dir/new" done << 'EOF' +actux.eu.org "To" ~~~ "*@actux.eu.org*" amazon.com "From" ~~~ "*@amazon.*" amnesty.org "From" ~~~ "*amnesty.*" bandcamp.com "From" ~~~ "*Cryo Chamber*" diff --git a/bin/s b/bin/s @@ -1,3 +0,0 @@ -#!/bin/sh - -git status -s --branch diff --git a/bin/sane-name b/bin/sane-name @@ -1,13 +1,13 @@ #!/bin/sh -# only keep '[:alnum:]', ',' and '.' and convert everyting else to '-' +# only keep '[:alnum:]', ',' and '.' and convert everyting else to '_' find . -depth | while IFS='' read -r path do dir=$(dirname "$path") old=$(basename "$path") new=$( - printf %s "$old" | tr -c '[:alnum:],.' '-' | - sed -r -e 's/-+/-/g' -e 's/([0-9]+)\.*-/\1-/' + printf %s "$old" | tr -c '[:alnum:],.' '_' | + sed -r -e 's/_+/_/g' -e 's/([0-9]+)\.*_/\1_/' ) [ "$dir/$old" = "$dir/$new" ] || mv -- "$dir/$old" "$dir/$new" diff --git a/bin/store b/bin/store @@ -11,6 +11,10 @@ case $1 in (*vimeo.com/*|*youtube.com/*) youtube-dl "$1" ;; +(*://*.torrent) + curl -L "$1" > "$HOME/var/torrent/$filename" + ;; + (*://*) curl -L "$1" > "$filename" ;; diff --git a/bin/xdg-open b/bin/xdg-open @@ -50,6 +50,12 @@ case $1 in (mailto:*) mcom "${1#mailto:}" ;; +(magnet:*) + transmission-cli "${1#magnet:}" + ;; +(*.torrent) + transmission-cli "$1" + ;; (*.pdf) exec mupdf "$1" ;; diff --git a/dot/bashrc b/dot/bashrc @@ -12,7 +12,8 @@ PS2=' -- ' alias cl='printf "\033[H\033[2J"' alias blih="blih -u $BLIH" alias p='p=$(io-ps)' -alias lines='find . -type f -name "*.[ch]" -exec wc -l {} +' +alias l='ls -Alp' +alias s='git status -s --branch' # --- functions ----------------------------------------------------------------