Skip to content

Commit e37d868

Browse files
Add contribution instructions and add Nixpkgs. Closes #31.
1 parent 5c48b7c commit e37d868

1 file changed

Lines changed: 109 additions & 1 deletion

File tree

README.md

Lines changed: 109 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,122 @@ A GUI wallpaper setter for Wayland that is a spiritual successor for the minimal
3434
- `swww` for transition effects
3535
2. Install `waytrogen`:
3636
- Arch Linux: Available on [`AUR`](https://aur.archlinux.org/packages/waytrogen)
37-
- NixOS: Available on [`NUR`](https://github:nikolaizombie1/nur-packages)
37+
- NixOS: Available on [`Nixpkgs`](https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=waytrogen)
3838

3939
## Usage
4040
- Launch via terminal: `waytrogen`
4141
- Restore previous wallpapers: `waytrogen --restore` or `waytrogen -r`
4242
- List current state in JSON: `waytrogen --list` or `waytrogen -l`
4343
- Use external script: `waytrogen --external_script` or `waytrogen -e`
4444
- Script receives: monitor, wallpaper path, complete state
45+
- Cycle to the next wallpaper: `waytrogen --next` or `waytrogen -n`
46+
47+
## Building from source
48+
On NixOS, you can use the provided `flake.nix` to compile and install from source. Just simply clone the repository using:
49+
```bash
50+
git clone https://github.com/nikolaizombie1/waytrogen.git && cd waytrogen
51+
```
52+
For those who would like to build from source on other distributions, the following dependencies are required:
53+
- sqlite3 version 3.42 or greater
54+
- openssl version 3.0 or greater
55+
- gtk4 version 4.12 or greater
56+
- gio-2.0 version 2.78 or greater
57+
- glib-2.0 version 2.78 or greater
58+
- meson version 1.2 or greater
59+
- ninja version 1.10 or greater
60+
- cargo version 1.75 or greater
61+
62+
On Arch use the following command to install the required build dependencies:
63+
```bash
64+
sudo pacman -S gtk4 sqlite openssl glib2 rust meson ninja
65+
```
66+
On Ubuntu use the following command to install the required build dependencies:
67+
```bash
68+
sudo apt install sqlite3 openssl libgtk-4-1 libglib2.0-dev cargo meson ninja-build
69+
```
70+
Then clone the repository using:
71+
```bash
72+
git clone https://github.com/nikolaizombie1/waytrogen.git && cd waytrogen
73+
```
74+
Configure meson and build using:
75+
```bash
76+
meson setup builddir --prefix=/usr && meson compile -C builddir
77+
```
78+
If you would like to install to your system, use:
79+
```bash
80+
meson install -C builddir
81+
```
82+
83+
## Contribution
84+
All help is welcome and appreciated for `waytrogen`. If you would like to contribute to `waytrogen` follow these steps:
85+
1. Create a fork of `waytrogen` by clicking the `fork` button on the top of the [github](https://github.com/nikolaizombie1/waytrogen) repository.
86+
2. Clone your fork waytrogen:
87+
```bash
88+
git clone https://github.com/YOUR_USERNAME/waytrogen.git && cd waytrogen
89+
```
90+
3. Create a branch who's name describe the changes you would like to do. Please be descriptive, do not use titles such as: `update-readme` or `fix-bug`
91+
```bash
92+
git switch --create descriptive-branch-name main
93+
```
94+
4. Perform the changes you like to do.
95+
- If you want to add a new language to waytrogen, follow these steps:
96+
1. Install `gettext`
97+
98+
On Arch Linux use:
99+
```bash
100+
sudo pacman -S gettext
101+
```
102+
On Ubuntu use:
103+
```bash
104+
sudo apt install gettext
105+
```
106+
On NixOS gettext is already installed.
107+
108+
2. Run `cd po`
109+
2. Add the language code you would like to add using a language code from [here](https://www.gnu.org/software/gettext/manual/html_node/index.html) to the `LINGUAS` file. Keep the file ordered alphabetically.
110+
4. Create the skeleton `po` file using the following command:
111+
```bash
112+
msginit -i waytrogen -o LL.po -l LL_CC.UTF8
113+
```
114+
Where `LL` is the language code used in the previous step and `CC` is the country code can be obtained [here](https://www.gnu.org/software/gettext/manual/html_node/Country-Codes.html)
115+
116+
5. Modify the skeleton `po` the sections where it says `msgstr ""`
117+
- If you would like to do code changes, follow these steps:
118+
1. Install `waytrogen` either from source or from your package manager. This is to install the required schemas. Skip this step if developing on NixOS.
119+
2. Install the required development dependencies:
120+
121+
On Arch Linux, use:
122+
```bash
123+
sudo pacman -S gtk4 sqlite openssl glib2 rust
124+
```
125+
On Ubuntu, use:
126+
```bash
127+
sudo apt install sqlite3 openssl libgtk-4-1 libglib2.0-dev cargo
128+
```
129+
On NixOS, add the following snippet to your `configuration.nix`
130+
```nix
131+
programs.direnv = {
132+
enable = true;
133+
nix-direnv.enable = true;
134+
};
135+
```
136+
If the nix flake is not loading in properly, run `direnv allow` in the root of the repository to enable the flake.
137+
138+
3. Perform the changes you would like to do on `waytrogen`.
139+
4. Compile and run `waytrogen` with the new changes using the following based on the distribution:
140+
- If on `NixOS` simply run:
141+
```bash
142+
nix build && nix run
143+
```
144+
- On any other distribution, run:
145+
```bash
146+
cargo run --release
147+
```
148+
5. Repeat steps 3 and 4 until you are satisfied with your changes.
149+
5. Run `cargo clippy` and make sure there are no suggestions.
150+
6. Format the project using `cargo fmt --all`
151+
7. Create a commit who's message describes your changes in slightly more detail.
152+
8. Go to your fork and create a pull request for `nikolaizombie1:waytrogen` on the main branch. If needed, go into detail what do your changes do in the description of the pull request.
45153

46154
## Credits
47155
Logo shape from [Inconify Tabler](https://icon-sets.iconify.design/tabler/) atom.

0 commit comments

Comments
 (0)