28 Commits

Author SHA1 Message Date
fa1f013640 fix(ci): add libpci-dev for zig build
All checks were successful
Release / build (push) Successful in 37s
2026-02-24 17:18:23 +00:00
c14e14fc6c fix(ci): add libpci-dev for zig build 2026-02-24 17:18:13 +00:00
2854d2a922 ci: add release workflow for x86_64 builds
Some checks failed
Release / build (push) Failing after 19s
2026-02-24 16:57:29 +00:00
utox39
8bd839a567 chore: update .gitignore 2026-02-10 16:28:26 +01:00
utox39
7c7b214c1d build: add default.nix 2026-02-10 16:24:11 +01:00
utox39
41af324564 docs(README): update README 2025-12-21 02:29:06 +01:00
utox39
366cd7b497 docs(README): update README 2025-12-21 02:26:38 +01:00
utox39
d85ae15fe6 build(build.yml): add a new path 2025-12-15 23:41:40 +01:00
utox39
19edc21b89 build(build.yml): bump zig version to 0.15.2 2025-12-15 23:40:07 +01:00
utox39
d50ccb06b1 build(build.yml): bump to macos-15 x86_64 2025-12-15 23:37:26 +01:00
utox39
c8fb8d6a3e Merge pull request #30 from utox39/feat-linux/packages
Feat linux/packages
2025-12-15 23:33:33 +01:00
utox39
df0f21bc48 docs: update README 2025-12-15 23:29:33 +01:00
utox39
8258df5aae docs: update README 2025-12-15 23:26:49 +01:00
utox39
937746ad50 build: bump version to 0.25.0 2025-12-15 23:16:16 +01:00
utox39
6ca8dcf334 perf(linux-packages): improve nix packages counting speed by adding a cache system 2025-12-15 23:12:44 +01:00
utox39
87d31a9112 refactor(linux-packages): switch Flatpak package counting to filesystem-based method 2025-12-14 20:19:54 +01:00
utox39
c867ea69c6 feat(linux-packages): add packages count 2025-12-14 02:28:52 +01:00
utox39
29d5bb1d98 refactor(linux-packages): change a comment 2025-12-14 02:09:50 +01:00
utox39
a88aab97ff feat(linux-packages): add xbps packages count 2025-12-14 02:08:27 +01:00
utox39
2de0d6ec09 feat(linux-packages): add pacman packages count 2025-12-09 21:24:24 +01:00
utox39
6f4e4eb044 refactor(utils): move countEntries from macos utils in common utils 2025-12-09 19:35:10 +01:00
utox39
a64db7a7d3 feat(linux-packages): add dpkg packages count 2025-12-09 18:25:57 +01:00
utox39
e2cbda50c1 fix(linux-packages): fix a memory leak caused by the child process writing to stderr 2025-12-09 18:25:40 +01:00
utox39
51de84d210 refactor(linux-packages): rename countFlatpaks to countFlatpakPackages 2025-12-06 23:17:24 +01:00
utox39
b9dc58fabe feat(linux-packages): add Nix packages count 2025-12-06 19:28:12 +01:00
utox39
2dfcadf413 feat(linux-packages): add flatpak packages count 2025-12-06 19:27:16 +01:00
utox39
2ea3adef12 build: add shell.nix 2025-11-15 16:06:25 +01:00
utox39
b4b92abcb5 docs(README): update README 2025-10-17 19:20:06 +02:00
13 changed files with 450 additions and 120 deletions

View File

@@ -0,0 +1,48 @@
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libpci-dev zip
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
- name: Build
run: zig build -Doptimize=ReleaseSafe
- name: Package and release
env:
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
cd zig-out/bin
zip ../../zigfetch-x86_64-linux.zip zigfetch
cd ../..
RELEASE_ID=$(curl -s -X POST "https://gitea.bitua.io/api/v1/repos/bitua/zigfetch/releases" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\": \"${GITHUB_REF_NAME}\", \"name\": \"${GITHUB_REF_NAME}\"}" | jq -r .id)
echo "Release ID: $RELEASE_ID"
curl -s -X POST "https://gitea.bitua.io/api/v1/repos/bitua/zigfetch/releases/${RELEASE_ID}/assets?name=zigfetch-x86_64-linux.zip" \
-H "Authorization: token ${GITEA_TOKEN}" \
-F "attachment=@zigfetch-x86_64-linux.zip"

