1
1
Fork 0

walker: modify config

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2025-01-20 17:31:40 -06:00
parent 982af3ed06
commit 7b3653162a
Signed by: Myned
GPG key ID: C7224454F7881A34
3 changed files with 90 additions and 52 deletions

View file

@ -7,8 +7,12 @@
}:
with lib; let
cfg = config.custom.programs.walker;
hm = config.home-manager.users.${config.custom.username};
in {
options.custom.programs.walker.enable = mkOption {default = false;};
options.custom.programs.walker = {
enable = mkOption {default = false;};
icons = mkOption {default = ["edit-find" "terminal"];};
};
config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
imports = [inputs.walker.homeManagerModules.default];
@ -24,32 +28,49 @@ in {
runAsService = true;
# https://github.com/abenz1267/walker/wiki/Basic-Configuration
# https://github.com/abenz1267/walker/blob/master/internal/config/config.default.json
# https://github.com/abenz1267/walker/blob/master/internal/config/config.default.toml
config = {
activation_mode.disabled = true; # Key chords
close_when_open = true;
disable_click_to_close = true;
force_keyboard_focus = true;
list.placeholder = "";
search.placeholder = "";
hotreload_theme = true;
ignore_mouse = true;
# HACK: Window client required to send Esc key on Hyprland
#// as_window = true; # Disable layer
list = {
placeholder = "";
};
search = {
placeholder = "";
resume_last_query = true;
};
# https://github.com/abenz1267/walker/wiki/Modules
# https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/tree/master/Papirus/64x64
disabled = [
"ai"
"commands"
"custom_commands"
"finder"
"websearch" # Replaced by custom plugin
"windows"
];
builtins = {
builtins = let
in {
applications = {
# BUG: Ghost entries are still visible with single module
actions.enabled = false;
hide_actions_with_empty_query = true;
hide_without_query = true;
placeholder = "";
show_generic = false;
switcher_only = false;
};
bookmarks = {
icon = "user-bookmarks";
placeholder = "";
prefix = "b";
switcher_only = false;
};
@ -70,7 +91,7 @@ in {
dmenu = {
keep_sort = true;
placeholder = "";
placeholder = "Input";
switcher_only = true;
};
@ -83,7 +104,7 @@ in {
finder = {
icon = "filetypes";
placeholder = "";
prefix = "/";
prefix = "//";
show_icon_when_single = true;
switcher_only = false;
};
@ -106,29 +127,46 @@ in {
switcher = {
icon = "application-default-icon";
prefix = "?";
prefix = "/";
show_icon_when_single = true;
};
symbols = {
placeholder = "";
prefix = "sym";
switcher_only = false;
};
translation = {
icon = "translator";
placeholder = "";
prefix = "tr";
switcher_only = false;
};
websearch = {
placeholder = "system-search";
switcher_only = false;
entries = [{}];
};
};
# TODO: Keybinds
# https://github.com/abenz1267/walker/wiki/Keybinds
# https://github.com/abenz1267/walker/wiki/Plugins
plugins = [
# Search engines by keyword prefix
{
# Search engines by keyword prefix
name = "search";
placeholder = "";
show_icon_when_single = true;
switcher_only = true;
switcher_only = false;
src = "${pkgs.writeShellApplication {
name = "search";
text = readFile ./search.sh;
runtimeInputs = with pkgs; [
coreutils
jq
xdg-utils
];
runtimeInputs = with pkgs; [coreutils jq xdg-utils];
}}/bin/search '%TERM%'";
}
];
@ -138,21 +176,17 @@ in {
theme = {
style = ''
#box {
border: ${toString config.custom.border}px #073642 solid;
font: larger ${config.custom.settings.fonts.sans-serif};
}
placeholder {
font: larger ${config.custom.settings.fonts.monospace};
}
${readFile ./style.css}
'';
#!! Inherit from default layout
# https://github.com/abenz1267/walker/blob/master/internal/config/layout.default.json
# https://github.com/abenz1267/walker/blob/master/internal/config/layout.default.toml
layout.ui.window = let
w = 750;
h = 250;
h = 300;
in {
width = w;
height = h;
@ -162,12 +196,6 @@ in {
width = -1;
height = -1;
ai_scroll = {
# BUG: AiScroll H/VScrollbarPolicy applies to Scroll widget
h_scrollbar_policy = "external";
v_scrollbar_policy = "external";
};
scroll = {
h_align = "fill";
h_scrollbar_policy = "external";
@ -182,11 +210,6 @@ in {
max_height = h;
item = {
icon = {
icon_size = "larger"; # 64px
pixel_size = 32; # Downscale
};
text = {
sub = {
hide = true; # Subtext
@ -195,17 +218,31 @@ in {
};
};
};
search = {
input = {
icons = false;
};
};
};
};
};
};
# # HACK: Create theme files for module prompt icons
# #?? MODULE.theme = "icon-ICON"
# # https://github.com/abenz1267/walker/blob/bb584eab3b0cc48ebfbac1a5da019864d74781c4/nix/hm-module.nix#L86
# xdg.configFile = listToAttrs (flatten (forEach cfg.icons (
# icon: [
# {
# name = "walker/themes/icon-${icon}.css";
# value = {text = hm.programs.walker.theme.style;};
# }
# {
# name = "walker/themes/icon-${icon}.json";
# value = {
# text = builtins.toJSON (recursiveUpdate hm.programs.walker.theme.layout {
# ui.window.box.search.prompt.icon = icon;
# });
# };
# }
# ]
# )));
# HACK: Allow child processes to live, otherwise applications launched through service are killed on stop
# https://www.freedesktop.org/software/systemd/man/latest/systemd.kill.html#KillMode=
systemd.user.services.walker.Service.KillMode = "process";

View file

@ -94,7 +94,7 @@ case "$1" in
;;
'k '*)
label="Kagi"
icon="kagi"
icon="plasma-search"
url="https://kagi.com/search?q="
query="${1:2}"
;;
@ -249,10 +249,11 @@ case "$1" in
query="${1:2}"
;;
*)
label="Search"
icon="globe-symbolic"
url="https://search.brave.com/search?q="
query="$1"
exit
# label="Search"
# icon="globe-symbolic"
# url="https://search.brave.com/search?q="
# query="$1"
;;
esac

View file

@ -1,6 +1,7 @@
/***
/* !! Inherits system GTK theme
https://github.com/abenz1267/walker/blob/master/internal/config/themes/bare.css
https://github.com/abenz1267/walker/blob/master/internal/config/themes/colors.css
https://github.com/abenz1267/walker/blob/master/internal/config/themes/default.css
https://docs.gtk.org/gtk4/css-properties.html
***/
@ -12,7 +13,6 @@ https://docs.gtk.org/gtk4/css-properties.html
/* Visible window overlay */
#box {
background: #002b36;
border: 2px #073642 solid;
border-radius: 30px;
}