Changed configuration

This commit is contained in:
2024-10-15 11:51:42 +02:00
parent 70b8527b2b
commit ce0ddc8356
4 changed files with 62 additions and 3 deletions

View File

@@ -0,0 +1,25 @@
{ pkgs, ... }:
pkgs.writeShellScriptBin "saveimage" ''
# Check if an argument is provided
if [ -z "$1" ]; then
echo "Usage: $0 <filename>"
exit 1
fi
# Create the assets directory if it doesn't exist
mkdir -p assets
# Set the output path in the assets directory
OUTPUT_PATH="assets/$1.png"
# Save the clipboard image to the specified file in assets directory
wl-paste --type image/png > "$OUTPUT_PATH"
# Check if the file was successfully saved
if [ $? -eq 0 ]; then
echo "Image saved to $OUTPUT_PATH"
else
echo "Failed to save the image"
fi
''