diff options
author | Mike Crute <mike@crute.us> | 2020-03-24 00:12:18 -0700 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2020-03-24 00:12:46 -0700 |
commit | 469e75c60a831f600def48b647ecf9cc58883fab (patch) | |
tree | a8089141872fe2f09b7190802cb3ea4452bf603d /bin | |
parent | 0983e3db4567b9cf9d38624a6d47c5c5796b97c7 (diff) | |
download | dotfiles-469e75c60a831f600def48b647ecf9cc58883fab.tar.bz2 dotfiles-469e75c60a831f600def48b647ecf9cc58883fab.tar.xz dotfiles-469e75c60a831f600def48b647ecf9cc58883fab.zip |
bin: add a few little scripts
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/HandBrake | 5 | ||||
-rwxr-xr-x | bin/optimize-images.sh | 21 | ||||
-rwxr-xr-x | bin/wakeup_cd.sh | 2 |
3 files changed, 28 insertions, 0 deletions
diff --git a/bin/HandBrake b/bin/HandBrake new file mode 100755 index 0000000..abb42e7 --- /dev/null +++ b/bin/HandBrake | |||
@@ -0,0 +1,5 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | export LD_LIBRARY_PATH=/lib64:/home/mcrute/.local/lib | ||
4 | |||
5 | exec /bin/ghb | ||
diff --git a/bin/optimize-images.sh b/bin/optimize-images.sh new file mode 100755 index 0000000..1cb37d7 --- /dev/null +++ b/bin/optimize-images.sh | |||
@@ -0,0 +1,21 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | for filename in $(find $1 -type f); do | ||
4 | kind="$(file -b "$filename" | cut -d, -f1)" | ||
5 | |||
6 | case "$kind" in | ||
7 | JPEG*) | ||
8 | jpegtran -optimize -progressive -copy none -outfile "$filename" "$filename" | ||
9 | ;; | ||
10 | PNG*) | ||
11 | optipng -o7 "$filename" | ||
12 | ;; | ||
13 | SVG*) | ||
14 | sed -e '/^<?xml/d' "$filename" | sed -E -e 's/^\s+//' | sed -e ':a;N;$!ba;s/\n//g' > "$filename.tmp" | ||
15 | mv "$filename.tmp" "$filename" | ||
16 | ;; | ||
17 | *) | ||
18 | echo "Unknown: $filename" | ||
19 | ;; | ||
20 | esac | ||
21 | done | ||
diff --git a/bin/wakeup_cd.sh b/bin/wakeup_cd.sh new file mode 100755 index 0000000..c3ff0c7 --- /dev/null +++ b/bin/wakeup_cd.sh | |||
@@ -0,0 +1,2 @@ | |||
1 | #!/bin/bash | ||
2 | sg_raw /dev/sr0 EA 00 00 00 00 00 01 | ||