Skip to content

Commit

Permalink
reintroduced sunshine-status reading
Browse files Browse the repository at this point in the history
  • Loading branch information
Odizinne committed Aug 2, 2024
1 parent 0bfa871 commit 1281439
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/BigPictureTV.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from audio_manager import switch_audio, is_audio_device_cmdlets_installed
from mode_manager import Mode, read_current_mode, write_current_mode
from shortcut_manager import check_startup_shortcut, handle_startup_checkbox_state_changed
from window_monitor import is_bigpicture_running
from status_monitor import is_bigpicture_running, is_sunshine_stream_active

SETTINGS_FILE = os.path.join(os.environ["APPDATA"], "BigPictureTV", "settings.json")
ICONS_FOLDER = "icons" if getattr(sys, "frozen", False) else os.path.join(os.path.dirname(__file__), "icons")
Expand Down Expand Up @@ -139,7 +139,7 @@ def get_audio_capabilities(self):
return

def update_mode(self):
if is_bigpicture_running() and self.current_mode != Mode.GAMEMODE:
if is_bigpicture_running() and self.current_mode != Mode.GAMEMODE and not is_sunshine_stream_active():
self.switch_mode(Mode.GAMEMODE)
elif not is_bigpicture_running() and self.current_mode != Mode.DESKTOP:
self.switch_mode(Mode.DESKTOP)
Expand Down
8 changes: 8 additions & 0 deletions src/window_monitor.py → src/status_monitor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import os
import pygetwindow as gw
from steam_language_reader import get_big_picture_window_title

SUNSHINE_STATUS_FILE = os.path.join(os.environ.get("APPDATA"), "sunshine-status", "status.txt")


def is_bigpicture_running():
big_picture_title = get_big_picture_window_title().lower()
Expand All @@ -12,3 +15,8 @@ def is_bigpicture_running():
return True

return False


def is_sunshine_stream_active():
# To be used with https://github.com/Odizinne/Sunshine-Toolbox
return os.path.exists("SUNSHINE_STATUS_FILE")

0 comments on commit 1281439

Please sign in to comment.