summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2014-09-13 00:08:33 +0200
committerFlorian Pritz <bluewind@xinu.at>2014-09-13 00:08:33 +0200
commit5b5b338503b82cde42fb8cdd7791abb61b939111 (patch)
tree94b6aa445cc86976346b101d08277ac488cf36d3
parent8450e9ac59dfb678ae3fc2adca5bb837804710f3 (diff)
downloadbin-5b5b338503b82cde42fb8cdd7791abb61b939111.tar.gz
bin-5b5b338503b82cde42fb8cdd7791abb61b939111.tar.xz
misc changes
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-x[-rw-r--r--]backup.sh0
-rwxr-xr-xfirefox-youtube-handler8
-rwxr-xr-xscan-multi9
-rwxr-xr-xslic3r5
-rwxr-xr-xsplit-kochabo.sh2
5 files changed, 14 insertions, 10 deletions
diff --git a/backup.sh b/backup.sh
index 09f68b4..09f68b4 100644..100755
--- a/backup.sh
+++ b/backup.sh
diff --git a/firefox-youtube-handler b/firefox-youtube-handler
index 666588c..c071f95 100755
--- a/firefox-youtube-handler
+++ b/firefox-youtube-handler
@@ -3,14 +3,14 @@ proto='yt://'
url=$1
id=${url##$proto}
-#audiourl="$(youtube-dl -g -f 141/140 "$id")"
-#videourl="$(youtube-dl -g -f 138/264/137/136/135/134 "$id")"
+audiourl="$(youtube-dl -g -f 141/140 -- "$id")"
+videourl="$(youtube-dl -g -f 138/264/137/136/135/134 -- "$id")"
#vlc "$videourl" --input-slave "$audiourl"
-#mpv --no-cache --demuxer-lavf-o=fflags=+ignidx "$videourl" --audiofile "$audiourl"
+mpv --title "YouTube - $id" --no-cache --demuxer-lavf-o=fflags=+ignidx "$videourl" --audio-file "$audiourl"
#mplayer "$videourl" -audiofile "$audiourl"
# max 720p because youtube serves 1080p only via DASH (seperate audio/video streams)
#urxvt -e bash -c "youtube-viewer -I \"http://youtube.com/watch?v=$id\"; sleep 5"
-smplayer "http://youtube.com/watch?v=$id"
+#smplayer "http://youtube.com/watch?v=$id"
#smplayer $(youtube-dl -g ${id})
diff --git a/scan-multi b/scan-multi
index 7c9cb7f..fc6ca33 100755
--- a/scan-multi
+++ b/scan-multi
@@ -1,15 +1,18 @@
#!/bin/bash
+jpeg_quality=70
+jpeg_size=1500x1500
+
time=$(date +%Y-%m-%d_%H%M%S)
-scanimage --resolution 200 -b -x 214.98 -y 294.973
+scanimage --resolution 200 -b -x 215 -y 297
i=1
while [[ -e "out$i.pnm" ]]; do
img="out$i.pnm"
newname="$(printf "%s_%03d" "$time" "$i")"
- convert "$img" -normalize -quality 70 "$newname.jpg" && rm "$img"
+ convert "$img" -normalize -resize $jpeg_size -quality $jpeg_quality "$newname.jpg" && rm "$img"
((i++))
done
if [[ $1 = "--pdf" ]]; then
- convert "${time}"_*.jpg -resize 1500x1500 "${time}.pdf" && rm "${time}"_*.jpg
+ convert "${time}"_*.jpg -resize $jpeg_size -compress jpeg -quality $jpeg_quality -density 72x72 -repage 595x842 "${time}.pdf" && rm "${time}"_*.jpg
fi
diff --git a/slic3r b/slic3r
index d00a7c4..6683b92 100755
--- a/slic3r
+++ b/slic3r
@@ -5,10 +5,11 @@ gitdir="$HOME/git/Slic3r"
#merged="$HOME/.Slic3r/config.ini.merged"
#truncate -s 0 "$merged"
-TMPDIR="`mktemp -d "/tmp/slic3r.XXXXXX"`"
-locallib="$TMPDIR/local-lib-dir"
+TMPDIR="$(mktemp -d "/tmp/${0##*/}.XXXXXX")"
trap "rm -rf '${TMPDIR}'" EXIT TERM
+locallib="$TMPDIR/local-lib-dir"
+
# I don't want to install the libs
mkdir -p "$locallib"
ln -sr "$gitdir/xs/blib/lib/Slic3r/" "$locallib/Slic3r"
diff --git a/split-kochabo.sh b/split-kochabo.sh
index 94081ec..11c71ec 100755
--- a/split-kochabo.sh
+++ b/split-kochabo.sh
@@ -8,7 +8,7 @@
set -e
-TMPDIR="`mktemp -d "/tmp/${0##*/}.XXXXXX"`"
+TMPDIR="$(mktemp -d "/tmp/${0##*/}.XXXXXX")"
trap "rm -rf '${TMPDIR}'" EXIT TERM
extract_pages() {