config/shell: little adjustments
This commit is contained in:
parent
91582b036d
commit
7d80a75276
|
@ -60,13 +60,13 @@ formatsongs() {
|
||||||
_pwd="$PWD"
|
_pwd="$PWD"
|
||||||
find "$PWD" "$@" -type d | while read d; do builtin cd $d; findsongs | while read song; do
|
find "$PWD" "$@" -type d | while read d; do builtin cd $d; findsongs | while read song; do
|
||||||
new="$(formatsong "$song")"
|
new="$(formatsong "$song")"
|
||||||
test "$new" != "$song" && mv -v "$song" "$new"
|
test "$new" && test "$new" != "$song" && mv -iv "$song" "$new"
|
||||||
done; done
|
done; done
|
||||||
builtin cd "$_pwd"
|
builtin cd "$_pwd"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
for f in $(find "$@" -name "*.wav"); do
|
for f in $(find "$@" -name "*.wav"); do
|
||||||
echo "Converting $f to ${f%.*}.flac"
|
echo "Converting $f to ${f%.*}.flac"
|
||||||
ffmpeg -i "$f" "${f%.*}.flac" -v warning && rm -v $f
|
ffmpeg -i "$f" "${f%.*}.flac" -v warning && mv -v $f /tmp
|
||||||
done
|
done
|
||||||
unset IFS
|
unset IFS
|
||||||
}
|
}
|
||||||
|
@ -77,11 +77,12 @@ formatsong() {
|
||||||
s/ \((Original Mix)\|(Original)\|(Full Stream)\|.NCS Release.\)//i;
|
s/ \((Original Mix)\|(Original)\|(Full Stream)\|.NCS Release.\)//i;
|
||||||
s/ (\(Acoustic\|Live\))/ [\1]/i;
|
s/ (\(Acoustic\|Live\))/ [\1]/i;
|
||||||
s/ \[\(feat.*\)\]/ (\1)/i;
|
s/ \[\(feat.*\)\]/ (\1)/i;
|
||||||
|
s/^\([A-z]\+\) The \([^-]\+\)$/\1, the \2/g;
|
||||||
s/ \(\..\{2,4\}\)$/\1/;
|
s/ \(\..\{2,4\}\)$/\1/;
|
||||||
s/---/ - /;
|
s/---/ - /;
|
||||||
s/^[0-9]\{6\}_//;
|
s/^[0-9]\{6\}_//;
|
||||||
s/ / /g;
|
|
||||||
s/_\././g;
|
|
||||||
s/_/ /g;
|
s/_/ /g;
|
||||||
|
s/ \././g;
|
||||||
|
s/ / /g;
|
||||||
s/\(\w\)+\(\w\)/\1 \2/g' -
|
s/\(\w\)+\(\w\)/\1 \2/g' -
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
test -r "$1" || (echo "Usage: sign <document.pdf> [hoffset [voffset [scale [alt-signature]]]]" && exit 1)
|
test ! -r "$1" && echo "Usage: sign <document.pdf> [hoffset [voffset [scale [alt-signature]]]]" && exit 1
|
||||||
|
|
||||||
signature=$(pass information/signature$(test -n "$5" && echo "-$5"))
|
signature=$(pass information/signature$(test -n "$5" && echo "-$5"))
|
||||||
|
|
||||||
|
@ -15,6 +15,8 @@ pdfjam "$signature" --outfile "$sig" --papersize "{595pt, 842pt}" --noautoscale
|
||||||
--offset "${2:-0}pt ${3:-0}pt" --scale "${4:-1}"
|
--offset "${2:-0}pt ${3:-0}pt" --scale "${4:-1}"
|
||||||
pdfjam "$1" last "$sig" --outfile "$tmp_signed" --delta "0 -842pt" --nup "1x2" --fitpaper true
|
pdfjam "$1" last "$sig" --outfile "$tmp_signed" --delta "0 -842pt" --nup "1x2" --fitpaper true
|
||||||
|
|
||||||
|
timg "$tmp_signed"
|
||||||
|
|
||||||
# https://apple.stackexchange.com/questions/198854/shell-command-to-count-pages-in-a-pdf-other-than-pdftk
|
# https://apple.stackexchange.com/questions/198854/shell-command-to-count-pages-in-a-pdf-other-than-pdftk
|
||||||
if test "$(pdftk "$1" dump_data | grep Pages | cut -d' ' -f2)" -gt 1
|
if test "$(pdftk "$1" dump_data | grep Pages | cut -d' ' -f2)" -gt 1
|
||||||
then
|
then
|
||||||
|
@ -22,5 +24,3 @@ if test "$(pdftk "$1" dump_data | grep Pages | cut -d' ' -f2)" -gt 1
|
||||||
pdfjam "$tmp_reversed" last-2 "$tmp_signed" --outfile "$result"
|
pdfjam "$tmp_reversed" last-2 "$tmp_signed" --outfile "$result"
|
||||||
else cp "$tmp_signed" "$result"
|
else cp "$tmp_signed" "$result"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
xdg-open "$result"
|
|
||||||
|
|
|
@ -49,8 +49,8 @@ export TASKRC="$XDG_CONFIG_HOME/task/taskrc"
|
||||||
export TASKDATA="$XDG_DATA_HOME/task"
|
export TASKDATA="$XDG_DATA_HOME/task"
|
||||||
# zsh dirs
|
# zsh dirs
|
||||||
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
|
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
|
||||||
|
export ZSH="$XDG_DATA_HOME/zsh/oh-my-zsh"
|
||||||
export HISTFILE="$XDG_STATE_HOME/zsh/history"
|
export HISTFILE="$XDG_STATE_HOME/zsh/history"
|
||||||
export ZSH="$XDG_STATE_HOME/zsh/oh-my-zsh"
|
|
||||||
export CONFIG_ZSH="$XDG_CONFIG_HOME/zsh"
|
export CONFIG_ZSH="$XDG_CONFIG_HOME/zsh"
|
||||||
export CONFIG_SHELLS="$XDG_CONFIG_HOME/shell"
|
export CONFIG_SHELLS="$XDG_CONFIG_HOME/shell"
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ and configuration for ~less~ and ~fzf~.
|
||||||
** Graphical
|
** Graphical
|
||||||
- x :: xorg-xserver xorg-xkill xorg-setxkbmap xorg-xinit xterm xclip xprintidle light
|
- x :: xorg-xserver xorg-xkill xorg-setxkbmap xorg-xinit xterm xclip xprintidle light
|
||||||
- music production :: lilypond lilypond-docs timidity++ chordpro-git musescore
|
- music production :: lilypond lilypond-docs timidity++ chordpro-git musescore
|
||||||
- video :: vlc kdenlive
|
- video :: vlc obs-studio kdenlive
|
||||||
- kde :: plasma-desktop plasma-nm spectacle breeze systemsettings konsole ktorrent dolphin kdeplasma-addons kinfocenter partitionmanager kdeconnect kwallet-pam kwalletmanager ksshaskpass okular bluedevil
|
- kde :: plasma-desktop plasma-nm spectacle breeze systemsettings konsole ktorrent dolphin kdeplasma-addons kinfocenter partitionmanager kdeconnect kwallet-pam kwalletmanager ksshaskpass okular bluedevil
|
||||||
- office :: emacs texlive-core texlive-latexextra context-bin libreoffice-fresh
|
- office :: emacs texlive-core texlive-latexextra context-bin libreoffice-fresh
|
||||||
- hacking :: etcher-bin
|
- hacking :: etcher-bin
|
||||||
|
|
Loading…
Reference in New Issue