impl single-gpu-passthru

This commit is contained in:
zack 2025-01-13 17:07:11 -05:00
parent a8219d7148
commit 82c3c45428
No known key found for this signature in database
GPG key ID: EE8A2B709E2401D1
8 changed files with 312 additions and 130 deletions

View file

@ -6,10 +6,8 @@
}:
writeShellScriptBin "sc" ''
# Take a screenshot with grim and slurp
${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp})" /tmp/screenshot.png
# Upload the screenshot and store the response
response=$(${lib.getExe pkgs.curl} -s \
-X POST \
-H "Accept: application/json" \
@ -17,12 +15,9 @@ writeShellScriptBin "sc" ''
-F "file=@/tmp/screenshot.png" \
https://zoeys.computer/api/images/create)
# Extract the URL using jq and copy to clipboard
echo "$response" | ${lib.getExe pkgs.jq} -r '.url' | ${pkgs.wl-clipboard}/bin/wl-copy
# Clean up the temporary file
rm /tmp/screenshot.png
# Notify user
echo "Screenshot uploaded and URL copied to clipboard!"
''