Skip to content

Commit

Permalink
Merge pull request #456 from stablestud/autocreate-xfce4-config
Browse files Browse the repository at this point in the history
Automatically create xfce4-terminal config if it does not exist
  • Loading branch information
Mgldvd committed Jul 15, 2024
2 parents 9dc41d5 + 1efa3c0 commit 8315850
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 @@ -956,12 +956,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 8315850

Please sign in to comment.