Skip to content

Commit

Permalink
rofi-type
Browse files Browse the repository at this point in the history
  • Loading branch information
mightyiam committed Nov 22, 2024
1 parent e4709ab commit 834b36c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
18 changes: 18 additions & 0 deletions home-manager-modules/users/mightyiam/modules/dotool.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
lib,
pkgs,
...
}:
let
package = pkgs.dotool;
in
{
options.dotoolc = lib.mkOption {
type = lib.types.pathInStore;
default = lib.getExe' package "dotoolc";
};
config = {
home.packages = [ package ];
wayland.windowManager.sway.extraConfig = "exec ${lib.getExe' package "dotoold"}";
};
}
17 changes: 17 additions & 0 deletions home-manager-modules/users/mightyiam/modules/rofi-type.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
pkgs,
config,
lib,
...
}:
let
rofi-type = pkgs.writeShellScript "rofi-type" ''
CMD=$(${lib.getExe config.programs.rofi.package} -dmenu -p '  ')
echo "type $($CMD)" | ${config.dotoolc}
'';

mod = config.wayland.windowManager.sway.config.modifier;
in
{
wayland.windowManager.sway.config.keybindings."--no-repeat ${mod}+t" = "exec ${rofi-type}";
}

0 comments on commit 834b36c

Please sign in to comment.