From d5f457ff1907ba096c08d5a28e6a7c8b00ea9cdb Mon Sep 17 00:00:00 2001 From: andrey_varnavskiy Date: Tue, 10 Dec 2024 13:10:43 +0500 Subject: [PATCH] file manager bind --- home-manager/modules/anyrun.nix | 40 +++++++++++++++++++++++++ home-manager/modules/hyprland/binds.nix | 2 +- home-manager/modules/swaync/default.nix | 6 ++++ home-manager/modules/swaync/style.css | 16 ++++++++++ home-manager/modules/swaync/swaync.nix | 24 +++++++++++++++ 5 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 home-manager/modules/anyrun.nix create mode 100644 home-manager/modules/swaync/default.nix create mode 100644 home-manager/modules/swaync/style.css create mode 100644 home-manager/modules/swaync/swaync.nix diff --git a/home-manager/modules/anyrun.nix b/home-manager/modules/anyrun.nix new file mode 100644 index 0000000..10b735e --- /dev/null +++ b/home-manager/modules/anyrun.nix @@ -0,0 +1,40 @@ +{ + programs.anyrun = { + enable = true; + config = { + x = { fraction = 0.5; }; + y = { fraction = 0.3; }; + width = { fraction = 0.3; }; + hideIcons = false; + ignoreExclusiveZones = false; + layer = "overlay"; + hidePluginInfo = false; + closeOnClick = false; + showResultsImmediately = false; + maxEntries = null; + + plugins = [ + # An array of all the plugins you want, which either can be paths to the .so files, or their packages + inputs.anyrun.packages.${pkgs.system}.applications + ./some_plugin.so + "${inputs.anyrun.packages.${pkgs.system}.anyrun-with-all-plugins}/lib/kidex" + ]; + }; + + # Inline comments are supported for language injection into + # multi-line strings with Treesitter! (Depends on your editor) + extraCss = /*css */ '' + .some_class { + background: red; + } + ''; + + extraConfigFiles."some-plugin.ron".text = '' + Config( + // for any other plugin + // this file will be put in ~/.config/anyrun/some-plugin.ron + // refer to docs of xdg.configFile for available options + ) + ''; + }; +} diff --git a/home-manager/modules/hyprland/binds.nix b/home-manager/modules/hyprland/binds.nix index 53f2bda..050bdc7 100644 --- a/home-manager/modules/hyprland/binds.nix +++ b/home-manager/modules/hyprland/binds.nix @@ -4,7 +4,7 @@ "$mainMod SHIFT, Return, exec, $terminal" "$mainMod SHIFT, C, killactive," "$mainMod SHIFT, Q, exit," - # "$mainMod, E, exec, $fileManager" + "$mainMod, R, exec, $fileManager" "$mainMod, F, togglefloating," "$mainMod, D, exec, $menu" "$mainMod, P, pseudo," diff --git a/home-manager/modules/swaync/default.nix b/home-manager/modules/swaync/default.nix new file mode 100644 index 0000000..3b10616 --- /dev/null +++ b/home-manager/modules/swaync/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./swaync.nix + ./style.css + ]; +} diff --git a/home-manager/modules/swaync/style.css b/home-manager/modules/swaync/style.css new file mode 100644 index 0000000..ccecce3 --- /dev/null +++ b/home-manager/modules/swaync/style.css @@ -0,0 +1,16 @@ +.notification-row { + outline: none; +} + +.notification-row:focus, +.notification-row:hover { + background: @noti-bg-focus; +} + +.notification { + border-radius: 12px; + margin: 6px 12px; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.7), + 0 2px 6px 2px rgba(0, 0, 0, 0.3); + padding: 0; +} diff --git a/home-manager/modules/swaync/swaync.nix b/home-manager/modules/swaync/swaync.nix new file mode 100644 index 0000000..7e765e5 --- /dev/null +++ b/home-manager/modules/swaync/swaync.nix @@ -0,0 +1,24 @@ +{ + services.swaync = { + enable = true; + settings = { + positionX = "right"; + positionY = "top"; + layer = "overlay"; + control-center-layer = "top"; + layer-shell = true; + cssPriority = "application"; + control-center-margin-top = 0; + control-center-margin-bottom = 0; + control-center-margin-right = 0; + control-center-margin-left = 0; + notification-2fa-action = true; + notification-inline-replies = false; + notification-icon-size = 64; + notification-body-image-height = 100; + notification-body-image-width = 200; + }; + }; + + home.file.".config/swaync.style.css" = ./style.css; +}