diff --git a/nix/configuration/roles/sway/default.nix b/nix/configuration/roles/sway/default.nix index 46c7949..0f0903a 100644 --- a/nix/configuration/roles/sway/default.nix +++ b/nix/configuration/roles/sway/default.nix @@ -6,7 +6,6 @@ }: let - # TODO: Maybe replace wofi with tofi (with config to make it start quickly) sway-config = pkgs.writeTextFile { name = "config"; text = '' @@ -31,7 +30,8 @@ let # Your preferred application launcher # Note: it's recommended that you pass the final command to sway # set $menu dmenu_path | dmenu | xargs swaymsg exec - set $menu ${pkgs.wofi}/bin/wofi --show drun --gtk-dark + set $menu ${pkgs.tofi}/bin/tofi-drun | xargs swaymsg exec -- + #set $menu ${pkgs.wofi}/bin/wofi --show drun --gtk-dark # Do not show a title bar on windows default_border pixel 2 @@ -332,7 +332,8 @@ in hideMounts = true; users.talexander = { files = [ - ".cache/wofi-drun" # Execution history for wofi to sort results + ".local/state/tofi-drun-history" # A cache of the desktop files for tofi + ".cache/tofi-drun" # Execution history for tofi to sort results ]; }; }; diff --git a/nix/configuration/roles/sway/files/tofi-config b/nix/configuration/roles/sway/files/tofi-config new file mode 100644 index 0000000..6e93cc9 --- /dev/null +++ b/nix/configuration/roles/sway/files/tofi-config @@ -0,0 +1,3 @@ +border-width = 4 +outline-width = 1 +border-color = #FF6600 diff --git a/nix/configuration/roles/sway/rofimoji.nix b/nix/configuration/roles/sway/rofimoji.nix index 4c5e880..dd1c32e 100644 --- a/nix/configuration/roles/sway/rofimoji.nix +++ b/nix/configuration/roles/sway/rofimoji.nix @@ -10,7 +10,7 @@ let name = "rofimoji.conf"; text = '' # Emoji selector - bindsym $mod+backslash exec ${pkgs.rofimoji}/bin/rofimoji --selector wofi + bindsym $mod+backslash exec ${pkgs.rofimoji}/bin/rofimoji --selector tofi ''; }; in @@ -39,14 +39,31 @@ in nixpkgs.overlays = [ (final: prev: { rofimoji = prev.rofimoji.overrideAttrs (old: { - propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.wofi ]; - # postPatch = - # old.postPatch + propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.tofi ]; + # postInstall = + # old.postInstall # + '' # wrapProgram $out/bin/rofimoji --prefix PATH : ${lib.makeBinPath [ pkgs.wofi ]} # ''; + src = builtins.fetchGit { + # https://github.com/fdw/rofimoji/issues/209 + url = "https://github.com/fdw/rofimoji.git"; + rev = "615f00abeb984f3e648ef712164aa4e61f2e1808"; + }; }); }) + (final: prev: { + tofi = prev.tofi.overrideAttrs (old: { + nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.makeWrapper ]; + postInstall = + old.postInstall or "" + + '' + wrapProgram $out/bin/tofi-drun --add-flags --font=${pkgs.source-sans-pro}/share/fonts/opentype/SourceSansPro-Regular.otf --add-flags --config=${./files/tofi-config} + wrapProgram $out/bin/tofi --add-flags --config=${./files/tofi-config} + ''; + }); + }) + ]; }; }