From e7d8d46e9a7f8590fd89f4b1964778f6b1f57e13 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 10 May 2014 11:32:45 +1200 Subject: First preparations for config reloading on-the-fly --- reload.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 reload.c (limited to 'reload.c') diff --git a/reload.c b/reload.c new file mode 100644 index 0000000..fcc5ca9 --- /dev/null +++ b/reload.c @@ -0,0 +1,22 @@ +/************************************************************************ + * This file is part of trayfreq-archlinux. * + * * + * trayfreq-archlinux is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation; either version 3 of the * + * License, or (at your option) any later version. * + * * + * trayfreq-archlinux is distributed in the hope that it will be useful,* + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with trayfreq-archlinux. If not, see * + * . * + ************************************************************************/ + +void reload_config() +{ + printf("USR1\n"); +} -- cgit v1.1 From 55da9c20452dd62db8fb776d4fee8f16a967281d Mon Sep 17 00:00:00 2001 From: David Date: Sat, 10 May 2014 13:31:43 +1200 Subject: Better makefile (I got sidetracked) --- reload.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'reload.c') diff --git a/reload.c b/reload.c index fcc5ca9..2026365 100644 --- a/reload.c +++ b/reload.c @@ -16,7 +16,16 @@ * . * ************************************************************************/ +#include "reload.h" + void reload_config() { - printf("USR1\n"); + config_init(); + if (_DEFAULT_SHOW_BATTERY) + { + bat_tray_hide(); + bat_tray_show(); + } else { + bat_tray_hide(); + } } -- cgit v1.1 From e05ece0acdc38ecf16e3ed2088a557248537d2a7 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 10 May 2014 14:08:33 +1200 Subject: Fixed auto governor change bug --- reload.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'reload.c') diff --git a/reload.c b/reload.c index 2026365..6b78dac 100644 --- a/reload.c +++ b/reload.c @@ -20,12 +20,15 @@ void reload_config() { + debug("Reloading config\n"); config_init(); if (_DEFAULT_SHOW_BATTERY) { - bat_tray_hide(); + //bat_tray_hide(); bat_tray_show(); } else { bat_tray_hide(); } + debug("Re-init freq tray\n"); + tray_set_defaults(); } -- cgit v1.1