Skip to content

Commit

Permalink
Automatically create xfce4-terminal config if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
stablestud committed Jul 15, 2024
1 parent 75675b7 commit 1efa3c0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions apply-colors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -930,12 +930,12 @@ apply_xfce4-terminal() {
CONFFILE="${HOME}/.config/xfce4/terminal/terminalrc"

if [[ ! (-w "${CONFFILE}") ]]; then
if [[ -r "${XDG_CONFIG_DIRS%%:*}/Terminal/terminalrc" ]]; then
cp "${XDG_CONFIG_DIRS%%:*}/Terminal/terminalrc" ${CONFFILE}
else
printserr "ERROR: config file not present or not writable!"
exit 1
fi
if [[ -r "${XDG_CONFIG_DIRS%%:*}/Terminal/terminalrc" ]]; then
cp "${XDG_CONFIG_DIRS%%:*}/Terminal/terminalrc" ${CONFFILE}
else
[[ -d "$(dirname "${CONFFILE}")" ]] || mkdir --parents "$(dirname "${CONFFILE}")"
touch "${CONFFILE}" || { printserr "Error: xfce4-terminal config file not writeable: ${CONFFILE}"; exit 1; }
fi
fi

[[ -d "${SCHEMEDIR}" ]] || mkdir -p "${SCHEMEDIR}"
Expand Down

0 comments on commit 1efa3c0

Please sign in to comment.