From 542d57342ea64a337614c4635b06e06521266a6e Mon Sep 17 00:00:00 2001 From: reidlab Date: Thu, 2 Jan 2025 16:15:26 -0600 Subject: [PATCH] more scripts --- modules/desktop/hyprland.nix | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix index 29165cf..d7cde8a 100644 --- a/modules/desktop/hyprland.nix +++ b/modules/desktop/hyprland.nix @@ -118,9 +118,9 @@ in { action=$(${pkgs.libnotify}/bin/notify-send "Screenshot Captured" \ --app-name="Screenshot" \ - --urgency=normal \ + --urgency="normal" \ --action="default=Edit Image" \ - --icon "$temp_file" \ + --icon="$temp_file" \ "Click to annotate image") case "$action" in @@ -130,7 +130,23 @@ in { esac ''; pickerScript = pkgs.writeShellScript "picker" '' - ${lib.getExe pkgs.zenity} --color-selection --color $(${lib.getExe pkgs.hyprpicker}) + ${lib.getExe pkgs.hyprpicker} --render-inactive --format hex | sed -z 's/\n//g' | ${lib.getExe pkgs.wl-clipboard-x11} -selection clipboard -t text/plain + + ${pkgs.libnotify}/bin/notify-send "Color Captured" \ + --app-name="Picker" \ + --urgency="normal" \ + "Color copied to clipboard" + ''; + ocrScript = pkgs.writeShellScript "ocr" '' + output=$(${lib.getExe pkgs.grimblast} --freeze save area - | ${lib.getExe pkgs.tesseract5} - -) + + echo "$output" | ${lib.getExe pkgs.wl-clipboard-x11} -selection clipboard -t text/plain + + ${pkgs.libnotify}/bin/notify-send "OCR Captured" \ + --app-name="OCR" \ + --urgency="normal" \ + --icon="text-x-generic-symbolic" \ + "Text copied to clipboard" ''; in [ "$mod, Q, killactive, " @@ -178,6 +194,8 @@ in { "$mod SHIFT ALT, S, exec, ${screenshotScript} window" # pick color "$mod SHIFT, C, exec, ${pickerScript}" + # ocr + "$mod SHIFT, T, exec, ${ocrScript}" ", XF86LaunchA, exec, ${screenshotScript} area" ", XF86LaunchB, exec, ${lib.getExe pkgs.rofi-rbw-wayland} -a copy -t password --clear-after 20"