7 Commits

Author SHA1 Message Date
murat 5bbe703ec1 update for manually running workflow for old releases 2026-05-26 18:52:02 +03:00
murat d8bc65e0d6 ability to generate releases by manually running workflows 2026-05-26 18:46:52 +03:00
murat 7abb846a81 fixed github actions build
i hate llms so much
2026-05-26 18:38:51 +03:00
murat 58bcb147e4 init github actions for builds 2026-05-26 18:32:17 +03:00
murat ecf066dcb3 init Makefile
i used chatgpt for it please don't take my life i still don't know make
2026-05-26 18:28:46 +03:00
murat e6e5648a2d updated gitignore 2026-05-26 18:21:35 +03:00
murat e47dc4f7d8 updated readme 2026-05-25 21:36:10 +03:00
4 changed files with 194 additions and 65 deletions
+80
View File
@@ -0,0 +1,80 @@
name: Build and Release
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main
workflow_dispatch:
inputs:
release_tag:
description: "Optional tag to release (e.g. v1.1)"
required: false
type: string
jobs:
build:
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
container: debian:11
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install build dependencies
run: apt-get update && apt-get install -y --no-install-recommends make g++ git tar ca-certificates
- name: Build
run: make clean build
release:
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && inputs.release_tag != '')
runs-on: ubuntu-latest
container: debian:11
permissions:
contents: write
steps:
- name: Checkout (tag push)
uses: actions/checkout@v4
if: github.event_name == 'push'
- name: Checkout (manual tag)
uses: actions/checkout@v4
if: github.event_name == 'workflow_dispatch'
with:
ref: ${{ inputs.release_tag }}
- name: Install build dependencies
run: apt-get update && apt-get install -y --no-install-recommends make g++ git tar ca-certificates
- name: Build release tarball
env:
VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref_name }}
run: |
if make -n release >/dev/null 2>&1; then
make release VERSION="$VERSION"
else
make clean build
mkdir -p dist
tar -C build -czf "dist/fetchit-${VERSION}-linux-x86_64-gnu.tar.gz" fetchit
fi
- name: Upload workflow artifact
uses: actions/upload-artifact@v4
with:
name: fetchit-${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref_name }}-linux-x86_64-gnu
path: dist/*.tar.gz
- name: Publish GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref_name }}
files: dist/*.tar.gz
overwrite_files: true
generate_release_notes: true
+1 -64
View File
@@ -1,69 +1,6 @@
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Linker files
*.ilk
# Debugger Files
*.pdb
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
*.so.*
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# Build directories
build/
Build/
build-*/
dist/
# CMake generated files
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
Makefile
install_manifest.txt
compile_commands.json
# Temporary files
*.tmp
*.log
*.bak
*.swp
# vcpkg
vcpkg_installed/
# debug information files
*.dwo
# test output & cache
Testing/
.cache/
+50
View File
@@ -0,0 +1,50 @@
APP := fetchit
SRC := main.cpp
BUILD_DIR := build
DIST_DIR := dist
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
DESTDIR ?=
CXX ?= g++
CXXFLAGS ?= -O2 -Wall -Wextra -std=c++17 -pipe
LDFLAGS ?= -static-libstdc++ -static-libgcc
VERSION ?= $(shell git describe --tags --dirty --always 2>/dev/null)
.PHONY: all build run install uninstall clean dist release
all: build
build: $(BUILD_DIR)/$(APP)
$(BUILD_DIR)/$(APP): $(SRC) | $(BUILD_DIR)/.dir
$(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS)
$(BUILD_DIR)/.dir:
mkdir -p $(BUILD_DIR)
touch $@
run: build
./$(BUILD_DIR)/$(APP)
install: build
install -d "$(DESTDIR)$(BINDIR)"
install -m 0755 $(BUILD_DIR)/$(APP) "$(DESTDIR)$(BINDIR)/$(APP)"
uninstall:
rm -f "$(DESTDIR)$(BINDIR)/$(APP)"
clean:
rm -f $(BUILD_DIR)/$(APP)
dist: build | $(DIST_DIR)/.dir
tar -C $(BUILD_DIR) -czf $(DIST_DIR)/$(APP)-$(VERSION)-linux-x86_64-gnu.tar.gz $(APP)
$(DIST_DIR)/.dir:
mkdir -p $(DIST_DIR)
touch $@
release: clean build dist
+63 -1
View File
@@ -1,2 +1,64 @@
# fetchit
Works on my machine
fetchit is a terminal-based system information viewer written in C++. It works like neofetch/fastfetch and consists of a single file (`main.cpp`).
## Features
- Displays distro, kernel, uptime, shell, CPU, GPU, RAM, and OS date information.
- Detects distro name via `/etc/os-release`.
- Shows ASCII logos for supported distros.
- Reads `/usr/share/hwdata/pci.ids` for GPU names; prints hex IDs if missing.
- Accounts for Unicode character width (for icon alignment).
## Supported Distro Logos
`arch`, `cachyos`, `debian`, `ubuntu`, `fedora`, `manjaro`, `opensuse`, `pop`, `linuxmint`, `endeavouros`, `void`, `alpine`
## Requirements
- Linux
- A C++17-capable compiler (e.g., g++)
- A UTF-8 terminal with ANSI color support (for icons and colors)
- The following files/paths are read:
- `/etc/os-release`
- `/etc/hostname`
- `/proc/uptime`
- `/proc/cpuinfo`
- `/proc/meminfo`
- `/sys/bus/pci/devices/`
- `/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
- `/usr/share/hwdata/pci.ids` (optional)
## Build
```bash
g++ -std=c++17 -O2 -o fetchit main.cpp
```
## Run
```bash
./fetchit
```
## Sample Output
```text
--- murat@baklava ---
/\  distro: Arch Linux
/ \  kernel: 7.0.10-arch1-1
/ \  uptime: 1 minutes
/ \  shell: /usr/bin/bash
/ ,, \ 󰍛 CPU: 12th Gen Intel(R) Core(TM) i5-12500H (16) @ 4.5 GHz
/ | | \ 󰾲 GPU: AD107M [GeForce RTX 4060 Max-Q / Mobile] / Alder Lake-P GT2 [Iris Xe Graphics]
/_-'' ''-_\  RAM: 15.2529 GB
 OS Date: 6 months 17 days 3 hours 40 minutes
```
## Notes
- `OS Date` is based on the creation time of `/etc/hostname`.
- If no ASCII logo is found, only the info list is printed.
- The distro logo is displayed in color via ANSI escape codes.
- This tool targets Linux systems and is not expected to work on non-Linux OSes.