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()
|
||||
root_check()
|
||||
file_stats()
|
||||
if IS_INSTALLED_WITH_SNAP and dcheck == "enabled":
|
||||
if IS_INSTALLED_WITH_SNAP and SNAP_DAEMON_CHECK == "enabled":
|
||||
gnome_power_detect_snap()
|
||||
tlp_service_detect_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.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 *
|
||||
|
||||
|
@ -55,9 +55,6 @@ else:
|
|||
auto_cpufreq_stats_path = Path("/var/run/auto-cpufreq.stats")
|
||||
governor_override_state = Path("/opt/auto-cpufreq/override.pickle")
|
||||
|
||||
# daemon check
|
||||
dcheck = getoutput("snapctl get daemon")
|
||||
|
||||
def file_stats():
|
||||
global auto_cpufreq_stats_file
|
||||
auto_cpufreq_stats_file = open(auto_cpufreq_stats_path, "w")
|
||||
|
@ -917,7 +914,7 @@ def running_daemon_check():
|
|||
if is_running("auto-cpufreq", "--daemon"):
|
||||
daemon_running_msg()
|
||||
exit(1)
|
||||
elif IS_INSTALLED_WITH_SNAP and dcheck == "enabled":
|
||||
elif IS_INSTALLED_WITH_SNAP and SNAP_DAEMON_CHECK == "enabled":
|
||||
daemon_running_msg()
|
||||
exit(1)
|
||||
|
||||
|
@ -926,6 +923,6 @@ def not_running_daemon_check():
|
|||
if not is_running("auto-cpufreq", "--daemon"):
|
||||
daemon_not_running_msg()
|
||||
exit(1)
|
||||
elif IS_INSTALLED_WITH_SNAP and dcheck == "disabled":
|
||||
elif IS_INSTALLED_WITH_SNAP and SNAP_DAEMON_CHECK == "disabled":
|
||||
daemon_not_running_msg()
|
||||
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_SNAP = getenv("PKG_MARKER") == "SNAP"
|
||||
POWER_SUPPLY_DIR = "/sys/class/power_supply/"
|
||||
SNAP_DAEMON_CHECK = getoutput("snapctl get daemon")
|
Loading…
Reference in New Issue