diff --git a/README.md b/README.md index 158fd0b..515d4f7 100644 --- a/README.md +++ b/README.md @@ -1,98 +1,134 @@ -# Hibernate Setup Script +# Hibernate Setup -A Python-based utility for configuring hibernation on Linux systems using a swap file. -This script automates resume configuration for GRUB and initramfs, and optionally creates a swap file of configurable size. +A Python-based utility for configuring hibernation on Linux systems using a swap file. +This tool automates resume configuration for GRUB and initramfs and optionally creates a swap file of configurable size. + +Designed for Arch-based systems (Arch Linux, Manjaro) and intended for automation and reproducible system setup. --- ## πŸ›  Features -- Optionally create and activate a swap file -- Automatically detect UUID and resume offset -- Inject `resume` and `resume_offset` into GRUB config -- Regenerate initramfs via `mkinitcpio` -- Interactive confirmation before file changes -- Preview mode for dry-run without changes -- Supports Arch-based systems (Manjaro, Arch, etc.) -- Root permission required +* Optionally create and activate a swap file +* Automatically detect UUID and resume offset +* Inject `resume` and `resume_offset` into GRUB config +* Regenerate initramfs via `mkinitcpio` +* Interactive confirmation before file changes +* Preview mode for dry-run without changes +* Non-interactive mode for automation +* Root permission required --- ## πŸ“¦ Installation -This utility is available via **Kevin’s Package Manager**: -➑️ [github.com/kevinveenbirkenbach/package-manager](https://github.com/kevinveenbirkenbach/package-manager) +### Using pip (recommended) + +Install directly from PyPI: ```bash -pkgmgr install setup-hibernate +pip install setup-hibernate +``` + +Or system-wide: + +```bash +sudo pip install setup-hibernate +``` + +Or isolated using pipx: + +```bash +pipx install setup-hibernate +``` + +--- + +### From source + +```bash +git clone https://github.com/kevinveenbirkenbach/setup-hibernate.git +cd setup-hibernate +pip install . ``` --- ## πŸš€ Usage -Run the script as root: +Run the tool as root: ```bash -sudo ./main.py [OPTIONS] +sudo setup-hibernate [OPTIONS] ``` -### Options +Or via Python module: -| Option | Description | -|-------------------------|-----------------------------------------------------------------------------| -| `--create-swapfile` | Create and configure a swap file at `/swapfile` | -| `--swap-size ` | Set the swap file size in GB (default: `32`) | -| `-p`, `--preview` | Show what would be done without executing any changes (dry-run mode) | -| `--non-interactive` | Apply all changes automatically without prompting for confirmation | +```bash +sudo python -m setup_hibernate [OPTIONS] +``` -### Examples +--- + +## βš™ Options + +| Option | Description | +| ------------------- | -------------------------------------------------------------------- | +| `--create-swapfile` | Create and configure a swap file at `/swapfile` | +| `--swap-size ` | Set the swap file size in GB (default: `32`) | +| `-p`, `--preview` | Show what would be done without executing any changes (dry-run mode) | +| `--non-interactive` | Apply all changes automatically without prompting for confirmation | + +--- + +## πŸ§ͺ Examples Create a 40GB swapfile and configure hibernation interactively: ```bash -sudo ./main.py --create-swapfile --swap-size 40 +sudo setup-hibernate --create-swapfile --swap-size 40 ``` Preview what would happen without actually doing anything: ```bash -sudo ./main.py --create-swapfile --swap-size 40 --preview +sudo setup-hibernate --create-swapfile --swap-size 40 --preview ``` Non-interactive, suitable for automation: ```bash -sudo ./main.py --create-swapfile --swap-size 40 --non-interactive +sudo setup-hibernate --create-swapfile --swap-size 40 --non-interactive ``` --- ## βœ… Requirements -- Python 3 -- Tools: `fallocate`, `mkswap`, `swapon`, `filefrag`, `findmnt`, `mkinitcpio`, `update-grub` -- Root privileges +* Python 3.8+ +* Tools: -No external Python packages are required (no `requirements.txt` needed). + * `fallocate` + * `mkswap` + * `swapon` + * `filefrag` + * `findmnt` + * `mkinitcpio` + * `update-grub` +* Root privileges ---- - -## πŸ€– AI-Assisted Development - -This script was developed with the help of [ChatGPT](https://chat.openai.com) -πŸ”— [Click here to view the development conversation](https://chatgpt.com/share/67ed158b-66d4-800f-b418-e52460c225ce) +No external Python packages are required. --- ## πŸ‘€ Author -Developed by **Kevin Veen-Birkenbach** -🌐 https://www.veen.world/ +Developed by **Kevin Veen-Birkenbach** +🌐 [https://www.veen.world](https://www.veen.world) --- ## πŸ“„ License -This project is licensed under the **MIT License**. -See [LICENSE](./LICENSE) for details. \ No newline at end of file +This project is licensed under the **MIT License**. +See [LICENSE](./LICENSE) for details.