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 <anjan@momi.ca>
			
			
This commit is contained in:
		
							parent
							
								
									65f18565f1
								
							
						
					
					
						commit
						e11cf9e523
					
				
					 12 changed files with 16 additions and 16 deletions
				
			
		| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
#!/usr/bin/env sh
 | 
					#!/usr/bin/env sh
 | 
				
			||||||
[ -z "$SXMO_RECDIR" ] && SXMO_RECDIR=~/Recordings
 | 
					[ -z "$SXMO_RECDIR" ] && SXMO_RECDIR="$XDG_DATA_HOME"/sxmo/recordings
 | 
				
			||||||
mkdir -p "$SXMO_RECDIR"
 | 
					mkdir -p "$SXMO_RECDIR"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
getdur() {
 | 
					getdur() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#!/usr/bin/env sh
 | 
					#!/usr/bin/env sh
 | 
				
			||||||
trap gracefulexit INT TERM
 | 
					trap gracefulexit INT TERM
 | 
				
			||||||
WIN=$(xdotool getwindowfocus)
 | 
					WIN=$(xdotool getwindowfocus)
 | 
				
			||||||
NOTIFDIR="$XDG_CONFIG_HOME"/sxmo/notifications
 | 
					NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications
 | 
				
			||||||
 | 
					
 | 
				
			||||||
gracefulexit() {
 | 
					gracefulexit() {
 | 
				
			||||||
	echo "Gracefully exiting $0"
 | 
						echo "Gracefully exiting $0"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,7 +9,7 @@
 | 
				
			||||||
# Prints in output format: "number: contact"
 | 
					# Prints in output format: "number: contact"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CONTACTSFILE="$XDG_CONFIG_HOME"/sxmo/contacts.tsv
 | 
					CONTACTSFILE="$XDG_CONFIG_HOME"/sxmo/contacts.tsv
 | 
				
			||||||
LOGFILE="$XDG_CONFIG_HOME"/sxmo/modem/modemlog.tsv
 | 
					LOGFILE="$XDG_DATA_HOME"/sxmo/modem/modemlog.tsv
 | 
				
			||||||
 | 
					
 | 
				
			||||||
contacts() {
 | 
					contacts() {
 | 
				
			||||||
	grep -q . "$CONTACTSFILE" || echo " " > "$CONTACTSFILE"
 | 
						grep -q . "$CONTACTSFILE" || echo " " > "$CONTACTSFILE"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,7 +8,7 @@ update() {
 | 
				
			||||||
	if pgrep -f sxmo_modemcall.sh; then
 | 
						if pgrep -f sxmo_modemcall.sh; then
 | 
				
			||||||
		NOWS="$(date +"%s")"
 | 
							NOWS="$(date +"%s")"
 | 
				
			||||||
		CALLSTARTS="$(date +"%s" -d "$(
 | 
							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 |
 | 
								tail -n1 |
 | 
				
			||||||
			cut -f1
 | 
								cut -f1
 | 
				
			||||||
		)")"
 | 
							)")"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
#!/usr/bin/env sh
 | 
					#!/usr/bin/env sh
 | 
				
			||||||
LOGDIR="$XDG_CONFIG_HOME"/sxmo/modem
 | 
					LOGDIR="$XDG_DATA_HOME"/sxmo/modem
 | 
				
			||||||
trap "gracefulexit" INT TERM
 | 
					trap "gracefulexit" INT TERM
 | 
				
			||||||
 | 
					
 | 
				
			||||||
modem_n() {
 | 
					modem_n() {
 | 
				
			||||||
| 
						 | 
					@ -199,4 +199,4 @@ pickup() {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
modem_n || fatalerr "Couldn't determine modem number - is modem online?"
 | 
					modem_n || fatalerr "Couldn't determine modem number - is modem online?"
 | 
				
			||||||
"$@"
 | 
					"$@"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,3 @@
 | 
				
			||||||
#!/usr/bin/env sh
 | 
					#!/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
 | 
					st -f "Terminus-14" -e tail -n9999 -f "$LOGDIR"/modemlog.tsv
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
#!/usr/bin/env sh
 | 
					#!/usr/bin/env sh
 | 
				
			||||||
LOGDIR="$XDG_CONFIG_HOME"/sxmo/modem
 | 
					LOGDIR="$XDG_DATA_HOME"/sxmo/modem
 | 
				
			||||||
NOTIFDIR="$XDG_CONFIG_HOME"/sxmo/notifications
 | 
					NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications
 | 
				
			||||||
trap "gracefulexit" INT TERM
 | 
					trap "gracefulexit" INT TERM
 | 
				
			||||||
 | 
					
 | 
				
			||||||
err() {
 | 
					err() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
#!/usr/bin/env sh
 | 
					#!/usr/bin/env sh
 | 
				
			||||||
LOGDIR="$XDG_CONFIG_HOME"/sxmo/modem
 | 
					LOGDIR="$XDG_DATA_HOME"/sxmo/modem
 | 
				
			||||||
 | 
					
 | 
				
			||||||
info() {
 | 
					info() {
 | 
				
			||||||
	echo "$1" > /dev/stderr
 | 
						echo "$1" > /dev/stderr
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#!/usr/bin/env sh
 | 
					#!/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")
 | 
					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() {
 | 
					menu() {
 | 
				
			||||||
	if [ "$TERMMODE" != "true" ]; then
 | 
						if [ "$TERMMODE" != "true" ]; then
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
#!/usr/bin/env sh
 | 
					#!/usr/bin/env sh
 | 
				
			||||||
trap gracefulexit INT TERM
 | 
					trap gracefulexit INT TERM
 | 
				
			||||||
NOTIFDIR="$XDG_CONFIG_HOME"/sxmo/notifications
 | 
					NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications
 | 
				
			||||||
 | 
					
 | 
				
			||||||
gracefulexit() {
 | 
					gracefulexit() {
 | 
				
			||||||
	echo "Gracefully exiting $0"
 | 
						echo "Gracefully exiting $0"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
#!/usr/bin/env sh
 | 
					#!/usr/bin/env sh
 | 
				
			||||||
NOTIFDIR="$XDG_CONFIG_HOME"/sxmo/notifications
 | 
					NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications
 | 
				
			||||||
 | 
					
 | 
				
			||||||
notificationmenu() {
 | 
					notificationmenu() {
 | 
				
			||||||
	CHOICES="Close Menu\nClear Notifications"
 | 
						CHOICES="Close Menu\nClear Notifications"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
#!/usr/bin/env sh
 | 
					#!/usr/bin/env sh
 | 
				
			||||||
NOTIFDIR="$XDG_CONFIG_HOME"/sxmo/notifications
 | 
					NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Takes 4 args:
 | 
					# Takes 4 args:
 | 
				
			||||||
# (1) the filepath of the notification to write (or random to generate a random id)
 | 
					# (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
 | 
					[ "$#" -lt 4 ] && echo "Need >=4 args to create a notification" && exit 1
 | 
				
			||||||
writenotification
 | 
					writenotification
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue