Added -X to create just .xprofile, -x still generates both.

This commit is contained in:
Storm Dragon 2022-11-27 12:47:35 -05:00
parent f0fba65cec
commit f4f191014a

13
i38.sh
View File

@ -69,10 +69,7 @@ help() {
write_xinitrc() write_xinitrc()
{ {
if [[ -f "$HOME/.xinitrc" ]]; then if [[ -f "$HOME/.xinitrc" ]]; then
continue="$(yesno "This will overwrite your existing $HOME/.xinitrc file. Do you want to continue?")" yesno "This will overwrite your existing $HOME/.xinitrc file. Do you want to continue?" || exit 0
if [ "$continue" = "no" ]; then
exit 0
fi
fi fi
cat << 'EOF' > ~/.xinitrc cat << 'EOF' > ~/.xinitrc
#!/bin/sh #!/bin/sh
@ -99,6 +96,9 @@ export DBUS_SESSION_BUS_ADDRESS
exec i3 exec i3
EOF EOF
}
write_xprofile() {
if [[ -f "$HOME/.xprofile" ]]; then if [[ -f "$HOME/.xprofile" ]]; then
continue="$(yesno "Would you like to add accessibility variables to your $HOME/.xprofile? Without these, accessibility will be limited or may not work at all. Do you want to continue?")" continue="$(yesno "Would you like to add accessibility variables to your $HOME/.xprofile? Without these, accessibility will be limited or may not work at all. Do you want to continue?")"
if [ "$continue" = "no" ]; then if [ "$continue" = "no" ]; then
@ -114,6 +114,7 @@ export QT_ACCESSIBILITY=1
export QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1 export QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
export SAL_USE_VCLPLUGIN=gtk3 export SAL_USE_VCLPLUGIN=gtk3
EOF EOF
exit 0
} }
update_scripts() { update_scripts() {
@ -127,6 +128,7 @@ declare -A command=(
[h]="This help screen." [h]="This help screen."
[u]="Copy over the latest version of scripts." [u]="Copy over the latest version of scripts."
[x]="Generate ~/.xinitrc and ~/.xprofile." [x]="Generate ~/.xinitrc and ~/.xprofile."
[X]="Generate ~/.xprofile only."
) )
# 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,7 +138,8 @@ while getopts "${args}" i ; do
case "$i" in case "$i" in
h) help;; h) help;;
u) update_scripts;; u) update_scripts;;
x) write_xinitrc x) write_xinitrc ;&
X) write_xprofile ;;
esac esac
done done