From 998fbfc0398079326094a7f97e8d8745d0f49d82 Mon Sep 17 00:00:00 2001 From: Jason Felice Date: Tue, 24 Aug 2021 17:13:48 -0400 Subject: defaults: magic mouse option --- modules/system/defaults-write.nix | 6 +++++- modules/system/defaults/magicmouse.nix | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 modules/system/defaults/magicmouse.nix (limited to 'modules/system') diff --git a/modules/system/defaults-write.nix b/modules/system/defaults-write.nix index 6c79138..8342984 100644 --- a/modules/system/defaults-write.nix +++ b/modules/system/defaults-write.nix @@ -34,6 +34,8 @@ let spaces = defaultsToList "com.apple.spaces" cfg.spaces; trackpad = defaultsToList "com.apple.AppleMultitouchTrackpad" cfg.trackpad; trackpadBluetooth = defaultsToList "com.apple.driver.AppleBluetoothMultitouch.trackpad" cfg.trackpad; + magicmouse = defaultsToList "com.apple.AppleMultitouchMouse" cfg.magicmouse; + magicmouseBluetooth = defaultsToList "com.apple.driver.AppleMultitouchMouse.mouse" cfg.magicmouse; mkIfAttrs = list: mkIf (any (attrs: attrs != {}) list); in @@ -52,7 +54,7 @@ in ''; system.activationScripts.userDefaults.text = mkIfAttrs - [ NSGlobalDomain GlobalPreferences LaunchServices dock finder screencapture spaces trackpad trackpadBluetooth ] + [ NSGlobalDomain GlobalPreferences LaunchServices dock finder screencapture spaces trackpad trackpadBluetooth magicmouse magicmouseBluetooth ] '' # Set defaults echo >&2 "user defaults..." @@ -66,6 +68,8 @@ in ${concatStringsSep "\n" spaces} ${concatStringsSep "\n" trackpad} ${concatStringsSep "\n" trackpadBluetooth} + ${concatStringsSep "\n" magicmouse} + ${concatStringsSep "\n" magicmouseBluetooth} ''; }; diff --git a/modules/system/defaults/magicmouse.nix b/modules/system/defaults/magicmouse.nix new file mode 100644 index 0000000..9344ffe --- /dev/null +++ b/modules/system/defaults/magicmouse.nix @@ -0,0 +1,21 @@ +{ config, lib, ... }: + +with lib; + +{ + options = { + + system.defaults.magicmouse.MouseButtonMode = mkOption { + type = types.nullOr (types.enum [ + "OneButton" + "TwoButton" + ]); + default = null; + description = '' + "OneButton": any tap is a left click. "TwoButton": allow left- + and right-clicking. + ''; + }; + + }; +} -- cgit v1.2.3