SecUpwN / Spotify-AdKiller

Your Party with Spotify - without ads!
https://github.com/SecUpwN/Spotify-AdKiller
GNU General Public License v3.0
845 stars 84 forks source link

Possible to start as a systemd service? #91

Closed mikeframpo closed 7 years ago

mikeframpo commented 7 years ago

I created a simple systemd service. But I get errors, see below.

I understand that it's not a good idea to run an Xorg program as a system-level task. So my question is: it is possible to run Spotify-AdKiller headless as a system-level thing?

Thanks, --Mike

● spotify-adkiller.service - Spotify-AdKiller
   Loaded: loaded (/etc/systemd/system/spotify-adkiller.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2017-02-17 09:54:31 NZDT; 11min ago
  Process: 23943 ExecStart=/usr/bin/spotify-adkiller.sh (code=exited, status=1/FAILURE)
 Main PID: 23943 (code=exited, status=1/FAILURE)

Feb 17 09:54:31 frampspc systemd[1]: Started Spotify-AdKiller.
Feb 17 09:54:31 frampspc spotify-adkiller.sh[23943]: Error: Can't open display: (null)
Feb 17 09:54:31 frampspc spotify-adkiller.sh[23943]: Failed creating new xdo instance
Feb 17 09:54:31 frampspc spotify-adkiller.sh[23943]: Spotify not active. Exiting.
Feb 17 09:54:31 frampspc spotify-adkiller.sh[23943]: ## Restoring settings ##
Feb 17 09:54:31 frampspc spotify-adkiller.sh[23943]: No PulseAudio daemon running, or not running as session daemon
Feb 17 09:54:31 frampspc systemd[1]: spotify-adkiller.service: Main process exited, code=exited, status=1/FAILURE
Feb 17 09:54:31 frampspc systemd[1]: spotify-adkiller.service: Unit entered failed state.
Feb 17 09:54:31 frampspc systemd[1]: spotify-adkiller.service: Failed with result 'exit-code'.
mikeframpo commented 7 years ago

I didn't realise that the program is intended to start spotify using a desktop icon. I think this issue can be closed.

I just like systemd services because they easily allow you to see the program's console output.

OlegSmelov commented 7 years ago

The script depends on Xorg too much to be run this early. 😄

But yeah, if you start it using the desktop icon, the script runs in background until you close Spotify.