1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 13:32:50 -05:00

theme: fix gtk apply button on empty file

fixes #1280
This commit is contained in:
bbedward
2026-01-05 21:56:50 -05:00
parent 4484f6bd61
commit f762f9ae49

View File

@@ -45,8 +45,12 @@ apply_gtk4_colors() {
exit 1
fi
if [ -f "$gtk_css" ]; then
sed -i '/^@import url.*dank-colors\.css.*);$/d' "$gtk_css"
if [ -f "$gtk_css" ] && grep -q '^@import url.*dank-colors\.css.*);$' "$gtk_css"; then
echo "GTK4 import already exists"
return
fi
if [ -f "$gtk_css" ] && [ -s "$gtk_css" ]; then
sed -i "1i\\$gtk4_import" "$gtk_css"
else
echo "$gtk4_import" >"$gtk_css"