#!/usr/bin/env bash

# Required to display notifications if run as a cronjob:
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus
export DISPLAY=:0.0

mv $HOME/down/*.epub $HOME/docs/epub_landing/

if [[ $? -ne 1 ]]; then
    notify-send "Moved some epubs" "" --app-name="epub_lander" --icon="emblem_success"
fi

mv $HOME/down/*.pdf $HOME/docs/pdf_landing/

if [[ $? -ne 1 ]]; then
    notify-send "Moved some pdfs" "" --app-name="epub_lander" --icon="emblem_success"
fi