{"id":13605807,"url":"https://github.com/kernc/xsuspender","last_synced_at":"2025-05-16T08:06:13.664Z","repository":{"id":44788782,"uuid":"85129282","full_name":"kernc/xsuspender","owner":"kernc","description":":eyes: :computer: :zzz: :battery: Save battery by auto-suspending unfocused X11 applications.","archived":false,"fork":false,"pushed_at":"2025-03-30T22:36:01.000Z","size":192,"stargazers_count":345,"open_issues_count":15,"forks_count":19,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-08T20:18:30.480Z","etag":null,"topics":["battery","cpu","daemon","desktop","hacktoberfest","laptop","libvirt","libwnck","linux","powersave","powersaving","qemu","sigstop","suspend","virt-manager","virtualbox","window-manager","x11","xorg"],"latest_commit_sha":null,"homepage":"https://kernc.github.io/xsuspender/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kernc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":"kernc"}},"created_at":"2017-03-15T22:58:45.000Z","updated_at":"2025-04-04T13:46:42.000Z","dependencies_parsed_at":"2024-11-14T00:02:01.293Z","dependency_job_id":"8d06cea8-9cb2-4a5b-a70a-10bea23f18e2","html_url":"https://github.com/kernc/xsuspender","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernc%2Fxsuspender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernc%2Fxsuspender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernc%2Fxsuspender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kernc%2Fxsuspender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kernc","download_url":"https://codeload.github.com/kernc/xsuspender/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254493378,"owners_count":22080126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["battery","cpu","daemon","desktop","hacktoberfest","laptop","libvirt","libwnck","linux","powersave","powersaving","qemu","sigstop","suspend","virt-manager","virtualbox","window-manager","x11","xorg"],"created_at":"2024-08-01T19:01:03.027Z","updated_at":"2025-05-16T08:06:08.646Z","avatar_url":"https://github.com/kernc.png","language":"C","funding_links":["https://github.com/sponsors/kernc"],"categories":["C"],"sub_categories":[],"readme":"XSuspender\n==========\n[![Build: Passing](https://img.shields.io/github/actions/workflow/status/kernc/xsuspender/ci.yml?branch=master\u0026style=for-the-badge)](https://github.com/kernc/xsuspender/actions)\n[![Source lines of code](https://img.shields.io/endpoint?url=https%3A%2F%2Fghloc.vercel.app%2Fapi%2Fkernc%2Fxsuspender%2Fbadge?format=human\u0026style=for-the-badge\u0026label=SLOC\u0026color=green)](https://ghloc.vercel.app/kernc/xsuspender)\n[![Language: shell / Bash](https://img.shields.io/badge/lang-C99-skyblue?style=for-the-badge)](https://github.com/kernc/xsuspender)\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/kernc?color=pink\u0026style=for-the-badge)](https://github.com/sponsors/kernc)\n\n**Automatically suspend inactive X11 (Xorg) applications.**\n\n[XSuspender project website](https://kernc.github.io/xsuspender/)\n\nWhen an application window loses focus, XSuspender tries to match it to\none of the rules in its configuration. If a match is found, the\napplication is sent a SIGSTOP signal (preventing the process from obtaining\nfurther CPU time). Upon windows regaining focus, the process is seamlessly\ncontinued where it had left off.\n\n#### Advantages\n\n* **Reduce battery use (increase battery run-time).**  \n  Make your laptop run on battery for as long as your mobile phone does,\n  using roughly the same technique.\n* **Reduce interaction latency on low-end CPUs.**  \n  With fewer clients requesting processing power, there's more of it to go\n  around where it's needed.\n* **Reduce CPU fan noise.**  \n  Save the tinnitus for old age.\n* **Avoid apps plotting stuff behind your back.**  \n  That Kali you're running in a VM is perfectly fine, but god\n  only knows what Microsoft Windos is doing.\n* **Suspend processes using well-known Unix signals SIGSTOP \u0026 SIGCONT ...**  \n  ... or custom shell scripts. Decades of portable operating systems\n  engineering at its finest.\n* **Preconfigured for recent versions of popular software.**  \n  Chromium, Firefox, JetBrains IDEs, qBittorrent, VirtualBox ...\n\n#### Quirks\n\n* Quirky. See [Notes] below.\n* May prevent suspended windows from redrawing until re-gaining focus.\n* May make your web downloads stall and your in-browser media\n  playback stop if you configure it thus.\n* Prevents pasting from clipboard while the selection source process\n  is suspended\n  ([explanation](https://unix.stackexchange.com/questions/316715/xclip-works-differently-in-interactive-and-non-interactive-shells/316890#316890)).\n* Relies on windows having their `_NET_WM_PID` hint set correctly.\n* Won't work in remote X sessions.\n* Won't work with Wayland.\n\nSee section [_BUGS_ in the manual] for the full, updated list.\n\n[_BUGS_ in the manual]: https://kernc.github.io/xsuspender/xsuspender.1.html#BUGS\n\n\nInstallation\n------------\n\n#### Binary packages\n\nInstall binary package for your GNU/Linux distribution:\n\n[![Debian, Ubuntu](doc/debian_ubuntu.svg)](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=975103)\n[![Arch Linux](doc/arch.svg)](https://aur.archlinux.org/packages/xsuspender-git/)\n\n\n#### From Source\n\n```bash\n# Install dependencies, namely GLib, Libwnck, procps\n# on Debian / Ubuntu / Mint:\nsudo apt install libglib2.0-dev \\\n                 libwnck-3-dev  \\\n                 procps         \\\n                 make cmake gcc pkg-config\n\n# on Fedora / RHEL / openSUSE / Solus:\nsudo dnf install glib2-devel    \\\n                 libwnck3-devel \\\n                 procps-ng      \\\n                 make cmake gcc pkg-config\n```\n\n```bash\n# Fetch a copy of the source code\ngit clone https://github.com/kernc/xsuspender\ncd xsuspender\n\n# Move to build directory for an out-of-tree build\ncd build\n\n# Configure and make\ncmake -DCMAKE_INSTALL_PREFIX=/usr/local ..\nmake\nmake test\n\n# Install within chosen prefix\nsudo make install\n```\n\nUsage\n-----\nFor brief usage instructions, run:\n\n```bash\nxsuspender --help\n```\n\n#### Automatically starting xsuspender\n\nUpon installation there will be a `/etc/xdg/autostart/xsuspender.dektop`\nfile which allows you to autostart xsuspender on the start of your\ndesktop. You need to explicitly enable autostarting xsuspender in your\ndesktop's session management settings - this amounts to the same as copying\n`/etc/xdg/autostart/xsuspender.dektop` to `~/.config/autostart/` and setting\n`Hidden=false`.\n\nIf you let xsuspender autostart, then you need to be aware of spurious\nsuspended app lock-ups such as in [GH-11](https://github.com/kernc/xsuspender/issues/11)\nand be ready to mitigate them.\n \n#### Configuration debugging\n\nTo have it print verbose debug messages about what it is doing, run the\nprogram with environmental variable `G_MESSAGES_DEBUG=xsuspender` set:\n\n    G_MESSAGES_DEBUG=xsuspender xsuspender\n\nThis is _strongly recommended_ to confirm your customized configuration\nrules indeed work as you expect.\n\n#### Logs\n\nIf xsuspender is autostarted by your X session manager, you might find clues\nto its unexpected behavior in `~/.xsession-errors`.\n\nNotes\n-----\n[Notes]: #notes\n\n* Processes that take a long time to shut down after their window already\n  disappears may be stopped in the middle of their termination routines.\n  Avoid with reasonably generous `suspend_delay`.\n* Windows that minimize to system tray need to be awaken frequently to\n  respond to click events in a seamless manner.\n* Don't configure xsuspender for software you want to keep continuously alive\n  in the background, such as music players, daemons, IM clients ... If you\n  frequently stream music from YouTube, you might give\n  [Clementine], [Minitube], [YouTube Viewer] or [SMTube] a try.\n  \n[Clementine]: https://www.clementine-player.org\n[Minitube]: https://flavio.tordini.org/minitube\n[YouTube Viewer]: https://github.com/trizen/youtube-viewer\n[SMTube]: https://www.smtube.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkernc%2Fxsuspender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkernc%2Fxsuspender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkernc%2Fxsuspender/lists"}