commit d55f8945e1154b18fd97a1c28323b5b58e07da95
parent be8b925921dec7916c8a84d9c619292b5a20ef59
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Fri, 28 Dec 2018 22:30:07 +0100
Add audio cd burn script, write wallpaper to ~/.wallpaper
Diffstat:
2 files changed, 50 insertions(+), 1 deletion(-)
diff --git a/links/bin/burn-audio-cd.sh b/links/bin/burn-audio-cd.sh
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+set -e
+
+# https://wiki.archlinux.org/index.php/Optical_disc_drive#Burning_an_audio_CD
+
+function help {
+ echo "$0 FILES"
+ echo "converts FILES to wav and burns as an audio cd"
+ echo "requires lame, mpg123, faad2, and cdrtools"
+}
+
+drive=/dev/sr0
+
+if [ $# -lt 1 ]; then
+ help
+ exit 1
+fi
+
+if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
+ help
+ exit 0
+fi
+
+# convert to mp3
+for f in "$@"; do
+ extension="${f##*.}"
+ outwav="$(basename "$f" "$extension").wav"
+
+ if [ "$extension" = "mp3" ]; then
+ lame --decode "$f" "$outwav"
+ elif [ "$extension" = "m4a" ]; then
+ faad "$f"
+ fi
+done
+
+# burn wav as audio cd (remove -dummy to really burn)
+cdrecord -dummy -v -pad speed=1 dev="$drive" -dao -swab *.wav
+
+read -p "Really burn to $drive? [y/N] " -n 1 -r
+echo
+if [[ $REPLY =~ ^[Yy]$ ]]; then
+ cdrecord -v -pad speed=1 dev="$drive" -dao -swab *.wav
+else
+ exit 1
+fi
+
+eject "$drive"
+rm *.wav
diff --git a/links/bin/wallpaper.sh b/links/bin/wallpaper.sh
@@ -3,6 +3,7 @@
#hsetroot -full ~/wallpapers/hackingtheloop_1920.jpg # single screen
#hsetroot -fill ~/wallpapers/polygon-art-17498.jpg
#hsetroot -fill ~/photos/wallpapers/current_wallpapers/overdeepenings-Edit-Edit.jpg
+statusfile="$HOME/.wallpaper"
function get_random_wallpaper {
wallpapers=($1/*.{jpg,JPG,jpeg,JPEG,png,PNG,tif,TIF,tiff,TIFF})
@@ -12,7 +13,7 @@ function get_random_wallpaper {
function set_wallpaper {
feh --bg-scale "$1"
- #echo "$1" > $statusfile # written to ~/.fehbg
+ echo "$1" > $statusfile # written to ~/.fehbg
}
dir="$HOME/photos/wallpapers/google_earth/"