diff --git a/atom b/atom index 9302fde..ee00357 100755 --- a/atom +++ b/atom @@ -46,8 +46,6 @@ declare -r \ \ oldIFS="$IFS" -cffile="$HOME/.atom/atom.cfg" - LC_ALL=C shopt -s extglob @@ -59,6 +57,15 @@ do source "$function" done +if ! [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" ]] \ +&& [[ -f "$HOME/.atom/atom.cfg" ]] +then + echo "Configuration found in legacy location $HOME/.atom/atom.cfg."\ + "Migrating configuration and data to XDG standard" + xdgMigrate +fi +cffile="${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" + help() { cat <<-EOF Options: @@ -78,7 +85,6 @@ help() { } #parse arguments -OPTERR=0 while getopts ':c:Cl:T:F:f:B:ShDq' opt do case $opt in diff --git a/toys/checkextensions b/toys/checkextensions index 08da0b0..0783b98 100755 --- a/toys/checkextensions +++ b/toys/checkextensions @@ -32,7 +32,6 @@ declare -r \ \ oldIFS="$IFS" -cffile="$HOME/.atom/atom.cfg" LC_ALL=C shopt -s extglob @@ -42,6 +41,15 @@ do source "$function" done +if ! [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" ]] \ +&& [[ -f "$HOME/.atom/atom.cfg" ]] +then + echo "Configuration found in legacy location $HOME/.atom/atom.cfg."\ + "Migrating configuration and data to XDG standard" + xdgMigrate +fi +cffile="${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" + while getopts 'urnD' opt do case $opt in diff --git a/toys/checkgenre b/toys/checkgenre index 616c97e..e2b55d4 100755 --- a/toys/checkgenre +++ b/toys/checkgenre @@ -32,7 +32,6 @@ declare -r \ \ oldIFS="$IFS" -cffile="$HOME/.atom/atom.cfg" LC_ALL=C shopt -s extglob @@ -42,6 +41,15 @@ do source "$function" done +if ! [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" ]] \ +&& [[ -f "$HOME/.atom/atom.cfg" ]] +then + echo "Configuration found in legacy location $HOME/.atom/atom.cfg."\ + "Migrating configuration and data to XDG standard" + xdgMigrate +fi +cffile="${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" + while getopts 'D' opt do case $opt in diff --git a/toys/checkmissing b/toys/checkmissing index 4fb0771..b56ba51 100755 --- a/toys/checkmissing +++ b/toys/checkmissing @@ -32,7 +32,6 @@ declare -r \ \ oldIFS="$IFS" -cffile="$HOME/.atom/atom.cfg" LC_ALL=C shopt -s extglob @@ -42,6 +41,15 @@ do source "$function" done +if ! [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" ]] \ +&& [[ -f "$HOME/.atom/atom.cfg" ]] +then + echo "Configuration found in legacy location $HOME/.atom/atom.cfg."\ + "Migrating configuration and data to XDG standard" + xdgMigrate +fi +cffile="${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" + while getopts 'Dr' opt do case $opt in diff --git a/toys/cleandestinations b/toys/cleandestinations index b5a35e8..0b85453 100755 --- a/toys/cleandestinations +++ b/toys/cleandestinations @@ -32,7 +32,6 @@ declare -r \ \ oldIFS="$IFS" -cffile="$HOME/.atom/atom.cfg" LC_ALL=C shopt -s extglob @@ -42,6 +41,15 @@ do source "$function" done +if ! [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" ]] \ +&& [[ -f "$HOME/.atom/atom.cfg" ]] +then + echo "Configuration found in legacy location $HOME/.atom/atom.cfg."\ + "Migrating configuration and data to XDG standard" + xdgMigrate +fi +cffile="${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" + while getopts 'rD' opt do case $opt in diff --git a/toys/createindex b/toys/createindex index 6a7ddc0..139f9dd 100755 --- a/toys/createindex +++ b/toys/createindex @@ -34,8 +34,6 @@ declare -r \ \ oldIFS="$IFS" -cffile="$HOME/.atom/atom.cfg" - LC_ALL=C shopt -s extglob @@ -47,6 +45,15 @@ do source "$function" done +if ! [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" ]] \ +&& [[ -f "$HOME/.atom/atom.cfg" ]] +then + echo "Configuration found in legacy location $HOME/.atom/atom.cfg."\ + "Migrating configuration and data to XDG standard" + xdgMigrate +fi +cffile="${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" + args="$@" while [ -n "$1" ] do diff --git a/toys/lowquality b/toys/lowquality index 1adfdab..8ba3dd3 100755 --- a/toys/lowquality +++ b/toys/lowquality @@ -32,7 +32,6 @@ declare -r \ \ oldIFS="$IFS" -cffile="$HOME/.atom/atom.cfg" LC_ALL=C shopt -s extglob @@ -42,6 +41,15 @@ do source "$function" done +if ! [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" ]] \ +&& [[ -f "$HOME/.atom/atom.cfg" ]] +then + echo "Configuration found in legacy location $HOME/.atom/atom.cfg."\ + "Migrating configuration and data to XDG standard" + xdgMigrate +fi +cffile="${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" + while getopts 'fm:o:p:*:uD' opt do case $opt in diff --git a/toys/missingtags b/toys/missingtags index 417444a..1fa2efc 100755 --- a/toys/missingtags +++ b/toys/missingtags @@ -33,7 +33,6 @@ declare -r \ \ oldIFS="$IFS" -cffile="$HOME/.atom/atom.cfg" LC_ALL=C shopt -s extglob @@ -43,6 +42,15 @@ do source "$function" done +if ! [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" ]] \ +&& [[ -f "$HOME/.atom/atom.cfg" ]] +then + echo "Configuration found in legacy location $HOME/.atom/atom.cfg."\ + "Migrating configuration and data to XDG standard" + xdgMigrate +fi +cffile="${XDG_CONFIG_HOME:-$HOME/.config}/AtOM/atom.cfg" + while getopts 'AlacdgptnNyuD' opt do case $opt in