improve scripts

This commit is contained in:
shibao 2024-08-16 20:20:17 -04:00
parent b555b50451
commit 2d16fe1338
5 changed files with 17 additions and 39 deletions

View File

@ -1,25 +0,0 @@
#!/usr/bin/env sh
set -eou pipefail
# Old script to get json url for some reason? Don't know why I did this
# youtube-dl -j --flat-playlist -a - | \
# jq -r '.id' | \
# sed 's_^_https://youtu.be/_' | \
# wget-titles-from-urls >> titles.txt
test -f append.txt
if [[ $? -ne 0 ]]; then
echo No append.txt found! Cannot append
exit
fi
if [[ ! -s append.txt ]]; then
echo append.txt is empty
exit
fi
cat append.txt | wget-titles-from-urls >> titles.txt
cat append.txt | youtube-audio
> append.txt
standardize-music

View File

@ -2,5 +2,5 @@
# record video
dir=~/Downloads/temp
(cd $dir && wf-recorder -g "$(slurp)" --audio --file=$(date +%Y-%m-%d_%H-%m-%s).mp4)
(cd $dir && wf-recorder -g "$(slurp)" -a alsa_output.pci-0000_0b_00.4.analog-stereo.monitor --file=$(date +%Y-%m-%d_%H-%m-%s).mp4)
xdg-open $dir

View File

@ -1,15 +1,16 @@
#!/usr/bin/env sh
set -eou pipefail
sudo mkdir -p /run/media/default/
if [[ ! -d /run/media/default/MUSIC ]]; then
sudo mkdir -p /run/media/default
echo "mounting /run/media/default/MUSIC"
sudo fsck -fy /dev/disk/by-uuid/E6F8-C183 || true
sudo mkdir /run/media/default/MUSIC
sudo mount -U E6F8-C183 /run/media/default/MUSIC
fi
echo "syncing music..."
sudo rsync --info=progress2 -W -r --delete ~/Music/* /run/media/default/MUSIC/
sudo sync /run/media/default/MUSIC/
cd /run/media/default/MUSIC
sudo generate-playlists

View File

@ -1,14 +1,16 @@
#!/usr/bin/env sh
set -eou pipefail
if [[ ! -d /run/media/default/MUSIC ]]; then
sudo mkdir -p /run/media/default
echo "mounting /run/media/default/MUSIC"
sudo fsck -fy /dev/disk/by-uuid/DB09-89C3
sudo mkdir /run/media/default/MUSIC
sudo mount -U DB09-89C3 /run/media/default/MUSIC
fi
echo "syncing music..."
sudo rsync --info=progress2 -W -r --delete ~/Music/* /run/media/default/MUSIC/
sudo sync /run/media/default/MUSIC/
cd /run/media/default/MUSIC
sudo generate-playlists

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -eoux pipefail
system-prune-space
system-free-space
yay --noconfirm -Syu --overwrite \*
system-prune-space
system-free-space