Skip to content

Commit

Permalink
fix: give error message when no kde_setting is detected
Browse files Browse the repository at this point in the history
  • Loading branch information
kRHYME7 committed Jul 19, 2024
1 parent 217ef11 commit a89dc96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Scripts/Manage-Sddm
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ sddm_exec_seleted() {
[[ -d "$(dirname ${sddm_conf})" ]] || SUPER mkdir -p "$(dirname ${sddm_conf})"
[[ -f "${sddm_conf}" ]] && cp -fr "${sddm_conf}" "$(dirname "${sddm_conf}")/kde_settings.t2.bkp"
# cp "${sddm_theme_conf}" "$(dirname "${sddm_conf}")"
cp "${sddm_theme_conf}" "${sddm_conf}" && print_prompt -y "[ok] " "Sddm theme set"
cp -fr "${sddm_theme_conf}" "${sddm_conf}" && print_prompt -y "[ok] " "Sddm theme set"
}

sddm_list_local() {
declare -A sddm_themes
output=$(find "${sddm_theme_dir}" -name "kde_settings.conf" -exec grep -H "Current" {} \;)
[[ -z "${output}" ]] && print_prompt -crit "[error] " "No settings detected.Do themes have 'kde_settings.conf' declared? " && exit 1

# Populate the associative array
while IFS=':' read -r path theme_name; do
Expand All @@ -58,7 +59,7 @@ sddm_set_local() {

declare -A sddm_themes
output=$(find "${sddm_theme_dir}" -name "kde_settings.conf" -exec grep -H "Current" {} \;)

[[ -z "${output}" ]] && print_prompt -crit "[error] " "No settings detected.Do themes have 'kde_settings.conf' declared? " && exit 1
# Populate the associative array
while IFS=':' read -r path theme_name; do
# Remove "Current=" from the theme_name
Expand Down Expand Up @@ -96,7 +97,6 @@ sddm_set_local() {
if [ ! -w "$(dirname ${sddm_conf})" ] || [ ! -w "${sddm_conf}" ]; then
NOTIFY -a " HyDE-cli " "Run 'sudo chmod -R a+wr $(dirname ${sddm_conf})' to set the permissions one time"
print_prompt -c "[note] " "Run 'sudo chmod -R a+wr $(dirname ${sddm_conf})' to set the permissions one time"

pkexec bash -c ". ${CLI_PATH}/lib/hyde-cli/Package-Manager ;. ${CLI_PATH}/lib/hyde-cli/Manage-Sddm;sddm_exec_seleted ${sddm_theme_conf}" || exit 1
else
sddm_exec_seleted "${sddm_theme_conf}"
Expand Down

0 comments on commit a89dc96

Please sign in to comment.