{"id":841,"date":"2024-01-01T02:50:41","date_gmt":"2024-01-01T05:50:41","guid":{"rendered":"https:\/\/freeshell.de\/~felipe\/blog\/?p=841"},"modified":"2024-06-09T15:43:53","modified_gmt":"2024-06-09T18:43:53","slug":"creating-a-systemd-service-for-xscreensaver","status":"publish","type":"post","link":"https:\/\/freeshell.de\/~felipe\/blog\/01\/2024\/linux\/creating-a-systemd-service-for-xscreensaver\/","title":{"rendered":"Creating a systemd service for xscreensaver"},"content":{"rendered":"\n<p>First, is to define a systemd service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ cat &gt; ~\/.config\/systemd\/user\/xscreensaver.service &lt;&lt;EOF\n&#91;Unit]\nDescription=XScreenSaver\nAfter=network.target\n\n&#91;Service]\nExecStart=\/usr\/bin\/xscreensaver -nosplash\nRestart=always\nRestartSec=3\n\n&#91;Install]\nWantedBy=default.target\nEOF\n<\/code><\/pre>\n\n\n\n<p>Then,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ systemctl --user enable xscreensaver.service\n$ systemctl --user start xscreensaver.service\n$ systemctl --user status xscreensaver.service\n<\/code><\/pre>\n\n\n\n<p>BTW it could appear to fail at first if the xscreensaver daemon is already running. In that case, do:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ pkill xscreensaver\n<\/code><\/pre>\n\n\n\n<p>Then check the status again, and it should now be active.<\/p>\n\n\n\n<p>$ systemctl &#8211;user status xscreensaver.service<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>First, is to define a systemd service: Then, BTW it could appear to fail at first if the xscreensaver daemon is already running. In that case, do: Then check the status again, and it should now be active. $ systemctl &#8211;user status xscreensaver.service<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[71,70],"tags":[66,98,67,96,99,100,97],"class_list":["post-841","post","type-post","status-publish","format-standard","hentry","category-arch","category-linux","tag-arch","tag-demon","tag-linux","tag-screensaver","tag-service","tag-systemd","tag-xscreensaver"],"_links":{"self":[{"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/posts\/841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/comments?post=841"}],"version-history":[{"count":1,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/posts\/841\/revisions"}],"predecessor-version":[{"id":842,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/posts\/841\/revisions\/842"}],"wp:attachment":[{"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/media?parent=841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/categories?post=841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/freeshell.de\/~felipe\/blog\/wp-json\/wp\/v2\/tags?post=841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}