1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-31 04:04:45 +00:00

controlcenter: fix descriptions and add deprecation warnings

This commit is contained in:
iamanaws 2025-02-22 12:54:26 -08:00 committed by angel
parent 8508b13f80
commit ad91f3c412
4 changed files with 176 additions and 87 deletions

View file

@ -6,13 +6,15 @@
type = lib.types.nullOr lib.types.bool;
default = null;
description = ''
Apple menu > System Preferences > Control Center > Menu Bar Only > Spotlight
Show Spotlight control in menu bar.
Show Spotlight in menu bar. Default is null.
Available settings:
true - Don't Show in Menu Bar
false - Show in Menu Bar
false - "Don't Show in Menu Bar"
true - "Show in Menu Bar"
This option mirrors the setting found in:
System Preferences > Control Center > Menu Bar Only > Spotlight
'';
};
};
}
}

View file

@ -4,6 +4,8 @@ let
mapping: default: v:
if v == null then
null
else if builtins.isBool v then
if v then mapping.true else mapping.false
else if mapping ? v then
mapping.${v}
else
@ -37,13 +39,16 @@ in
hide = 12;
} 12;
description = ''
Apple menu > System Preferences > Control Center > Accessibility Shortcuts
Show an Accessibility Shortcuts control in menu bar.
Options:
both - Show in Menu Bar and Control Center (3)
menuBar - Show in Menu Bar only (6)
controlCenter - Show in Control Center only (1 or 9)
hide - Don't Show (2, 4, 8, or 12)
Available settings:
both - Show in both the Menu Bar and Control Center (3)
menuBar - Show in the Menu Bar only (6)
controlCenter - Show in Control Center only (9)
hide - Don't Show (12)
This option mirrors the setting found in:
System Preferences > Control Center > AccessibilityShortcuts
'';
};
@ -55,12 +60,14 @@ in
false = 24;
};
description = ''
Apple menu > System Preferences > Control Center > AirDrop
Show an AirDrop control in menu bar.
Show a AirDrop control in menu bar. Default is null.
Available settings:
true - Show in Menu Bar (18)
false - Don't Show in Menu Bar (24)
18 = Show in Menu Bar
24 = Don't Show in Menu Bar
This option mirrors the setting found in:
System Preferences > Control Center > AirDrop
'';
};
@ -81,26 +88,40 @@ in
hide = 12;
} 4;
description = ''
Apple menu > System Preferences > Control Center > Battery
Show a Battery control in menu bar.
Options:
both - Show in Menu Bar and Control Center (3)
menuBar - Show in Menu Bar only (6)
controlCenter - Show in Control Center only (1 or 9)
hide - Don't Show (2, 4, 8, or 12)
Available settings:
both - Show in both the Menu Bar and Control Center (3)
menuBar - Show in the Menu Bar only (4)
controlCenter - Show in Control Center only (9)
hide - Don't Show (12)
This option mirrors the setting found in:
System Preferences > Control Center > Battery
'';
};
system.defaults.controlcenter.BatteryShowEnergyMode = lib.mkOption {
type = lib.types.nullOr lib.types.bool;
type = lib.types.nullOr (
lib.types.enum [
"whenActive"
"always"
]
);
default = null;
apply = mkEnumApply {
always = true;
whenActive = false;
} false;
description = ''
Apple menu > System Preferences > Control Center > Battery
Show a Battery Energy Mode control in menu bar.
Show a battery energy mode. Default is null.
Available settings:
whenActive - Show When Active
always - Always Show
false - "When Active"
true - "Always"
This option mirrors the setting found in:
System Preferences > Control Center > Battery
'';
};
@ -108,9 +129,14 @@ in
type = lib.types.nullOr lib.types.bool;
default = null;
description = ''
Apple menu > System Preferences > Control Center > Battery
Show a Battery Percentage control in menu bar.
Show a battery percentage in menu bar. Default is null.
Available settings:
true - Show in Menu Bar
false - Don't Show in Menu Bar
This option mirrors the setting found in:
System Preferences > Control Center > Battery
'';
};
@ -122,12 +148,14 @@ in
false = 24;
};
description = ''
Apple menu > System Preferences > Control Center > Bluetooth
Show a Bluetooth control in menu bar.
Show a bluetooth control in menu bar. Default is null.
Available settings:
true - Show in Menu Bar (18)
false - Don't Show in Menu Bar (24)
18 = Show in Menu Bar
24 = Don't Show in Menu Bar
This option mirrors the setting found in:
System Preferences > Control Center > Bluetooth
'';
};
@ -137,6 +165,8 @@ in
"whenActive"
"hide"
"always"
true
false
]
);
default = null;
@ -144,14 +174,22 @@ in
always = 18;
hide = 8;
whenActive = 2;
true = lib.warn "system.defaults.controlcenter.Display = true is deprecated; please use \"always\" instead" 18;
false = lib.warn "system.defaults.controlcenter.Display = false is deprecated; please use \"whenActive\" instead" 2;
} 2;
description = ''
Apple menu > System Preferences > Control Center > Display
Show a Display control in menu bar.
Options:
Available settings:
whenActive - Show When Active (2)
hide - Don't Show in Menu Bar (8)
always - Always Show in Menu Bar (18)
Note: Boolean values are deprecated; please use the enum values.
This option mirrors the setting found in:
System Preferences > Control Center > Display
'';
};
@ -161,6 +199,8 @@ in
"whenActive"
"hide"
"always"
true
false
]
);
default = null;
@ -168,14 +208,22 @@ in
always = 18;
hide = 8;
whenActive = 2;
true = lib.warn "system.defaults.controlcenter.FocusModes = true is deprecated; please use \"always\" instead" 18;
false = lib.warn "system.defaults.controlcenter.FocusModes = false is deprecated; please use \"whenActive\" instead" 2;
} 2;
description = ''
Apple menu > System Preferences > Control Center > Focus
Show a Focus control in menu bar.
Options:
Available settings:
whenActive - Show When Active (2)
hide - Don't Show in Menu Bar (8)
always - Always Show in Menu Bar (18)
Note: Boolean values are deprecated; please use the enum values.
This option mirrors the setting found in:
System Preferences > Control Center > Focus
'';
};
@ -196,13 +244,16 @@ in
hide = 12;
} 12;
description = ''
Apple menu > System Preferences > Control Center > Hearing
Show a Hearing control in menu bar.
Options:
both - Show in Menu Bar and Control Center (3)
menuBar - Show in Menu Bar only (6)
controlCenter - Show in Control Center only (1 or 9)
hide - Don't Show (2, 4, 8, or 12)
Available settings:
both - Show in both the Menu Bar and Control Center (3)
menuBar - Show in the Menu Bar only (6)
controlCenter - Show in Control Center only (9)
hide - Don't Show (12)
This option mirrors the setting found in:
System Preferences > Control Center > Hearing
'';
};
@ -223,13 +274,16 @@ in
hide = 12;
} 12;
description = ''
Apple menu > System Preferences > Control Center > Keyboard Brightness
Show a Keyboard Brightness control in menu bar.
Options:
both - Show in Menu Bar and Control Center (3)
menuBar - Show in Menu Bar only (6)
controlCenter - Show in Control Center only (1 or 9)
hide - Don't Show (2, 4, 8, or 12)
Available settings:
both - Show in both the Menu Bar and Control Center (3)
menuBar - Show in the Menu Bar only (6)
controlCenter - Show in Control Center only (9)
hide - Don't Show (12)
This option mirrors the setting found in:
System Preferences > Control Center > Keyboard Brightness
'';
};
@ -250,13 +304,16 @@ in
hide = 12;
} 12;
description = ''
Apple menu > System Preferences > Control Center > Music Recognition
Show a Music Recognition control in menu bar.
Options:
both - Show in Menu Bar and Control Center (3)
menuBar - Show in Menu Bar only (6)
controlCenter - Show in Control Center only (1 or 9)
hide - Don't Show (2, 4, 8, or 12)
Available settings:
both - Show in both the Menu Bar and Control Center (3)
menuBar - Show in the Menu Bar only (6)
controlCenter - Show in Control Center only (9)
hide - Don't Show (12)
This option mirrors the setting found in:
System Preferences > Control Center > Music Recognition
'';
};
@ -266,6 +323,8 @@ in
"whenActive"
"hide"
"always"
true
false
]
);
default = null;
@ -273,14 +332,22 @@ in
always = 18;
hide = 8;
whenActive = 2;
true = lib.warn "system.defaults.controlcenter.NowPlaying = true is deprecated; please use \"always\" instead" 18;
false = lib.warn "system.defaults.controlcenter.NowPlaying = false is deprecated; please use \"whenActive\" instead" 2;
} 2;
description = ''
Apple menu > System Preferences > Control Center > Now Playing
Show a Now Playing control in menu bar.
Options:
Available settings:
whenActive - Show When Active (2)
hide - Don't Show in Menu Bar (8)
always - Always Show in Menu Bar (18)
Note: Boolean values are deprecated; please use the enum values.
This option mirrors the setting found in:
System Preferences > Control Center > Now Playing
'';
};
@ -299,12 +366,15 @@ in
whenActive = 2;
} 2;
description = ''
Apple menu > System Preferences > Control Center > Screen Mirroring
Show a Screen Mirroring control in menu bar.
Options:
Available settings:
whenActive - Show When Active (2)
hide - Don't Show in Menu Bar (8)
always - Always Show in Menu Bar (18)
This option mirrors the setting found in:
System Preferences > Control Center > Screen Mirroring
'';
};
@ -314,6 +384,8 @@ in
"whenActive"
"hide"
"always"
true
false
]
);
default = null;
@ -321,14 +393,22 @@ in
always = 18;
hide = 8;
whenActive = 2;
true = lib.warn "system.defaults.controlcenter.Sound = true is deprecated; please use \"always\" instead" 18;
false = lib.warn "system.defaults.controlcenter.Sound = false is deprecated; please use \"whenActive\" instead" 2;
} 2;
description = ''
Apple menu > System Preferences > Control Center > Sound
Show a Sound control in menu bar.
Options:
Available settings:
whenActive - Show When Active (2)
hide - Don't Show in Menu Bar (8)
always - Always Show in Menu Bar (18)
Note: Boolean values are deprecated; please use the enum values.
This option mirrors the setting found in:
System Preferences > Control Center > Sound
'';
};
@ -340,12 +420,14 @@ in
false = 8;
};
description = ''
Apple menu > System Preferences > Control Center > Stage Manager
Show a Stage Manager control in menu bar.
Show a Wi-Fi control in menu bar. Default is null.
Available settings:
true - Show in Menu Bar (2)
false - Don't Show in Menu Bar (8)
2 = Show in Menu Bar
8 = Don't Show in Menu Bar
This option mirrors the setting found in:
System Preferences > Control Center > Stage Manager
'';
};
@ -366,13 +448,16 @@ in
hide = 28;
} 28;
description = ''
Apple menu > System Preferences > Control Center > Fast User Switching
Show a User Switcher control in menu bar.
Options:
both - Show in Menu Bar and Control Center (19)
menuBar - Show in Menu Bar (22)
controlCenter - Show in Control Center (25)
Available settings:
both - Show in both the Menu Bar and Control Center (19)
menuBar - Show in the Menu Bar only (22)
controlCenter - Show in Control Center only (25)
hide - Don't Show (28)
This option mirrors the setting found in:
System Preferences > Control Center > Fast User Switching
'';
};
@ -384,12 +469,14 @@ in
false = 24;
};
description = ''
Apple menu > System Preferences > Control Center > Wi-Fi
Show a Wi-Fi control in menu bar.
Show a Wi-Fi control in menu bar. Default is null.
Available settings:
true - Show in Menu Bar (18)
false - Don't Show in Menu Bar (24)
18 = Show in Menu Bar
24 = Don't Show in Menu Bar
This option mirrors the setting found in:
System Preferences > Control Center > Wi-Fi
'';
};

