use HOME variable

This commit is contained in:
thomasabishop 2025-02-22 14:12:25 +00:00
parent d8e62a632d
commit f049e72130
4 changed files with 12 additions and 10 deletions

View file

@ -5,13 +5,13 @@
# Parameters # Parameters
# --- $1 = Time schedule ('hourly' | 'daily' | 'weekly' | 'monthly') # --- $1 = Time schedule ('hourly' | 'daily' | 'weekly' | 'monthly')
USER=thomas #USER=thomas
export XDG_RUNTIME_DIR=/run/user/1000 #export XDG_RUNTIME_DIR=/run/user/1000
source /home/thomas/.env #source /home/thomas/.env
SCHEDULE=$1 SCHEDULE=$1
THIS_FILE=${0} THIS_FILE=${0}
SLACK_NOTIFIER="/home/thomas/repos/utilities/slack_notifier.sh" SLACK_NOTIFIER="${HOME}/repos/utilities/slack_notifier.sh"
if mountpoint -q /media/samsung-T3; then if mountpoint -q /media/samsung-T3; then
ERROR=$(sudo /usr/bin/rsnapshot -c /etc/rsnapshot.conf hourly 2>&1) ERROR=$(sudo /usr/bin/rsnapshot -c /etc/rsnapshot.conf hourly 2>&1)

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
THIS_FILE=${0} THIS_FILE=${0}
SLACK_NOTIFIER="/home/thomas/repos/utilities/slack_notifier.sh" SLACK_NOTIFIER="${HOME}/repos/utilities/slack_notifier.sh"
FILE_NAME=$(date +%Y-%m-%d_%H:%M:%S-%Z) FILE_NAME=$(date +%Y-%m-%d_%H:%M:%S-%Z)
BAK=$(ls -dt "/media/crucial/music/"*"music_lib_bak"* | head -n 1) BAK=$(ls -dt "/media/crucial/music/"*"music_lib_bak"* | head -n 1)
TEMP="/media/crucial/music/temp" TEMP="/media/crucial/music/temp"

View file

@ -4,11 +4,13 @@ BLUE='\033[0;34m'
NO_COLOR='\033[0m' NO_COLOR='\033[0m'
echo -e "${BLUE}INFO Syncing music library to DAP SD card...${NO_COLOR}" echo -e "${BLUE}INFO Syncing music library to DAP SD card...${NO_COLOR}"
/home/thomas/repos/utilities/music_sync/transfer_to_DAP.sh "${HOME}/repos/utilities/music_sync/transfer_to_DAP.sh"
sleep 3 sleep 3
echo -e "${BLUE}INFO Backing up music library to additional external drive...${NO_COLOR}" echo -e "${BLUE}INFO Backing up music library to additional external drive...${NO_COLOR}"
/home/thomas/repos/utilities/music_sync/backup_music_library.sh "${HOME}/repos/utilities/music_sync/backup_music_library.sh"
# /home/thomas/repos/utilities/music_sync/backup_music_library.sh
echo -e "${BLUE}INFO Backup completed...${NO_COLOR}" echo -e "${BLUE}INFO Backup completed...${NO_COLOR}"

View file

@ -63,7 +63,7 @@ ERROR_BLOCKS=$(
) )
# Initialise sound playback # Initialise sound playback
mpv --volume=0 --start=0 --length=0.1 /home/thomas/dotfiles/gruvbox-95/sounds/st-computer-on.mp3 mpv --volume=0 --start=0 --length=0.1 "${HOME}/dotfiles/gruvbox-95/sounds/st-computer-on.mp3"
sleep 1 sleep 1
# Process notification # Process notification
@ -72,11 +72,11 @@ if [ "$2" != "error" ]; then
-H 'Content-type: application/json' \ -H 'Content-type: application/json' \
--data '{"text":"🟢 '"$3"'"}' \ --data '{"text":"🟢 '"$3"'"}' \
"$WEBHOOK" "$WEBHOOK"
mpv --volume=100 /home/thomas/dotfiles/sounds/star-trek-computer-success.mp3 mpv --volume=100 "${HOME}/dotfiles/sounds/star-trek-computer-success.mp3"
else else
curl -X POST \ curl -X POST \
-H 'Content-type: application/json' \ -H 'Content-type: application/json' \
--json "$ERROR_BLOCKS" \ --json "$ERROR_BLOCKS" \
"$WEBHOOK" "$WEBHOOK"
mpv --volume=100 /home/thomas/dotfiles/sounds/star-trek-computer-error.mp3 mpv --volume=100 "${HOME}/dotfiles/sounds/star-trek-computer-error.mp3"
fi fi