walker: refactor config
Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
parent
228d238744
commit
0197eabd92
6 changed files with 403 additions and 58 deletions
|
@ -122,11 +122,11 @@ in {
|
|||
(key "Alt_L" "Super+Alt+Shift" "movetoworkspacesilent" "special:wallpaper")
|
||||
(key "Control_L" "Super+Ctrl" "exec" workspace)
|
||||
(key "Shift_L" "Super+Shift" "workspace" "previous")
|
||||
(key "Super_L" "Super" "exec" "${menu}")
|
||||
#// (key "Super_L" "Super+Alt" "exec" "${menu} --passwords")
|
||||
(key "Super_L" "Super+Ctrl" "exec" "${menu} --calculator")
|
||||
(key "Super_L" "Super+Ctrl+Shift" "exec" "${menu} --networks")
|
||||
(key "Super_L" "Super+Shift" "exec" "${menu} --search")
|
||||
(key "Super_L" "Super" "exec" menu)
|
||||
#// (key "Super_L" "Super+Alt" "exec" "${menu} search")
|
||||
#// (key "Super_L" "Super+Ctrl" "exec" "${menu} calculator")
|
||||
(key "Super_L" "Super+Ctrl+Shift" "exec" "${menu} network")
|
||||
(key "Super_L" "Super+Shift" "exec" "${menu} search")
|
||||
];
|
||||
|
||||
# Regular binds
|
||||
|
@ -263,8 +263,8 @@ in {
|
|||
(key "T" "Super" "togglespecialworkspace" "terminal")
|
||||
(key "T" "Super+Ctrl" "exec" kitty)
|
||||
(key "T" "Super+Shift" "movetoworkspacesilent" "special:terminal")
|
||||
(key "V" "Super" "exec" "${kitty} --app-id clipboard --override font_size=12 ${clipse}")
|
||||
(key "V" "Super+Shift" "exec" "${clipse} --clear && ${notify-send} clipse 'Clipboard cleared' --urgency low")
|
||||
(key "V" "Super" "exec" "${menu} clipboard")
|
||||
(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+Ctrl" "exec" ''${remote} --vm --client xfreerdp --username Myned --password "$(${cat} ${config.age.secrets."desktop/vm/myndows.pass".path})" ${
|
||||
if config.custom.hidpi
|
||||
|
|
|
@ -70,8 +70,7 @@ in {
|
|||
++ [
|
||||
sway-audio-idle-inhibit # Inhibit idle while audio is playing
|
||||
"${audio} --init" # Enforce audio profile state
|
||||
"${clipse} --listen" # Monitor clipboard
|
||||
"${sleep} 1 && ${clipse} --clear" # Clear clipboard history
|
||||
"${rm} ~/.cache/walker/clipboard.gob" # Clear clipboard history
|
||||
"${_1password} --silent" # Launch password manager in background
|
||||
#// "[group new; tile] ${firefox-esr}"
|
||||
|
||||
|
|
|
@ -14,11 +14,11 @@ in {
|
|||
# https://github.com/firecat53/networkmanager-dmenu
|
||||
# https://github.com/firecat53/networkmanager-dmenu/blob/main/config.ini.example
|
||||
#!! Option not available, files written directly
|
||||
# FIXME: active_chars does not take effect
|
||||
xdg.configFile."networkmanager-dmenu/config.ini".text = ''
|
||||
[dmenu]
|
||||
compact = true
|
||||
dmenu_command = ${menu} --input
|
||||
active_chars = >
|
||||
active_chars =
|
||||
wifi_icons =
|
||||
format = {icon} {name}
|
||||
'';
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
config,
|
||||
lib,
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
|
@ -26,63 +27,116 @@ in {
|
|||
# https://github.com/abenz1267/walker/blob/master/internal/config/config.default.json
|
||||
config = {
|
||||
activation_mode.disabled = true; # Key chords
|
||||
force_keyboard_focus = true;
|
||||
|
||||
# BUG: Hover interrupts keyboard selections
|
||||
ignore_mouse = true;
|
||||
list = {
|
||||
placeholder = "";
|
||||
#// show_initial_entries = false;
|
||||
single_click = false;
|
||||
};
|
||||
|
||||
search.placeholder = "";
|
||||
|
||||
disabled = [
|
||||
# BUG: Applications such as GNOME Files require multiple copy operations to register
|
||||
"clipboard"
|
||||
];
|
||||
search = {
|
||||
placeholder = "";
|
||||
};
|
||||
|
||||
# https://github.com/abenz1267/walker/wiki/Modules
|
||||
# https://www.nerdfonts.com/cheat-sheet
|
||||
builtins = {
|
||||
clipboard.switcher_only = true;
|
||||
commands.switcher_only = true;
|
||||
custom_commands.switcher_only = true;
|
||||
runner.switcher_only = true;
|
||||
ssh.switcher_only = true;
|
||||
windows.switcher_only = true;
|
||||
# https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/tree/master/Papirus/64x64
|
||||
disabled = [
|
||||
"commands"
|
||||
"custom_commands"
|
||||
"websearch" # Replaced by custom plugin
|
||||
"windows"
|
||||
];
|
||||
|
||||
builtins = {
|
||||
applications = {
|
||||
# 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;
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
dmenu = {
|
||||
keep_sort = true; # Disable sorting entries
|
||||
placeholder = "Input";
|
||||
keep_sort = true;
|
||||
placeholder = "";
|
||||
switcher_only = true;
|
||||
};
|
||||
|
||||
emojis = {
|
||||
placeholder = "Unicode";
|
||||
switcher_only = true;
|
||||
placeholder = "";
|
||||
prefix = "`";
|
||||
switcher_only = false;
|
||||
};
|
||||
|
||||
finder = {
|
||||
placeholder = "Files";
|
||||
switcher_only = true;
|
||||
icon = "filetypes";
|
||||
placeholder = "";
|
||||
prefix = "/";
|
||||
show_icon_when_single = true;
|
||||
switcher_only = false;
|
||||
};
|
||||
|
||||
websearch = {
|
||||
# TODO: Implement custom search engine
|
||||
engines = ["duckduckgo"];
|
||||
runner = {
|
||||
icon = "utilities-x-terminal";
|
||||
placeholder = "";
|
||||
prefix = ">";
|
||||
show_icon_when_single = true;
|
||||
switcher_only = false;
|
||||
};
|
||||
|
||||
placeholder = "Search";
|
||||
ssh = {
|
||||
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
|
||||
|
@ -92,21 +146,66 @@ in {
|
|||
font: larger ${config.custom.font.sans-serif};
|
||||
}
|
||||
|
||||
placeholder {
|
||||
font: larger ${config.custom.font.monospace};
|
||||
}
|
||||
|
||||
${builtins.readFile ./style.css}
|
||||
'';
|
||||
|
||||
#!! Inherit from default layout
|
||||
# https://github.com/abenz1267/walker/blob/master/internal/config/layout.default.json
|
||||
layout.ui.window.box.scroll.list = {
|
||||
max_height = 500 / config.custom.scale;
|
||||
min_width = 750 / config.custom.scale;
|
||||
layout.ui.window = let
|
||||
w = 1000 / config.custom.scale;
|
||||
h = 500 / config.custom.scale;
|
||||
in {
|
||||
width = w;
|
||||
height = h;
|
||||
|
||||
box = {
|
||||
h_align = "fill";
|
||||
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";
|
||||
v_scrollbar_policy = "external";
|
||||
|
||||
list = {
|
||||
width = -1;
|
||||
height = -1;
|
||||
min_width = -1;
|
||||
min_height = -1;
|
||||
max_width = w;
|
||||
max_height = h;
|
||||
|
||||
item = {
|
||||
text.sub.hide = true; # Subtext
|
||||
|
||||
icon = {
|
||||
icon_size = "largest"; # 128px
|
||||
pixel_size = 32; # Downscale
|
||||
};
|
||||
|
||||
text = {
|
||||
sub = {
|
||||
hide = true; # Subtext
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
search = {
|
||||
input = {
|
||||
icons = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
248
options/custom/programs/walker/search.sh
Normal file
248
options/custom/programs/walker/search.sh
Normal 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
|
|
@ -13,20 +13,19 @@ https://docs.gtk.org/gtk4/css-properties.html
|
|||
#box {
|
||||
background: #002b36;
|
||||
border: 2px #073642 solid;
|
||||
border-radius: 25px;
|
||||
padding: 4px;
|
||||
border-radius: 30px;
|
||||
}
|
||||
|
||||
/* Input box */
|
||||
#search entry {
|
||||
border-radius: 25px;
|
||||
margin-bottom: 4px;
|
||||
padding: 4px;
|
||||
border-radius: 30px;
|
||||
margin: 4px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
/* Input box icons */
|
||||
#search entry image {
|
||||
opacity: 0;
|
||||
/* Input box typeahead */
|
||||
#search #typeahead {
|
||||
opacity: 0.25;
|
||||
}
|
||||
|
||||
/* List */
|
||||
|
@ -37,7 +36,7 @@ https://docs.gtk.org/gtk4/css-properties.html
|
|||
/* List entry */
|
||||
#list child {
|
||||
border-radius: 25px;
|
||||
margin: 2px 8px;
|
||||
margin: 0px 4px 4px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue