#!/bin/bash
x=1
if [ "$#" -lt 2 ]; then
    exit 1
fi
if [ ! -d "$1" ]; then
	exit 1
fi
cd "$1"
uid=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1)
mkdir "$uid" && cd "$uid"
for a in "$@"
do
	if [ "$x" -gt 1 ]; then
		if [ -f "$a" ]; then
			echo "$a"
			mv "$a" "$(basename "$a")"
		fi
	fi
    let "x++"
done
cd ".." && xdotool type "$uid" && xdotool key Escape && xdotool key F2