impl single-gpu-passthru
This commit is contained in:
parent
a8219d7148
commit
82c3c45428
8 changed files with 312 additions and 130 deletions
|
|
@ -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!"
|
||||
''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue