-  FILENAME="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1).png"
-  gnome-screenshot -f "${LOCALPATH}/${FILENAME}" -p "$@"
-  scp -q "${LOCALPATH}/${FILENAME}" "${REMOTEUSER}@${REMOTEHOST}:${REMOTEPATH}"
-  echo -n "${URLBASE}/${FILENAME}"|xclip -selection p
-  echo -n "${URLBASE}/${FILENAME}"|xclip -selection c
-  notify-send -i applets-screenshooter "screenshot.sh" "Screenshot published to ${URLBASE}/${FILENAME}"
+  FileName="$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 6 | head -n 1).png"
+  if [ "$@" = "clipboard" ]; then
+    xclip -out -selection clipboard -t image/png > "/tmp/${FileName}" 2>/dev/null
+    if [ "$(file -b --mime-type /tmp/${FileName})" == "image/png" ]; then
+      mv "/tmp/${FileName}" "${LocalPath}/"
+    else
+      rm "/tmp/${FileName}"
+      notify-send -i applets-screenshooter "screenshot.sh" "Tried to post image from clipboard, but found no image there."
+    fi
+  else
+    gnome-screenshot -f "${LocalPath}/${FileName}" -p "$@"
+  fi
+  if [ -f "${LocalPath}/${FileName}" ]; then
+    scp -q "${LocalPath}/${FileName}" "${RemoteUser}@${RemoteHost}:${RemotePath}"
+    echo -n "${UrlBase}/${FileName}"|xclip -selection p
+    echo -n "${UrlBase}/${FileName}"|xclip -selection c
+    notify-send -i applets-screenshooter "screenshot.sh" "Screenshot published to ${UrlBase}/${FileName}"
+  fi