Replace wofi with tofi.

This commit is contained in:
Tom Alexander 2025-01-18 16:40:43 -05:00
parent dcffced35a
commit 1535800e2f
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 28 additions and 7 deletions

View File

@ -6,7 +6,6 @@
}: }:
let let
# TODO: Maybe replace wofi with tofi (with config to make it start quickly)
sway-config = pkgs.writeTextFile { sway-config = pkgs.writeTextFile {
name = "config"; name = "config";
text = '' text = ''
@ -31,7 +30,8 @@ let
# Your preferred application launcher # Your preferred application launcher
# Note: it's recommended that you pass the final command to sway # Note: it's recommended that you pass the final command to sway
# set $menu dmenu_path | dmenu | xargs swaymsg exec # 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 # Do not show a title bar on windows
default_border pixel 2 default_border pixel 2
@ -332,7 +332,8 @@ in
hideMounts = true; hideMounts = true;
users.talexander = { users.talexander = {
files = [ 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
]; ];
}; };
}; };

View File

@ -0,0 +1,3 @@
border-width = 4
outline-width = 1
border-color = #FF6600

View File

@ -10,7 +10,7 @@ let
name = "rofimoji.conf"; name = "rofimoji.conf";
text = '' text = ''
# Emoji selector # Emoji selector
bindsym $mod+backslash exec ${pkgs.rofimoji}/bin/rofimoji --selector wofi bindsym $mod+backslash exec ${pkgs.rofimoji}/bin/rofimoji --selector tofi
''; '';
}; };
in in
@ -39,14 +39,31 @@ in
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: { (final: prev: {
rofimoji = prev.rofimoji.overrideAttrs (old: { rofimoji = prev.rofimoji.overrideAttrs (old: {
propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.wofi ]; propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.tofi ];
# postPatch = # postInstall =
# old.postPatch # old.postInstall
# + '' # + ''
# wrapProgram $out/bin/rofimoji --prefix PATH : ${lib.makeBinPath [ pkgs.wofi ]} # 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}
'';
});
})
]; ];
}; };
} }