bdwmb/doc/CUSTOM_MODULES.md
Ari Archer df4a3c1dc7
update @ Sat 19 Mar 17:14:52 EET 2022
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
2022-03-19 17:14:52 +02:00

56 lines
810 B
Markdown

# Custom modules
To add a custom module you need to create them in ~/.config/bdwmb/modules directory.
Proper way of creating a module:
**We will create a module called "test" in this semi tutorial with a type of shellscript**
1. go into your `~/.config/bdwmb/modules` directory:
```bash
cd ~/.config/bdwmb/modules
```
2. make a new module:
```bash
vim test
```
3. add a shbang to the file:
```bash
#!/bin/sh
```
4. write the main function:
```bash
btest() {
}
```
5. in the function, let's greet the user:
```bash
printf 'welcome, %s' "$USER"
```
6. add the module to our modules in our `~/.config/bdwmb/config.sh`:
```bash
export MODULES=('test')
```
7. done, here's our final source code:
**~/.config/bdwmb/modules/test**
```bash
#!/bin/sh
btest() {
printf 'welcome, %s' "$USER"
}
```