View file

@ -634,7 +634,7 @@ defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter 'Battery' $'
defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter 'BatteryShowEnergyMode' $'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<false/>
<true/>
</plist>'
defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter 'BatteryShowPercentage' $'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@ -649,17 +649,17 @@ defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter 'Bluetooth'
defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter 'Display' $'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<integer>2</integer>
<integer>18</integer>
</plist>'
defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter 'FocusModes' $'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<integer>2</integer>
<integer>18</integer>
</plist>'
defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter 'Hearing' $'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<integer>3</integer>
<integer>6</integer>
</plist>'
defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter 'KeyboardBrightness' $'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@ -679,12 +679,12 @@ defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter 'NowPlaying'
defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter 'ScreenMirroring' $'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<integer>2</integer>
<integer>18</integer>
</plist>'
defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter 'Sound' $'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<integer>8</integer>
<integer>18</integer>
</plist>'
defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter 'StageManager' $'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@ -694,7 +694,7 @@ defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter 'StageManage
defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter 'UserSwitcher' $'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<integer>19</integer>
<integer>22</integer>
</plist>'
defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter 'WiFi' $'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

View file

@ -138,19 +138,19 @@
system.defaults.controlcenter.AccessibilityShortcuts = "both";
system.defaults.controlcenter.AirDrop = true;
system.defaults.controlcenter.Battery = "menuBar";
system.defaults.controlcenter.BatteryShowEnergyMode = true;
system.defaults.controlcenter.BatteryShowEnergyMode = "always";
system.defaults.controlcenter.BatteryShowPercentage = true;
system.defaults.controlcenter.Bluetooth = true;
system.defaults.controlcenter.Display = "whenActive";
system.defaults.controlcenter.FocusModes = "whenActive";
system.defaults.controlcenter.Hearing = "both";
system.defaults.controlcenter.Display = "always";
system.defaults.controlcenter.FocusModes = "always";
system.defaults.controlcenter.Hearing = "menuBar";
system.defaults.controlcenter.KeyboardBrightness = "menuBar";
system.defaults.controlcenter.MusicRecognition = "menuBar";
system.defaults.controlcenter.NowPlaying = "always";
system.defaults.controlcenter.ScreenMirroring = "whenActive";
system.defaults.controlcenter.Sound = "whenActive";
system.defaults.controlcenter.ScreenMirroring = "always";
system.defaults.controlcenter.Sound = "always";
system.defaults.controlcenter.StageManager = true;
system.defaults.controlcenter.UserSwitcher = "both";
system.defaults.controlcenter.UserSwitcher = "menuBar";
system.defaults.controlcenter.WiFi = true;
system.defaults.Spotlight.MenuItemHidden = true;
test = lib.strings.concatMapStringsSep "\n"