Added flag for generating .xinitrc and .xprofile.

This commit is contained in:
Storm Dragon 2022-11-22 21:17:35 -05:00
parent 882009a092
commit 587496b681

7
i38.sh
View File

@ -128,6 +128,7 @@ fi
# Array of command line arguments # Array of command line arguments
declare -A command=( declare -A command=(
[h]="This help screen." [h]="This help screen."
[x]="Generate ~/.xinitrc and ~/.xprofile."
) )
# Convert the keys of the associative array to a format usable by getopts # Convert the keys of the associative array to a format usable by getopts
@ -136,15 +137,11 @@ args="${args//[[:space:]]/}"
while getopts "${args}" i ; do while getopts "${args}" i ; do
case "$i" in case "$i" in
h) help;; h) help;;
x) write_xinitrc
esac esac
done done
# Create .xinitrc file if requested
if [[ "$1" = "-x" || "$1" = "--xinitrc" ]]; then
write_xinitrc
exit 0
fi
# Make sure rc variable is empty # Make sure rc variable is empty
unset rc unset rc
# Set path for helper scripts. # Set path for helper scripts.