From 0ca8bf32c29a716993abcfb8db707ea8ea2d12e9 Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Thu, 3 Apr 2025 10:30:13 +0200 Subject: [PATCH] fix mangal download and use grimblast --- home-manager/hyprland/hyprland-settings.nix | 9 ++++----- modules/services/kavita.nix | 3 +++ pkgs/mangal/default.nix | 10 +++++++++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/home-manager/hyprland/hyprland-settings.nix b/home-manager/hyprland/hyprland-settings.nix index 8a5825b..afa1125 100644 --- a/home-manager/hyprland/hyprland-settings.nix +++ b/home-manager/hyprland/hyprland-settings.nix @@ -188,8 +188,7 @@ in thunar = "${pkgs.xfce.thunar}/bin/thunar"; wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy"; wl-paste = "${pkgs.wl-clipboard}/bin/wl-paste"; - grim = "${pkgs.grim}/bin/grim"; - slurp = "${pkgs.slurp}/bin/slurp"; + grimblast = "${pkgs.grimblast}/bin/grimblast"; swww = "${pkgs.swww}/bin/swww"; pdfgrep = "${pkgs.pdfgrep}/bin/pdfgrep"; brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; @@ -210,11 +209,11 @@ in ''$mainMod, S, exec, echo "skip" | nc kopatz.ddns.net 8888'' "$mainMod, R, exec, ${swww} img $(ls -d /synced/default/dinge/Bg/* | shuf -n 1)" "$mainMod, W, exec, ${swww} img ${config.stylix.image}" - " , Print, exec, hyprshade off && ${grim} -g \"$(${slurp} -d)\" - | ${wl-copy} && hyprshade auto" + " , Print, exec, hyprshade off && ${grimblast} --freeze copy area && hyprshade auto" '' - $mainMod, Print, exec, ${grim} -g "$(${slurp} -d)" /tmp/$(date +'%s_grim.png')'' + $mainMod, Print, exec, ${grimblast} --freeze save area /tmp/$(date +'%s_grim.png')'' '' - Shift_L, Print, exec, ${grim} -g "$(${slurp} -d)" ~/Pictures/$(date +'%s_grim.png')'' + Shift_L, Print, exec, ${grimblast} --freeze save area ~/Pictures/$(date +'%s_grim.png')'' "$mainMod, SPACE, exec, ${rofi} -modi drun -show drun -config ~/.config/rofi/rofidmenu.rasi" " , XF86AudioPlay, exec, ${playerctl} play-pause" " , XF86AudioNext, exec, ${playerctl} next" diff --git a/modules/services/kavita.nix b/modules/services/kavita.nix index 71ae1a2..82e970a 100644 --- a/modules/services/kavita.nix +++ b/modules/services/kavita.nix @@ -70,6 +70,9 @@ in { else config.age.secrets.kavita.path; }; + environment.systemPackages = with pkgs; [ + libgbm + ]; #todo: base url needs new kavita version systemd.services = { diff --git a/pkgs/mangal/default.nix b/pkgs/mangal/default.nix index bd5755b..54c94d5 100644 --- a/pkgs/mangal/default.nix +++ b/pkgs/mangal/default.nix @@ -3,6 +3,8 @@ , buildGoModule , fetchFromGitHub , installShellFiles +, libgbm +, makeWrapper , }: buildGoModule rec { @@ -23,7 +25,13 @@ buildGoModule rec { "-w" ]; - nativeBuildInputs = [ installShellFiles ]; + buildInputs = [ libgbm ]; + runtimeDeps = [ libgbm ]; + nativeBuildInputs = [ installShellFiles makeWrapper ]; + + preFixup = '' + wrapProgram $out/bin/mangal --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libgbm ]} + ''; postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' # Mangal creates a config file in the folder ~/.config/mangal and fails if not possible