Skip to content

Commit 45ef74f

Browse files
committed
add option to disable updates in steamui
1 parent 019b91b commit 45ef74f

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

src/hhd/plugins/bootc/__init__.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -254,16 +254,16 @@ def __init__(self) -> None:
254254
self.state: STAGES = "init"
255255

256256
def settings(self) -> HHDSettings:
257-
if self.enabled:
258-
sets = {"updates": {"bootc": load_relative_yaml("settings.yml")}}
257+
sets = {
258+
"updates": {"bootc": load_relative_yaml("settings.yml")},
259+
"hhd": {"settings": load_relative_yaml("general.yml")},
260+
}
259261

260-
sets["updates"]["bootc"]["children"]["stage"]["modes"]["rebase"][
261-
"children"
262-
]["branch"]["options"] = self.branches
262+
sets["updates"]["bootc"]["children"]["stage"]["modes"]["rebase"][
263+
"children"
264+
]["branch"]["options"] = self.branches
263265

264-
return sets
265-
else:
266-
return {}
266+
return sets
267267

268268
def open(
269269
self,
@@ -422,7 +422,10 @@ def update(self, conf: Config):
422422

423423
# Handle steamos polkit
424424
if steamos == "check":
425-
if e == "ready":
425+
if not conf.get("hhd.settings.bootc_steamui", True):
426+
# Updates are disabled, return that there are none
427+
conf["updates.bootc.steamos-update"] = "ready"
428+
elif e == "ready":
426429
conf["updates.bootc.steamos-update"] = "has-update"
427430
elif e == "ready_rebased":
428431
# Make sure nothing funny happens on the rebase dialog
@@ -690,7 +693,7 @@ def autodetect(existing: Sequence[HHDPlugin]) -> Sequence[HHDPlugin]:
690693

691694
if not BOOTC_ENABLED:
692695
return []
693-
696+
694697
if not shutil.which(BOOTC_PATH):
695698
logger.warning("Bootc is enabled but not found in path.")
696699
return []

src/hhd/plugins/bootc/general.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
type: container
2+
tags: [non-essential]
3+
4+
children:
5+
bootc_steamui:
6+
type: bool
7+
tags: [non-essential]
8+
title: Show updates in SteamUI
9+
default: True

0 commit comments

Comments
 (0)