packages/gnome-control-center: disable alert chooser structurally with XML editing

This commit is contained in:
Max Headroom 2024-06-29 16:47:23 +02:00
parent caa75fff53
commit ebc0d2d381
2 changed files with 12 additions and 13 deletions

View file

@ -9,7 +9,18 @@ super: rec {
kubo = patch super.kubo "patches/base/ipfs";
gnome-control-center = patch' super.gnome.gnome-control-center;
gnome-control-center = super.gnome.gnome-control-center.overrideAttrs (old: {
postPatch = (old.postPatch or "") + ''
echo disabling alert sound chooser
${super.xmlstarlet}/bin/xmlstarlet edit -L \
-s '//property[@name="title" and text()="_Alert Sound"]/..' -t elem -n propertyAlertSoundVisible -v False \
-s //propertyAlertSoundVisible -t attr -n name -v visible \
-r //propertyAlertSoundVisible -v property \
panels/sound/cc-sound-panel.ui
test "$(${super.xmlstarlet}/bin/xmlstarlet select -t -c '//property[@name="title" and text()="_Alert Sound"]/../property[@name="visible"]/text()' panels/sound/cc-sound-panel.ui)" == "False"
'';
});
libfprint = (patch' super.libfprint).overrideAttrs (old: {
buildInputs = old.buildInputs ++ [

View file

@ -1,12 +0,0 @@
diff --git a/panels/sound/cc-sound-panel.ui b/panels/sound/cc-sound-panel.ui
index 97ae875ec..c679a9e1a 100644
--- a/panels/sound/cc-sound-panel.ui
+++ b/panels/sound/cc-sound-panel.ui
@@ -372,6 +372,7 @@
<object class="AdwActionRow">
<property name="title" translatable="yes">Alert Sound</property>
<property name="activatable">True</property>
+ <property name="visible">False</property>
<accessibility>
<relation name="described-by">alert_sound_label</relation>
</accessibility>