1
1
Fork 0

walker: refactor config

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2024-11-23 21:21:56 -06:00
parent 228d238744
commit 0197eabd92
Signed by: myned
GPG key ID: C7224454F7881A34
6 changed files with 403 additions and 58 deletions

View file

@ -122,11 +122,11 @@ in {
(key "Alt_L" "Super+Alt+Shift" "movetoworkspacesilent" "special:wallpaper") (key "Alt_L" "Super+Alt+Shift" "movetoworkspacesilent" "special:wallpaper")
(key "Control_L" "Super+Ctrl" "exec" workspace) (key "Control_L" "Super+Ctrl" "exec" workspace)
(key "Shift_L" "Super+Shift" "workspace" "previous") (key "Shift_L" "Super+Shift" "workspace" "previous")
(key "Super_L" "Super" "exec" "${menu}") (key "Super_L" "Super" "exec" menu)
#// (key "Super_L" "Super+Alt" "exec" "${menu} --passwords") #// (key "Super_L" "Super+Alt" "exec" "${menu} search")
(key "Super_L" "Super+Ctrl" "exec" "${menu} --calculator") #// (key "Super_L" "Super+Ctrl" "exec" "${menu} calculator")
(key "Super_L" "Super+Ctrl+Shift" "exec" "${menu} --networks") (key "Super_L" "Super+Ctrl+Shift" "exec" "${menu} network")
(key "Super_L" "Super+Shift" "exec" "${menu} --search") (key "Super_L" "Super+Shift" "exec" "${menu} search")
]; ];
# Regular binds # Regular binds
@ -263,8 +263,8 @@ in {
(key "T" "Super" "togglespecialworkspace" "terminal") (key "T" "Super" "togglespecialworkspace" "terminal")
(key "T" "Super+Ctrl" "exec" kitty) (key "T" "Super+Ctrl" "exec" kitty)
(key "T" "Super+Shift" "movetoworkspacesilent" "special:terminal") (key "T" "Super+Shift" "movetoworkspacesilent" "special:terminal")
(key "V" "Super" "exec" "${kitty} --app-id clipboard --override font_size=12 ${clipse}") (key "V" "Super" "exec" "${menu} clipboard")
(key "V" "Super+Shift" "exec" "${clipse} --clear && ${notify-send} clipse 'Clipboard cleared' --urgency low") (key "V" "Super+Shift" "exec" "${rm} ~/.cache/walker/clipboard.gob && ${notify-send} menu 'Clipboard cleared' --urgency low")
(key "W" "Super" "togglespecialworkspace" "vm") (key "W" "Super" "togglespecialworkspace" "vm")
(key "W" "Super+Ctrl" "exec" ''${remote} --vm --client xfreerdp --username Myned --password "$(${cat} ${config.age.secrets."desktop/vm/myndows.pass".path})" ${ (key "W" "Super+Ctrl" "exec" ''${remote} --vm --client xfreerdp --username Myned --password "$(${cat} ${config.age.secrets."desktop/vm/myndows.pass".path})" ${
if config.custom.hidpi if config.custom.hidpi

View file

@ -70,8 +70,7 @@ in {
++ [ ++ [
sway-audio-idle-inhibit # Inhibit idle while audio is playing sway-audio-idle-inhibit # Inhibit idle while audio is playing
"${audio} --init" # Enforce audio profile state "${audio} --init" # Enforce audio profile state
"${clipse} --listen" # Monitor clipboard "${rm} ~/.cache/walker/clipboard.gob" # Clear clipboard history
"${sleep} 1 && ${clipse} --clear" # Clear clipboard history
"${_1password} --silent" # Launch password manager in background "${_1password} --silent" # Launch password manager in background
#// "[group new; tile] ${firefox-esr}" #// "[group new; tile] ${firefox-esr}"

View file

@ -14,13 +14,13 @@ in {
# https://github.com/firecat53/networkmanager-dmenu # https://github.com/firecat53/networkmanager-dmenu
# https://github.com/firecat53/networkmanager-dmenu/blob/main/config.ini.example # https://github.com/firecat53/networkmanager-dmenu/blob/main/config.ini.example
#!! Option not available, files written directly #!! Option not available, files written directly
# FIXME: active_chars does not take effect
xdg.configFile."networkmanager-dmenu/config.ini".text = '' xdg.configFile."networkmanager-dmenu/config.ini".text = ''
[dmenu] [dmenu]
compact = true
dmenu_command = ${menu} --input dmenu_command = ${menu} --input
active_chars = > active_chars =
wifi_icons = 󰤯󰤟󰤢󰤥󰤨 wifi_icons = 󰤯󰤟󰤢󰤥󰤨
format = {icon} {name} format = {icon} {name}
''; '';
}; };
} }

View file

@ -2,6 +2,7 @@
config, config,
lib, lib,
inputs, inputs,
pkgs,
... ...
}: }:
with lib; let with lib; let
@ -26,63 +27,116 @@ in {
# https://github.com/abenz1267/walker/blob/master/internal/config/config.default.json # https://github.com/abenz1267/walker/blob/master/internal/config/config.default.json
config = { config = {
activation_mode.disabled = true; # Key chords activation_mode.disabled = true; # Key chords
force_keyboard_focus = true;
# BUG: Hover interrupts keyboard selections list = {
ignore_mouse = true; placeholder = "";
#// show_initial_entries = false;
single_click = false;
};
search.placeholder = ""; search = {
placeholder = "";
disabled = [ };
# BUG: Applications such as GNOME Files require multiple copy operations to register
"clipboard"
];
# https://github.com/abenz1267/walker/wiki/Modules # https://github.com/abenz1267/walker/wiki/Modules
# https://www.nerdfonts.com/cheat-sheet # https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/tree/master/Papirus/64x64
builtins = { disabled = [
clipboard.switcher_only = true; "commands"
commands.switcher_only = true; "custom_commands"
custom_commands.switcher_only = true; "websearch" # Replaced by custom plugin
runner.switcher_only = true; "windows"
ssh.switcher_only = true; ];
windows.switcher_only = true;
builtins = {
applications = { applications = {
# BUG: Ghost entries are still visible with single module # BUG: Ghost entries are still visible with single module
actions = false; # Desktop file actions actions = false;
hide_actions_with_empty_query = true;
placeholder = "";
switcher_only = false; switcher_only = false;
}; };
calc = { calc = {
min_chars = 0; icon = "accessories-calculator";
min_chars = 1;
placeholder = "";
prefix = "=";
show_icon_when_single = true;
switcher_only = false;
};
clipboard = {
max_entries = 50;
placeholder = "";
switcher_only = true; switcher_only = true;
}; };
dmenu = { dmenu = {
keep_sort = true; # Disable sorting entries keep_sort = true;
placeholder = "Input"; placeholder = "";
switcher_only = true; switcher_only = true;
}; };
emojis = { emojis = {
placeholder = "Unicode"; placeholder = "";
switcher_only = true; prefix = "`";
switcher_only = false;
}; };
finder = { finder = {
placeholder = "Files"; icon = "filetypes";
switcher_only = true; placeholder = "";
prefix = "/";
show_icon_when_single = true;
switcher_only = false;
}; };
websearch = { runner = {
# TODO: Implement custom search engine icon = "utilities-x-terminal";
engines = ["duckduckgo"]; placeholder = "";
prefix = ">";
show_icon_when_single = true;
switcher_only = false;
};
placeholder = "Search"; ssh = {
switcher_only = true; icon = "folder-remote-symbolic";
placeholder = "";
prefix = "ssh";
show_icon_when_single = true;
switcher_only = false;
};
switcher = {
icon = "application-default-icon";
prefix = "?";
show_icon_when_single = true;
}; };
}; };
# https://github.com/abenz1267/walker/wiki/Plugins
plugins = [
# Search engines by keyword prefix
{
name = "search";
placeholder = "";
show_icon_when_single = true;
switcher_only = true;
src = "${pkgs.writeShellApplication {
name = "search";
text = builtins.readFile ./search.sh;
runtimeInputs = with pkgs; [
coreutils
jq
xdg-utils
];
}}/bin/search '%TERM%'";
}
];
}; };
# https://github.com/abenz1267/walker/wiki/Theming # https://github.com/abenz1267/walker/wiki/Theming
@ -92,20 +146,65 @@ in {
font: larger ${config.custom.font.sans-serif}; font: larger ${config.custom.font.sans-serif};
} }
placeholder {
font: larger ${config.custom.font.monospace};
}
${builtins.readFile ./style.css} ${builtins.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.json
layout.ui.window.box.scroll.list = { layout.ui.window = let
max_height = 500 / config.custom.scale; w = 1000 / config.custom.scale;
min_width = 750 / config.custom.scale; h = 500 / config.custom.scale;
in {
width = w;
height = h;
item = { box = {
text.sub.hide = true; # Subtext h_align = "fill";
width = -1;
height = -1;
icon = { ai_scroll = {
icon_size = "largest"; # 128px # BUG: AiScroll H/VScrollbarPolicy applies to Scroll widget
pixel_size = 32; # Downscale h_scrollbar_policy = "external";
v_scrollbar_policy = "external";
};
scroll = {
h_align = "fill";
h_scrollbar_policy = "external";
v_scrollbar_policy = "external";
list = {
width = -1;
height = -1;
min_width = -1;
min_height = -1;
max_width = w;
max_height = h;
item = {
icon = {
icon_size = "largest"; # 128px
pixel_size = 32; # Downscale
};
text = {
sub = {
hide = true; # Subtext
};
};
};
};
};
search = {
input = {
icons = false;
};
}; };
}; };
}; };

View file

@ -0,0 +1,248 @@
#! /usr/bin/env bash
# Match prefixed keyword followed by space
case "$1" in
'a '*)
label="Amazon"
icon="amazon"
url="https://www.amazon.com/s?k="
query="${1:2}"
;;
'aw '*)
label="ArchWiki"
icon="distributor-logo-archlinux"
url="https://wiki.archlinux.org/index.php?search="
query="${1:2}"
;;
'b '*)
label="Brave"
icon="brave-browser"
url="https://search.brave.com/search?q="
query="${1:2}"
;;
'd '*)
label="DuckDuckGo"
icon="duckduckgo"
url="https://duckduckgo.com/?q="
query="${1:2}"
;;
'dh '*)
label="Docker Hub"
icon="docker-desktop"
url="https://hub.docker.com/search?q="
query="${1:2}"
;;
'e '*)
label="e621"
icon="amarok"
url="https://e621.net/posts?tags="
query="${1:2}"
;;
'ei '*)
label="Element Issues"
icon="com.github.zren.bugzilla"
url="https://github.com/element-hq/element-web/issues?q=is%3Aissue+is%3Aopen+"
query="${1:2}"
;;
'fh '*)
label="Flathub"
icon="application-vnd.flatpak"
url="https://flathub.org/apps/search?q="
query="${1:2}"
;;
'g '*)
label="Google"
icon="google"
url="https://www.google.com/search?q="
query="${1:2}"
;;
'gh '*)
label="GitHub"
icon="github"
url="https://github.com/search?q="
query="${1:2}"
;;
'hi '*)
label="Home Manager Issues"
icon="com.github.zren.bugzilla"
url="https://github.com/nix-community/home-manager/issues?q=is%3Aissue+is%3Aopen+"
query="${1:2}"
;;
'ho '*)
label="Home Manager Options"
icon="home"
url="https://home-manager-options.extranix.com/?query="
query="${1:2}"
;;
'hyi '*)
label="Hyprland Issues"
icon="com.github.zren.bugzilla"
url="https://github.com/hyprwm/Hyprland/issues?q=is%3Aissue+is%3Aopen+"
query="${1:2}"
;;
'ii '*)
label="i3 Issues"
icon="com.github.zren.bugzilla"
url="https://github.com/i3/i3/issues?q=is%3Aissue+is%3Aopen+"
query="${1:2}"
;;
'l '*)
label="Lutris"
icon="lutris"
url="https://lutris.net/games?q="
query="${1:2}"
;;
'li '*)
label="Lix Issues"
icon="com.github.zren.bugzilla"
url="https://git.lix.systems/lix-project/lix/issues?state=open&q="
query="${1:2}"
;;
'mdn '*)
label="Mozilla Web Docs"
icon="emblem-web"
url="https://developer.mozilla.org/en-US/search?q="
query="${1:2}"
;;
'mno '*)
label="MyNixOS Options"
icon="nix-snowflake"
url="https://mynixos.com/search?q=option+"
query="${1:2}"
;;
'nd '*)
label="Nix Dev"
icon="nix-snowflake"
url="https://nix.dev/manual/nix/latest?search="
query="${1:2}"
;;
'nf '*)
label="NixOS Flakes"
icon="nix-snowflake"
url="https://search.nixos.org/flakes?channel=unstable&query="
query="${1:2}"
;;
'nh '*)
label="Nix Hub"
icon="nix-snowflake"
url="https://www.nixhub.io/search?q="
query="${1:2}"
;;
'ni '*)
label="NixOS Nixpkgs Issues"
icon="com.github.zren.bugzilla"
url="https://github.com/NixOS/nixpkgs/issues?q=is%3Aissue+is%3Aopen+"
query="${1:2}"
;;
'no '*)
label="NixOS Options"
icon="nix-snowflake"
url="https://search.nixos.org/options?channel=unstable&query="
query="${1:2}"
;;
'nod '*)
label="Noogle Dev"
icon="nix-snowflake"
url="https://noogle.dev/q?term="
query="${1:2}"
;;
'np '*)
label="NixOS Packages"
icon="nix-snowflake"
url="https://search.nixos.org/packages?channel=unstable&query="
query="${1:2}"
;;
'npr '*)
label="Nix PR"
icon="nix-snowflake"
url="https://nixpk.gs/pr-tracker.html?pr="
query="${1:2}"
;;
'nw '*)
label="NixOS Wiki"
icon="nix-snowflake"
url="https://wiki.nixos.org/w/index.php?search="
query="${1:2}"
;;
'p '*)
label="Piped"
icon="youtube"
url="https://piped.bjork.tech/results?search_query="
query="${1:2}"
;;
'pc '*)
label="PCGamingWiki"
icon="computer"
url="https://www.pcgamingwiki.com/w/index.php?search="
query="${1:2}"
;;
'pdb '*)
label="ProtonDB"
icon="portproton"
url="https://www.protondb.com/search?q="
query="${1:2}"
;;
'pip '*)
label="PyPI"
icon="python"
url="https://pypi.org/search/?q="
query="${1:2}"
;;
'r '*)
label="Reddit"
icon="reddit"
url="https://search.brave.com/search?q=site%3Areddit.com+"
query="${1:2}"
;;
's '*)
label="SearXNG"
icon="preferences-system-search"
url="https://search.bjork.tech/search?q="
query="${1:2}"
;;
'si '*)
label="Sway Issues"
icon="com.github.zren.bugzilla"
url="https://github.com/swaywm/sway/issues?q=is%3Aissue+is%3Aopen+"
query="${1:2}"
;;
'w '*)
label="Wikipedia"
icon="wikipedia"
url="https://en.wikipedia.org/w/index.php?search="
query="${1:2}"
;;
'wa '*)
label="Wolfram Alpha"
icon="wolfram-mathematica"
url="https://www.wolframalpha.com/input?i="
query="${1:2}"
;;
'y '*)
label="YouTube"
icon="youtube"
url="https://www.youtube.com/results?search_query="
query="${1:2}"
;;
*)
label="Search"
icon="globe-symbolic"
url="https://search.brave.com/search?q="
query="$1"
;;
esac
# URL-encode search query
query="$(echo "$query" | jq --raw-input --raw-output @uri)"
# Return JSON list entry
jq << END
[
{
"label": "$label",
"icon": "$icon",
"matching": 1,
"exec": "$(which xdg-open) '$url$query'"
}
]
END

View file

@ -13,20 +13,19 @@ https://docs.gtk.org/gtk4/css-properties.html
#box { #box {
background: #002b36; background: #002b36;
border: 2px #073642 solid; border: 2px #073642 solid;
border-radius: 25px; border-radius: 30px;
padding: 4px;
} }
/* Input box */ /* Input box */
#search entry { #search entry {
border-radius: 25px; border-radius: 30px;
margin-bottom: 4px; margin: 4px;
padding: 4px; padding: 8px;
} }
/* Input box icons */ /* Input box typeahead */
#search entry image { #search #typeahead {
opacity: 0; opacity: 0.25;
} }
/* List */ /* List */
@ -37,7 +36,7 @@ https://docs.gtk.org/gtk4/css-properties.html
/* List entry */ /* List entry */
#list child { #list child {
border-radius: 25px; border-radius: 25px;
margin: 2px 8px; margin: 0px 4px 4px;
padding: 8px; padding: 8px;
} }