Changed configuration
This commit is contained in:
25
modules/scripts/save_image.nix
Normal file
25
modules/scripts/save_image.nix
Normal 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
|
||||
''
|
Reference in New Issue
Block a user