From e11cf9e5230ecf58a19c65c39a65a27a5b1688ed Mon Sep 17 00:00:00 2001 From: Anjandev Momi Date: Sun, 8 Nov 2020 15:12:47 -0500 Subject: [PATCH] move sxmo data to XDG_DATA_HOME Breaking change. Make sure you send an email to the mailing list telling users to move their $XDG_CONFIG_HOME/{modem,notifications} files/folders to $XDG_DATA_HOME Signed-off-by: Anjandev Momi --- scripts/appscripts/sxmo_record.sh | 2 +- scripts/core/sxmo_appmenu.sh | 2 +- scripts/core/sxmo_contacts.sh | 2 +- scripts/core/sxmo_statusbar.sh | 2 +- scripts/modem/sxmo_modemcall.sh | 4 ++-- scripts/modem/sxmo_modemlog.sh | 2 +- scripts/modem/sxmo_modemmonitor.sh | 4 ++-- scripts/modem/sxmo_modemsendsms.sh | 2 +- scripts/modem/sxmo_modemtext.sh | 4 ++-- scripts/notifications/sxmo_notificationmonitor.sh | 2 +- scripts/notifications/sxmo_notificationsmenu.sh | 2 +- scripts/notifications/sxmo_notificationwrite.sh | 4 ++-- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/appscripts/sxmo_record.sh b/scripts/appscripts/sxmo_record.sh index 956d016..185b584 100755 --- a/scripts/appscripts/sxmo_record.sh +++ b/scripts/appscripts/sxmo_record.sh @@ -1,5 +1,5 @@ #!/usr/bin/env sh -[ -z "$SXMO_RECDIR" ] && SXMO_RECDIR=~/Recordings +[ -z "$SXMO_RECDIR" ] && SXMO_RECDIR="$XDG_DATA_HOME"/sxmo/recordings mkdir -p "$SXMO_RECDIR" getdur() { diff --git a/scripts/core/sxmo_appmenu.sh b/scripts/core/sxmo_appmenu.sh index afa99fb..b66aac1 100755 --- a/scripts/core/sxmo_appmenu.sh +++ b/scripts/core/sxmo_appmenu.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh trap gracefulexit INT TERM WIN=$(xdotool getwindowfocus) -NOTIFDIR="$XDG_CONFIG_HOME"/sxmo/notifications +NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications gracefulexit() { echo "Gracefully exiting $0" diff --git a/scripts/core/sxmo_contacts.sh b/scripts/core/sxmo_contacts.sh index e2c26d4..471c2c9 100755 --- a/scripts/core/sxmo_contacts.sh +++ b/scripts/core/sxmo_contacts.sh @@ -9,7 +9,7 @@ # Prints in output format: "number: contact" CONTACTSFILE="$XDG_CONFIG_HOME"/sxmo/contacts.tsv -LOGFILE="$XDG_CONFIG_HOME"/sxmo/modem/modemlog.tsv +LOGFILE="$XDG_DATA_HOME"/sxmo/modem/modemlog.tsv contacts() { grep -q . "$CONTACTSFILE" || echo " " > "$CONTACTSFILE" diff --git a/scripts/core/sxmo_statusbar.sh b/scripts/core/sxmo_statusbar.sh index 55c9200..240aefc 100755 --- a/scripts/core/sxmo_statusbar.sh +++ b/scripts/core/sxmo_statusbar.sh @@ -8,7 +8,7 @@ update() { if pgrep -f sxmo_modemcall.sh; then NOWS="$(date +"%s")" CALLSTARTS="$(date +"%s" -d "$( - grep -aE 'call_start|call_pickup' "$XDG_CONFIG_HOME"/sxmo/modem/modemlog.tsv | + grep -aE 'call_start|call_pickup' "$XDG_DATA_HOME"/sxmo/modem/modemlog.tsv | tail -n1 | cut -f1 )")" diff --git a/scripts/modem/sxmo_modemcall.sh b/scripts/modem/sxmo_modemcall.sh index b56e6ed..ba1b6b5 100755 --- a/scripts/modem/sxmo_modemcall.sh +++ b/scripts/modem/sxmo_modemcall.sh @@ -1,5 +1,5 @@ #!/usr/bin/env sh -LOGDIR="$XDG_CONFIG_HOME"/sxmo/modem +LOGDIR="$XDG_DATA_HOME"/sxmo/modem trap "gracefulexit" INT TERM modem_n() { @@ -199,4 +199,4 @@ pickup() { } modem_n || fatalerr "Couldn't determine modem number - is modem online?" -"$@" \ No newline at end of file +"$@" diff --git a/scripts/modem/sxmo_modemlog.sh b/scripts/modem/sxmo_modemlog.sh index ff44c69..8205939 100755 --- a/scripts/modem/sxmo_modemlog.sh +++ b/scripts/modem/sxmo_modemlog.sh @@ -1,3 +1,3 @@ #!/usr/bin/env sh -LOGDIR="$XDG_CONFIG_HOME"/sxmo/modem +LOGDIR="$XDG_DATA_HOME"/sxmo/modem st -f "Terminus-14" -e tail -n9999 -f "$LOGDIR"/modemlog.tsv diff --git a/scripts/modem/sxmo_modemmonitor.sh b/scripts/modem/sxmo_modemmonitor.sh index a2d21cd..7397a2b 100755 --- a/scripts/modem/sxmo_modemmonitor.sh +++ b/scripts/modem/sxmo_modemmonitor.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -LOGDIR="$XDG_CONFIG_HOME"/sxmo/modem -NOTIFDIR="$XDG_CONFIG_HOME"/sxmo/notifications +LOGDIR="$XDG_DATA_HOME"/sxmo/modem +NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications trap "gracefulexit" INT TERM err() { diff --git a/scripts/modem/sxmo_modemsendsms.sh b/scripts/modem/sxmo_modemsendsms.sh index 7b1296d..32d2d9c 100755 --- a/scripts/modem/sxmo_modemsendsms.sh +++ b/scripts/modem/sxmo_modemsendsms.sh @@ -1,5 +1,5 @@ #!/usr/bin/env sh -LOGDIR="$XDG_CONFIG_HOME"/sxmo/modem +LOGDIR="$XDG_DATA_HOME"/sxmo/modem info() { echo "$1" > /dev/stderr diff --git a/scripts/modem/sxmo_modemtext.sh b/scripts/modem/sxmo_modemtext.sh index 75bc934..8fbe460 100755 --- a/scripts/modem/sxmo_modemtext.sh +++ b/scripts/modem/sxmo_modemtext.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh -LOGDIR="$XDG_CONFIG_HOME"/sxmo/modem +LOGDIR="$XDG_DATA_HOME"/sxmo/modem TERMMODE=$([ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && echo "true") -DRAFT_DIR="$XDG_CONFIG_HOME/sxmo/modem/draft" +DRAFT_DIR="$XDG_DATA_HOME/sxmo/modem/draft" menu() { if [ "$TERMMODE" != "true" ]; then diff --git a/scripts/notifications/sxmo_notificationmonitor.sh b/scripts/notifications/sxmo_notificationmonitor.sh index 2bc378b..7a0bf55 100755 --- a/scripts/notifications/sxmo_notificationmonitor.sh +++ b/scripts/notifications/sxmo_notificationmonitor.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh trap gracefulexit INT TERM -NOTIFDIR="$XDG_CONFIG_HOME"/sxmo/notifications +NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications gracefulexit() { echo "Gracefully exiting $0" diff --git a/scripts/notifications/sxmo_notificationsmenu.sh b/scripts/notifications/sxmo_notificationsmenu.sh index f635632..dff161a 100755 --- a/scripts/notifications/sxmo_notificationsmenu.sh +++ b/scripts/notifications/sxmo_notificationsmenu.sh @@ -1,5 +1,5 @@ #!/usr/bin/env sh -NOTIFDIR="$XDG_CONFIG_HOME"/sxmo/notifications +NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications notificationmenu() { CHOICES="Close Menu\nClear Notifications" diff --git a/scripts/notifications/sxmo_notificationwrite.sh b/scripts/notifications/sxmo_notificationwrite.sh index f662596..62f05f9 100755 --- a/scripts/notifications/sxmo_notificationwrite.sh +++ b/scripts/notifications/sxmo_notificationwrite.sh @@ -1,5 +1,5 @@ #!/usr/bin/env sh -NOTIFDIR="$XDG_CONFIG_HOME"/sxmo/notifications +NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications # Takes 4 args: # (1) the filepath of the notification to write (or random to generate a random id) @@ -22,4 +22,4 @@ writenotification() { } [ "$#" -lt 4 ] && echo "Need >=4 args to create a notification" && exit 1 -writenotification \ No newline at end of file +writenotification