#!/bin/bash

sleep 5;

# Define the directory where the screenshot will be saved
screenshot_dir="$HOME/Screenshots"

# Create the directory if it doesn't exist
mkdir -p "$screenshot_dir"

# Generate a unique filename based on date and time
timestamp=$(date +"%Y-%m-%d-%H-%M-%S")
screenshot_file="$screenshot_dir/screenshot_$timestamp.png"

# Capture the screen selection and save it to the specified file
gnome-screenshot -a -f "$screenshot_file"
scp "$screenshot_file" teraflops@192.168.1.37:/usr/share/nginx/fiche/
# Copy the filename to the clipboard
paste=$(basename $screenshot_file)
echo -n "https://paste.priet.us/$paste" yes | wl-copy 

# Notify the user
#echo "Screenshot saved as $screenshot_file and copied to the clipboard"
