{"id":29195474,"url":"https://github.com/md8-habibullah/power-mode-switcher","last_synced_at":"2026-04-27T17:33:09.678Z","repository":{"id":302119576,"uuid":"1002084630","full_name":"md8-habibullah/power-mode-switcher","owner":"md8-habibullah","description":"Auto-switch GNOME power profiles between Balanced and Power Saver based on charger status, including at boot and wake.","archived":false,"fork":false,"pushed_at":"2025-07-30T07:49:29.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-30T09:41:10.490Z","etag":null,"topics":["auto-power-intelligence","autostart","bash-script","gnome","laptop","power-management","power-mode-switcher","systemd","ubuntu","udev"],"latest_commit_sha":null,"homepage":"https://md8-habibullah.github.io/power-mode-switcher/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/md8-habibullah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":null,"dco":null,"cla":null}},"created_at":"2025-06-14T17:20:45.000Z","updated_at":"2025-07-30T07:49:33.000Z","dependencies_parsed_at":"2025-06-30T17:56:54.888Z","dependency_job_id":null,"html_url":"https://github.com/md8-habibullah/power-mode-switcher","commit_stats":null,"previous_names":["md8-habibullah/power-mode-switcher"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/md8-habibullah/power-mode-switcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/md8-habibullah%2Fpower-mode-switcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/md8-habibullah%2Fpower-mode-switcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/md8-habibullah%2Fpower-mode-switcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/md8-habibullah%2Fpower-mode-switcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/md8-habibullah","download_url":"https://codeload.github.com/md8-habibullah/power-mode-switcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/md8-habibullah%2Fpower-mode-switcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32348048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["auto-power-intelligence","autostart","bash-script","gnome","laptop","power-management","power-mode-switcher","systemd","ubuntu","udev"],"created_at":"2025-07-02T05:04:32.094Z","updated_at":"2026-04-27T17:33:09.672Z","avatar_url":"https://github.com/md8-habibullah.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Power Mode Switcher\n\nAutomatically switch power profiles between **Balanced** and **Power Saver** based on laptop power status (plugged/unplugged), including on boot and resume — now with **cross‑distro support**!\n\n## 📂 Repository Layout\n```\npower-mode-switcher/\n├── README.md            # This file\n├── install.sh           # Cross‑distro installation script\n├── uninstall.sh         # Uninstallation script\n├── LICENSE\n└── src/\n├── power-mode-switch.sh   # Main switching script\n├── 99-power-mode.rules    # udev rule\n└── power-mode.service     # systemd service definition\n```\n---\n\n## ⚙️ Supported Distributions\n\n- **Debian / Ubuntu / Zorin** (APT)\n- **Arch / Manjaro / EndeavourOS** (Pacman)\n- **Fedora / RHEL / CentOS** (DNF / tuned‑ppd)\n\n---\n\n## 🛠️ Prerequisites\n\n- A modern GNOME or KDE desktop with **`powerprofilesctl`** support  \n- **`bash`**, **`udev`**, **`systemd`** (default on all supported distros)  \n- **Root** or sudo privileges to install/uninstall  \n\n---\n\n## 🚀 Installation\n\n1. **Clone \u0026 enter repo**  \n   ```bash\n   git clone https://github.com/md8-habibullah/power-mode-switcher.git\n   cd power-mode-switcher\n   ```\n\n2. **Make scripts executable**\n\n   ```bash\n   chmod +x install.sh uninstall.sh src/power-mode-switch.sh\n   ```\n\n3. **Run the installer**\n\n   ```bash\n   ./install.sh\n   ```\n\n   You’ll see **coloured**, step‑by‑step output:\n\n   * Detects your package manager (`apt`, `pacman`, or `dnf`)\n   * Installs **`power-profiles-daemon`** (or swaps in **`tuned‑ppd`** on Fedora ≥ 41)\n   * Copies the switch script, udev rule, and systemd unit into place\n   * Reloads systemd \u0026 udev, then **enables** all services\n\n---\n\n## 🔍 Testing \u0026 Manual Use\n\n1. **Automatic switching**\n\n   * **Plug** or **unplug** your AC adapter → runs automatically\n   * **Suspend** \u0026 **resume** → runs on wake\n\n2. **Check current profile**\n\n   ```bash\n   powerprofilesctl get\n   ```\n\n   (on Fedora/RHEL with tuned‑ppd you can also run `tuned-adm active`)\n\n3. **Manual invocation**\n\n   ```bash\n   sudo /usr/local/bin/power-mode-switch.sh\n   ```\n\n---\n\n## 🛠 Uninstallation\n\nIn the repo directory:\n\n```bash\n./uninstall.sh\n```\n\nThis will:\n\n1. Disable \u0026 remove the `power-mode.service` unit\n2. Remove `/etc/udev/rules.d/99-power-mode.rules`\n3. Remove `/usr/local/bin/power-mode-switch.sh`\n4. Reload systemd \u0026 udev rules\n\n---\n\n## 🔧 Customization\n\n* **AC device name**\n  If your AC path differs, edit in `src/power-mode-switch.sh`:\n\n  ```bash\n  for P in /sys/class/power_supply/ADP* /sys/class/power_supply/AC* /sys/class/power_supply/ACAD*; do\n    …\n  done\n  ```\n\n* **Enable logging**\n  Uncomment in `power-mode-switch.sh`:\n\n  ```bash\n  # echo \"$(date +'%F %T'): AC=$STATUS → $(powerprofilesctl get)\" \u003e\u003e /var/log/power-mode.log\n  ```\n\n  Ensure `/var/log/power-mode.log` is writable by root.\n\n* **Custom profiles**\n  Replace `balanced`/`power-saver` with any profile name supported by your system.\n\n---\n\n## 🆘 Troubleshooting\n\n* **No switching on plug/unplug**\n\n  ```bash\n  udevadm monitor --udev\n  ```\n\n  Verify `POWER_SUPPLY_ONLINE` events and that your rule matches the device.\n\n* **Service errors on boot/resume**\n\n  ```bash\n  journalctl -u power-mode.service -b\n  systemctl status power-mode.service\n  ```\n\n* **Permissions**\n  Ensure `/usr/local/bin/power-mode-switch.sh` is `chmod +x` and owned by root.\n\n\n---\n\n\u003e *Supports Debian/Ubuntu, Zorin, Mint, Arch, Manjaro, EndeavourOS, Fedora, CentOS, RHEL and any system with systemd \u0026 udev.*\n\u003e *Created by Md. Habibullah (md8-habibullah)*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmd8-habibullah%2Fpower-mode-switcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmd8-habibullah%2Fpower-mode-switcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmd8-habibullah%2Fpower-mode-switcher/lists"}