mirror of
https://github.com/aclist/dztui.git
synced 2026-11-06 18:10:58 +01:00
feat: dzgui 7 alpha
This commit is contained in:
1 parent
1acdbd58c5
commit
2e5b771137
150 files changed
+10359
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import re
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
CPU_FILE = "/proc/cpuinfo"
|
||||
|
||||
def is_steam_deck() -> bool:
|
||||
# TODO: tests
|
||||
r = r"AMD Custom APU [0-9]{4}"
|
||||
with open(CPU_FILE, "r") as f:
|
||||
s = f.read()
|
||||
match = re.search(r, s)
|
||||
if match:
|
||||
if "0932" in match.group() or "0405" in match.group():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def is_game_mode() -> bool:
|
||||
proc = subprocess.run(
|
||||
["/usr/bin/pgrep", "-a", "gamescope"],
|
||||
capture_output=True,
|
||||
text=True
|
||||
)
|
||||
if proc.returncode != 0:
|
||||
return False
|
||||
if "generate-drm-mode" in proc.stdout:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
Reference in new issue
Block a user