feat: add walker and general launcher config
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{
|
||||
browserCommand,
|
||||
launcherCommands,
|
||||
shortcutCommands,
|
||||
terminalCommand,
|
||||
}:
|
||||
@@ -15,10 +16,7 @@
|
||||
};
|
||||
"Mod+Space" = {
|
||||
repeat = false;
|
||||
action.spawn = [
|
||||
"vicinae"
|
||||
"toggle"
|
||||
];
|
||||
action.spawn = launcherCommands.open;
|
||||
hotkey-overlay.title = "App Launcher";
|
||||
};
|
||||
"Mod+E" = {
|
||||
@@ -43,10 +41,7 @@
|
||||
};
|
||||
"Mod+Ctrl+F" = {
|
||||
repeat = false;
|
||||
action.spawn = [
|
||||
shortcutCommands.vicinaeCommand
|
||||
"files"
|
||||
];
|
||||
action.spawn = launcherCommands.files;
|
||||
hotkey-overlay.title = "Find Files";
|
||||
};
|
||||
"Mod+V" = {
|
||||
@@ -54,38 +49,6 @@
|
||||
action.spawn = shortcutCommands.clipboardHistory;
|
||||
hotkey-overlay.title = "Clipboard History";
|
||||
};
|
||||
"Mod+Ctrl+N" = {
|
||||
repeat = false;
|
||||
action.spawn = [
|
||||
shortcutCommands.vicinaeCommand
|
||||
"nix-options"
|
||||
];
|
||||
hotkey-overlay.title = "NixOS Options";
|
||||
};
|
||||
"Mod+Ctrl+H" = {
|
||||
repeat = false;
|
||||
action.spawn = [
|
||||
shortcutCommands.vicinaeCommand
|
||||
"home-manager-options"
|
||||
];
|
||||
hotkey-overlay.title = "Home Manager Options";
|
||||
};
|
||||
"Mod+Ctrl+P" = {
|
||||
repeat = false;
|
||||
action.spawn = [
|
||||
shortcutCommands.vicinaeCommand
|
||||
"nix-packages"
|
||||
];
|
||||
hotkey-overlay.title = "Nix Packages";
|
||||
};
|
||||
"Mod+Ctrl+W" = {
|
||||
repeat = false;
|
||||
action.spawn = [
|
||||
shortcutCommands.vicinaeCommand
|
||||
"niri-windows"
|
||||
];
|
||||
hotkey-overlay.title = "Windows";
|
||||
};
|
||||
"Mod+Ctrl+C" = {
|
||||
repeat = false;
|
||||
action.spawn = shortcutCommands.pickColor;
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
}:
|
||||
let
|
||||
nixosConfigDir = repo.account.nixosConfigurationPath;
|
||||
launcherDmenuCommand =
|
||||
lib.concatMapStringsSep " " lib.escapeShellArg
|
||||
config.meta.desktop.launcher.commands.dmenu;
|
||||
mkTerminalScript =
|
||||
{
|
||||
name,
|
||||
@@ -122,45 +125,15 @@ rec {
|
||||
'';
|
||||
};
|
||||
|
||||
vicinaeCommand = pkgs.writeShellApplication {
|
||||
name = "niri-shortcut-vicinae-command";
|
||||
runtimeInputs = [ config.programs.vicinae.package ];
|
||||
text = ''
|
||||
case "''${1:-}" in
|
||||
files)
|
||||
link="vicinae://extensions/sameoldlab/fuzzy-files/find"
|
||||
;;
|
||||
nix-options)
|
||||
link="vicinae://extensions/knoopx/nix/options"
|
||||
;;
|
||||
home-manager-options)
|
||||
link="vicinae://extensions/knoopx/nix/home-manager-options"
|
||||
;;
|
||||
nix-packages)
|
||||
link="vicinae://extensions/knoopx/nix/packages"
|
||||
;;
|
||||
niri-windows)
|
||||
link="vicinae://extensions/knoopx/niri/windows"
|
||||
;;
|
||||
*)
|
||||
printf 'unknown Vicinae command target: %s\n' "''${1:-}" >&2
|
||||
exit 64
|
||||
;;
|
||||
esac
|
||||
|
||||
exec vicinae deeplink "$link"
|
||||
'';
|
||||
};
|
||||
|
||||
clipboardHistory = pkgs.writeShellApplication {
|
||||
name = "niri-shortcut-clipboard-history";
|
||||
runtimeInputs = [
|
||||
pkgs.cliphist
|
||||
config.programs.vicinae.package
|
||||
config.meta.desktop.launcher.package
|
||||
pkgs.wl-clipboard
|
||||
];
|
||||
text = ''
|
||||
selection="$(cliphist list | vicinae dmenu --navigation-title Clipboard --placeholder 'Search clipboard' --no-metadata)"
|
||||
selection="$(cliphist list | ${launcherDmenuCommand})"
|
||||
if [ -z "$selection" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -164,6 +164,7 @@ in
|
||||
|
||||
binds = import ./_bindings.nix {
|
||||
browserCommand = config.meta.desktop.browser.command;
|
||||
launcherCommands = config.meta.desktop.launcher.commands;
|
||||
terminalCommand = config.meta.desktop.terminal.command;
|
||||
shortcutCommands = shortcuts.commands;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user