mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-05 08:17:01 +00:00
Merge pull request #447 from dsyang/additional-options
add options for configuring activity monitor
This commit is contained in:
commit
1a387b8b3e
4 changed files with 77 additions and 0 deletions
|
@ -23,6 +23,7 @@
|
||||||
./system/defaults/spaces.nix
|
./system/defaults/spaces.nix
|
||||||
./system/defaults/trackpad.nix
|
./system/defaults/trackpad.nix
|
||||||
./system/defaults/universalaccess.nix
|
./system/defaults/universalaccess.nix
|
||||||
|
./system/defaults/ActivityMonitor.nix
|
||||||
./system/etc.nix
|
./system/etc.nix
|
||||||
./system/keyboard.nix
|
./system/keyboard.nix
|
||||||
./system/launchd.nix
|
./system/launchd.nix
|
||||||
|
|
|
@ -40,6 +40,7 @@ let
|
||||||
trackpad = defaultsToList "com.apple.AppleMultitouchTrackpad" cfg.trackpad;
|
trackpad = defaultsToList "com.apple.AppleMultitouchTrackpad" cfg.trackpad;
|
||||||
trackpadBluetooth = defaultsToList "com.apple.driver.AppleBluetoothMultitouch.trackpad" cfg.trackpad;
|
trackpadBluetooth = defaultsToList "com.apple.driver.AppleBluetoothMultitouch.trackpad" cfg.trackpad;
|
||||||
universalaccess = defaultsToList "com.apple.universalaccess" cfg.universalaccess;
|
universalaccess = defaultsToList "com.apple.universalaccess" cfg.universalaccess;
|
||||||
|
ActivityMonitor = defaultsToList "com.apple.ActivityMonitor" cfg.ActivityMonitor;
|
||||||
|
|
||||||
mkIfAttrs = list: mkIf (any (attrs: attrs != { }) list);
|
mkIfAttrs = list: mkIf (any (attrs: attrs != { }) list);
|
||||||
in
|
in
|
||||||
|
@ -76,6 +77,7 @@ in
|
||||||
trackpad
|
trackpad
|
||||||
trackpadBluetooth
|
trackpadBluetooth
|
||||||
universalaccess
|
universalaccess
|
||||||
|
ActivityMonitor
|
||||||
]
|
]
|
||||||
''
|
''
|
||||||
# Set defaults
|
# Set defaults
|
||||||
|
@ -94,6 +96,7 @@ in
|
||||||
${concatStringsSep "\n" trackpad}
|
${concatStringsSep "\n" trackpad}
|
||||||
${concatStringsSep "\n" trackpadBluetooth}
|
${concatStringsSep "\n" trackpadBluetooth}
|
||||||
${concatStringsSep "\n" universalaccess}
|
${concatStringsSep "\n" universalaccess}
|
||||||
|
${concatStringsSep "\n" ActivityMonitor}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
63
modules/system/defaults/ActivityMonitor.nix
Normal file
63
modules/system/defaults/ActivityMonitor.nix
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
|
||||||
|
system.defaults.ActivityMonitor.ShowCategory = mkOption {
|
||||||
|
type = types.nullOr (types.enum [100 101 102 103 104 105 106 107]);
|
||||||
|
default = 100;
|
||||||
|
description = ''
|
||||||
|
Change which processes to show.
|
||||||
|
100: All Processes
|
||||||
|
101: All Processes, Hierarchally
|
||||||
|
102: My Processes
|
||||||
|
103: System Processes
|
||||||
|
104: Other User Processes
|
||||||
|
105: Active Processes
|
||||||
|
106: Inactive Processes
|
||||||
|
107: Windowed Processes
|
||||||
|
Default is 100.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
system.defaults.ActivityMonitor.IconType = mkOption {
|
||||||
|
type = types.nullOr types.int;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Change the icon in the dock when running.
|
||||||
|
0: Application Icon
|
||||||
|
2: Network Usage
|
||||||
|
3: Disk Activity
|
||||||
|
5: CPU Usage
|
||||||
|
6: CPU History
|
||||||
|
Default is null.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
system.defaults.ActivityMonitor.SortColumn = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Which column to sort the main activity page (such as "CPUUsage"). Default is null.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
system.defaults.ActivityMonitor.SortDirection = mkOption {
|
||||||
|
type = types.nullOr types.int;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
The sort direction of the sort column (0 is decending). Default is null.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
system.defaults.ActivityMonitor.OpenMainWindow = mkOption {
|
||||||
|
type = types.nullOr types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Open the main window when opening Activity Monitor. Default is true.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -44,6 +44,11 @@
|
||||||
system.defaults.universalaccess.reduceTransparency = true;
|
system.defaults.universalaccess.reduceTransparency = true;
|
||||||
system.defaults.universalaccess.closeViewScrollWheelToggle = true;
|
system.defaults.universalaccess.closeViewScrollWheelToggle = true;
|
||||||
system.defaults.universalaccess.closeViewZoomFollowsFocus = true;
|
system.defaults.universalaccess.closeViewZoomFollowsFocus = true;
|
||||||
|
system.defaults.ActivityMonitor.ShowCategory = 103;
|
||||||
|
system.defaults.ActivityMonitor.IconType = 3;
|
||||||
|
system.defaults.ActivityMonitor.SortColumn = "CPUUsage";
|
||||||
|
system.defaults.ActivityMonitor.SortDirection = 0;
|
||||||
|
system.defaults.ActivityMonitor.OpenMainWindow = true;
|
||||||
|
|
||||||
test = ''
|
test = ''
|
||||||
echo >&2 "checking defaults write in /activate"
|
echo >&2 "checking defaults write in /activate"
|
||||||
|
@ -92,5 +97,10 @@
|
||||||
grep "defaults write com.apple.universalaccess 'reduceTransparency' -bool YES" ${config.out}/activate-user
|
grep "defaults write com.apple.universalaccess 'reduceTransparency' -bool YES" ${config.out}/activate-user
|
||||||
grep "defaults write com.apple.universalaccess 'closeViewScrollWheelToggle' -bool YES" ${config.out}/activate-user
|
grep "defaults write com.apple.universalaccess 'closeViewScrollWheelToggle' -bool YES" ${config.out}/activate-user
|
||||||
grep "defaults write com.apple.universalaccess 'closeViewZoomFollowsFocus' -bool YES" ${config.out}/activate-user
|
grep "defaults write com.apple.universalaccess 'closeViewZoomFollowsFocus' -bool YES" ${config.out}/activate-user
|
||||||
|
grep "defaults write com.apple.ActivityMonitor 'ShowCategory' -int 103" ${config.out}/activate-user
|
||||||
|
grep "defaults write com.apple.ActivityMonitor 'IconType' -int 3" ${config.out}/activate-user
|
||||||
|
grep "defaults write com.apple.ActivityMonitor 'SortColumn' -string 'CPUUsage'" ${config.out}/activate-user
|
||||||
|
grep "defaults write com.apple.ActivityMonitor 'SortDirection' -int 0" ${config.out}/activate-user
|
||||||
|
grep "defaults write com.apple.ActivityMonitor 'OpenMainWindow' -bool YES" ${config.out}/activate-user
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue