mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-08 06:28:27 -04:00
matugen: only write accent-color if changed
This commit is contained in:
@@ -1056,6 +1056,9 @@ func closestAdwaitaAccent(primaryHex string) string {
|
|||||||
|
|
||||||
func syncAccentColor(primaryHex string) {
|
func syncAccentColor(primaryHex string) {
|
||||||
accent := closestAdwaitaAccent(primaryHex)
|
accent := closestAdwaitaAccent(primaryHex)
|
||||||
|
if cur, err := utils.GsettingsGet("org.gnome.desktop.interface", "accent-color"); err == nil && strings.Trim(cur, "'") == accent {
|
||||||
|
return
|
||||||
|
}
|
||||||
log.Infof("Setting GNOME accent color: %s", accent)
|
log.Infof("Setting GNOME accent color: %s", accent)
|
||||||
if err := utils.GsettingsSet("org.gnome.desktop.interface", "accent-color", accent); err != nil {
|
if err := utils.GsettingsSet("org.gnome.desktop.interface", "accent-color", accent); err != nil {
|
||||||
log.Warnf("Failed to set accent-color: %v", err)
|
log.Warnf("Failed to set accent-color: %v", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user