Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Simplify systemd autostart
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbt365 committed Oct 3, 2023
1 parent 6c708ca commit f78c668
Showing 1 changed file with 9 additions and 69 deletions.
78 changes: 9 additions & 69 deletions OpenTabletDriver.Web/Views/Wiki/FAQ/Linux.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -231,77 +231,15 @@

<hr/>

<h3 class="wiki-nav-item pb-2" id="display-session-not-detected">
The systemd user service doesn't start correctly?
<h3 class="wiki-nav-item pb-2" id="systemd-autostart">
The systemd user service doesn't automatically start?
</h3>
<div class="ms-3">
<h4>X11 <small class="text-muted">(systemd)</small></h4>
<div class="mx-3">
<p>
Your <code>.xinitrc</code> is likely configured improperly and the <code>DISPLAY</code> environment
variable isn't set for systemd.<br/>
Proper configuration for the <code>.xinitrc</code> file can be found
<a href="https://wiki.archlinux.org/index.php/Xinit#Configuration">here</a>.<br/>
<small class="ms-3 text-muted">
Note: The fix below is just a quick and dirty fix to get OpenTabletDriver running and should
instead be resolved as above.
</small>
</p>
<ol>
<li>
Create an override file
<codeblock class="mt-2" language="bash">
# Opens with whatever program is set to $EDITOR
systemctl --user edit opentabletdriver.service
</codeblock>
</li>
<li>
Add this block below the first 2 lines of the file, then save and exit
<codeblock class="mt-2" language="ini">
[Service]
Environment=DISPLAY=:0
</codeblock>
</li>
<li>
Finally, run the following commands
<codeblock class="mt-2" language="bash">
# Reload the systemd user daemon
systemctl --user daemon-reload
# Start the OpenTabletDriver daemon service (restarts if already running)
systemctl --user restart opentabletdriver.service
</codeblock>
</li>
</ol>
</div>

<h4>Wayland <small class="text-muted">(systemd)</small></h4>
<div class="mx-3">
<ol>
<li>
Create an override file
<codeblock class="mt-2" language="bash">
# Opens with whatever program is set to $EDITOR
systemctl --user edit opentabletdriver.service
</codeblock>
</li>
<li>
Add this block below the first 2 lines of the file, then save and exit
<codeblock class="mt-2" language="ini">
[Service]
Environment=WAYLAND_DISPLAY=:0
</codeblock>
</li>
<li>
Finally, run the following commands
<codeblock class="mt-2" language="bash">
# Reload the systemd user daemon
systemctl --user daemon-reload
# Start the OpenTabletDriver daemon service (restarts if already running)
systemctl --user restart opentabletdriver.service
</codeblock>
</li>
</ol>
</div>
<p>
If you have enabled the systemd user service and this happens, your window manager isn't properly setting up
<code>graphical-session.target</code> before OpenTabletDriver starts, If you are experiencing this, add
<code>otd-daemon</code> to the autostart of your window manager for OpenTabletDriver to work on startup.
</p>
</div>

<hr/>
Expand All @@ -316,6 +254,8 @@

If you are not using a packaged build and instead compiled from source,
you will need to run <code>./OpenTabletDriver.Daemon</code> in your terminal from the build directory instead.

You may place this in your Window Managers startup for it to automatically start.
</p>
</div>

Expand Down

0 comments on commit f78c668

Please sign in to comment.