From 980343743b728398f97ad3fafe91a6278001fabd Mon Sep 17 00:00:00 2001 From: azikx Date: Fri, 18 Oct 2024 23:44:46 +0900 Subject: [PATCH] =?UTF-8?q?update=20=EF=8C=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2024-10-17.md | 0 2024-10-18.md | 0 flake.lock | 16 ------ home/programs/cli/helix/binds.nix | 27 +++++++++ home/programs/cli/helix/default.nix | 2 +- home/programs/cli/yazi/default.nix | 67 +++++++++++++++++++--- home/programs/cli/yazi/plugins.nix | 13 ++--- home/programs/gui/pkgs.nix | 2 +- home/themes/gtk.nix | 28 ++++++++- home/window-managers/hyprland/rules.nix | 18 +++--- home/window-managers/terminals/default.nix | 7 ++- 11 files changed, 137 insertions(+), 43 deletions(-) create mode 100644 2024-10-17.md create mode 100644 2024-10-18.md create mode 100644 home/programs/cli/helix/binds.nix diff --git a/2024-10-17.md b/2024-10-17.md new file mode 100644 index 0000000..e69de29 diff --git a/2024-10-18.md b/2024-10-18.md new file mode 100644 index 0000000..e69de29 diff --git a/flake.lock b/flake.lock index fe0baf0..b494c93 100644 --- a/flake.lock +++ b/flake.lock @@ -668,21 +668,6 @@ "type": "github" } }, - "nur": { - "locked": { - "lastModified": 1728794320, - "narHash": "sha256-5Dm+961fOsneg5nX6gBCHPHMdwF6/JbV5p0Zvmi6ybU=", - "owner": "nix-community", - "repo": "NUR", - "rev": "15bee9bde462e0e47e7d34c78d50bb0cc718c6e4", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "NUR", - "type": "github" - } - }, "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat", @@ -716,7 +701,6 @@ "hyprland": "hyprland", "nixpkgs": "nixpkgs_3", "nixpkgs-stable": "nixpkgs-stable_2", - "nur": "nur", "spicetify-nix": "spicetify-nix", "stylix": "stylix", "walls": "walls", diff --git a/home/programs/cli/helix/binds.nix b/home/programs/cli/helix/binds.nix new file mode 100644 index 0000000..4e2587c --- /dev/null +++ b/home/programs/cli/helix/binds.nix @@ -0,0 +1,27 @@ +{ ... }: { + programs.helix.settings.keys = { + normal = { + y = "yank"; + Y = "yank_to_clipboard"; + D = "delete_selection_noyank"; + space = { + space = "file_picker"; + c = "toggle_comments"; + f = "file_picker_in_current_directory"; + F = "file_picker"; + b = { + b = "buffer_picker"; + n = ":buffer-next"; + p = ":buffer-previous"; + d = ":buffer-close"; + D = ":buffer-close!"; + O = ":buffer-close-others"; + }; + }; + }; + insert = { + # "Tab" = "completion"; + "C-z" = "undo"; + }; + }; +} diff --git a/home/programs/cli/helix/default.nix b/home/programs/cli/helix/default.nix index 8019260..2db5a8f 100644 --- a/home/programs/cli/helix/default.nix +++ b/home/programs/cli/helix/default.nix @@ -1,5 +1,5 @@ { ... }: { - imports = [ ./theme.nix ./languages.nix ]; + imports = [ ./binds.nix ./theme.nix ./languages.nix ]; programs.helix = { enable = true; defaultEditor = true; diff --git a/home/programs/cli/yazi/default.nix b/home/programs/cli/yazi/default.nix index dba7249..c794179 100644 --- a/home/programs/cli/yazi/default.nix +++ b/home/programs/cli/yazi/default.nix @@ -25,32 +25,84 @@ in { }; opener = { edit = [{ - run = "hx $@"; + run = ''hx "$@"''; block = true; }]; play = [{ run = "mpv $@"; orphan = true; }]; + reveal = [ + { + run = ''imv-dir "$@"''; + block = true; + } + { run = ''xdg-open "$(dirname "$0")"''; } + { + run = ''exiftool "$1"; echo "Press enter to exit"; read ''; + block = true; + } + ]; + audio = [ + { + run = ''mpv --no-video "$@"''; + block = true; + } + { + run = ''mediainfo "$1"; echo "Press enter to exit"; read''; + block = true; + } + ]; + video = [ + { + run = ''mpv "$@"''; + block = true; + } + { + run = ''mediainfo "$1"; echo "Press enter to exit"; read _''; + block = true; + } + ]; + document = [{ + desc = "Document"; + orphan = true; + run = "onlyoffice-desktopeditors"; + }]; open = [{ run = "xdg-open $@"; }]; }; open = { rules = [ + { + mime = "*"; + use = [ "edit" "reveal" ]; + } + { + mime = "*/"; + use = [ "edit" "open" "reveal" ]; + } { mime = "text/*"; - use = "edit"; + use = [ "edit" "reveal" ]; } { - mime = "video/*"; - use = "play"; + mime = "inode/x-empty"; + use = [ "edit" "reveal" ]; } { - mime = "audio/*"; - use = "play"; + mime = "application/json"; + use = [ "edit" "reveal" ]; + } + { + mime = "{audio,video}/*"; + use = [ "play" "reveal" ]; } { mime = "image/*"; - use = "open"; + use = [ "open" "reveal" ]; + } + { + mime = "application/vnd.openxmlformats-officedocument.*"; + use = "document"; } ]; }; @@ -80,7 +132,6 @@ in { mime = "application/x-xz"; run = "ouch"; } - { name = "*.md"; run = "glow"; diff --git a/home/programs/cli/yazi/plugins.nix b/home/programs/cli/yazi/plugins.nix index 98816a5..87c3e4a 100644 --- a/home/programs/cli/yazi/plugins.nix +++ b/home/programs/cli/yazi/plugins.nix @@ -63,14 +63,13 @@ in { # CUSTOM PLUGINS xdg.configFile = { - # SMART ENTER "yazi/plugins/smart-enter.yazi/init.lua".text = '' - return { - entry = function() - local h = cx.active.current.hovered - ya.manager_emit(h and h.cha.is_dir and "enter" or "open", { hovered = true }) - end, - } + return { + entry = function() + local h = cx.active.current.hovered + ya.manager_emit(h and h.cha.is_dir and "enter" or "open", { hovered = true }) + end, + } ''; }; } diff --git a/home/programs/gui/pkgs.nix b/home/programs/gui/pkgs.nix index 069f24d..33be59b 100644 --- a/home/programs/gui/pkgs.nix +++ b/home/programs/gui/pkgs.nix @@ -1,5 +1,4 @@ { pkgs, inputs, ... }: { - imports = [ inputs.nur.hmModules.nur ]; home.packages = with pkgs; [ home-manager @@ -16,6 +15,7 @@ gvfs obsidian + logseq popsicle ventoy diff --git a/home/themes/gtk.nix b/home/themes/gtk.nix index 88cf4c0..8b51b90 100644 --- a/home/themes/gtk.nix +++ b/home/themes/gtk.nix @@ -9,7 +9,7 @@ enable = true; iconTheme = { name = "Papirus-Dark"; - package = pkgs.papirus-icon-theme.override { color = "yaru"; }; + package = pkgs.papirus-icon-theme.override { color = "adwaita"; }; }; font = lib.mkForce { name = "JetBrainsMono NerdFont"; @@ -17,5 +17,31 @@ pkgs.nerdfonts.override { fonts = [ "FiraCode" "JetBrainsMono" ]; }; size = 12; }; + gtk3 = { + extraConfig = { + gtk-application-prefer-dark-theme = 1; + gtk-xft-antialias = 1; + gtk-xft-hinting = 1; + gtk-xft-hintstyle = "hintslight"; + gtk-xft-rgba = "rgb"; + gtk-button-images = 0; + gtk-menu-images = 0; + gtk-enable-event-sounds = 1; + gtk-enable-input-feedback-sounds = 0; + }; + }; + gtk4 = { + extraConfig = { + gtk-application-prefer-dark-theme = 1; + gtk-xft-antialias = 1; + gtk-xft-hinting = 1; + gtk-xft-hintstyle = "hintslight"; + gtk-xft-rgba = "rgb"; + gtk-button-images = 0; + gtk-menu-images = 0; + gtk-enable-event-sounds = 1; + gtk-enable-input-feedback-sounds = 0; + }; + }; }; } diff --git a/home/window-managers/hyprland/rules.nix b/home/window-managers/hyprland/rules.nix index cf1721f..4188f39 100644 --- a/home/window-managers/hyprland/rules.nix +++ b/home/window-managers/hyprland/rules.nix @@ -1,10 +1,7 @@ -{ config, lib, ... }: { +{ config, ... }: { wayland.windowManager.hyprland.settings = with config.lib.stylix.colors; { windowrulev2 = [ - # "rounding 8, floating:1" - # "noshadow, floating:0" - # "noanim, floating:0" - + # WORKSPACE RULES "workspace 2 silent, class:^(firefox)$" "workspace 2 silent, class:^(floorp)$" "workspace 3 silent, class:^(Spotify)$" @@ -13,28 +10,33 @@ "workspace 5 silent, class:^(obsidian)$" "workspace 6 silent, class:^(anicli)$" + # TERMINAL RULES "float, class:^(termfloat)$" "size 650 430, class:^(termfloat)$" "move center, class:^(termfloat)$" + # FILE MANAGER "float, class:^(tfm)$" "size 800 350, class:^(tfm)$" "move center, class:^(tfm)$" + # AYUGRAM + "minsize 540 680, class:^(com.ayugram)$" "float, title:^(Media viewer)$" "fullscreen, title:^(Media viewer)$" "size 670 540, title:^(Media viewer)$" + "float, title:^(Choose Files)$" + "size 650 450, title:^Choose Files()$" + # XDG "float, class:^(xdg-desktop-portal-gtk)$" "size 807 570, class:^(xdg-desktop-portal-gtk)$" + # MPV & ANIME "nodim, class:^(mpv)$" "float, class:^(anicliru)$" "size 660 630, class:^(anicliru)$" "bordercolor rgb(${base08}) rgb(${base09}) 45deg, class:^(anicliru)$" - - "bordercolor rgb(${base0E}, title:^(Картинка в картинке)$" - "noshadow, title:^(Картинка в картинке)$" ]; }; } diff --git a/home/window-managers/terminals/default.nix b/home/window-managers/terminals/default.nix index f3cf7b6..38227d4 100644 --- a/home/window-managers/terminals/default.nix +++ b/home/window-managers/terminals/default.nix @@ -1 +1,6 @@ -{ imports = [ ./foot ./kitty ]; } +{ + imports = [ + # ./foot + ./kitty + ]; +}