diff --git a/home/modules/programs/my-sway/default.nix b/home/modules/programs/my-sway/default.nix index 1063d7e..ef20587 100644 --- a/home/modules/programs/my-sway/default.nix +++ b/home/modules/programs/my-sway/default.nix @@ -29,11 +29,11 @@ let in f from; - flameshot = pkgs.unstable.flameshot.overrideAttrs - (attrs: { - nativeBuildInputs = attrs.nativeBuildInputs ++ (with pkgs.unstable; [ libsForQt5.kguiaddons ]); - cmakeFlags = [ "-DUSE_WAYLAND_CLIPBOARD=true" ]; - }); + screenshotScript = pkgs.writeScriptBin "screenshot" '' + #! ${pkgs.fish}/bin/fish + + ${pkgs.grim}/bin/grim -g (${pkgs.slurp}/bin/slurp) - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png + ''; ignored-devices = [ "Surface_Headphones" ]; playerctl = "${pkgs.playerctl}/bin/playerctl --ignore-player=${strings.concatStringsSep "," ignored-devices}"; @@ -128,8 +128,6 @@ in { command = "systemctl --user restart waybar"; always = true; } # Startup programs { command = "${cfg.browser}"; } - # Screenshot - { command = "${flameshot}/bin/flameshot"; } ] ++ (if cfg.discord != null then [ { command = "${cfg.discord}"; } ] else [ ]); @@ -146,7 +144,7 @@ in "${mod}+r" = "exec ${config.wayland.windowManager.sway.config.menu}"; "${mod}+Shift+r" = "mode resize"; ## Screenshot - "Print" = "exec ${flameshot}/bin/flameshot gui"; + "Print" = "exec ${screenshotScript}/bin/screenshot"; ## Locking "${mod}+semicolon" = "exec ${cfg.lockCmd}"; ## Multimedia @@ -582,7 +580,5 @@ in qt5.qtwayland # For waybar font-awesome - - flameshot ]); }