mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-08-05 20:58:29 +02:00
Integrated sd_notify to get status messages in systemd (#28)
* Integrated sd_notify to get status messages in systemd * reset color attributes after use in string
This commit is contained in:
@@ -36,6 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "governors.h"
|
||||
#include "logging.h"
|
||||
|
||||
#include <systemd/sd-daemon.h>
|
||||
#include <linux/limits.h>
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
@@ -161,6 +162,8 @@ void game_mode_context_destroy(GameModeContext *self)
|
||||
static void game_mode_context_enter(GameModeContext *self)
|
||||
{
|
||||
LOG_MSG("Entering Game Mode...\n");
|
||||
sd_notifyf(0,"STATUS=%sGameMode is now active.%s\n", "\x1B[1;32m", "\x1B[0m");
|
||||
|
||||
if (!self->performance_mode && set_governors("performance")) {
|
||||
self->performance_mode = true;
|
||||
}
|
||||
@@ -175,6 +178,8 @@ static void game_mode_context_enter(GameModeContext *self)
|
||||
static void game_mode_context_leave(GameModeContext *self)
|
||||
{
|
||||
LOG_MSG("Leaving Game Mode...\n");
|
||||
sd_notifyf(0,"STATUS=%sGameMode is currently deactivated.%s\n", "\x1B[1;36m", "\x1B[0m");
|
||||
|
||||
if (self->performance_mode && set_governors(NULL)) {
|
||||
self->performance_mode = false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user