Skip to content

Commit

Permalink
feat: Update Homerow application config (using defaults)
Browse files Browse the repository at this point in the history
  • Loading branch information
sudosubin committed Dec 14, 2024
1 parent bc89d32 commit 5618d8a
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 0 deletions.
126 changes: 126 additions & 0 deletions libraries/home-manager/programs/homerow/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,128 @@ in
enable = mkEnableOption "homerow";

package = mkPackageOption pkgs "homerow" { };

config = {
auto-deactivate-scrolling = mkOption {
type = types.bool;
default = false;
description = "Automatic scroll deactivation";
};
auto-deactivate-scrolling-delay-s = mkOption {
type = types.oneOf [ types.int types.float ];
default = 1;
description = "Deactivation delay";
};
auto-switch-input-source-id = mkOption {
type = types.str;
default = "com.apple.keylayout.ABC";
description = "Input source";
};
check-for-updates-automatically = mkOption {
type = types.bool;
default = true;
description = "Check for updates automatically";
};
dash-speed-multiplier = mkOption {
type = types.oneOf [ types.int types.float ];
default = 1.5;
description = "Dash speed";
};
disabled-bundle-paths = mkOption {
type = types.listOf (types.oneOf [ types.path types.str ]);
default = [ ];
description = "Ignored applications";
apply = value:
if !(isList value)
then value
else "(${(strings.concatStringsSep "," (map (val: "\"${val}\"") value))})";
};
enable-hyper-key = mkOption {
type = types.bool;
default = false;
description = "Hyperkey enabled";
};
hide-labels-when-nothing-is-searched = mkOption {
type = types.bool;
default = false;
description = "Hide labels before search";
};
is-auto-click-enabled = mkOption {
type = types.bool;
default = true;
description = "Automatic click";
};
is-scroll-shortcuts-enabled = mkOption {
type = types.bool;
default = true;
description = "Scroll commands";
};
label-characters = mkOption {
type = types.str;
default = "";
description = "Label characters";
};
label-font-size = mkOption {
type = types.int;
default = 10;
description = "Label size";
};
launch-at-login = mkOption {
type = types.bool;
default = false;
description = "Launch on login";
};
map-arrow-keys-to-scroll = mkOption {
type = types.bool;
default = false;
description = "Arrow keys";
};
non-search-shortcut = mkOption {
type = types.str;
default = "⌥⌘Space"; # ⌥⌘Space
description = "Shortcut";
};
scroll-keys = mkOption {
type = types.str;
default = "HJKL";
description = "Scroll keys";
};
scroll-px-per-ms = mkOption {
type = types.oneOf [ types.int types.float ];
default = 1;
description = "Scroll speed";
};
scroll-shortcut = mkOption {
type = types.str;
default = "⇧⌘J"; # ⇧⌘J
description = "Shortcut (Scrolling)";
};
scroll-show-numbers = mkOption {
type = types.bool;
default = true;
description = "Show scroll area numbers";
};
search-shortcut = mkOption {
type = types.str;
default = "";
description = "Search Shortcut";
};
show-menubar-icon = mkOption {
type = types.bool;
default = true;
description = "Show menubar icon";
};
theme-id = mkOption {
type = types.str;
default = "original";
description = "Theme";
};
use-search-predicate = mkOption {
type = types.bool;
default = true;
description = "Browser labels";
};
};
};

config = mkMerge [
Expand All @@ -26,6 +148,10 @@ in
(mkIf cfg.enable {
home.packages = [ cfg.package ];

darwin.defaults."com.superultra.Homerow" = cfg.config // {
"NSStatusItem Visible Item-0" = cfg.config.show-menubar-icon;
};

launchd.agents.homerow = {
enable = true;
config = {
Expand Down
9 changes: 9 additions & 0 deletions modules/darwin/programs/homerow/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,14 @@
{
services.homerow = {
enable = true;

config = {
check-for-updates-automatically = false;
dash-speed-multiplier = 2;
label-font-size = 9;
non-search-shortcut = "⌥⌘Space"; # ⌥⌘Space
scroll-px-per-ms = 1.5;
search-shortcut = "⌥⌘↩"; # ⌥⌘↩
};
};
}

0 comments on commit 5618d8a

Please sign in to comment.