function take_screenshot() {
FileName="$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 6 | head -n 1).png"
- if [ "$@" = "clipboard" ]; then
+ 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
+ if [ "$(file -b --mime-type "/tmp/${FileName}")" == "image/png" ]; then
mv "/tmp/${FileName}" "${LocalPath}/"
else
rm "/tmp/${FileName}"