diff --git a/alacritty/.config/alacritty/alacritty.toml b/alacritty/.config/alacritty/alacritty.toml index 1081d51..28f2f53 100644 --- a/alacritty/.config/alacritty/alacritty.toml +++ b/alacritty/.config/alacritty/alacritty.toml @@ -39,7 +39,7 @@ unfocused_hollow = true TERM = "xterm-256color" [font] -size = 10.0 +size = 13.0 [font.bold] family = "Go Mono" diff --git a/bash/.aliases b/bash/.aliases index a540238..0aaf328 100644 --- a/bash/.aliases +++ b/bash/.aliases @@ -19,3 +19,4 @@ alias chglg="git add ./changelog/ && git commit -m 'Add changelog' && git push" alias surepayment="portforward 5001" alias sureroc="portforward 5002" alias slip="sli dev changelog" +alias deploy_v="ssh vrobbler.service \"rm -rf /usr/local/lib/python3.9/site-packages/vrobbler-0.15.4.dist-info/ && pip install git+https://code.unbl.ink/secstate/vrobbler.git@develop && immortalctl restart vrobbler\"" diff --git a/bin/.bin/write_pdf_metadata_in_calibre.sh b/bin/.bin/write_pdf_metadata_in_calibre.sh new file mode 100755 index 0000000..c5f4da7 --- /dev/null +++ b/bin/.bin/write_pdf_metadata_in_calibre.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# Scans the given directory and all subdirectories for the file +# "metadata.opf". This file is created by Calibre. From this file data will be +# written into the PDFs, which are exactly in the same directory. +# +# +# REQUIREMENTS: calibre by KOVID GOYAL (http://calibre-ebook.com/) +# + + + +shopt -s nullglob +shopt -s nocaseglob + + +write_metadata() { + find "$1" -depth -type f -name "metadata.opf" | { while read -r metadata_path; + do + echo "metadata found: $metadata_path" + dir_name=$(dirname "$metadata_path") + + pdfs=$(find "$dir_name" -maxdepth 1 -type f -name '*.pdf' | wc -l) + + echo "pdfs found: $pdfs" + + find "$dir_name" -maxdepth 1 -type f -name "*.pdf" | { while read -r pdf_path; + do + ebook-meta --from-opf="$metadata_path" "$pdf_path" 2>/dev/null + done + echo + } + done + } +} + +[[ -z "$1" ]] && logError "Please specify a start directory." && exit 1 + +if [ -f "$1" ] +then + search_path=$(dirname "$1") +else + search_path="$1" +fi + +write_metadata "$search_path" + +exit 0 + diff --git a/zsh/.zshrc b/zsh/.zshrc index 6f4b6f4..f7a2aba 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -7,7 +7,7 @@ export ZSH="$HOME/.oh-my-zsh" ZSH_THEME="robbyrussell" -plugins=(git z fzf asdf direnv emacs yarn) +plugins=(git z fzf asdf direnv yarn) eval "$(aws configure export-credentials --profile np-farmers --format env)"