Commit eb3dc8ed authored by Roman Alifanov's avatar Roman Alifanov

fixed configs priority

parent d5fd621b
......@@ -7,7 +7,7 @@ CONFIG_FILE="/etc/ximper-unified-theme-switcher/themes"
HOME_CONFIG_DIR="$HOME/.config/ximper-unified-theme-switcher"
HOME_CONFIG_FILE="$HOME_CONFIG_DIR/themes"
# Функция для создания конфига в домашнем каталоге
# Функция для создания конфига в домашнем каталоге (TODO: перенести в GUI)
create_home_config() {
mkdir -p "$HOME_CONFIG_DIR"
touch "$HOME_CONFIG_FILE"
......@@ -17,14 +17,15 @@ create_home_config() {
cfg_check() {
# Проверка наличия конфига в /etc
if [ -f "$CONFIG_FILE" ]; then
echo "$CONFIG_FILE"
else
# Если нет конфига в /etc, ищем в домашнем каталоге
if [ -f "$HOME_CONFIG_FILE" ]; then
echo "$HOME_CONFIG_FILE"
else
create_home_config
echo "$CONFIG_FILE"
fi
elif [ -f "$HOME_CONFIG_FILE" ]; then
echo "$HOME_CONFIG_FILE"
else
create_home_config
fi
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment