pinwheel: Add screenshot annotation with satty
Shift-prefixed screenshot bindings pipe the capture to satty, and notifications use a short timeout so they are not captured.
This commit is contained in:
1 file changed
+26
-15
@@ -9,28 +9,39 @@ let
|
|||||||
hyprlandEnabled = config.mod.hyprland.enable;
|
hyprlandEnabled = config.mod.hyprland.enable;
|
||||||
|
|
||||||
grimblast = inputs.hyprland-contrib.packages.${pkgs.stdenv.hostPlatform.system}.grimblast;
|
grimblast = inputs.hyprland-contrib.packages.${pkgs.stdenv.hostPlatform.system}.grimblast;
|
||||||
area = "${pkgs.libnotify}/bin/notify-send 'ps: selected area' && ${grimblast}/bin/grimblast copy area";
|
satty = "${pkgs.satty}/bin/satty --filename - --copy-command ${pkgs.wl-clipboard}/bin/wl-copy --initial-tool brush --actions-on-enter save-to-clipboard,exit --early-exit copy";
|
||||||
screen = "${pkgs.libnotify}/bin/notify-send 'ps: selected screen' &&${grimblast}/bin/grimblast copy output";
|
|
||||||
|
# Short timeout so the notification is gone before the capture happens.
|
||||||
|
# Output captures are instant, so they wait for it to disappear.
|
||||||
|
notify = msg: "${pkgs.libnotify}/bin/notify-send -t 500 'ps: ${msg}'";
|
||||||
|
waitForNotify = "${pkgs.coreutils}/bin/sleep 0.6";
|
||||||
|
|
||||||
|
area = "${notify "selected area"} && ${grimblast}/bin/grimblast copy area";
|
||||||
|
screen = "${notify "selected screen"} && ${waitForNotify} && ${grimblast}/bin/grimblast copy output";
|
||||||
|
annotateArea = "${notify "annotate area"} && ${grimblast}/bin/grimblast save area - | ${satty}";
|
||||||
|
annotateScreen = "${notify "annotate screen"} && ${waitForNotify} && ${grimblast}/bin/grimblast save output - | ${satty}";
|
||||||
|
|
||||||
|
bind = keys: cmd: {
|
||||||
|
_args = [
|
||||||
|
keys
|
||||||
|
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${cmd}")'')
|
||||||
|
];
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
home-manager.users.alex = {
|
home-manager.users.alex = {
|
||||||
home.packages = [ grimblast ];
|
home.packages = [
|
||||||
|
grimblast
|
||||||
|
pkgs.satty
|
||||||
|
];
|
||||||
|
|
||||||
wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled {
|
wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled {
|
||||||
settings = {
|
settings = {
|
||||||
bind = [
|
bind = [
|
||||||
{
|
(bind "SUPER + Print" area)
|
||||||
_args = [
|
(bind "SUPER + CTRL + Print" screen)
|
||||||
"SUPER + Print"
|
(bind "SUPER + SHIFT + Print" annotateArea)
|
||||||
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${area}")'')
|
(bind "SUPER + CTRL + SHIFT + Print" annotateScreen)
|
||||||
];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
_args = [
|
|
||||||
"SUPER + CTRL + Print"
|
|
||||||
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${screen}")'')
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user