Skip to content

LGUG2Z/wpm

Repository files navigation

wpm

Simple user process management for Windows.

Tech for Palestine GitHub Workflow Status GitHub all releases GitHub commits since latest release (by date) for a branch Discord GitHub Sponsors Ko-fi Notado Feed YouTube

Watch the introduction video

wpm is a simple user process manager for Microsoft Windows 11 and above.

wpm allows you to start, stop and manage user level background processes as defined in unit files.

wpm allows you to codify availability and dependency relationships between different units.

wpm allows you to configure healthchecks for different units, with custom retry and back-off strategies.

wpm allows you to pin executables in your unit files to specific versions via remote package manifests.

wpm provides a comprehensive collection of lifecycle hooks which can be set for each unit.

wpm is not an open source project, but an educational source project which is free for personal use, and one that encourages you to make charitable donations if you find the software to be useful and have the financial means.

I encourage you to make a charitable donation to the Palestine Children's Relief Fund or contributing to a Gaza Funds campaign before you consider sponsoring me on GitHub.

GitHub Sponsors is enabled for this project. Unfortunately I don't have anything specific to offer besides my gratitude and shout outs at the end of komorebi live development videos and tutorials.

If you would like to tip or sponsor the project but are unable to use GitHub Sponsors, you may also sponsor through Ko-fi.

Installation

While this project is in a pre-release state, you can install wpmd and wpmctl using cargo:

cargo install --git https://github.com/LGUG2Z/wpm wpmd
cargo install --git https://github.com/LGUG2Z/wpm wpmctl

Usage

  • Create unit files in ~/.config/wpm - take a look at the examples
  • The full schema can be found here and is likely to change during this early development phase
  • $USERPROFILE is a specially handled string in both arguments and environment which will be replaced with your home dir
  • Run wpmd to start the daemon, this will load all unit files in ~/.config/wpm
  • Run wpmctl start <UNIT> (or whatever your unit name is) to start the process
  • Run wpmctl stop <UNIT> (or whatever your unit name is) to stop the process
  • Run wpmctl reload to reload all unit definitions (useful if you're making changes)
  • Run wpmctl rebuild to install manifests for remote executable sources

Process Monitoring

  • Run wpmctl log <UNIT> (or whatever your unit name is) to log the output of the process
❯ wpmctl log whkd
komorebic focus right
komorebic focus left
komorebic focus left
komorebic focus right
  • Run wpmctl state to inspect the state of the process manager
❯ wpmctl state
+--------------+---------+-----------+-------+--------------------------------------+
| name         | kind    | state     | pid   | timestamp                            |
+--------------+---------+-----------+-------+--------------------------------------+
| komorebi     | Simple  | Running   | 34304 |                                      |
+--------------+---------+-----------+-------+--------------------------------------+
| whkd         | Simple  | Running   | 6460  |                                      |
+--------------+---------+-----------+-------+--------------------------------------+
| komorebi-bar | Simple  | Running   | 37400 |                                      |
+--------------+---------+-----------+-------+--------------------------------------+
| kanata       | Simple  | Running   | 34204 |                                      |
+--------------+---------+-----------+-------+--------------------------------------+
| masir        | Simple  | Stopped   |       |                                      |
+--------------+---------+-----------+-------+--------------------------------------+
| desktop      | Oneshot | Completed |       | 2024-12-15 20:12:36.446380800 -08:00 |
+--------------+---------+-----------+-------+--------------------------------------+
  • Run wpmctl status <UNIT> to inspect the status of a unit
❯ wpmctl status kanata
● Status of kanata:
  Kind: Simple
  State: Running since 2024-12-16 17:20:01.796661100 -08:00
  PID: 41704
  Log file: C:\Users\LGUG2Z\.config\wpm\logs\kanata.log
  Command: C:\Users\LGUG2Z\.cargo\bin\kanata.exe -c C:\Users\LGUG2Z\minimal.kbd --port 9999
  Healthcheck: Liveness check after 1s

Recent logs:
  15:46:38.0790 [INFO] Sleeping for 2s. Please release all keys and don't press additional ones. Run kanata with --help to see how understand more and how to disable this sleep.
  15:46:40.0807 [INFO] entering the processing loop
  15:46:40.0808 [INFO] listening for event notifications to relay to connected clients
  15:46:40.0808 [INFO] Init: catching only releases and sending immediately
  15:46:40.6899 [INFO] Starting kanata proper
  15:46:40.6900 [INFO] You may forcefully exit kanata by pressing lctl+spc+esc at any time. These keys refer to defsrc input, meaning BEFORE kanata remaps keys.

Contribution Guidelines

If you would like to contribute to wpm please take the time to carefully read the guidelines below.

Commit hygiene

  • Flatten all use statements
  • Run cargo +stable clippy and ensure that all lints and suggestions have been addressed before committing
  • Run cargo +nightly fmt --all to ensure consistent formatting before committing
  • Use git cz with the Commitizen CLI to prepare commit messages
  • Provide at least one short sentence or paragraph in your commit message body to describe your thought process for the changes being committed

License

wpm is licensed under the Komorebi 1.0.0 license, which is a fork of the PolyForm Strict 1.0.0 license. On a high level this means that you are free to do whatever you want with wpm for personal use other than redistribution, or distribution of new works (i.e. hard-forks) based on the software.

Anyone is free to make their own fork of wpm with changes intended either for personal use or for integration back upstream via pull requests.

The Komorebi 1.0.0 License does not permit any kind of commercial use.

Contribution licensing

Contributions are accepted with the following understanding:

  • Contributed content is licensed under the terms of the 0-BSD license
  • Contributors accept the terms of the project license at the time of contribution

By making a contribution, you accept both the current project license terms, and that all contributions that you have made are provided under the terms of the 0-BSD license.

Zero-Clause BSD

Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Releases

No releases published

Packages

No packages published