Sway : Use fuzzel for launcher.

This commit is contained in:
Dmitry Voronin 2024-06-23 00:40:52 +03:00
parent 8dda43271e
commit b9cb5480b3
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
7 changed files with 44 additions and 21 deletions

View file

@ -1,9 +1,10 @@
{ pkgs, ... }: { { pkgs, setting, ... }: {
variables = { variables = {
EDITOR = "nvim"; EDITOR = "nvim";
MANPAGER = "nvim +Man!"; MANPAGER = "nvim +Man!";
NIXPKGS_ALLOW_UNFREE = "1"; NIXPKGS_ALLOW_UNFREE = "1";
NIX_CURRENT_SYSTEM = "${pkgs.stdenv.system}"; NIX_CURRENT_SYSTEM = "${pkgs.stdenv.system}";
TERM = "xterm-256color"; TERM = "xterm-256color";
TERMINAL = setting.terminal;
}; };
} }

View file

@ -10,7 +10,8 @@ in {
# Application launcher. # Application launcher.
# Note: pass the final command to swaymsg so that the resulting window can be opened # Note: pass the final command to swaymsg so that the resulting window can be opened
# on the original workspace that the command was run on. # on the original workspace that the command was run on.
set $menu _dmenu_path_wrapped | wmenu -b -p 'Run:' -i -f "${fontName} ${fontSize}" -M ${bg}D9 -S ${bg}D9 -N ${bg}D9 -m ${accent} -s ${accent} -n ${fg} | xargs swaymsg exec -- # set $menu _dmenu_path_wrapped | wmenu -b -p 'Run:' -i -f "${fontName} ${fontSize}" -M ${bg}D9 -S ${bg}D9 -N ${bg}D9 -m ${accent} -s ${accent} -n ${fg} | xargs swaymsg exec --
set $menu fuzzel
bindsym $mod+${key.action.launch} exec $menu bindsym $mod+${key.action.launch} exec $menu
''; '';

View file

@ -53,9 +53,6 @@ in {
# timezone = "America/New_York"; # timezone = "America/New_York";
tooltip-format = "<big><tt>{calendar}</tt></big>"; tooltip-format = "<big><tt>{calendar}</tt></big>";
format-alt = "{:%d %a %H:%M}"; format-alt = "{:%d %a %H:%M}";
calendar = {
on-scroll = 1;
};
}; };
battery = { battery = {
states = { states = {

View file

@ -45,7 +45,6 @@
foot = { foot = {
font = { font = {
step = 1; step = 1;
dpi = true;
}; };
}; };
@ -64,5 +63,8 @@
ollama.primaryModel = "llama3"; ollama.primaryModel = "llama3";
browser = "firefox-esr"; browser = "firefox-esr";
terminal = "foot";
dpiAware = true;
} }

View file

@ -13,6 +13,7 @@
btop = import ./top/btop args; btop = import ./top/btop args;
editor = import ./editorconfig args; editor = import ./editorconfig args;
foot = import ./foot args; foot = import ./foot args;
fuzzel = import ./fuzzel args;
gtk3 = import ./gtk/3 args; gtk3 = import ./gtk/3 args;
htop = import ./top/htop args; htop = import ./top/htop args;
keyd = import ./keyd args; keyd = import ./keyd args;
@ -29,18 +30,19 @@ in {
homeDirectory = homeDir; homeDirectory = homeDir;
stateVersion = const.stateVersion; stateVersion = const.stateVersion;
file = { file = {
".config/btop/btop.conf".text = btop.text; ".config/btop/btop.conf".text = btop.text;
".config/foot/foot.ini".source = foot.file; ".config/foot/foot.ini".source = foot.file;
".config/gtk-3.0/bookmarks".text = gtk3.bookmarks; ".config/fuzzel/fuzzel.ini".source = fuzzel.file;
".config/htop/htoprc".text = htop.text; ".config/gtk-3.0/bookmarks".text = gtk3.bookmarks;
".config/keyd/app.conf".text = keyd.text; ".config/htop/htoprc".text = htop.text;
".config/mako/config".source = mako.file; ".config/keyd/app.conf".text = keyd.text;
".config/yazi/init.lua".source = yazi.init; ".config/mako/config".source = mako.file;
".config/yazi/keymap.toml".source = yazi.keymap; ".config/yazi/init.lua".source = yazi.init;
".config/yazi/yazi.toml".source = yazi.yazi; ".config/yazi/keymap.toml".source = yazi.keymap;
".editorconfig".source = editor.file; ".config/yazi/yazi.toml".source = yazi.yazi;
".parallel/will-cite".text = ""; ".editorconfig".source = editor.file;
"media/template".source = ./template; ".parallel/will-cite".text = "";
"media/template".source = ./template;
}; };
}; };

View file

@ -1,5 +1,5 @@
{ style, setting, pkgs, ... }: let { style, setting, pkgs, ... }: let
dpiaware = if setting.foot.font.dpi then "yes" else "no"; dpiAware = if setting.dpiAware then "yes" else "no";
in { in {
file = (pkgs.formats.iniWithGlobalSection {}).generate "FootConfig" { file = (pkgs.formats.iniWithGlobalSection {}).generate "FootConfig" {
globalSection = { globalSection = {
@ -7,7 +7,7 @@ in {
# font-bold = "${style.font.monospace.name}:size=${toString style.font.size.terminal}"; # font-bold = "${style.font.monospace.name}:size=${toString style.font.size.terminal}";
font-italic = "${style.font.monospace.name}:size=${toString style.font.size.terminal}"; font-italic = "${style.font.monospace.name}:size=${toString style.font.size.terminal}";
font-bold-italic = "${style.font.monospace.name}:size=${toString style.font.size.terminal}"; font-bold-italic = "${style.font.monospace.name}:size=${toString style.font.size.terminal}";
dpi-aware = dpiaware; dpi-aware = dpiAware;
font-size-adjustment = setting.foot.font.step; font-size-adjustment = setting.foot.font.step;
}; };

View file

@ -0,0 +1,20 @@
{ pkgs, style, setting, ... }: let
dpiAware = if setting.dpiAware then "yes" else "no";
in {
file = (pkgs.formats.ini {}).generate "FuzzelConfig" {
main = {
font = "${style.font.serif.name}:size=${toString style.font.size.popup}";
dpi-aware = dpiAware;
show-actions = "yes";
terminal = setting.terminal;
list-executables-in-path = "no";
lines = 20;
width = 40;
# prompt = "\"$ \""
};
border = {
radius = 0;
width = 1;
};
};
}