Skip to content

Commit 045e583

Browse files
committed
sddm stuff
1 parent 39879fc commit 045e583

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Scripts/Manage-Sddm

+8-8
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ check_user_sddm_theme_writable() {
2020
return 1
2121
}
2222
fi
23-
23+
2424
# Make the file writable by all users
2525
SUPER chmod 666 "${user_sddm_theme}" || {
2626
print_prompt -r "Failed to change permissions of ${user_sddm_theme}"
2727
return 1
2828
}
29-
29+
3030
print_prompt -y "Made ${user_sddm_theme} writable by all users"
3131
print_prompt -g "Successfully made ${user_sddm_theme} writable by user"
3232
fi
@@ -165,10 +165,10 @@ sddm_unset() {
165165

166166
if [ -f "${user_sddm_theme}" ]; then
167167
# Check if the file is empty or has only whitespace
168-
if [ -s "${user_sddm_theme}" ] && [ "$(tr -d '[:space:]' < "${user_sddm_theme}" | wc -c)" -ne 0 ]; then
168+
if [ -s "${user_sddm_theme}" ] && [ "$(tr -d '[:space:]' <"${user_sddm_theme}" | wc -c)" -ne 0 ]; then
169169
# File exists and is not empty
170-
line_count=$(wc -l < "${user_sddm_theme}")
171-
: > "${user_sddm_theme}"
170+
line_count=$(wc -l <"${user_sddm_theme}")
171+
: >"${user_sddm_theme}"
172172
print_prompt -g "[success] " "User's SDDM theme configuration has been cleared (${line_count} lines removed)"
173173
else
174174
# File exists but is already empty
@@ -182,11 +182,11 @@ sddm_unset() {
182182
}
183183

184184
sddm_info() {
185-
output=$(find /etc/sddm.conf.d/ -type f -name "*.conf" -exec grep -H "Current" {} \; | tail -n 1)
186-
theme=$(awk -F ':Current=' '{print $2}' <<<${output})
185+
output=$(find /etc/sddm.conf.d/ -type f -name "*.conf" -exec grep -H "Current" {} \; | sort | tail -n 1)
186+
theme=$(awk -F ':Current=' '{print $2}' <<<"${output}")
187187
cat <<STAT
188188
Current theme: ${theme}
189-
Theme directory: $(awk -F ':Current=' '{print $1}' <<<${output})
189+
Theme directory: $(awk -F ':Current=' '{print $1}' <<<"${output}")
190190
Available themes:
191191
$(find "${sddm_theme_dir}" -maxdepth 2 -name "theme.conf" -exec dirname {} \; | awk -F "${sddm_theme_dir}/" '{print $2}')
192192

0 commit comments

Comments
 (0)