Add publish metadata: MIT license, README, icon, store tags, working make dist
This commit is contained in:
parent
cb06115f08
commit
c11585e79c
7 changed files with 111 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -2,3 +2,4 @@
|
||||||
dist
|
dist
|
||||||
*.uid
|
*.uid
|
||||||
*.remap
|
*.remap
|
||||||
|
*.import
|
||||||
|
|
|
||||||
21
LICENSE
Normal file
21
LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 Jose Falanga
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
11
Makefile
11
Makefile
|
|
@ -1,8 +1,9 @@
|
||||||
PLUGIN_ID ?= $(shell grep 'plugin\.id' plugin.json | grep -o ':.*' | grep -o '"[^"]\+"' | sed 's/"//g')
|
PLUGIN_ID ?= $(shell grep 'plugin\.id' plugin.json | grep -o ':.*' | grep -o '"[^"]\+"' | sed 's/"//g')
|
||||||
PLUGIN_NAME ?= $(shell grep 'plugin\.name' plugin.json | grep -o ':.*' | grep -o '"[^"]\+"' | sed 's/"//g')
|
PLUGIN_NAME ?= $(shell grep 'plugin\.name' plugin.json | grep -o ':.*' | grep -o '"[^"]\+"' | sed 's/"//g')
|
||||||
|
|
||||||
GODOT ?= /usr/bin/godot
|
GODOT ?= $(shell command -v godot 2>/dev/null || echo godot)
|
||||||
OPENGAMEPAD_UI_REPO ?= https://github.com/ShadowBlip/OpenGamepadUI.git
|
OPENGAMEPAD_UI_REPO ?= https://github.com/ShadowBlip/OpenGamepadUI.git
|
||||||
|
OPENGAMEPAD_UI_TAG ?= v0.40.4
|
||||||
OPENGAMEPAD_UI_BASE ?= ../OpenGamepadUI
|
OPENGAMEPAD_UI_BASE ?= ../OpenGamepadUI
|
||||||
EXPORT_PRESETS ?= $(OPENGAMEPAD_UI_BASE)/export_presets.cfg
|
EXPORT_PRESETS ?= $(OPENGAMEPAD_UI_BASE)/export_presets.cfg
|
||||||
PLUGINS_DIR := $(OPENGAMEPAD_UI_BASE)/plugins
|
PLUGINS_DIR := $(OPENGAMEPAD_UI_BASE)/plugins
|
||||||
|
|
@ -33,8 +34,8 @@ dist: build ## Build and package plugin
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: $(PLUGINS_DIR)/$(PLUGIN_ID) export_preset ## Build the plugin
|
build: $(PLUGINS_DIR)/$(PLUGIN_ID) export_preset ## Build the plugin
|
||||||
@echo "Exporting plugin package"
|
@echo "Importing project assets (expect non-fatal GDExtension errors without a built core addon)"
|
||||||
cd $(OPENGAMEPAD_UI_BASE) && $(MAKE) addons
|
cd $(OPENGAMEPAD_UI_BASE) && $(GODOT) --headless --import > /dev/null 2>&1 || true
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
touch dist/.gdignore
|
touch dist/.gdignore
|
||||||
$(GODOT) --headless \
|
$(GODOT) --headless \
|
||||||
|
|
@ -51,7 +52,7 @@ install: dist ## Installs the plugin
|
||||||
@echo "Installed plugin to $(INSTALL_DIR)"
|
@echo "Installed plugin to $(INSTALL_DIR)"
|
||||||
|
|
||||||
$(OPENGAMEPAD_UI_BASE):
|
$(OPENGAMEPAD_UI_BASE):
|
||||||
git clone $(OPENGAMEPAD_UI_REPO) $@
|
git clone --branch $(OPENGAMEPAD_UI_TAG) --depth 1 $(OPENGAMEPAD_UI_REPO) $@
|
||||||
|
|
||||||
$(PLUGINS_DIR)/$(PLUGIN_ID): $(OPENGAMEPAD_UI_BASE)
|
$(PLUGINS_DIR)/$(PLUGIN_ID): $(OPENGAMEPAD_UI_BASE)
|
||||||
if ! [ -L $(PLUGINS_DIR)/$(PLUGIN_ID) ]; then ln -s $(PWD) $(PLUGINS_DIR)/$(PLUGIN_ID); fi
|
if ! [ -L $(PLUGINS_DIR)/$(PLUGIN_ID) ]; then ln -s $(PWD) $(PLUGINS_DIR)/$(PLUGIN_ID); fi
|
||||||
|
|
@ -60,7 +61,7 @@ $(PLUGINS_DIR)/$(PLUGIN_ID): $(OPENGAMEPAD_UI_BASE)
|
||||||
export_preset: $(OPENGAMEPAD_UI_BASE) ## Configure plugin export preset
|
export_preset: $(OPENGAMEPAD_UI_BASE) ## Configure plugin export preset
|
||||||
$(eval LAST_PRESET=$(shell grep -oEi '^\[preset\.([0-9]+)]' $(EXPORT_PRESETS) | tail -n 1))
|
$(eval LAST_PRESET=$(shell grep -oEi '^\[preset\.([0-9]+)]' $(EXPORT_PRESETS) | tail -n 1))
|
||||||
$(eval LAST_PRESET_NUM=$(shell echo "$(LAST_PRESET)" | grep -oE '([0-9]+)'))
|
$(eval LAST_PRESET_NUM=$(shell echo "$(LAST_PRESET)" | grep -oE '([0-9]+)'))
|
||||||
$(eval PRESET_NUM=$(shell echo "$(LAST_PRESET_NUM)+1" | bc))
|
$(eval PRESET_NUM=$(shell expr $(LAST_PRESET_NUM) + 1))
|
||||||
@if grep 'name="$(PLUGIN_NAME)"' $(EXPORT_PRESETS) > /dev/null; then \
|
@if grep 'name="$(PLUGIN_NAME)"' $(EXPORT_PRESETS) > /dev/null; then \
|
||||||
echo "Export preset already configured"; \
|
echo "Export preset already configured"; \
|
||||||
else \
|
else \
|
||||||
|
|
|
||||||
62
README.md
Normal file
62
README.md
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
# Session Switch
|
||||||
|
|
||||||
|
An OpenGamepadUI plugin that adds a **Switch to Steam** button to the power
|
||||||
|
menu so OpenGamepadUI can return to Steam game mode.
|
||||||
|
|
||||||
|
OpenGamepadUI's built-in ChimeraOS platform support adds a "Switch to Desktop"
|
||||||
|
button but has no way to get back to Steam game mode once you leave it. This
|
||||||
|
plugin adds the missing round-trip button.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Adds a **Switch to Steam** button to the power menu, right above the exit
|
||||||
|
button.
|
||||||
|
- Returns to the session that was active before OpenGamepadUI took over, so
|
||||||
|
your autologin configuration is left untouched.
|
||||||
|
- Restarts InputPlumber before switching so the gamepad is not left in an
|
||||||
|
exclusive (blocked) state for Steam.
|
||||||
|
- No configuration required.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- ChimeraOS or SteamOS with OpenGamepadUI running as an exclusive session.
|
||||||
|
- Godot 4.4.x on the build machine (the plugin bytecode must match the Godot
|
||||||
|
version embedded in the OpenGamepadUI release you are targeting).
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Download the plugin zip and place it in the plugins directory
|
||||||
|
(`~/.local/share/opengamepadui/plugins`), or build it yourself:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make dist
|
||||||
|
```
|
||||||
|
|
||||||
|
Then restart OpenGamepadUI. The **Switch to Steam** button appears in the
|
||||||
|
power menu.
|
||||||
|
|
||||||
|
## How it works
|
||||||
|
|
||||||
|
- The plugin only activates when the OS session switcher
|
||||||
|
(`/usr/lib/os-session-select`) is present. On other systems the button is
|
||||||
|
never added.
|
||||||
|
- Pressing **Switch to Steam** runs
|
||||||
|
`os-session-select <return-session>`, where `<return-session>` is the value
|
||||||
|
ChimeraOS recorded in `~/.config/chimeraos-session-return` before
|
||||||
|
OpenGamepadUI took over (falling back to `gamescope-session-steam-plus`).
|
||||||
|
- Before switching, it runs `sudo -n systemctl restart inputplumber`.
|
||||||
|
ChimeraOS's default sudoers grants passwordless access to exactly this
|
||||||
|
command, so the switch stays non-interactive. If passwordless sudo for
|
||||||
|
`systemctl restart inputplumber` is not configured on your system, the
|
||||||
|
restart is skipped with a warning and the switch still proceeds.
|
||||||
|
|
||||||
|
## Compatibility
|
||||||
|
|
||||||
|
Tested with OpenGamepadUI v0.40.4 on ChimeraOS. The plugin pins to the
|
||||||
|
OpenGamepadUI tag it is built against (`OPENGAMEPAD_UI_TAG` in the Makefile)
|
||||||
|
so the compiled plugin bytecode always matches the running OpenGamepadUI
|
||||||
|
version.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MIT
|
||||||
9
assets/session-switch.svg
Normal file
9
assets/session-switch.svg
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128">
|
||||||
|
<rect width="128" height="128" rx="16" fill="#3a6bd8"/>
|
||||||
|
<rect x="24" y="34" width="18" height="60" rx="9" fill="#ffffff"/>
|
||||||
|
<rect x="86" y="34" width="18" height="60" rx="9" fill="#ffffff"/>
|
||||||
|
<path d="M42 46 h28" stroke="#ffffff" stroke-width="6" stroke-linecap="round"/>
|
||||||
|
<path d="M74 40 L84 46 L74 52 Z" fill="#ffffff"/>
|
||||||
|
<path d="M86 82 h-28" stroke="#ffffff" stroke-width="6" stroke-linecap="round"/>
|
||||||
|
<path d="M54 76 L44 82 L54 88 Z" fill="#ffffff"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 535 B |
BIN
docs/icon.png
Normal file
BIN
docs/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
15
plugin.json
15
plugin.json
|
|
@ -5,9 +5,18 @@
|
||||||
"plugin.min-api-version": "1.1.0",
|
"plugin.min-api-version": "1.1.0",
|
||||||
"plugin.link": "https://forge.thergic.ar/jose/steam-button-opengamepadui-plugin",
|
"plugin.link": "https://forge.thergic.ar/jose/steam-button-opengamepadui-plugin",
|
||||||
"plugin.source": "https://forge.thergic.ar/jose/steam-button-opengamepadui-plugin",
|
"plugin.source": "https://forge.thergic.ar/jose/steam-button-opengamepadui-plugin",
|
||||||
"plugin.description": "Adds a 'Switch to Steam' button to the power menu so OpenGamepadUI can return to Steam game mode on ChimeraOS and SteamOS.",
|
"plugin.summary": "Adds a 'Switch to Steam' button to the power menu",
|
||||||
"store.tags": [],
|
"plugin.description": "Lets OpenGamepadUI return to Steam game mode on ChimeraOS and SteamOS by adding a 'Switch to Steam' button to the power menu, in addition to the built-in 'Switch to Desktop' button.",
|
||||||
"store.images": [],
|
"store.tags": [
|
||||||
|
"session-switch",
|
||||||
|
"utility",
|
||||||
|
"system",
|
||||||
|
"chimeraos",
|
||||||
|
"steamos"
|
||||||
|
],
|
||||||
|
"store.images": [
|
||||||
|
"https://forge.thergic.ar/jose/steam-button-opengamepadui-plugin/raw/branch/trunk/docs/icon.png"
|
||||||
|
],
|
||||||
"author.name": "Jose Falanga",
|
"author.name": "Jose Falanga",
|
||||||
"author.email": "jose.falanga@gmail.com",
|
"author.email": "jose.falanga@gmail.com",
|
||||||
"entrypoint": "plugin.gd"
|
"entrypoint": "plugin.gd"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue