diff --git a/init/install_service.sh b/init/install_service.sh index 9796088..0482a58 100755 --- a/init/install_service.sh +++ b/init/install_service.sh @@ -1,19 +1,20 @@ #!/usr/bin/env bash -INIT=${1:-systemd} +INIT="${1:-systemd}" CONFIG_PATH="${XDG_CONFIG_HOME:-$HOME/.config}" SETTINGS_PATH="${CONFIG_PATH}/photocatalog" SYSTEMD_UNIT_PATH="${CONFIG_PATH}/systemd/user/" -if "${INIT}" == "systemd" +if [[ "${INIT}" == "systemd" ]] then cp ./init/systemd/photocatalog.service $SYSTEMD_UNIT_PATH/photocatalog.service if test ! -f "${SETTINGS_PATH}" then - echo "TARGET=\nMONITOR=\nMODE=hardlink" > "${SETTINGS_PATH}" - ${EDITOR} "${SETTINGS_PATH}" + echo "TARGET=\nMONITOR=\nMODE=hardlink\n" > "${SETTINGS_PATH}" + echo "UPDATECTIME=true\n" >> "${SETTINGS_PATH}" + ${EDITOR:-vi} "${SETTINGS_PATH}" exit $? else exit 0 diff --git a/init/systemd/photocatalog.service b/init/systemd/photocatalog.service index 8c20187..d69fa63 100644 --- a/init/systemd/photocatalog.service +++ b/init/systemd/photocatalog.service @@ -7,5 +7,5 @@ WantedBy=default.target [Service] Type=simple EnvironmentFile=/home/%u/.config/photocatalog -ExecStart=photocatalog -mode $MODE -target $TARGET -monitor $MONITOR +ExecStart=photocatalog -mode $MODE -target $TARGET -monitor $MONITOR -update_mtime $UPDATECTIME ExecStartPre=photocatalog -mode $MODE -target $TARGET ${MONITOR}