2 |
3 | A super tiny battery information fetch script written in BASH
4 |
5 |

6 |

7 |

8 |
9 |
10 |
11 | # Batfetch
12 |
13 | BatFetch is a command-line tool that displays detailed information about the battery of your device in a clean and organized way. The tool is inspired by pfetch, a popular command-line system information tool.
14 |
15 | It provides information about the battery model, current charge level, power state, and health status. The tool also displays an ASCII art title that adds a touch of fun to the output.
16 |
17 | ## Usage:
18 |
19 | #### Basic usage:
20 |
21 | ```
22 | batfetch
23 | ```
24 |
25 | #### JSON Output:
26 |
27 | To obtain detailed information in JSON format, use the -j or --json flag.
28 | Note that this feature requires the installation of jq on your system.
29 |
30 | ```
31 | batfetch -j
32 | # or
33 | batfetch --json
34 | ```
35 |
36 | Make sure to install jq for the JSON output functionality:
37 |
38 | ```
39 | # On arch based systems*
40 | yay -S jq
41 |
42 | # On Debian-based systems
43 | sudo apt-get install jq
44 |
45 | # On Red Hat-based systems
46 | sudo yum install jq
47 | ```
48 |
49 | 
50 |
51 | ## Installation:
52 |
53 | #### AUR:
54 |
55 | ```
56 | yay -S batfetch
57 | ```
58 |
59 | ## For manual instalation:
60 |
61 | #### To install run
62 |
63 | ```
64 | git clone https://github.com/ashish-kus/batfetch
65 | cd batfetch
66 | sudo make install
67 | ```
68 |
69 | #### To uninstall run
70 |
71 | ```
72 | git clone https://github.com/ashish-kus/batfetch
73 | cd batfetch
74 | sudo make uninstall
75 | ```
76 |
77 | #### Nix os (via Flake)
78 |
79 |
80 | >[!NOTE]
81 | > This will run the command without installation of the tool.
82 |
83 |
84 | ```
85 | nix run github:ashish-kus/batfetch
86 | ```
87 |
88 | >[!NOTE]
89 | > Using flake to install in the system.
90 |
91 |
92 | ```bash
93 | # flake input
94 | batfetch = {
95 | url = "github:ashish-kus/batfetch";
96 | inputs.nixpkgs.follows = "nixpkgs";
97 | };
98 |
99 | environment.systemPackages = [
100 | inputs.batfetch.packages.${pkgs.system}.default
101 | ];
102 | ```
103 |
104 | #### LICENCE
105 |
106 |