-
-
Notifications
You must be signed in to change notification settings - Fork 325
Headless Operation
Wellington Wallace edited this page Aug 2, 2018
·
4 revisions
PulseEffects is a GUI application requiring X and Gtk. To run it on a headless machine, for example a Raspberry Pi used to play back music, Xvfb can be used instead of a full X session:
Xvfb :1 &
export DISPLAY=:1
pulseeffects --gapplication-service &
Running a VNC server could give access to the Xvfb session.
The following script can be used to start/stop Xvfb and PulseEffects. /usr/local/bin/pulseeffects-xvfb:
#!/bin/bash
if [[ "$1" = "start" ]]; then
pkill Xvfb
sleep 1
Xvfb :43 -screen 0 1024x768x16 &
sleep 3
export DISPLAY=:43
pulseeffects --gapplication-service
fi
if [[ "$1" = "stop" ]]; then
pulseeffects --quit
pkill Xvfb
fi
An appropriate systemd service can be stored in .config/systemd/user/pulseeffects-xvfb.service:
[Unit]
Description=Pulseeffects inside Xvfb
[Service]
Type=simple
ExecStart=/usr/local/bin/pulseeffects-xvfb start
ExecStop=/usr/local/bin/pulseeffects-xvfb stop
Restart=on-failure
[Install]
WantedBy=default.target
Now the service can be started and enabled so PulseEffects is run on user login.
systemctl --user daemon-reload
systemctl --user start pulseeffects-xvfb
systemctl --user enable pulseeffects-xvfb