Skip to content

Commit bd7d578

Browse files
committed
Update README.md
1 parent ddae359 commit bd7d578

File tree

3 files changed

+149
-58
lines changed

3 files changed

+149
-58
lines changed

README.md

Lines changed: 128 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
<h2></h2> <!-- add a separating line -->
66

77
> [!WARNING]
8-
> Parts of this README refers to the `v2.0.0-beta1` release.
8+
> Parts of this README refers to the `v2.0.0-beta1` release.
99
> Some features such as the plugin system may differ from the upcoming stable release.
1010
1111
<p align="center">
12-
A modular information fetching (neofetch-like) tool, which its focus point is the performance and <b>customizability</b>
12+
A modular information fetching tool (neofetch-like), focused on <b>performance</b> and <b>customizability</b>
1313
</p>
1414

1515
<p align="center">
@@ -37,6 +37,7 @@
3737
</p>
3838
<img src="https://upload.wikimedia.org/wikipedia/commons/2/24/Transparent_Square_Tiles_Texture.png" width="1px" height="1px" align="left" />
3939
<img src="screenshots/pipeline-style.png" />
40+
4041
<!-- Leaving this here for future, it's not as fire as the one above
4142
| | |
4243
|:-:|:-:|
@@ -47,23 +48,52 @@
4748
## Key Features
4849
- Works as a **terminal program**, **GTK3 GUI app**, or **native Android widget**
4950
- Modular design - fetch anything through `$<>` tags and plugins
50-
- Super lightweight
51-
- Easy to configure and script
52-
- Optional dependencies only, no runtime bloat (as like as [fastfetch](https://github.com/fastfetch-cli/fastfetch)
53-
- Plugin system for adding new info sources
51+
- Super lightweight with no required dependencies
52+
- Easy to configure with auto-generated, well-commented config files
53+
- Plugin system for extending beyond system info (weather, GitHub, APIs, etc.)
54+
- Live mode for continuous updates
55+
56+
## Quick Start
57+
58+
After [installing](#installation) customfetch, simply run:
59+
60+
```bash
61+
customfetch
62+
```
63+
64+
On first run, customfetch automatically creates a config file `~/.config/customfetch/config.toml` (or `$XDG_CONFIG_HOME/customfetch/config.toml` if set) with helpful comments explaining every option.
65+
66+
**Useful commands to get started:**
67+
68+
| Command | Description |
69+
|---------|-------------|
70+
| `customfetch` | Run with default/current config |
71+
| `customfetch -w` | Show comprehensive guide on tags, colors, and syntax |
72+
| `customfetch -l` | List all available modules (including from plugins) |
73+
| `customfetch --gen-config <path>` | Regenerate the default config file (if to a path) |
74+
| `customfetch -h` | Show all CLI arguments |
75+
| `customfetch -C /path/to/config.toml` | Use a custom config file |
76+
| `customfetch -n` | Disable logo display |
77+
| `customfetch -N` | Disable all colors |
78+
| `customfetch -d NAME` | Use a specific distro logo |
79+
| `customfetch -s PATH` | Path to custom ASCII art or image (must specify `--image-backend` `-i`) |
80+
| `customfetch -N -m "\$<gpu>" -m "\$<cpu>"` | Display only CPU and GPU info, no logo, no colors |
81+
| `customfetch -m "\${cyan}Kernel: \$<os.kernel>" -m "\${green}Uptime: \$<os.uptime>"` | Quick system check with custom formatting in the terminal |
82+
| `customfetch --loop-ms 1000` | Update display every second |
5483

5584
## Dependencies
56-
Customfetch has no required dependencies unless you build the GUI app version.\
85+
86+
Customfetch has **no required dependencies** unless you build the GUI app version.
5787
For compiling from source, all you need is a **C++20** compiler (C++17 might still work).
5888

59-
Packages for running the GUI app:
89+
**GUI app packages:**
6090
* `gtk3`
6191
* `gtkmm3`
6292

63-
Optional packages that will make customfetch system query faster:
64-
* `dconf`: Alternative to the slow `gsettings` command
65-
* `libxfce4util`: Query XFCE4 version faster
66-
* `wayland-client`: Library for getting the Wayland compositor faster
93+
**Optional packages** (for faster system queries):
94+
* `dconf` - Alternative to the slow `gsettings` command
95+
* `libxfce4util` - Query XFCE4 version faster
96+
* `wayland-client` - Get Wayland compositor info faster
6797

6898
## Installation
6999

@@ -72,7 +102,7 @@ Grab the latest `.deb` file from the [releases page](https://github.com/Toni500g
72102

73103
### Arch (AUR)
74104
```bash
75-
# Binary
105+
# Binary (stable)
76106
yay -S customfetch-bin # Terminal only
77107
yay -S customfetch-gui-bin # GUI version
78108

@@ -90,7 +120,7 @@ Download the `.tar.gz` from [releases](https://github.com/Toni500github/customfe
90120
It includes a `/usr` folder so you can install it manually or through your package manager.
91121

92122
### Android widget
93-
Moved to its own repo:
123+
Moved to its own repo:
94124
https://github.com/Toni500github/customfetch-android-app
95125

96126
### Build from source
@@ -101,15 +131,16 @@ cd customfetch
101131
# DEBUG=0 for release build
102132
# GUI_APP=0 or 1 for terminal or GUI app
103133
make install DEBUG=0 GUI_APP=0
104-
105-
customfetch
106134
```
107135

108-
## How to customize
109-
This is only an explanation about tags and preview, that can be always found in the documentation.
136+
## Configuration
137+
138+
### Example config
139+
140+
Here's an example config and its output:
110141

111-
Here's an example using my config
112142
![image](screenshots/demo.png)
143+
113144
```toml
114145
[config]
115146

@@ -141,32 +172,93 @@ layout = [
141172
]
142173
```
143174

144-
### Tag Syntax (both ASCII art and layout)
175+
### Tag Syntax
176+
177+
Customfetch uses a tag system in both the layout and ASCII art. Here's a quick reference:
178+
179+
| Tag | Description | Example |
180+
|-----|-------------|---------|
181+
| `$<module.member>` | Print info from a module | `$<cpu>`, `$<ram.used>`, `$<os.kernel.version>` |
182+
| `${color}` | Set text color | `${red}`, `${#ff5500}` |
183+
| `$(command)` | Run a shell command | `$(date +%H:%M)`, `$(!cbonsai)` |
184+
| `$[x,y,eq,neq]` | Conditional output | `$[$<os.name>,Arch,btw,]` |
185+
| `$%n1,n2%` | Colored percentage | `$%$<ram.used>,$<ram.total>%` |
186+
187+
> [!NOTE]
188+
> - Use `$(!command)` (with `!`) in ASCII art to prevent color leaking
189+
> - Use `!` in the begin of the `$%%` for inverting red and green
190+
> - Escape `<` as `\<` and `&` as `\&` when needed (especially for GUI app)
191+
> - Run `customfetch -w` for the complete syntax reference with all color modifiers and advanced examples
145192
146-
| Tag | Description |
147-
|-----|--------------|
148-
| `$<info.module>` | Print a module info (for example `$<cpu>` or `$<github.user.followers>`) |
149-
| `${color}` | Set output color (hex or ANSI escape colors) |
150-
| `$(bash command)` | Print the output of a shell command (`!` prefix if in ASCII art or big ANSI escape color outputs) |
151-
| `$[x,y,if_equal,if_not]` | Conditional tag to print based on comparision |
152-
| `$%n1,n2%` | Colored percentage between two numbers (prefix `!` to invert colors) |
193+
### Colors and formatting
153194

154-
Run `customfetch -w` or `man customfetch` for full syntax reference.\
155-
Escape `<` or `&` when needed (especially for GUI compatibility).
195+
Colors can be specified as:
196+
- **Named colors**: `${red}`, `${green}`, `${cyan}`, `${auto}` (matches logo colors), `${auto2}`, `${auto3}`...
197+
- **Hex colors**: `${#ff5500}`, `${#f50}` (shorthand)
198+
- **ANSI escapes**: `${\e[1;33m}` (e.g., bold yellow)
199+
- **Reset**: `${0}` (normal reset), `${1}` (bold reset)
200+
201+
**Text modifiers** (prefix before hex color):
202+
203+
| Modifier | Effect | Example |
204+
|----------|--------|---------|
205+
| `!` | Bold | `${!#ff0000}` |
206+
| `u` | Underline | `${u#00ff00}` |
207+
| `i` | Italic | `${i#0000ff}` |
208+
| `s` | Strikethrough | `${s#888888}` |
209+
| `l` | Blink (terminal only) | `${l#ff00ff}` |
210+
| `b` | Background color | `${b#222222}` |
211+
212+
**Combining modifiers:** `${!u#ff0000}` (bold + underlined red)
213+
214+
<details>
215+
<summary><b>GUI-only modifiers</b></summary>
216+
217+
| Modifier | Effect |
218+
|----------|--------|
219+
| `o` | Overline |
220+
| `a(value)` | Foreground alpha (0%-100% or 1-65536) |
221+
| `A(value)` | Background alpha |
222+
| `L(value)` | Underline style (none/single/double/low/error) |
223+
| `U(color)` | Underline color (hex) |
224+
| `B(color)` | Background color (hex) |
225+
| `S(color)` | Strikethrough color (hex) |
226+
| `O(color)` | Overline color (hex) |
227+
| `w(value)` | Font weight (light/normal/bold/ultrabold or 100-1000) |
228+
229+
Example: `${oU(#ff0000)L(double)#ffffff}Error` — white text with double red underline and overline
230+
231+
</details>
156232

157233
## Plugins
158-
Thanks to plugins, customfetch is able to fetch beyond system information and be able to fetch anything — weather, GitHub data, APIs, etc.
159234

160-
You can easily install plugins from repositories using `cufetchpm`.
161-
For example:
235+
Plugins extend customfetch beyond system information — fetch weather, GitHub stats, API data, and more.
236+
237+
### Installing plugins
238+
239+
Use `cufetchpm` to install plugins from repositories:
240+
241+
```bash
242+
cufetchpm install https://github.com/Toni500github/customfetch-plugins-github
243+
```
244+
245+
After installing, run `customfetch -l` to see newly available modules from the plugin.
246+
247+
### Managing plugins
248+
162249
```bash
163-
$ cufetchpm install https://github.com/Toni500github/customfetch-plugins-github
250+
cufetchpm list # List installed plugins
251+
cufetchpm enable <plugin> # Enable a plugin
252+
cufetchpm disable <plugin> # Disable a plugin
253+
cufetchpm remove <plugin> # Remove a plugin
164254
```
165-
For more plugin managing, such as enabling/disabling or removing them, refer to the `cufetchpm --help` guide.
255+
256+
See `cufetchpm --help` for all options.
166257

167258
### Writing your own plugins
168-
Plugins are just shared libraries.
169-
There’s a [guide here](https://github.com/Toni500github/customfetch/blob/main/docs/build-plugin.md) that walks you through writing one.
259+
260+
Plugins are shared libraries (`.so` files) that register custom modules.
261+
See the [plugin development guide](https://github.com/Toni500github/customfetch/blob/main/docs/build-plugin.md) to create your own.
170262

171263
## Star History
172264

src/config.cpp

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ void Config::loadConfigFile(const std::filesystem::path& filename)
5959
die(_("Parsing config file '{}' failed:\n"
6060
"{}\n"
6161
"\t(error occurred at line {} column {})"),
62-
filename.string(), err.description(),
63-
err.source().begin.line, err.source().begin.column);
62+
filename.string(), err.description(), err.source().begin.line, err.source().begin.column);
6463
}
6564

6665
// clang-format off
@@ -95,23 +94,23 @@ void Config::loadConfigFile(const std::filesystem::path& filename)
9594
this->flatpak_dirs = getValueArrayStr("os.pkgs.flatpak-dirs", {"/var/lib/flatpak/app", "~/.local/share/flatpak/app"});
9695
this->apk_files = getValueArrayStr("os.pkgs.apk-files", {"/var/lib/apk/db/installed"});
9796

98-
colors.black = getValueStr("config.black", "\033[1;30m");
99-
colors.red = getValueStr("config.red", "\033[1;31m");
100-
colors.green = getValueStr("config.green", "\033[1;32m");
101-
colors.yellow = getValueStr("config.yellow", "\033[1;33m");
102-
colors.blue = getValueStr("config.blue", "\033[1;34m");
103-
colors.magenta = getValueStr("config.magenta", "\033[1;35m");
104-
colors.cyan = getValueStr("config.cyan", "\033[1;36m");
105-
colors.white = getValueStr("config.white", "\033[1;37m");
106-
107-
colors.gui_black = getValueStr("gui.black", "!#000005");
108-
colors.gui_red = getValueStr("gui.red", "!#ff2000");
109-
colors.gui_green = getValueStr("gui.green", "!#00ff00");
110-
colors.gui_blue = getValueStr("gui.blue", "!#00aaff");
111-
colors.gui_cyan = getValueStr("gui.cyan", "!#00ffff");
112-
colors.gui_yellow = getValueStr("gui.yellow", "!#ffff00");
113-
colors.gui_magenta = getValueStr("gui.magenta", "!#ff11cc");
114-
colors.gui_white = getValueStr("gui.white", "!#ffffff");
97+
this->colors.black = getValueStr("config.black", "\033[1;30m");
98+
this->colors.red = getValueStr("config.red", "\033[1;31m");
99+
this->colors.green = getValueStr("config.green", "\033[1;32m");
100+
this->colors.yellow = getValueStr("config.yellow", "\033[1;33m");
101+
this->colors.blue = getValueStr("config.blue", "\033[1;34m");
102+
this->colors.magenta = getValueStr("config.magenta", "\033[1;35m");
103+
this->colors.cyan = getValueStr("config.cyan", "\033[1;36m");
104+
this->colors.white = getValueStr("config.white", "\033[1;37m");
105+
106+
this->colors.gui_black = getValueStr("gui.black", "!#000005");
107+
this->colors.gui_red = getValueStr("gui.red", "!#ff2000");
108+
this->colors.gui_green = getValueStr("gui.green", "!#00ff00");
109+
this->colors.gui_blue = getValueStr("gui.blue", "!#00aaff");
110+
this->colors.gui_cyan = getValueStr("gui.cyan", "!#00ffff");
111+
this->colors.gui_yellow = getValueStr("gui.yellow", "!#ffff00");
112+
this->colors.gui_magenta = getValueStr("gui.magenta", "!#ff11cc");
113+
this->colors.gui_white = getValueStr("gui.white", "!#ffffff");
115114

116115
if (this->percentage_colors.size() < 3)
117116
{

src/display.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ static std::vector<std::string> render_with_image(const moduleMap_t& modulesInfo
145145
const size_t height = image_height / font_height;
146146

147147
if (config.args_image_backend == "kitty")
148-
TinyProcessLib::Process({ "kitty", "+kitten", "icat",
149-
"--align", (config.logo_position == "top" ? "center" : config.logo_position),
150-
"--place", fmt::format("{}x{}@0x0", width, height), path.string() });
148+
TinyProcessLib::Process({ "kitty", "+kitten", "icat", "--align",
149+
(config.logo_position == "top" ? "center" : config.logo_position), "--place",
150+
fmt::format("{}x{}@0x0", width, height), path.string() });
151151
else if (config.args_image_backend == "viu")
152152
TinyProcessLib::Process(
153153
{ "viu", "-t", "-w", fmt::to_string(width), "-h", fmt::to_string(height), path.string() });

0 commit comments

Comments
 (0)