From 117417f148dbc4c3b4222bb843a407fcc0c729a1 Mon Sep 17 00:00:00 2001 From: js0ny Date: Sun, 7 Dec 2025 07:45:51 +0000 Subject: [PATCH] minor fix --- nixcfgs/users/js0ny/packages/stylix.nix | 4 +- .../desktop/wayland-wm/niri/keymaps.nix | 2 + .../desktop/wayland-wm/niri/window-rules.nix | 41 +++++++++++++++---- .../js0ny/programs/obsidian/obsidian-grep.nix | 11 +++-- 4 files changed, 44 insertions(+), 14 deletions(-) diff --git a/nixcfgs/users/js0ny/packages/stylix.nix b/nixcfgs/users/js0ny/packages/stylix.nix index 6340461..d157762 100644 --- a/nixcfgs/users/js0ny/packages/stylix.nix +++ b/nixcfgs/users/js0ny/packages/stylix.nix @@ -71,8 +71,8 @@ in { }; }; - base16Scheme = "${pkgs.base16-schemes}/share/themes/rose-pine-dawn.yaml"; + base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-material-dark-soft.yaml"; image = ./wallpaper.jpg; - polarity = "light"; + polarity = "dark"; }; } diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/keymaps.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/keymaps.nix index 0155084..39df91f 100644 --- a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/keymaps.nix +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/keymaps.nix @@ -26,6 +26,8 @@ in { "Mod+Shift+A".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "CherryStudio" "cherry-studio"; "Mod+O".hotkey-overlay.title = "Focus or launch Obsidian"; "Mod+O".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "obsidian" "obsidian"; + # See: programs/obsidian/obsidian-grep.nix + "Mod+Shift+O".action = spawn-sh "${term} --class=kitty-terminal-popup -e obsidian-grep && ${lib.getExe nirictl.focusOrLaunch} obsidian obsidian"; # TODO: Change "org.kde.dolphin" to a more generic explorer app id via config.currentUser "Mod+E".hotkey-overlay.title = "Focus or launch file explorer"; "Mod+E".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "org.kde.dolphin" "dolphin"; diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/window-rules.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/window-rules.nix index b767690..57228f4 100644 --- a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/window-rules.nix +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/window-rules.nix @@ -15,14 +15,6 @@ # {{{ float, opacity 0.8, top right: Picture-in-Picture // waybar childs { matches = [ - { - app-id = "^firefox$"; - title = "^Picture-in-Picture$"; - } - { - # Applies to all chromium - title = "^Picture in picture$"; - } { app-id = "^org.pulseaudio.pavucontrol$"; title = "^Volume Control$"; @@ -37,6 +29,39 @@ relative-to = "top-right"; }; } + { + matches = [ + { + app-id = "^firefox$"; + title = "^Picture-in-Picture$"; + } + { + # Applies to all chromium + title = "^Picture in picture$"; + } + ]; + + open-floating = true; + opacity = 0.8; + default-floating-position = { + x = 50; + y = 50; + relative-to = "bottom-right"; + }; + } + { + matches = [ + { + app-id = "^mpv$"; + } + ]; + + default-floating-position = { + x = 50; + y = 50; + relative-to = "bottom-right"; + }; + } # }}} { matches = [ diff --git a/nixcfgs/users/js0ny/programs/obsidian/obsidian-grep.nix b/nixcfgs/users/js0ny/programs/obsidian/obsidian-grep.nix index 063beae..30af660 100644 --- a/nixcfgs/users/js0ny/programs/obsidian/obsidian-grep.nix +++ b/nixcfgs/users/js0ny/programs/obsidian/obsidian-grep.nix @@ -1,27 +1,30 @@ -{pkgs, ...}: { +{pkgs, ...}: let obsidian-grep = pkgs.writeShellApplication { name = "obsidian-grep"; - runtimeInputs = with pkgs; [fzf rg]; + runtimeInputs = with pkgs; [fzf ripgrep]; text = '' #!/usr/bin/env bash BASE_DIR="$HOME/Obsidian" VAULT="Obsidian" - # PATTERN="''${1:-ob}" + # PATTERN="" cd "$BASE_DIR" || { echo "Error: Cannot access $BASE_DIR" exit 1 } + # TODO: Add tag search support rg --line-number --color=always "" | fzf --ansi \ --delimiter : \ --preview 'bat --color=always --highlight-line {2} {1}' \ --preview-window 'up,+{2}/2' \ - --header $'Enter: open file Ctrl-O: open in Obsidian Ctrl-T: Tag search Esc: quit' \ + --header $'Enter: open file Ctrl-O: open in Obsidian Esc: quit' \ --bind 'enter:execute(xdg-open {1})+abort' \ --bind "ctrl-o:execute(sh -c 'encoded=\$(printf %s \"{1}\" | sed \"s/ /%20/g\"); xdg-open \"obsidian://open?vault=''${VAULT}&file=\$encoded\"')+abort" ''; }; +in { + home.packages = [obsidian-grep]; }