Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ sudo make install
sudo ldconfig
```

On Void Linux, additional arguments need to be passed to `./configure`.

```
./configure CFLAGS="-I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include" LDFLAGS=-ljack
```

Some udev rules might need to be installed manually with `sudo make install` from the `udev` directory as they are not part of the `install` target. This is not needed when packaging or when distributions already provide them.

The package dependencies for Debian based distributions are:
Expand Down Expand Up @@ -76,6 +82,12 @@ For Arch, no additional dependencies are needed.

As this will install `jackd2`, you would be asked to configure it to be run with real time priority. Be sure to answer yes. With this, the `audio` group would be able to run processes with real time priority. Be sure to be in the `audio` group too.

For Void Linux, run this to install the dependencies. Notice that, since this distribution is not based on `systemd`, the Overwitch service based on it will not be installed.

```
sudo xbps-install base-devel gettext-devel pipewire libjack-pipewire jack-devel libusb-devel glib-devel json-glib-devel libsndfile-devel libsamplerate-devel gtk4-devel
```

### systemd service

For embedded systems or users not wanting to use the GUI, it is recommended to install the systemd service unit by running `sudo make install` from the `systemd` directory. Notice `overwitch.service` is installed as a user service.
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ AC_DEFINE([PACKAGE_SERVICE_DBUS_NAME], ["io.github.dagargo.OverwitchService"], "
AC_PROG_CC

# Define conditional prior to package checks
AM_CONDITIONAL([CLI_ONLY], [test "${CLI_ONLY}" == yes])
AM_CONDITIONAL([CLI_ONLY], [test "${CLI_ONLY}" = yes])
AM_CONDITIONAL([GUI], [test "${CLI_ONLY}" != yes])

AM_COND_IF(GUI, [PKG_CHECK_MODULES(GTK4, gtk4 >= 4.14)])
Expand Down
12 changes: 12 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ sudo make install
sudo ldconfig
```

On Void Linux, additional arguments need to be passed to `./configure`.

```
./configure CFLAGS="-I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include" LDFLAGS=-ljack
```

Some udev rules might need to be installed manually with `sudo make install` from the `udev` directory as they are not part of the `install` target. This is not needed when packaging or when distributions already provide them.

The package dependencies for Debian based distributions are:
Expand Down Expand Up @@ -51,6 +57,12 @@ For Arch, no additional dependencies are needed.

As this will install `jackd2`, you would be asked to configure it to be run with real time priority. Be sure to answer yes. With this, the `audio` group would be able to run processes with real time priority. Be sure to be in the `audio` group too.

For Void Linux, run this to install the dependencies. Notice that, since this distribution is not based on `systemd`, the Overwitch service based on it will not be installed.

```
sudo xbps-install base-devel gettext-devel pipewire libjack-pipewire jack-devel libusb-devel glib-devel json-glib-devel libsndfile-devel libsamplerate-devel gtk4-devel
```

### systemd service

For embedded systems or users not wanting to use the GUI, it is recommended to install the systemd service unit by running `sudo make install` from the `systemd` directory. Notice `overwitch.service` is installed as a user service.
Expand Down
4 changes: 4 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,8 @@ SAMPLERATE_LIBS = @SAMPLERATE_LIBS@
SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
SNDFILE_LIBS = @SNDFILE_LIBS@

if HAVE_SYSTEMD
AM_CPPFLAGS = -DDATADIR='"$(datadir)/$(PACKAGE)"' -DLOCALEDIR='"$(localedir)"' -DHAVE_SYSTEMD='"yes"'
else
AM_CPPFLAGS = -DDATADIR='"$(datadir)/$(PACKAGE)"' -DLOCALEDIR='"$(localedir)"'
endif
9 changes: 8 additions & 1 deletion src/main-service.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
#define _GNU_SOURCE
#include <signal.h>
#include <errno.h>
#ifdef HAVE_SYSTEMD
#include <systemd/sd-daemon.h>
#endif
#include <time.h>
#include "../config.h"
#include "jclient.h"
Expand Down Expand Up @@ -141,16 +143,19 @@ signal_handler (int signum)
{
struct timespec ts;
clock_gettime (CLOCK_MONOTONIC, &ts);
#ifdef HAVE_SYSTEMD
sd_notifyf (0, "RELOADING=1\nMONOTONIC_USEC=%" PRIdMAX "%06d",
(intmax_t) ts.tv_sec, (int) (ts.tv_nsec / 1000));
#endif
handle_start ();
#ifdef HAVE_SYSTEMD
sd_notify (0, "READY=1");
#endif
}
else
{
error_print ("Signal not handled");
}

}

static void *
Expand Down Expand Up @@ -544,7 +549,9 @@ app_startup (GApplication *app, gpointer *user_data)
startup ();
g_application_hold (app);
g_application_activate (app);
#ifdef HAVE_SYSTEMD
sd_notify (0, "READY=1");
#endif
}
}

Expand Down
1 change: 0 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#define _GNU_SOURCE
#include <errno.h>
#include <libusb.h>
#include <string.h>
#include <gtk/gtk.h>
#include <json-glib/json-glib.h>
Expand Down
Loading