View File

@@ -2,11 +2,12 @@ name: Build
on:
push:
branches: [ "main" ]
branches: ["main"]
paths:
- 'src/**'
- 'build.zig'
- 'build.zig.zon'
- ".github/workflows/build.yml"
- "src/**"
- "build.zig"
- "build.zig.zon"
jobs:
build:
@@ -22,7 +23,7 @@ jobs:
sudo apt-get install -y libpci-dev
# macOS x86_64
- os: macos-13
- os: macos-15
target: x86_64-darwin
runner_arch: x64
setup_deps: ""
@@ -36,64 +37,64 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.1
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
- name: Setup platform dependencies
if: matrix.setup_deps != ''
run: ${{ matrix.setup_deps }}
- name: Setup platform dependencies
if: matrix.setup_deps != ''
run: ${{ matrix.setup_deps }}
- name: Cache Zig
uses: actions/cache@v4
with:
path: |
~/.cache/zig
zig-cache
key: ${{ runner.os }}-${{ matrix.target }}-zig-${{ hashFiles('build.zig', 'build.zig.zon') }}
restore-keys: |
${{ runner.os }}-${{ matrix.target }}-zig-
- name: Cache Zig
uses: actions/cache@v4
with:
path: |
~/.cache/zig
zig-cache
key: ${{ runner.os }}-${{ matrix.target }}-zig-${{ hashFiles('build.zig', 'build.zig.zon') }}
restore-keys: |
${{ runner.os }}-${{ matrix.target }}-zig-
- name: Build for target
run: |
zig build -Doptimize=ReleaseSafe
- name: Build for target
run: |
zig build -Doptimize=ReleaseSafe
mv zig-out/bin/zigfetch zig-out/bin/zigfetch-${{ matrix.target }}
mv zig-out/bin/zigfetch zig-out/bin/zigfetch-${{ matrix.target }}
- name: Verify binary
run: |
ls -la zig-out/bin/
file zig-out/bin/zigfetch-${{ matrix.target }}
- name: Verify binary
run: |
ls -la zig-out/bin/
file zig-out/bin/zigfetch-${{ matrix.target }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: zigfetch-${{ matrix.target }}
path: zig-out/bin/zigfetch-${{ matrix.target }}
retention-days: 3
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: zigfetch-${{ matrix.target }}
path: zig-out/bin/zigfetch-${{ matrix.target }}
retention-days: 3
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.1
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.1
- name: Setup dependencies
run: |
sudo apt-get update
sudo apt-get install -y libpci-dev
- name: Setup dependencies
run: |
sudo apt-get update
sudo apt-get install -y libpci-dev
- name: Run tests
run: |
zig test src/ascii.zig
zig test src/utils.zig
- name: Run tests
run: |
zig test src/ascii.zig
zig test src/utils.zig

3
.gitignore vendored
View File

@@ -1 +1,2 @@
*zig-*
*zig-*
result

View File

@@ -13,13 +13,13 @@
---
- [Description](#description)
- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [Configuration](#configuration)
- [Roadtrip](#roadtrip)
- [Contributing](#contributing)
- [Description](#description)
- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [Configuration](#configuration)
- [Roadtrip](#roadtrip)
- [Contributing](#contributing)
## Description
@@ -27,17 +27,17 @@ Zigfetch is a minimal [neofetch](https://github.com/dylanaraps/neofetch)/[fastfe
## Requirements
- \>= [zig v0.15.2](https://ziglang.org/)
- \>= [zig v0.15.2](https://ziglang.org/)
### Linux only
- [libpci](https://github.com/pciutils/pciutils)
- [libpci](https://github.com/pciutils/pciutils)
## Installation
### Build from source
```console
```bash
# Clone the repo
$ git clone https://github.com/utox39/zigfetch.git
@@ -53,14 +53,20 @@ $ mv ./zig-out/zigfetch ~/bin/
### Via [Homebrew](https://brew.sh/)
```console
$ brew install utox39/tap/zigfetch
```bash
brew install utox39/tap/zigfetch
```
### Other package managers
[![Packaging status](https://repology.org/badge/vertical-allrepos/zigfetch.svg)](https://repology.org/project/zigfetch/versions)
- nixpkg: Thanks to [@heisfer](https://github.com/heisfer)
## Usage
```console
$ zigfetch
```bash
zigfetch
```
### Configuration
@@ -68,51 +74,51 @@ $ zigfetch
> [!IMPORTANT]
> Currently, Zig does not have a built-in library for JSON validation via JSON schema, so it is very important to follow the pattern shown in the default configuration file ([config.json](https://github.com/utox39/zigfetch/blob/main/config.json)) to avoid errors
- Create the config folder
- Create the config folder
```console
$ mkdir -p ~/.config/zigfetch
```bash
mkdir -p ~/.config/zigfetch
```
- Create the config file
- Create the config file
```console
$ cd ~/.config/zigfetch
$ touch config.json
```bash
cd ~/.config/zigfetch
touch config.json
```
- Or copy the default config (preferred way)
- Or copy the default config (preferred way)
```console
$ cp /path/to/zigfetch/config.json ~/.config/zigfetch/config.json
```bash
cp /path/to/zigfetch/config.json ~/.config/zigfetch/config.json
```
#### Modules
Available modules:
- Os
- Kernel
- Uptime
- Packages
- Shell
- Cpu
- Gpu
- Ram
- Swap
- Disk
- Net
- WM (Window Manager)
- Terminal
- Locale
- Custom
- Os
- Kernel
- Uptime
- Packages
- Shell
- Cpu
- Gpu
- Ram
- Swap
- Disk
- Net
- WM (Window Manager)
- Terminal
- Locale
- Custom
| Module type | Linux | macOS | Windows |
| :---------: | :-------------: | :----------------------: | :-----: |
| os | Yes | Yes | WIP |
| kernel | Yes | Yes | WIP |
| uptime | Yes | Yes | WIP |
| packages | WIP | Yes (Homebrew, Macports) | WIP |
| packages | Yes* | Yes (Homebrew, Macports) | WIP |
| shell | Yes (bash, zsh) | Yes (bash, zsh) | WIP |
| cpu | Yes | Yes | WIP |
| gpu | Yes | Yes (Apple Silicon only) | WIP |
@@ -124,6 +130,8 @@ Available modules:
| terminal | Yes | Yes | WIP |
| locale | Yes | Yes | WIP |
\*(flatpak, nix, dpkg, pacman, xbps)
```json
"modules": [
{
@@ -168,11 +176,11 @@ To change the Username and Hostname color (HEX colors only):
## Roadtrip
- [ ] Add ASCII art for each operating system and Linux distro
- [x] Add GPU info for Linux
- [ ] Add packages info for Linux
- [x] Add user customization
- [ ] Add support for Windows
- [ ] Add ASCII art for each operating system and Linux distro
- [x] Add GPU info for Linux
- [x] Add packages info for Linux
- [x] Add user customization
- [ ] Add support for Windows
## Contributing

View File

@@ -10,7 +10,7 @@
// This is a [Semantic Version](https://semver.org/).
// In a future version of Zig it will be used for package deduplication.
.version = "0.24.2",
.version = "0.25.0",
// Together with name, this represents a globally unique package
// identifier. This field is generated by the Zig toolchain when the

20
default.nix Normal file
View File

@@ -0,0 +1,20 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.stdenv.mkDerivation {
pname = "zigfetch";
version = "0.25.0";
src = ./.;
nativeBuildInputs = with pkgs; [
zig.hook
];
buildInputs = with pkgs; [
pciutils
];
zigBuildFlags = [
"-Doptimize=ReleaseSafe"
];
}

13
shell.nix Normal file
View File

@@ -0,0 +1,13 @@
{ pkgs ? import <nixpkgs> {} }:
let
unstable = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz";
}) {};
in
pkgs.mkShell {
buildInputs = [
unstable.zig
pkgs.pciutils
];
}

View File

@@ -100,13 +100,9 @@ pub fn getDefaultFormattedPackagesInfo(allocator: std.mem.Allocator) !Result {
}
pub fn getFormattedPackagesInfo(allocator: std.mem.Allocator, key: []const u8, key_color: []const u8) !Result {
if (builtin.os.tag == .macos) {
const packages_info = try detection.packages.getPackagesInfo(allocator);
defer allocator.free(packages_info);
return Result{ .string = try std.fmt.allocPrint(allocator, "{s}{s}:{s}{s}", .{ key_color, key, ascii.Reset, packages_info }) };
} else if (builtin.os.tag == .linux) {
return Result{ .string = try std.fmt.allocPrint(allocator, "{s}{s}:{s} WIP", .{ key_color, key, ascii.Reset }) };
}
const packages_info = try detection.packages.getPackagesInfo(allocator);
defer allocator.free(packages_info);
return Result{ .string = try std.fmt.allocPrint(allocator, "{s}{s}:{s}{s}", .{ key_color, key, ascii.Reset, packages_info }) };
}
pub fn getDefaultFormattedShellInfo(allocator: std.mem.Allocator) !Result {

View File

@@ -2,3 +2,4 @@ pub const hardware = @import("./hardware.zig");
pub const network = @import("./network.zig");
pub const system = @import("./system.zig");
pub const user = @import("./user.zig");
pub const packages = @import("./packages.zig");

242
src/linux/packages.zig Normal file
View File

@@ -0,0 +1,242 @@
const std = @import("std");
const utils = @import("../utils.zig");
pub fn getPackagesInfo(allocator: std.mem.Allocator) ![]const u8 {
var packages_info = std.array_list.Managed(u8).init(allocator);
defer packages_info.deinit();
const flatpak_packages = countFlatpakPackages() catch |err| if (err == error.FileNotFound) 0 else return err;
const nix_packages = countNixPackages(allocator) catch 0;
const dpkg_packages = countDpkgPackages(allocator) catch |err| if (err == error.FileNotFound) 0 else return err;
const pacman_packages = countPacmanPackages() catch |err| if (err == error.FileNotFound) 0 else return err;
const xbps_packages = countXbpsPackages(allocator) catch |err| if (err == error.FileNotFound) 0 else return err;
var buffer: [32]u8 = undefined;
if (nix_packages > 0) {
try packages_info.appendSlice(try std.fmt.bufPrint(&buffer, " Nix: {d}", .{nix_packages}));
}
if (flatpak_packages > 0) {
try packages_info.appendSlice(try std.fmt.bufPrint(&buffer, " Flatpak: {d}", .{flatpak_packages}));
}
if (dpkg_packages > 0) {
try packages_info.appendSlice(try std.fmt.bufPrint(&buffer, " Dpkg: {d}", .{dpkg_packages}));
}
if (pacman_packages > 0) {
try packages_info.appendSlice(try std.fmt.bufPrint(&buffer, " Pacman: {d}", .{pacman_packages}));
}
if (xbps_packages > 0) {
try packages_info.appendSlice(try std.fmt.bufPrint(&buffer, " Xbps: {d}", .{xbps_packages}));
}
return try allocator.dupe(u8, packages_info.items);
}
fn countFlatpakPackages() !usize {
const flatpak_apps = try countFlatpakApps();
const flatpak_runtimes = try countFlatpakRuntimes();
return flatpak_apps + flatpak_runtimes;
}
fn countFlatpakApps() !usize {
var dir = try std.fs.openDirAbsolute("/var/lib/flatpak/app/", .{ .iterate = true });
defer dir.close();
var iter = dir.iterate();
var count: usize = 0;
while (try iter.next()) |e| {
if (e.kind != .directory) continue;
var sub_dir = try dir.openDir(e.name, .{});
defer sub_dir.close();
var current = sub_dir.openDir("current", .{}) catch continue;
defer current.close();
// If `current` was opened successfully, increment the count
count += 1;
}
return count;
}
fn countFlatpakRuntimes() !usize {
var dir = try std.fs.openDirAbsolute("/var/lib/flatpak/runtime/", .{ .iterate = true });
defer dir.close();
var iter = dir.iterate();
var counter: usize = 0;
while (try iter.next()) |e| {
if (std.mem.endsWith(u8, e.name, ".Locale") or std.mem.endsWith(u8, e.name, ".Debug")) continue;
var arch_dir = try dir.openDir(e.name, .{ .iterate = true });
defer arch_dir.close();
var arch_iter = arch_dir.iterate();
while (try arch_iter.next()) |arch_e| {
if (arch_e.kind != .directory) continue;
var sub_dir = try arch_dir.openDir(arch_e.name, .{ .iterate = true });
defer sub_dir.close();
var sub_iter = sub_dir.iterate();
while (try sub_iter.next()) |_| {
counter += 1;
}
}
}
return counter;
}
fn countNixPackages(allocator: std.mem.Allocator) !usize {
// `/run/current-system` is a sym-link, so we need to obtein the real path
const real_path = try std.fs.realpathAlloc(allocator, "/run/current-system");
defer allocator.free(real_path);
var hash: [32]u8 = undefined;
std.crypto.hash.Blake3.hash(real_path, &hash, .{});
const hash_hex = try std.fmt.allocPrint(allocator, "{x}", .{hash});
defer allocator.free(hash_hex);
var count: usize = 0;
// Inspired by https://github.com/fastfetch-cli/fastfetch/blob/608382109cda6623e53f318e8aced54cf8e5a042/src/detection/packages/packages_nix.c#L81
count = checkNixCache(allocator, hash_hex) catch |err| switch (err) {
error.FileNotFound, error.InvalidCache => {
// nix-store --query --requisites /run/current-system | wc -l
const result = try std.process.Child.run(.{ .allocator = allocator, .argv = &[_][]const u8{
"sh",
"-c",
"nix-store --query --requisites /run/current-system | wc -l",
} });
const result_trimmed = std.mem.trim(u8, result.stdout, "\n");
defer allocator.free(result.stdout);
defer allocator.free(result.stderr);
count = try std.fmt.parseInt(usize, result_trimmed, 10);
try writeNixCache(allocator, hash_hex, count);
return count;
},
else => return err,
};
return count;
}
fn getNixCachePath(allocator: std.mem.Allocator) ![]const u8 {
var cache_dir_path = std.process.getEnvVarOwned(allocator, "XDG_CACHE_HOME") catch try allocator.dupe(u8, "");
if (cache_dir_path.len == 0) {
allocator.free(cache_dir_path);
const home = try std.process.getEnvVarOwned(allocator, "HOME");
defer allocator.free(home);
cache_dir_path = try std.fs.path.join(allocator, &.{ home, ".cache", "zigfetch", "nix" });
} else {
cache_dir_path = try std.fs.path.join(allocator, &.{ cache_dir_path, "zigfetch", "nix" });
}
return cache_dir_path;
}
fn writeNixCache(allocator: std.mem.Allocator, hash: []const u8, count: usize) !void {
const cache_dir_path = try getNixCachePath(allocator);
defer allocator.free(cache_dir_path);
try std.fs.cwd().makePath(cache_dir_path);
var cache_dir = try std.fs.cwd().openDir(cache_dir_path, .{});
defer cache_dir.close();
var cache_file = try cache_dir.createFile("nix_cache", .{ .truncate = true });
defer cache_file.close();
const cache_content = try std.fmt.allocPrint(allocator, "{s}\n{d}", .{ hash, count });
defer allocator.free(cache_content);
try cache_file.writeAll(cache_content);
}
fn checkNixCache(allocator: std.mem.Allocator, hash: []const u8) !usize {
const cache_dir_path = try getNixCachePath(allocator);
defer allocator.free(cache_dir_path);
var cache_dir = try std.fs.cwd().openDir(cache_dir_path, .{});
defer cache_dir.close();
var cache_file = try cache_dir.openFile("nix_cache", .{ .mode = .read_only });
const cache_size = (try cache_file.stat()).size;
const cache_content = try utils.readFile(allocator, cache_file, cache_size);
defer allocator.free(cache_content);
var cache_iter = std.mem.splitScalar(u8, cache_content, '\n');
const hash_needle = cache_iter.next().?;
if (!std.mem.eql(u8, hash, hash_needle)) {
return error.InvalidCache;
}
// The next element in the split is the package count
return std.fmt.parseInt(usize, cache_iter.next().?, 10);
}
fn countDpkgPackages(allocator: std.mem.Allocator) !usize {
const dpkg_status_path = "/var/lib/dpkg/status";
const dpkg_file = try std.fs.cwd().openFile(dpkg_status_path, .{ .mode = .read_only });
defer dpkg_file.close();
const file_size = (try dpkg_file.stat()).size;
const content = try utils.readFile(allocator, dpkg_file, file_size);
defer allocator.free(content);
var count: usize = 0;
var iter = std.mem.splitSequence(u8, content, "\n\n");
// TODO: find a way to avoid this loop
while (iter.next()) |_| {
count += 1;
}
// Subtruct 1 to remove an useless line
return count - 1;
}
fn countPacmanPackages() !usize {
// Subtruct 1 to remove `ALPM_DB_VERSION` from the count
return try utils.countEntries("/var/lib/pacman/local") - 1;
}
fn countXbpsPackages(allocator: std.mem.Allocator) !usize {
var dir = try std.fs.openDirAbsolute("/var/db/xbps/", .{ .iterate = true });
defer dir.close();
var count: usize = 0;
var dir_iter = dir.iterate();
while (try dir_iter.next()) |e| {
if ((e.kind == .file) and std.mem.startsWith(u8, e.name, "pkgdb-")) {
const pkgdb_file = try dir.openFile(e.name, .{ .mode = .read_only });
defer pkgdb_file.close();
const file_size = (try pkgdb_file.stat()).size;
const content = try utils.readFile(allocator, pkgdb_file, file_size);
defer allocator.free(content);
var file_iter = std.mem.splitSequence(u8, content, "<string>installed</string>");
// TODO: find a way to avoid this loop
while (file_iter.next()) |_| {
count += 1;
}
break;
}
}
// Subtruct 1 to remove an useless line
return count - 1;
}

View File

@@ -1,5 +1,5 @@
const std = @import("std");
const utils = @import("utils.zig");
const utils = @import("../utils.zig");
pub fn getPackagesInfo(allocator: std.mem.Allocator) ![]const u8 {
var packages_info = std.array_list.Managed(u8).init(allocator);

View File

@@ -23,17 +23,3 @@ pub fn cfTypeRefToZigString(allocator: std.mem.Allocator, cf_type_ref: c_iokit.C
return allocator.realloc(buffer, actual_len);
}
pub fn countEntries(dir_path: []const u8) !usize {
var dir = try std.fs.openDirAbsolute(dir_path, .{ .iterate = true });
defer dir.close();
var count: usize = 0;
var iter = dir.iterate();
while (try iter.next()) |_| {
count += 1;
}
return count;
}

View File

@@ -125,3 +125,17 @@ pub fn readFile(allocator: std.mem.Allocator, file: std.fs.File, size: usize) ![
return allocator.dupe(u8, data);
}
pub fn countEntries(dir_path: []const u8) !usize {
var dir = try std.fs.openDirAbsolute(dir_path, .{ .iterate = true });
defer dir.close();
var count: usize = 0;
var iter = dir.iterate();
while (try iter.next()) |_| {
count += 1;
}
return count;
}