mirror of
https://github.com/AdnanHodzic/auto-cpufreq.git
synced 2025-07-30 00:54:55 +02:00
Add flag message for those using Snap package
This commit is contained in:
parent
ec0252915c
commit
81744e3d28
@ -323,15 +323,25 @@ def main(monitor, live, daemon, install, update, remove, force, config, stats, g
|
|||||||
print(override)
|
print(override)
|
||||||
|
|
||||||
elif bluetooth_boot_off:
|
elif bluetooth_boot_off:
|
||||||
footer()
|
if IS_INSTALLED_WITH_SNAP:
|
||||||
root_check()
|
footer()
|
||||||
bluetooth_disable()
|
bluetooth_notif_snap()
|
||||||
footer()
|
footer()
|
||||||
|
else:
|
||||||
|
footer()
|
||||||
|
root_check()
|
||||||
|
bluetooth_disable()
|
||||||
|
footer()
|
||||||
elif bluetooth_boot_on:
|
elif bluetooth_boot_on:
|
||||||
footer()
|
if IS_INSTALLED_WITH_SNAP:
|
||||||
root_check()
|
footer()
|
||||||
bluetooth_enable()
|
bluetooth_on_notif_snap()
|
||||||
footer()
|
footer()
|
||||||
|
else:
|
||||||
|
footer()
|
||||||
|
root_check()
|
||||||
|
bluetooth_enable()
|
||||||
|
footer()
|
||||||
elif debug:
|
elif debug:
|
||||||
config_info_dialog()
|
config_info_dialog()
|
||||||
root_check()
|
root_check()
|
||||||
|
@ -17,7 +17,7 @@ app_name = "python3 power_helper.py" if argv[0] == "power_helper.py" else "auto-
|
|||||||
def header(): print("\n------------------------- auto-cpufreq: Power helper -------------------------\n")
|
def header(): print("\n------------------------- auto-cpufreq: Power helper -------------------------\n")
|
||||||
def warning(): print("\n----------------------------------- Warning -----------------------------------\n")
|
def warning(): print("\n----------------------------------- Warning -----------------------------------\n")
|
||||||
|
|
||||||
def helper_opts(): print("\nFor full list of options run: python3 power_helper.py --help")
|
def helper_opts(): print("\nFor full list of options run: python3 -m auto_cpufreq.power_helper --help")
|
||||||
|
|
||||||
# used to check if binary exists on the system
|
# used to check if binary exists on the system
|
||||||
def does_command_exists(cmd): return which(cmd) is not None
|
def does_command_exists(cmd): return which(cmd) is not None
|
||||||
@ -67,7 +67,7 @@ def gnome_power_detect():
|
|||||||
print("\nOnly necessary to be manually done on Snap package installs!")
|
print("\nOnly necessary to be manually done on Snap package installs!")
|
||||||
print("Steps to perform this action using auto-cpufreq: power_helper script:")
|
print("Steps to perform this action using auto-cpufreq: power_helper script:")
|
||||||
print(f"git clone {GITHUB}.git")
|
print(f"git clone {GITHUB}.git")
|
||||||
print("python3 power_helper.py --gnome_power_disable")
|
print("python3 -m auto_cpufreq.power_helper --gnome_power_disable")
|
||||||
print(f"\nReference: {GITHUB}#configuring-auto-cpufreq")
|
print(f"\nReference: {GITHUB}#configuring-auto-cpufreq")
|
||||||
|
|
||||||
# automatically disable gnome power profile service in case it's running during install
|
# automatically disable gnome power profile service in case it's running during install
|
||||||
@ -90,7 +90,7 @@ def gnome_power_detect_snap():
|
|||||||
print("This daemon might interfere with auto-cpufreq and should be disabled!")
|
print("This daemon might interfere with auto-cpufreq and should be disabled!")
|
||||||
print("\nSteps to perform this action using auto-cpufreq: power_helper script:")
|
print("\nSteps to perform this action using auto-cpufreq: power_helper script:")
|
||||||
print(f"git clone {GITHUB}.git")
|
print(f"git clone {GITHUB}.git")
|
||||||
print("python3 power_helper.py --gnome_power_disable")
|
print("python3 -m auto_cpufreq.power_helper --gnome_power_disable")
|
||||||
print(f"\nReference: {GITHUB}#configuring-auto-cpufreq")
|
print(f"\nReference: {GITHUB}#configuring-auto-cpufreq")
|
||||||
|
|
||||||
# stops gnome >= 40 power profiles (live)
|
# stops gnome >= 40 power profiles (live)
|
||||||
@ -185,13 +185,15 @@ def bluetooth_enable():
|
|||||||
def bluetooth_notif_snap():
|
def bluetooth_notif_snap():
|
||||||
print("\n* Unable to turn off bluetooth on boot due to Snap package restrictions!")
|
print("\n* Unable to turn off bluetooth on boot due to Snap package restrictions!")
|
||||||
print("\nSteps to perform this action using auto-cpufreq: power_helper script:")
|
print("\nSteps to perform this action using auto-cpufreq: power_helper script:")
|
||||||
print("python3 power_helper.py --bluetooth_boot_off")
|
print("python3 -m auto_cpufreq.power_helper --bluetooth_boot_off")
|
||||||
|
print("\nFor help see: https://github.com/AdnanHodzic/auto-cpufreq/#1-power_helperpy-script-snap-package-install-only")
|
||||||
|
|
||||||
# turn off bluetooth on snap message
|
# turn off bluetooth on snap message
|
||||||
def bluetooth_on_notif_snap():
|
def bluetooth_on_notif_snap():
|
||||||
print("\n* Unable to turn on bluetooth on boot due to Snap package restrictions!")
|
print("\n* Unable to turn on bluetooth on boot due to Snap package restrictions!")
|
||||||
print("\nSteps to perform this action using auto-cpufreq: power_helper script:")
|
print("\nSteps to perform this action using auto-cpufreq: power_helper script:")
|
||||||
print("python3 power_helper.py --bluetooth_boot_on")
|
print("python3 -m auto_cpufreq.power_helper --bluetooth_boot_on")
|
||||||
|
print("\nFor help see: https://github.com/AdnanHodzic/auto-cpufreq/#1-power_helperpy-script-snap-package-install-only")
|
||||||
|
|
||||||
# gnome power removal reminder
|
# gnome power removal reminder
|
||||||
def gnome_power_rm_reminder():
|
def gnome_power_rm_reminder():
|
||||||
@ -207,7 +209,7 @@ def gnome_power_rm_reminder_snap():
|
|||||||
print("Now it's recommended to enable this service.")
|
print("Now it's recommended to enable this service.")
|
||||||
print("\nSteps to perform this action using auto-cpufreq: power_helper script:")
|
print("\nSteps to perform this action using auto-cpufreq: power_helper script:")
|
||||||
print(f"git clone {GITHUB}.git")
|
print(f"git clone {GITHUB}.git")
|
||||||
print("python3 power_helper.py --gnome_power_enable")
|
print("python3 -m auto_cpufreq.power_helper --gnome_power_enable")
|
||||||
print(f"\nReference: {GITHUB}#configuring-auto-cpufreq")
|
print(f"\nReference: {GITHUB}#configuring-auto-cpufreq")
|
||||||
|
|
||||||
def valid_options():
|
def valid_options():
|
||||||
@ -249,11 +251,11 @@ def gnome_power_svc_disable():
|
|||||||
# check if snapd is present and if snap package is installed | 0 is success
|
# check if snapd is present and if snap package is installed | 0 is success
|
||||||
if not bool(snap_pkg_check):
|
if not bool(snap_pkg_check):
|
||||||
print("GNOME Power Profiles Daemon is already disabled, it can be re-enabled by running:\n"
|
print("GNOME Power Profiles Daemon is already disabled, it can be re-enabled by running:\n"
|
||||||
"sudo python3 power_helper.py --gnome_power_enable\n"
|
"sudo python3 -m auto_cpufreq.power_helper --gnome_power_enable\n"
|
||||||
)
|
)
|
||||||
elif snap_pkg_check == 1:
|
elif snap_pkg_check == 1:
|
||||||
print("auto-cpufreq snap package not installed\nGNOME Power Profiles Daemon should be enabled. run:\n\n"
|
print("auto-cpufreq snap package not installed\nGNOME Power Profiles Daemon should be enabled. run:\n\n"
|
||||||
"sudo python3 power_helper.py --gnome_power_enable"
|
"sudo python3 -m auto_cpufreq.power_helper --gnome_power_enable"
|
||||||
)
|
)
|
||||||
except:
|
except:
|
||||||
# snapd not found on the system
|
# snapd not found on the system
|
||||||
@ -263,7 +265,7 @@ def gnome_power_svc_disable():
|
|||||||
if not bool(gnome_power_status) and powerprofilesctl_exists:
|
if not bool(gnome_power_status) and powerprofilesctl_exists:
|
||||||
if snap_pkg_check == 1:
|
if snap_pkg_check == 1:
|
||||||
print("auto-cpufreq snap package not installed.\nGNOME Power Profiles Daemon should be enabled, run:\n\n"
|
print("auto-cpufreq snap package not installed.\nGNOME Power Profiles Daemon should be enabled, run:\n\n"
|
||||||
"sudo python3 power_helper.py --gnome_power_enable"
|
"sudo python3 -m auto_cpufreq.power_helper --gnome_power_enable"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
print("auto-cpufreq snap package installed, GNOME Power Profiles Daemon should be disabled.\n")
|
print("auto-cpufreq snap package installed, GNOME Power Profiles Daemon should be disabled.\n")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user