Add rofi emoji picker

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-08-16 20:33:58 +02:00
parent 103bf021c4
commit 121e8d4ffe
5 changed files with 38 additions and 4 deletions

View File

@@ -8,6 +8,9 @@
pkgs, pkgs,
... ...
}: }:
let
hmConfig = config.home-manager.users.${user};
in
{ {
environment.persistence."/cache"."${home}/.cache/cliphist" = { }; environment.persistence."/cache"."${home}/.cache/cliphist" = { };
@@ -69,7 +72,9 @@
wayland.windowManager.hyprland.settings.bind = wayland.windowManager.hyprland.settings.bind =
let let
cliphist-rofi = lib.meta.getExe (pkgs.callPackage ./rofi.nix { }); cliphist-rofi = lib.meta.getExe (
pkgs.callPackage ./rofi.nix { rofi = hmConfig.programs.rofi.finalPackage; }
);
cliphist = lib.meta.getExe pkgs.cliphist; cliphist = lib.meta.getExe pkgs.cliphist;
in in
[ [

View File

@@ -1,4 +1,9 @@
{ lib, pkgs, ... }: {
rofi ? throw "rofi package is required",
lib,
pkgs,
...
}:
let let
copy = lib.meta.getExe ( copy = lib.meta.getExe (
pkgs.writeShellApplication { pkgs.writeShellApplication {
@@ -21,6 +26,6 @@ let
in in
pkgs.writeShellApplication { pkgs.writeShellApplication {
name = "cliphist-rofi"; name = "cliphist-rofi";
runtimeInputs = with pkgs; [ rofi-wayland ]; runtimeInputs = [ rofi ];
text = "rofi -modi \"copy:${copy},delete:${delete}\" -show copy"; text = "rofi -modi \"copy:${copy},delete:${delete}\" -show copy";
} }

View File

@@ -0,0 +1,23 @@
{
user ? throw "user argument is required",
home ? throw "home argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let
hmConfig = config.home-manager.users.${user};
in
{
home-manager.users.${user} = {
programs.rofi.plugins = with pkgs; [ rofi-emoji-wayland ];
wayland.windowManager.hyprland.settings.bind = [
# Super + Shift + :
"$mod_Shift, code:47, exec, ${lib.meta.getExe hmConfig.programs.rofi.finalPackage} -cache-dir ${home}/.cache/rofi -modi emoji -show emoji"
];
};
}

View File

@@ -22,7 +22,7 @@ in
}; };
wayland.windowManager.hyprland.settings.bind = [ wayland.windowManager.hyprland.settings.bind = [
"$mod, r, exec, ${lib.meta.getExe pkgs.rofi-wayland} -cache-dir ${home}/.cache/rofi -show drun" "$mod, r, exec, ${lib.meta.getExe hmConfig.programs.rofi.finalPackage} -cache-dir ${home}/.cache/rofi -modi drun,window -show drun"
]; ];
}; };
} }

View File

@@ -38,6 +38,7 @@ in
(import ../common/user/configs/gui/btop { inherit user home; }) (import ../common/user/configs/gui/btop { inherit user home; })
(import ../common/user/configs/gui/chromium { inherit user home; }) (import ../common/user/configs/gui/chromium { inherit user home; })
(import ../common/user/configs/gui/cliphist { inherit user home; }) (import ../common/user/configs/gui/cliphist { inherit user home; })
(import ../common/user/configs/gui/emoji { inherit user home; })
(import ../common/user/configs/gui/firefox { inherit user home; }) (import ../common/user/configs/gui/firefox { inherit user home; })
(import ../common/user/configs/gui/gtk { inherit user home; }) (import ../common/user/configs/gui/gtk { inherit user home; })
(import ../common/user/configs/gui/hyprland { inherit user home; }) (import ../common/user/configs/gui/hyprland { inherit user home; })