System/home-manager/linux/programs/desktop/fuzzel.nix

43 lines
1.3 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ config, lib, pkgs, inputs, ... }:
let
fuzzel-command = config.nathan.config.desktop.fuzzel-command;
hyprland = config.nathan.programs.hyprland.enable;
targets = config.nathan.config.desktop.targets;
shortcuts = inputs.self.packages.${pkgs.system}.shortcuts;
in lib.mkMerge [
(lib.mkIf hyprland {
wayland.windowManager.hyprland.extraConfig = ''
bind = SUPER, R, exec, ${fuzzel-command} --prompt=' '
# Clipboard history management
exec-once=wl-paste --watch cliphist store
bind = SUPER, X, exec, cliphist list | ${fuzzel-command} --prompt=' ' --dmenu | cliphist decode | wl-copy
# Shortcut dispatcher
bind = SUPER, W, exec, ${shortcuts}/bin/shortcuts ~/.config/shortcuts/shortcuts.toml
'';
})
# General configuration
(lib.mkIf hyprland {
home.packages = with pkgs; [
fuzzel
# Clipboard
wl-clipboard
cliphist
];
# Shortcut dispatcher
xdg.configFile."shortcuts/shortcuts.toml" = {
text = ''
directories = ["~/.config/shortcuts/shortcuts", "${shortcuts}/shortcuts"]
picker_command = "${
builtins.replaceStrings [ ''"'' ] [ ''\"'' ]
(fuzzel-command + " --prompt=' ' ")
} --dmenu"
'';
onChange = ''
mkdir -p ~/.config/shortcuts/shortcuts
'';
};
})
]