diff --git a/docs/USAGE.md b/docs/USAGE.md index c045437a..a0941d02 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -492,7 +492,7 @@ To see the logs run: journalctl onedrive -f ``` -### OneDrive service running as a non-root user via systemd +### OneDrive service running as a non-root user via systemd (without notifications or GUI) In some cases it is desirable to run the OneDrive client as a service, but not running as the 'root' user. In this case, follow the directions below to configure the service for a non-root user. @@ -505,12 +505,34 @@ onedrive --synchronize --verbose systemctl enable onedrive@.service systemctl start onedrive@.service ``` - 3. To view the status of the service running for the user, use the following: ```text systemctl status onedrive@.service ``` +### OneDrive service running as a non-root user via systemd (with notifications enabled) (Arch, Ubuntu, Debian, OpenSuSE, Fedora) + +In some cases you may wish to receive GUI notifications when using the client when logged in as a non-root user. In this case, follow the directions below: + +1. Login via graphical UI as user you wish to enable the service for +2. Disable any `onedive@` service files for your username - eg: +```text +sudo systemctl stop onedrive@alex.service +sudo systemctl disable onedrive@alex.service +``` +3. Enable service as per the following: +```text +systemctl --user enable onedrive +systemctl --user start onedrive +``` + +To see the logs run: +```text +journalctl --user-unit onedrive -f +``` + +**Note:** `systemctl --user` is not applicable for Red Hat Enterprise Linux (RHEL) or CentOS Linux platforms + ## Additional Configuration ### Using multiple OneDrive accounts You can run multiple instances of the application by specifying a different config directory in order to handle multiple OneDrive accounts. For example, if you have a work and a personal account, you can run the onedrive command using the --confdir parameter. Here is an example: diff --git a/src/log.d b/src/log.d index 894a88bc..cbcc27be 100644 --- a/src/log.d +++ b/src/log.d @@ -139,6 +139,11 @@ void notify(T...)(T args) auto n = new Notification("OneDrive", result, "IGNORED"); try { n.show(); + // Sent message to notification daemon + if (verbose >= 2) { + writeln("[DEBUG] Sent notification to notification service. If notification is not displayed, check dbus or notification-daemon for errors"); + } + } catch (Throwable e) { vlog("Got exception from showing notification: ", e); }