From 4b2f0434b22cf33a674e61a4e48baaa7bf7b4493 Mon Sep 17 00:00:00 2001 From: Matt Nish-Lapidus Date: Sun, 6 Apr 2025 16:18:55 -0400 Subject: [PATCH] rbw launcher --- flake.lock | 60 +++++++++---------- .../bin/niri-delayed-launch-at-startup | 2 +- hosts/eddie/configuration.nix | 2 +- modules/home/desktop.nix | 2 +- modules/home/niri.nix | 6 +- modules/home/sway-launcher-desktop.nix | 11 ++++ .../sway-launcher-providers/rbw-list.fish | 5 ++ modules/home/sway-launcher-providers/rbw.conf | 5 ++ .../sway-launcher-rbw.fish | 2 + packages/rbw-latest.nix | 2 +- 10 files changed, 62 insertions(+), 35 deletions(-) create mode 100644 modules/home/sway-launcher-desktop.nix create mode 100644 modules/home/sway-launcher-providers/rbw-list.fish create mode 100644 modules/home/sway-launcher-providers/rbw.conf create mode 100755 modules/home/sway-launcher-providers/sway-launcher-rbw.fish diff --git a/flake.lock b/flake.lock index 63cb0ef..951ec32 100644 --- a/flake.lock +++ b/flake.lock @@ -70,11 +70,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1743873242, - "narHash": "sha256-z1HQnvpt0doMfB2dmyRfvrgJumazI6gK8EdE+UI59m8=", + "lastModified": 1743959986, + "narHash": "sha256-PmR93ZHN6CfJVBNalg+zl2M78mNA8LWIfMLhdtT/C3A=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "761195be1ba33f90242eb52d7be277252c459e38", + "rev": "c7e8e7beb913fcdde90239c009bf3f7c21a3fdda", "type": "github" }, "original": { @@ -357,11 +357,11 @@ ] }, "locked": { - "lastModified": 1743869639, - "narHash": "sha256-Xhe3whfRW/Ay05z9m1EZ1/AkbV1yo0tm1CbgjtCi4rQ=", + "lastModified": 1743948087, + "narHash": "sha256-B6cIi2ScgVSROPPlTti6len+TdR0K25B9R3oKvbw3M8=", "owner": "nix-community", "repo": "home-manager", - "rev": "d094c6763c6ddb860580e7d3b4201f8f496a6836", + "rev": "ef3b2a6b602c3f1a80c6897d6de3ee62339a3eb7", "type": "github" }, "original": { @@ -744,11 +744,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1743846670, - "narHash": "sha256-1U6AklLP3yCo/qhmFvhdRv0YFW0d8TXcw013IOxc/20=", + "lastModified": 1743943715, + "narHash": "sha256-9xCTf79Naq7mxvqtjgbcU9ZlNwubAep0qlwrL3GqZQQ=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "f1d37a802c47e22ad4eff4e55d307e9ffb7a440b", + "rev": "f53eac2ea3c72dd4e9739228660f661eb27359d0", "type": "github" }, "original": { @@ -777,11 +777,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1743835358, - "narHash": "sha256-HiDNB5meUAsz8gbQrS551M8axbbVx+nHfJdYZedzivQ=", + "lastModified": 1743923080, + "narHash": "sha256-Hb3t6FoJycnqIZmu3c6K1bJGndBsrDw8IQtM2ieLbzU=", "owner": "YaLTeR", "repo": "niri", - "rev": "c359d248257bdb68785597d2822f9c3a5ccbfdfe", + "rev": "430b155929a60644ea223012ee0c1389fc5e3755", "type": "github" }, "original": { @@ -965,11 +965,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1743703532, - "narHash": "sha256-s1KLDALEeqy+ttrvqV3jx9mBZEvmthQErTVOAzbjHZs=", + "lastModified": 1743813633, + "narHash": "sha256-BgkBz4NpV6Kg8XF7cmHDHRVGZYnKbvG0Y4p+jElwxaM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bdb91860de2f719b57eef819b5617762f7120c70", + "rev": "7819a0d29d1dd2bc331bec4b327f0776359b1fa6", "type": "github" }, "original": { @@ -981,11 +981,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1743703532, - "narHash": "sha256-s1KLDALEeqy+ttrvqV3jx9mBZEvmthQErTVOAzbjHZs=", + "lastModified": 1743813633, + "narHash": "sha256-BgkBz4NpV6Kg8XF7cmHDHRVGZYnKbvG0Y4p+jElwxaM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bdb91860de2f719b57eef819b5617762f7120c70", + "rev": "7819a0d29d1dd2bc331bec4b327f0776359b1fa6", "type": "github" }, "original": { @@ -1013,11 +1013,11 @@ }, "nixpkgs-stable_4": { "locked": { - "lastModified": 1743703532, - "narHash": "sha256-s1KLDALEeqy+ttrvqV3jx9mBZEvmthQErTVOAzbjHZs=", + "lastModified": 1743813633, + "narHash": "sha256-BgkBz4NpV6Kg8XF7cmHDHRVGZYnKbvG0Y4p+jElwxaM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "bdb91860de2f719b57eef819b5617762f7120c70", + "rev": "7819a0d29d1dd2bc331bec4b327f0776359b1fa6", "type": "github" }, "original": { @@ -1075,11 +1075,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1743583204, - "narHash": "sha256-F7n4+KOIfWrwoQjXrL2wD9RhFYLs2/GGe/MQY1sSdlE=", + "lastModified": 1743827369, + "narHash": "sha256-rpqepOZ8Eo1zg+KJeWoq1HAOgoMCDloqv5r2EAa9TSA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2c8d3f48d33929642c1c12cd243df4cc7d2ce434", + "rev": "42a1c966be226125b48c384171c44c651c236c22", "type": "github" }, "original": { @@ -1255,11 +1255,11 @@ ] }, "locked": { - "lastModified": 1743756170, - "narHash": "sha256-2b11EYa08oqDmF3zEBLkG1AoNn9rB1k39ew/T/mSvbU=", + "lastModified": 1743910657, + "narHash": "sha256-zr2jmWeWyhCD8WmO2aWov2g0WPPuZfcJDKzMJZYGq3Y=", "owner": "Mic92", "repo": "sops-nix", - "rev": "cff8437c5fe8c68fc3a840a21bf1f4dc801da40d", + "rev": "523f58a4faff6c67f5f685bed33a7721e984c304", "type": "github" }, "original": { @@ -1562,11 +1562,11 @@ "rust-overlay": "rust-overlay_3" }, "locked": { - "lastModified": 1743861168, - "narHash": "sha256-BYDlpaq2jlWf7dZYikvD1wEWI9wkm1fDNd5fNgR82Jw=", + "lastModified": 1743929988, + "narHash": "sha256-XSE6fOEr0/W7NTIKAFiBJZTZ3Esc7rUbON6qLW3FDWY=", "owner": "sxyazi", "repo": "yazi", - "rev": "fd007ab0235f3e7dd5816870d852263ee6972b73", + "rev": "be00881403922f8dfd34840252649978fc75b5d6", "type": "github" }, "original": { diff --git a/homes/emenel/dotfiles/dot_local/bin/niri-delayed-launch-at-startup b/homes/emenel/dotfiles/dot_local/bin/niri-delayed-launch-at-startup index 7b53856..50ea852 100755 --- a/homes/emenel/dotfiles/dot_local/bin/niri-delayed-launch-at-startup +++ b/homes/emenel/dotfiles/dot_local/bin/niri-delayed-launch-at-startup @@ -1,3 +1,3 @@ #!/bin/sh sleep 10 -/etc/profiles/per-user/emenel/bin/filen-desktop && /etc/profiles/per-user/emenel/bin/bitwarden +/etc/profiles/per-user/emenel/bin/filen-desktop diff --git a/hosts/eddie/configuration.nix b/hosts/eddie/configuration.nix index e0dba72..23187f5 100644 --- a/hosts/eddie/configuration.nix +++ b/hosts/eddie/configuration.nix @@ -29,7 +29,7 @@ inputs.emacs-overlay.overlays.default inputs.nix-rice.overlays.default inputs.nh.overlays.default - inputs.emacs-lsp-booster.overlays.default + # inputs.emacs-lsp-booster.overlays.default (final: prev: { wineWowPackages.stagingFull = pkgs-stable.wineWowPackages.stagingFull.overrideAttrs diff --git a/modules/home/desktop.nix b/modules/home/desktop.nix index d2f0fda..b619b50 100644 --- a/modules/home/desktop.nix +++ b/modules/home/desktop.nix @@ -11,6 +11,7 @@ gnome hyprlock hypridle + sway-launcher-desktop ]; home.packages = lib.mkMerge [ @@ -61,7 +62,6 @@ stirling-pdf ripdrag - sway-launcher-desktop swayidle emojify smile diff --git a/modules/home/niri.nix b/modules/home/niri.nix index 36eeca8..d75279d 100644 --- a/modules/home/niri.nix +++ b/modules/home/niri.nix @@ -294,6 +294,10 @@ in hotkey-overlay.title = "Clipboard History"; action = wezlaunch "clipse"; }; + "Mod+Ctrl+P" = { + hotkey-overlay.title = "Bitwarden Search"; + action = wezlaunch "/home/emenel/.local/bin/sway-launcher-rbw"; + }; "Mod+Ctrl+F" = { hotkey-overlay.title = "Yazi"; action = wez "yazi"; @@ -318,7 +322,7 @@ in hotkey-overlay.title = "btop++"; action = wez "btop"; }; - "Mod+Ctrl+P" = { + "Mod+Ctrl+M" = { hotkey-overlay.title = "plexamp"; action = spawn "plexamp"; }; diff --git a/modules/home/sway-launcher-desktop.nix b/modules/home/sway-launcher-desktop.nix new file mode 100644 index 0000000..f4db9ff --- /dev/null +++ b/modules/home/sway-launcher-desktop.nix @@ -0,0 +1,11 @@ +{ config, lib, pkgs, ... }: + +{ + home.packages = with pkgs; [ + sway-launcher-desktop + wl-clipboard + ]; + + xdg.configFile."sway-launcher-desktop/providers".source = ./sway-launcher-providers; + home.file.".local/bin/sway-launcher-rbw".source = ./sway-launcher-providers/sway-launcher-rbw.fish; +} diff --git a/modules/home/sway-launcher-providers/rbw-list.fish b/modules/home/sway-launcher-providers/rbw-list.fish new file mode 100644 index 0000000..92c52fd --- /dev/null +++ b/modules/home/sway-launcher-providers/rbw-list.fish @@ -0,0 +1,5 @@ +#!/usr/bin/env fish + +for p in (rbw list) + echo $p\034rbw\034󰢁 $p +end diff --git a/modules/home/sway-launcher-providers/rbw.conf b/modules/home/sway-launcher-providers/rbw.conf new file mode 100644 index 0000000..b966aa7 --- /dev/null +++ b/modules/home/sway-launcher-providers/rbw.conf @@ -0,0 +1,5 @@ +[rbw] +list_cmd=fish /home/emenel/.config/sway-launcher-desktop/providers/rbw-list.fish +preview_cmd=echo -e '󰢁 {1}' +launch_cmd=fish -c "wl-copy (rbw get {1})" +purge_cmd=command -v '{1}' || exit 43 diff --git a/modules/home/sway-launcher-providers/sway-launcher-rbw.fish b/modules/home/sway-launcher-providers/sway-launcher-rbw.fish new file mode 100755 index 0000000..d1b7624 --- /dev/null +++ b/modules/home/sway-launcher-providers/sway-launcher-rbw.fish @@ -0,0 +1,2 @@ +#!/usr/bin/env fish +PROVIDERS_FILE=providers/rbw.conf sway-launcher-desktop diff --git a/packages/rbw-latest.nix b/packages/rbw-latest.nix index 62bd10a..4bcd1c4 100644 --- a/packages/rbw-latest.nix +++ b/packages/rbw-latest.nix @@ -31,7 +31,7 @@ rustPlatform.buildRustPackage rec { hash = "sha256-ebLbdIF+BybK7ssNtZacGWmAEwdNZh8b94QYgvcwzmM="; }; - cargoHash = "sha256-QngSXKwqKHoAnA6ELAkS8v0exQwBxT/FCOPPj5WM5LE="; + cargoHash = "sha256-xDb4shDHCbd0yuTSAt80i1aqyuhpkfd/fYF98CfXdcM="; nativeBuildInputs = [ installShellFiles