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

Merge pull request #643 from hraban/feat/menuextra

feat: defaults write com.apple.menuextra.clock
This commit is contained in:
Daiderd Jordan 2023-05-17 19:07:53 +02:00 committed by GitHub
commit bd8694d0e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 81 additions and 0 deletions

View file

@ -16,6 +16,7 @@
./system/defaults/NSGlobalDomain.nix
./system/defaults/GlobalPreferences.nix
./system/defaults/CustomPreferences.nix
./system/defaults/clock.nix
./system/defaults/dock.nix
./system/defaults/finder.nix
./system/defaults/screencapture.nix

View file

@ -29,6 +29,7 @@ let
GlobalPreferences = defaultsToList ".GlobalPreferences" cfg.".GlobalPreferences";
LaunchServices = defaultsToList "com.apple.LaunchServices" cfg.LaunchServices;
NSGlobalDomain = defaultsToList "-g" cfg.NSGlobalDomain;
menuExtraClock = defaultsToList "com.apple.menuextra.clock" cfg.menuExtraClock;
dock = defaultsToList "com.apple.dock" cfg.dock;
finder = defaultsToList "com.apple.finder" cfg.finder;
magicmouse = defaultsToList "com.apple.AppleMultitouchMouse" cfg.magicmouse;
@ -80,6 +81,7 @@ in
GlobalPreferences
LaunchServices
NSGlobalDomain
menuExtraClock
dock
finder
magicmouse
@ -101,6 +103,7 @@ in
${concatStringsSep "\n" GlobalPreferences}
${concatStringsSep "\n" LaunchServices}
${concatStringsSep "\n" menuExtraClock}
${concatStringsSep "\n" dock}
${concatStringsSep "\n" finder}
${concatStringsSep "\n" magicmouse}

View file

@ -0,0 +1,71 @@
{ config, lib, ... }:
with lib;
{
options = {
system.defaults.menuExtraClock.IsAnalog = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Show an analog clock instead of a digital one. Default is null.
'';
};
system.defaults.menuExtraClock.Show24Hour = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Show a 24-hour clock, instead of a 12-hour clock. Default is null.
'';
};
system.defaults.menuExtraClock.ShowAMPM = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Show the AM/PM label. Useful if Show24Hour is false. Default is null.
'';
};
system.defaults.menuExtraClock.ShowDayOfMonth = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Show the day of the month. Default is null.
'';
};
system.defaults.menuExtraClock.ShowDayOfWeek = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Show the day of the week. Default is null.
'';
};
system.defaults.menuExtraClock.ShowDate = mkOption {
type = types.nullOr (types.enum [ 0 1 2 ]);
default = null;
description = ''
Show the full date. Default is null.
0 = Show the date
1 = Don't show
2 = Don't show
TODO: I don't know what the difference is between 1 and 2.
'';
};
system.defaults.menuExtraClock.ShowSeconds = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Show the clock with second precision, instead of minutes. Default is null.
'';
};
};
}

View file

@ -37,6 +37,9 @@
system.defaults.NSGlobalDomain."com.apple.springing.delay" = 0.0;
system.defaults.NSGlobalDomain."com.apple.swipescrolldirection" = true;
system.defaults.".GlobalPreferences"."com.apple.sound.beep.sound" = "/System/Library/Sounds/Funk.aiff";
system.defaults.menuExtraClock.Show24Hour = false;
system.defaults.menuExtraClock.ShowDayOfWeek = true;
system.defaults.menuExtraClock.ShowDate = 2;
system.defaults.dock.appswitcher-all-displays = false;
system.defaults.dock.autohide-delay = 0.24;
system.defaults.dock.orientation = "left";
@ -102,6 +105,9 @@
grep "defaults write -g 'com.apple.springing.delay' -float 0.0" ${config.out}/activate-user
grep "defaults write -g 'com.apple.swipescrolldirection' -bool YES" ${config.out}/activate-user
grep "defaults write .GlobalPreferences 'com.apple.sound.beep.sound' -string '/System/Library/Sounds/Funk.aiff'" ${config.out}/activate-user
grep "defaults write com.apple.menuextra.clock 'Show24Hour' -bool NO" ${config.out}/activate-user
grep "defaults write com.apple.menuextra.clock 'ShowDayOfWeek' -bool YES" ${config.out}/activate-user
grep "defaults write com.apple.menuextra.clock 'ShowDate' -int 2" ${config.out}/activate-user
grep "defaults write com.apple.dock 'autohide-delay' -float 0.24" ${config.out}/activate-user
grep "defaults write com.apple.dock 'appswitcher-all-displays' -bool NO" ${config.out}/activate-user
grep "defaults write com.apple.dock 'orientation' -string 'left'" ${config.out}/activate-user