Compare commits

..

1 Commits

Author SHA1 Message Date
suchmememanyskill 395e45167d Shared Ctx tab rename to SharedJSContext (#395) 2023-03-09 18:58:19 +01:00
5 changed files with 11 additions and 39 deletions
+5 -3
View File
@@ -21,16 +21,18 @@ jobs:
run: |
STUB_CHANGED="false"
PATHS=(plugin plugin/decky_plugin.pyi)
SHA="${{ github.sha }}"
SHA=${{ github.sha }}
SHA_PREV=$(git rev-list --parents -n 1 $SHA)
FILES=$(git diff $SHA_PREV --name-only -- ${PATHS[@]} | jq -Rsc 'split("\n")[:-1] | join (",")')
FILES=$(git diff $SHA_PREV..$SHA --name-only -- ${PATHS[@]} | jq -Rsc 'split("\n")[:-1] | join (",")')
if [[ "$FILES" == *"plugin/decky_plugin.pyi"* ]]; then
STUB_CHANGED="true"
$STUB_CHANGED="true"
echo "Stub has changed, pushing updated stub"
else
echo "Stub has not changed, exiting."
echo "has_changed=$STUB_CHANGED" >> $GITHUB_OUTPUT
exit 0
fi
echo "has_changed=$STUB_CHANGED" >> $GITHUB_OUTPUT
- name: Push updated stub
if: steps.changed-stub.outputs.has_changed == true
+5 -3
View File
@@ -394,8 +394,10 @@ async def get_tab_lambda(test) -> Tab:
raise ValueError(f"Tab not found by lambda")
return tab
SHARED_CTX_NAMES = ["SharedJSContext", "Steam Shared Context presented by Valve™", "Steam", "SP"]
def tab_is_gamepadui(t: Tab) -> bool:
return "https://steamloopback.host/routes/" in t.url and (t.title == "Steam Shared Context presented by Valve™" or t.title == "Steam" or t.title == "SP")
return "https://steamloopback.host/routes/" in t.url and t.title in SHARED_CTX_NAMES
async def get_gamepadui_tab() -> Tab:
tabs = await get_tabs()
@@ -412,7 +414,7 @@ async def inject_to_tab(tab_name, js, run_async=False):
async def close_old_tabs():
tabs = await get_tabs()
for t in tabs:
if not t.title or (t.title != "Steam Shared Context presented by Valve™" and t.title != "Steam" and t.title != "SP"):
if not t.title or t.title not in SHARED_CTX_NAMES:
logger.debug("Closing tab: " + getattr(t, "title", "Untitled"))
await t.close()
await sleep(0.5)
await sleep(0.5)
+1 -3
View File
@@ -64,10 +64,8 @@ class PluginWrapper:
# export a bunch of environment variables to help plugin developers
environ["HOME"] = helpers.get_home_path("root" if "root" in self.flags else helpers.get_user())
environ["USER"] = "root" if "root" in self.flags else helpers.get_user()
environ["USER_ID"] = "0" if "root" in self.flags else helpers.get_user_id()
environ["DECKY_VERSION"] = helpers.get_loader_version()
environ["DECKY_USER"] = str(helpers.get_user())
environ["DECKY_USER_ID"] = str(helpers.get_user_id())
environ["DECKY_USER"] = helpers.get_user()
environ["DECKY_USER_HOME"] = helpers.get_home_path()
environ["DECKY_HOME"] = helpers.get_homebrew_path()
environ["DECKY_PLUGIN_SETTINGS_DIR"] = path.join(environ["DECKY_HOME"], "settings", self.plugin_directory)
-15
View File
@@ -38,14 +38,6 @@ It would be `root` if `root` was specified in the plugin's flags otherwise the u
e.g.: `deck`
"""
USER_ID: int = int(os.getenv("USER_ID", default="-1"))
"""
The effective UID running the process.
Environment variable: `USER_ID`.
It would be `0` if `root` was specified in the plugin's flags otherwise the id of the user whose home decky resides in.
e.g.: `1000`
"""
DECKY_VERSION: str = os.getenv("DECKY_VERSION", default="")
"""
The version of the decky loader.
@@ -60,13 +52,6 @@ Environment variable: `DECKY_USER`.
e.g.: `deck`
"""
DECKY_USER_ID: int = int(os.getenv("DECKY_USER_ID", default="-1"))
"""
The UID of the user whose home decky resides in.
Environment variable: `DECKY_USER_ID`.
e.g.: `1000`
"""
DECKY_USER_HOME: str = os.getenv("DECKY_USER_HOME", default="")
"""
The home of the user where decky resides in.
-15
View File
@@ -36,14 +36,6 @@ It would be `root` if `root` was specified in the plugin's flags otherwise the u
e.g.: `deck`
"""
USER_ID: int
"""
The effective UID running the process.
Environment variable: `UID`.
It would be `0` if `root` was specified in the plugin's flags otherwise the id of the user whose home decky resides in.
e.g.: `1000`
"""
DECKY_VERSION: str
"""
The version of the decky loader.
@@ -58,13 +50,6 @@ Environment variable: `DECKY_USER`.
e.g.: `deck`
"""
DECKY_USER_ID: int
"""
The UID of the user whose home decky resides in.
Environment variable: `DECKY_USER_ID`.
e.g.: `1000`
"""
DECKY_USER_HOME: str
"""
The home of the user where decky resides in.