mirror of
https://github.com/AdnanHodzic/auto-cpufreq.git
synced 2025-07-27 07:34:25 +02:00
Fix Snap package daemon check
This commit is contained in:
parent
64af2b4ec6
commit
429bf7672f
@ -114,7 +114,7 @@ def main(monitor, live, daemon, install, update, remove, force, config, stats, g
|
|||||||
config_info_dialog()
|
config_info_dialog()
|
||||||
root_check()
|
root_check()
|
||||||
file_stats()
|
file_stats()
|
||||||
if IS_INSTALLED_WITH_SNAP and dcheck == "enabled":
|
if IS_INSTALLED_WITH_SNAP and SNAP_DAEMON_CHECK == "enabled":
|
||||||
gnome_power_detect_snap()
|
gnome_power_detect_snap()
|
||||||
tlp_service_detect_snap()
|
tlp_service_detect_snap()
|
||||||
elif not IS_INSTALLED_WITH_SNAP:
|
elif not IS_INSTALLED_WITH_SNAP:
|
||||||
|
@ -15,7 +15,7 @@ from warnings import filterwarnings
|
|||||||
|
|
||||||
from auto_cpufreq.config.config import config
|
from auto_cpufreq.config.config import config
|
||||||
from auto_cpufreq.globals import (
|
from auto_cpufreq.globals import (
|
||||||
ALL_GOVERNORS, AVAILABLE_GOVERNORS, AVAILABLE_GOVERNORS_SORTED, GITHUB, IS_INSTALLED_WITH_AUR, IS_INSTALLED_WITH_SNAP, POWER_SUPPLY_DIR
|
ALL_GOVERNORS, AVAILABLE_GOVERNORS, AVAILABLE_GOVERNORS_SORTED, GITHUB, IS_INSTALLED_WITH_AUR, IS_INSTALLED_WITH_SNAP, POWER_SUPPLY_DIR, SNAP_DAEMON_CHECK
|
||||||
)
|
)
|
||||||
from auto_cpufreq.power_helper import *
|
from auto_cpufreq.power_helper import *
|
||||||
|
|
||||||
@ -55,9 +55,6 @@ else:
|
|||||||
auto_cpufreq_stats_path = Path("/var/run/auto-cpufreq.stats")
|
auto_cpufreq_stats_path = Path("/var/run/auto-cpufreq.stats")
|
||||||
governor_override_state = Path("/opt/auto-cpufreq/override.pickle")
|
governor_override_state = Path("/opt/auto-cpufreq/override.pickle")
|
||||||
|
|
||||||
# daemon check
|
|
||||||
dcheck = getoutput("snapctl get daemon")
|
|
||||||
|
|
||||||
def file_stats():
|
def file_stats():
|
||||||
global auto_cpufreq_stats_file
|
global auto_cpufreq_stats_file
|
||||||
auto_cpufreq_stats_file = open(auto_cpufreq_stats_path, "w")
|
auto_cpufreq_stats_file = open(auto_cpufreq_stats_path, "w")
|
||||||
@ -917,7 +914,7 @@ def running_daemon_check():
|
|||||||
if is_running("auto-cpufreq", "--daemon"):
|
if is_running("auto-cpufreq", "--daemon"):
|
||||||
daemon_running_msg()
|
daemon_running_msg()
|
||||||
exit(1)
|
exit(1)
|
||||||
elif IS_INSTALLED_WITH_SNAP and dcheck == "enabled":
|
elif IS_INSTALLED_WITH_SNAP and SNAP_DAEMON_CHECK == "enabled":
|
||||||
daemon_running_msg()
|
daemon_running_msg()
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
@ -926,6 +923,6 @@ def not_running_daemon_check():
|
|||||||
if not is_running("auto-cpufreq", "--daemon"):
|
if not is_running("auto-cpufreq", "--daemon"):
|
||||||
daemon_not_running_msg()
|
daemon_not_running_msg()
|
||||||
exit(1)
|
exit(1)
|
||||||
elif IS_INSTALLED_WITH_SNAP and dcheck == "disabled":
|
elif IS_INSTALLED_WITH_SNAP and SNAP_DAEMON_CHECK == "disabled":
|
||||||
daemon_not_running_msg()
|
daemon_not_running_msg()
|
||||||
exit(1)
|
exit(1)
|
||||||
|
@ -10,3 +10,4 @@ GITHUB = "https://github.com/AdnanHodzic/auto-cpufreq"
|
|||||||
IS_INSTALLED_WITH_AUR = path.isfile("/etc/arch-release") and bool(getoutput("pacman -Qs auto-cpufreq"))
|
IS_INSTALLED_WITH_AUR = path.isfile("/etc/arch-release") and bool(getoutput("pacman -Qs auto-cpufreq"))
|
||||||
IS_INSTALLED_WITH_SNAP = getenv("PKG_MARKER") == "SNAP"
|
IS_INSTALLED_WITH_SNAP = getenv("PKG_MARKER") == "SNAP"
|
||||||
POWER_SUPPLY_DIR = "/sys/class/power_supply/"
|
POWER_SUPPLY_DIR = "/sys/class/power_supply/"
|
||||||
|
SNAP_DAEMON_CHECK = getoutput("snapctl get daemon")
|
Loading…
x
Reference in New Issue
Block a user