feat: add cliphist

This commit is contained in:
Nydragon 2024-06-09 00:57:42 +09:00
parent c926deb63a
commit efa4b4d824
No known key found for this signature in database
GPG key ID: 14AA30A865EA1209
2 changed files with 19 additions and 25 deletions

View file

@ -4,7 +4,8 @@
let let
conf = "${config.home.homeDirectory}/.config/rofi"; conf = "${config.home.homeDirectory}/.config/rofi";
in in
{ rec {
package = pkgs.rofi-wayland.override { inherit plugins; };
enable = true; enable = true;
plugins = [ pkgs.rofi-calc ]; plugins = [ pkgs.rofi-calc ];
theme = "${conf}/themes/rounded-gray-dark.rasi"; theme = "${conf}/themes/rounded-gray-dark.rasi";
@ -16,8 +17,11 @@
"ssh" "ssh"
"drun" "drun"
"run" "run"
"calc" # WARNING: ABI version mismatch
"obsidian:rofi-obsidian" # "calc"
# TODO: Update to use nixpkgs version of cliphist
"clipboard:cliphist-rofi-img"
"obsidian:${pkgs.rofi-obsidian}/bin/rofi-obsidian"
]; ];
matching = "fuzzy"; matching = "fuzzy";
sort = true; sort = true;
@ -29,9 +33,6 @@
combi-modes = [ combi-modes = [
"window" "window"
"drun" "drun"
"filebrowser"
"ssh"
"calc"
"obsidian" "obsidian"
]; ];
}; };

View file

@ -63,7 +63,8 @@
mod = config.wayland.windowManager.sway.config.modifier; mod = config.wayland.windowManager.sway.config.modifier;
in in
lib.mkOptionDefault { lib.mkOptionDefault {
"${mod}+p" = "exec ${pkgs.swaylock}/bin/swaylock"; # TODO: Update to use nixpkgs version of cliphist
"${mod}+p" = "exec cliphist wipe & ${pkgs.swaylock}/bin/swaylock";
"${mod}+Shift+p" = "exec ${pkgs.rofi}/bin/rofi -show p -modi p:rofi-power-menu"; "${mod}+Shift+p" = "exec ${pkgs.rofi}/bin/rofi -show p -modi p:rofi-power-menu";
# Reload the config file # Reload the config file
"${mod}+Shift+c" = "reload"; "${mod}+Shift+c" = "reload";
@ -73,6 +74,7 @@
"${mod}+f" = "fullscreen"; "${mod}+f" = "fullscreen";
# Start launcher # Start launcher
"${mod}+d" = "exec rofi -config ${homeDirectory}/.config/rofi/config.rasi -show combi -automatic-save-to-history | xargs swaymsg exec --"; "${mod}+d" = "exec rofi -config ${homeDirectory}/.config/rofi/config.rasi -show combi -automatic-save-to-history | xargs swaymsg exec --";
"${mod}+s" = "exec rofi -show clipboard -show-icons";
# Toggle the current focus between tiling and floating mode # Toggle the current focus between tiling and floating mode
"${mod}+Shift+space" = "floating toggle"; "${mod}+Shift+space" = "floating toggle";
"${mod}+Return" = "exec ${term}"; "${mod}+Return" = "exec ${term}";
@ -93,7 +95,7 @@
"--locked XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous"; "--locked XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
"Print" = "exec ${screenshot}/bin/screenshot"; "Print" = "exec ${screenshot}/bin/screenshot";
"${mod}+u" = "exec ${screenshot}/bin/screenshot"; "${mod}+u" = "exec ${screenshot}/bin/screenshot";
#: {{{ #: Workspace movement {{{
"--input-device=${inputs.kb.builtin} ${mod}+ampersand" = "workspace number 1"; "--input-device=${inputs.kb.builtin} ${mod}+ampersand" = "workspace number 1";
"--input-device=${inputs.kb.builtin} ${mod}+eacute" = "workspace number 2"; "--input-device=${inputs.kb.builtin} ${mod}+eacute" = "workspace number 2";
"--input-device=${inputs.kb.builtin} ${mod}+quotedbl" = "workspace number 3"; "--input-device=${inputs.kb.builtin} ${mod}+quotedbl" = "workspace number 3";
@ -120,23 +122,10 @@
#: Startup {{{ #: Startup {{{
startup = [ startup = [
{ command = "${pkgs.swayidle}/bin/swayidle -C ${homeDirectory}/.config/swayidle/config"; } { command = "${pkgs.swayidle}/bin/swayidle -C ${homeDirectory}/.config/swayidle/config"; }
{ { command = "${pkgs.swaynotificationcenter}/bin/swaync"; }
{ command = "${pkgs.nextcloud-client}/bin/nextcloud --background"; }
command = "${pkgs.swaynotificationcenter}/bin/swaync"; { command = "${pkgs.kdeconnect}/bin/kdeconnect-indicator"; }
} { command = "${pkgs.protonmail-bridge-gui}/bin/protonmail-bridge"; }
{
command = ''[ -z "$(pidof nextcloud)" ] && ${pkgs.nextcloud-client}/bin/nextcloud --background'';
}
{
command = ''
[ -z "$(pidof kdeconnect-indicator)" ] && ${pkgs.kdeconnect}/bin/kdeconnect-indicator
'';
}
{
command = ''
[ -z "$(pidof protonmail-bridge)" ] && ${pkgs.protonmail-bridge-gui}/bin/protonmail-bridge
'';
}
{ {
command = "${set-background}/bin/set-background -f ${wallpaper}"; command = "${set-background}/bin/set-background -f ${wallpaper}";
always = true; always = true;
@ -145,6 +134,10 @@
command = "${pkgs.swaynotificationcenter}/bin/swaync-client --reload-config --reload-css"; command = "${pkgs.swaynotificationcenter}/bin/swaync-client --reload-config --reload-css";
always = true; always = true;
} }
{
# Copy all copied values into the cliphist store
command = "${pkgs.wl-clipboard}/bin/wl-paste --watch ${pkgs.cliphist}/bin/cliphist store -max-items 10";
}
]; ];
#: }}} #: }}}
assigns = { assigns = {