{"id":51438562,"url":"https://github.com/scaccogatto/gse-surface","last_synced_at":"2026-07-05T09:30:26.049Z","repository":{"id":350843211,"uuid":"1208472528","full_name":"scaccogatto/gse-surface","owner":"scaccogatto","description":"GNOME Shell extension for Microsoft Surface — power profiles, dGPU status, and Surface Book detachment in Quick Settings","archived":false,"fork":false,"pushed_at":"2026-06-27T16:27:16.000Z","size":79,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-27T18:13:40.788Z","etag":null,"topics":["gnome","gnome-shell-extension","linux-surface","microsoft-surface","power-management","quick-settings"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scaccogatto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-12T10:30:46.000Z","updated_at":"2026-06-27T16:27:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/scaccogatto/gse-surface","commit_stats":null,"previous_names":["scaccogatto/gse-surface"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/scaccogatto/gse-surface","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaccogatto%2Fgse-surface","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaccogatto%2Fgse-surface/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaccogatto%2Fgse-surface/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaccogatto%2Fgse-surface/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scaccogatto","download_url":"https://codeload.github.com/scaccogatto/gse-surface/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaccogatto%2Fgse-surface/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35150062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-05T02:00:06.290Z","response_time":100,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gnome","gnome-shell-extension","linux-surface","microsoft-surface","power-management","quick-settings"],"created_at":"2026-07-05T09:30:25.420Z","updated_at":"2026-07-05T09:30:26.031Z","avatar_url":"https://github.com/scaccogatto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Surface Control\n\n**GNOME Shell extension for Microsoft Surface hardware.**\n\nControl your Surface device directly from the Quick Settings panel — switch power profiles, check discrete GPU state, and manage Surface Book detachment without opening a terminal.\n\n![Surface Control quick settings panel showing the tile and profile submenu](screens/full-open.png)\n\n---\n\n## Features\n\n### Platform Profiles\nSwitch between all four power modes from the Quick Settings menu:\n\n| Profile | Description |\n|---------|-------------|\n| Low Power | Maximum battery savings for reading, writing, light tasks |\n| Balanced | Default everyday use — good balance of performance and battery |\n| Balanced Performance | Extra headroom for demanding apps without full performance draw |\n| Performance | Maximum CPU/GPU throughput, plugged-in use |\n\nThe tile shows the active profile. Clicking it toggles between Balanced and your last non-default profile. The chevron opens the full menu for direct selection. Changes made externally are reflected instantly via a kernel sysfs monitor — no polling.\n\n### Panel Indicator\nA contextual icon appears in the top bar whenever you're on a non-Balanced profile — a quick visual reminder without permanent clutter.\n\n### Discrete GPU Status *(Surface Book with dGPU)*\nShows current dGPU power state and runtime PM mode in the menu. Hidden automatically on devices without a discrete GPU.\n\n### Surface Book Detachment *(Surface Book 2)*\nRequest or cancel clipboard detachment directly from the Quick Settings panel. Hidden automatically on devices without DTX hardware.\n\n---\n\n## Requirements\n\n- GNOME Shell **45 or later**\n- Linux Surface kernel ([linux-surface](https://github.com/linux-surface/linux-surface))\n\n---\n\n## Installation\n\n### 1. Grant write access to the platform profile\n\nThe kernel exposes the power profile at `/sys/firmware/acpi/platform_profile`, but only root can write it by default. Run the included setup script once to fix this permanently:\n\n```sh\nbash setup-permissions.sh\n```\n\nThis creates `/etc/tmpfiles.d/surface-control.conf` which runs at every boot via `systemd-tmpfiles`, granting your user group write access before the session starts. No reboot needed — it applies immediately.\n\nIf the extension loads without this step, the tile will show **\"Setup required\"** and profile switching will be disabled until you run the script.\n\n### 2. Install the extension\n\n```sh\ngit clone https://github.com/scaccogatto/gse-surface.git\ncp -r gse-surface/surface-control@scaccogatto.github.com \\\n      ~/.local/share/gnome-shell/extensions/\n```\n\nLog out and back in, then enable:\n\n```sh\ngnome-extensions enable surface-control@scaccogatto.github.com\n```\n\n---\n\n## How It Works\n\n- **Profile reads** — watches `/sys/firmware/acpi/platform_profile` via `Gio.FileMonitor` for instant, zero-overhead change detection\n- **Profile writes** — writes directly to sysfs via `Gio.File`; no subprocess, no PATH dependency\n- **Permission check** — probes write access at startup; shows an in-tile error with instructions if access is missing\n- **Hardware detection** — probes `surface dgpu` and `surface dtx` at startup; sections unavailable on your device are simply not shown\n- **Clean teardown** — all monitors cancelled, all GObject references nulled on `disable()`\n\n---\n\n## Development\n\n```sh\n# Clone\ngit clone https://github.com/scaccogatto/gse-surface.git\ncd gse-surface\n\n# Symlink for live editing\nln -sf \"$PWD/surface-control@scaccogatto.github.com\" \\\n        ~/.local/share/gnome-shell/extensions/\n\n# Reload extension without logout (disable + enable via DBus)\ngdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell \\\n  --method org.gnome.Shell.Extensions.DisableExtension \\\n  \"surface-control@scaccogatto.github.com\"\ngdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell \\\n  --method org.gnome.Shell.Extensions.EnableExtension \\\n  \"surface-control@scaccogatto.github.com\"\n\n# Watch logs\njournalctl -f -o cat /usr/bin/gnome-shell | grep -i surface\n```\n\n### File Structure\n\n```\nsurface-control@scaccogatto.github.com/\n├── metadata.json       # Extension identity and supported shell versions\n├── extension.js        # Entry point — enable() / disable() lifecycle\n├── indicator.js        # SystemIndicator + QuickMenuToggle UI\n├── profileManager.js   # sysfs file monitor, permission check, profile read/write\n├── dgpuManager.js      # dGPU detection and state\n├── dtxManager.js       # DTX detection and detachment controls\n└── utils.js            # Profile definitions, icons, subprocess helpers\nsetup-permissions.sh    # One-time setup: grants write access to sysfs profile file\n```\n\n---\n\n## Compatibility\n\n| GNOME Shell | Status |\n|-------------|--------|\n| 50 | Tested |\n| 45 – 49 | Should work (ESModules + Quick Settings API stable since 45) |\n| \u003c 45 | Not supported |\n\n---\n\n## License\n\nGPL-2.0-or-later — required for GNOME Shell extensions (GNOME Shell is GPL-2.0-or-later).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscaccogatto%2Fgse-surface","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscaccogatto%2Fgse-surface","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscaccogatto%2Fgse-surface/lists"}