From 2d16fe133875d61d69160f56bfc10ffa6a6d2afb Mon Sep 17 00:00:00 2001 From: shibao Date: Fri, 16 Aug 2024 20:20:17 -0400 Subject: [PATCH] improve scripts --- home/default/scripts/append-urls-to-titles | 25 ---------------------- home/default/scripts/record-screen | 2 +- home/default/scripts/sync-car | 13 +++++------ home/default/scripts/sync-mp3-player | 12 ++++++----- home/default/scripts/system-update | 4 ++-- 5 files changed, 17 insertions(+), 39 deletions(-) delete mode 100755 home/default/scripts/append-urls-to-titles diff --git a/home/default/scripts/append-urls-to-titles b/home/default/scripts/append-urls-to-titles deleted file mode 100755 index 9df291a..0000000 --- a/home/default/scripts/append-urls-to-titles +++ /dev/null @@ -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 diff --git a/home/default/scripts/record-screen b/home/default/scripts/record-screen index 3e55a86..d314f7a 100755 --- a/home/default/scripts/record-screen +++ b/home/default/scripts/record-screen @@ -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 diff --git a/home/default/scripts/sync-car b/home/default/scripts/sync-car index 41ebb2a..a09fe34 100755 --- a/home/default/scripts/sync-car +++ b/home/default/scripts/sync-car @@ -1,15 +1,16 @@ #!/usr/bin/env sh set -eou pipefail -sudo mkdir -p /run/media/default/ -if [[ ! -d /run/media/default/MUSIC ]]; then - echo "mounting /run/media/default/MUSIC" - sudo mkdir /run/media/default/MUSIC - sudo mount -U E6F8-C183 /run/media/default/MUSIC -fi +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 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 diff --git a/home/default/scripts/sync-mp3-player b/home/default/scripts/sync-mp3-player index 5d37df3..31cc04d 100755 --- a/home/default/scripts/sync-mp3-player +++ b/home/default/scripts/sync-mp3-player @@ -1,14 +1,16 @@ #!/usr/bin/env sh set -eou pipefail -if [[ ! -d /run/media/default/MUSIC ]]; then - echo "mounting /run/media/default/MUSIC" - sudo mkdir /run/media/default/MUSIC - sudo mount -U DB09-89C3 /run/media/default/MUSIC -fi +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 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 diff --git a/home/default/scripts/system-update b/home/default/scripts/system-update index 672ea55..8e223b6 100755 --- a/home/default/scripts/system-update +++ b/home/default/scripts/system-update @@ -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