Merge branch 'non-systemd-gnome-power'
This commit is contained in:
commit
1909cc87c1
|
@ -21,6 +21,7 @@ def helper_opts():
|
||||||
|
|
||||||
# detect if gnome power profile service is running
|
# detect if gnome power profile service is running
|
||||||
if os.getenv('PKG_MARKER') != "SNAP":
|
if os.getenv('PKG_MARKER') != "SNAP":
|
||||||
|
if which("systemctl") is not None:
|
||||||
try:
|
try:
|
||||||
gnome_power_stats = call(["systemctl", "is-active", "--quiet", "power-profiles-daemon"])
|
gnome_power_stats = call(["systemctl", "is-active", "--quiet", "power-profiles-daemon"])
|
||||||
except:
|
except:
|
||||||
|
@ -30,6 +31,7 @@ if os.getenv('PKG_MARKER') != "SNAP":
|
||||||
|
|
||||||
# alert in case gnome power profile service is running
|
# alert in case gnome power profile service is running
|
||||||
def gnome_power_detect():
|
def gnome_power_detect():
|
||||||
|
if which("systemctl") is not None:
|
||||||
if gnome_power_stats == 0:
|
if gnome_power_stats == 0:
|
||||||
print("\n----------------------------------- Warning -----------------------------------\n")
|
print("\n----------------------------------- Warning -----------------------------------\n")
|
||||||
print("Detected running GNOME Power Profiles daemon service!")
|
print("Detected running GNOME Power Profiles daemon service!")
|
||||||
|
@ -42,6 +44,7 @@ def gnome_power_detect():
|
||||||
|
|
||||||
# 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
|
||||||
def gnome_power_detect_install():
|
def gnome_power_detect_install():
|
||||||
|
if which("systemctl") is not None:
|
||||||
if gnome_power_stats == 0:
|
if gnome_power_stats == 0:
|
||||||
print("\n----------------------------------- Warning -----------------------------------\n")
|
print("\n----------------------------------- Warning -----------------------------------\n")
|
||||||
print("Detected running GNOME Power Profiles daemon service!")
|
print("Detected running GNOME Power Profiles daemon service!")
|
||||||
|
@ -68,6 +71,7 @@ def gnome_power_disable_live():
|
||||||
|
|
||||||
# disable gnome >= 40 power profiles (install)
|
# disable gnome >= 40 power profiles (install)
|
||||||
def gnome_power_svc_disable():
|
def gnome_power_svc_disable():
|
||||||
|
if which("systemctl") is not None:
|
||||||
try:
|
try:
|
||||||
print("\n* Disabling GNOME power profiles")
|
print("\n* Disabling GNOME power profiles")
|
||||||
call(["systemctl", "stop", "power-profiles-daemon"])
|
call(["systemctl", "stop", "power-profiles-daemon"])
|
||||||
|
@ -82,6 +86,7 @@ def gnome_power_svc_disable():
|
||||||
|
|
||||||
# enable gnome >= 40 power profiles (uninstall)
|
# enable gnome >= 40 power profiles (uninstall)
|
||||||
def gnome_power_svc_enable():
|
def gnome_power_svc_enable():
|
||||||
|
if which("systemctl") is not None:
|
||||||
try:
|
try:
|
||||||
print("\n* Enabling GNOME power profiles")
|
print("\n* Enabling GNOME power profiles")
|
||||||
call(["systemctl", "unmask", "power-profiles-daemon"])
|
call(["systemctl", "unmask", "power-profiles-daemon"])
|
||||||
|
@ -96,6 +101,7 @@ def gnome_power_svc_enable():
|
||||||
|
|
||||||
# gnome power profiles current status
|
# gnome power profiles current status
|
||||||
def gnome_power_svc_status():
|
def gnome_power_svc_status():
|
||||||
|
if which("systemctl") is not None:
|
||||||
try:
|
try:
|
||||||
print("* GNOME power profiles status")
|
print("* GNOME power profiles status")
|
||||||
call(["systemctl", "status", "power-profiles-daemon"])
|
call(["systemctl", "status", "power-profiles-daemon"])
|
||||||
|
@ -161,6 +167,7 @@ def bluetooth_on_notif_snap():
|
||||||
|
|
||||||
# gnome power removal reminder
|
# gnome power removal reminder
|
||||||
def gnome_power_rm_reminder():
|
def gnome_power_rm_reminder():
|
||||||
|
if which("systemctl") is not None:
|
||||||
if gnome_power_stats != 0:
|
if gnome_power_stats != 0:
|
||||||
print("\n----------------------------------- Warning -----------------------------------\n")
|
print("\n----------------------------------- Warning -----------------------------------\n")
|
||||||
print("Detected GNOME Power Profiles daemon service is stopped!")
|
print("Detected GNOME Power Profiles daemon service is stopped!")
|
||||||
|
|
Loading…
Reference in New Issue