Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
996fb6c
Add parrot OS (#153)
BlivionIaG Jun 10, 2021
6731b70
fix windows scoop neofetch compatibility
BlivionIaG Jun 10, 2021
92264f9
Update version number
BlivionIaG Jun 10, 2021
919473c
Merge branch 'master' into testing
BlivionIaG Jun 10, 2021
e039354
Add more mobo support and os's
BlivionIaG Jun 10, 2021
6fb9ec7
Merge branch 'testing' of https://github.com/MrPotatoBobx/FetchCord i…
BlivionIaG Jun 10, 2021
f987ee3
Add mageia
BlivionIaG Jun 10, 2021
bb16e4a
Add elitedesk 800 g1
BlivionIaG Jun 10, 2021
b4ad426
Fix debug and add windows 11
BlivionIaG Jul 16, 2021
b950504
Add athlon silver & gold cpu support
BlivionIaG Jul 29, 2021
4f74c61
Prepare alt mobo detect
BlivionIaG Jul 29, 2021
b173700
[untested] motherboard fix
BlivionIaG Aug 8, 2021
76366db
Add some random acer laptop
BlivionIaG Aug 10, 2021
14957c2
Add elementary os support and thinkcenter
BlivionIaG Aug 19, 2021
ff5bdc3
Disable logger
BlivionIaG Aug 19, 2021
0e0d708
Revert "Disable logger"
BlivionIaG Aug 19, 2021
66c69f9
Disable logger file
BlivionIaG Aug 19, 2021
53f68ab
Add terminus / elementary os terminal
BlivionIaG Aug 19, 2021
819f7a8
Add windows terminal
BlivionIaG Aug 19, 2021
75dc95b
fix windows terminal detection
BlivionIaG Aug 22, 2021
5030351
Fix mobo detection on linux and host cycle
BlivionIaG Sep 19, 2021
fda8b8c
Add GUI frontend (#177)
TabulateJarl8 Nov 1, 2021
666f6ef
Black + flake8
BlivionIaG Nov 1, 2021
e124def
Fix for PRs #174, #178, #179, #181, #181 (#182)
luni-moon Nov 3, 2021
a6f1402
Fix #149 (#186)
SimPilotAdamT Dec 3, 2021
186f556
GUI Fixes (#184)
TabulateJarl8 Dec 3, 2021
404aa0e
Fixes syntax error caused by GitHub CoPilot (#187)
SimPilotAdamT Dec 4, 2021
4fda719
Update Computer.py (#188)
SimPilotAdamT Dec 4, 2021
fa7c2c5
Import gui stuff only when used
BlivionIaG Dec 4, 2021
de98dee
Fix the error preventing build (#191)
SimPilotAdamT Jan 4, 2022
eb11bf1
Fetchcord 3.0: Simpler code, less neofetch dependency on windows (#227)
BlivionIaG Apr 21, 2024
23cf857
README.md quick refactor
BlivionIaG May 7, 2024
b9163fb
Update README.md
BlivionIaG May 7, 2024
ebdb380
Split commands and cycle config
BlivionIaG May 7, 2024
5630e4e
Cleaning
BlivionIaG May 7, 2024
18b2664
Replace neofetch by fastfetch
BlivionIaG Jun 12, 2025
e2d821c
Remove gui - fix resolution and motherboard detect on linux
BlivionIaG Jun 12, 2025
5df8473
Fix version reporting
BlivionIaG Jun 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ assignees: ''

**Please run `fetchcord --debug` and send it here.**

**If you are unable to run FetchCord please run `neofetch --noart`(windows) or `neofetch -- stdout`(macos&linux)**
**If you are unable to run FetchCord please run `fastfetch -l none`(macos&linux)**

# Operating system & way of installation

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/distro-de-wm-shell-hw-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assignees: ''

# Debug info

**Please run `fetchcord --debug` and put it here. You might also want to send the output of `neofetch --noart`(windows) or `neofetch -- stdout`(macos&linux)**
**Please run `fetchcord --debug` and put it here. You might also want to send the output of `fas`(macos&linux)**

# Requested item

Expand Down
Binary file added Examples/gui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include *.py
include */*.py
include */*/*.py
include */*/*/*.py
include resources/*.json
include resources/fetchcord_conf.yml
include resources/fetchcord_cmds.yml
include resources/default.conf
106 changes: 67 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,30 @@
<a href="https://img.shields.io/badge/Compatible-MacOS%2FWindows%2FLinux-brightgreen?style=for-the-badge&logo=discord">
<img src="https://cdn.discordapp.com/attachments/695182849476657223/742064452421288077/FetchDis.png"
</a>

</a>
</p>

# Table of content

- [**Features**](#features)
- [**To-Do**](#to-do)
+ **Installing**
- [Install on (gnu/)linux](#installing-on-gnulinux)
- [Install on MacOS](#installing-on-macos)
- [Install on Windows](#installing-on-windows)
+ **Running**
- [Running on (gnu/)linux](#run)
- [Running on MacOS](#run-1)
- [Running on Windows](#run-2)
- [**Configuration**](#Configuration)
- **Installing**
- [Install on (gnu/)linux](#installing-on-gnulinux)
- [Install on MacOS](#installing-on-macos)
- [Install on Windows](#installing-on-windows)
- **Running**
- [Running on (gnu/)linux](#run-on-linux)
- [Running on MacOS](#run-on-macos)
- [Running on Windows](#run-on-windows)
- [**Configuration**](#configuration)
- [**Arguments**](#arguments)
- [**Website**](#website)
- [**Examples**](#examples)

+ [**Examples**](#examples)

### Features
## Features

- [x] Distribution detection

- [x] Distribution Version

- [x] Package detection
Expand All @@ -47,20 +47,21 @@

- [x] Detecting Window Manager/Desktop Environment

- [x] Detecting GPU/CPU and display it in a cycle (thanks to Hyper-KVM)
- [x] Detecting GPU/CPU and display it in a cycle

- [x] Flatpak support

- [x] Add Snap support

- [x] Add Windows support.

- [x] Detect Window Manager/Desktop Environment version

- [x] Periodic polling of info such as package count, RAM usage, etc.

## To be tested

### To-Do
- [ ] Snap support

## To-Do

- [ ] Add more distributions (If your distro is not supported open an issue)

Expand All @@ -70,50 +71,64 @@

- [ ] More GPUs?


## Installing on (GNU/)Linux
NOTE: you need neofetch to be also installed for this to work.
#### Via AUR
On Arch Linux install this package for the git version: [fetchcord-git](https://aur.archlinux.org/packages/fetchcord-git/)

Do note that this version is directly from master, for the stable release use [pip](#via-pip)
#### Via Snap
On systems with snap installed, you can run `sudo snap install fetchcord --classic` to install fetchcord.
NOTE: you need fastfetch to be also installed for this to work.

### Via pip (recommended)

Note that like the AUR version, this version is directly from master, for the stable release use [pip](#via-pip) <!-- remove this if you're not automatically deploying it -->
#### Via pip
To Install fetchcord via pip you can run `pip3 install fetchcord`
To install fetchcord via pip you can run `pip3 install fetchcord`

If you want to remove FetchCord you can run `pip3 uninstall fetchcord`

### Run
### Via AUR

On Arch Linux for the git testing version (the less stable version): [fetchcord-testing](https://aur.archlinux.org/packages/fetchcord-testing/)

And the git version (synced with master): [fetchcord](https://aur.archlinux.org/packages/fetchcord/)

### Via Snap

On systems with snap installed, you can run `sudo snap install fetchcord --classic` to install fetchcord.

Note that like the AUR version, this version is directly from master, for the stable release use [pip](#via-pip-recommended) <!-- remove this if you're not automatically deploying it -->

### Run on Linux

Once installed, simply run `fetchcord`. The program is also daemonizable meaning you can start it on boot using any method you prefer.

If you get `fetchcord: command not found`,add `export PATH="$HOME/.local/bin:$PATH"` to your bashrc, or just run `python3 -m fetchcord`.
If you get `fetchcord: command not found`,add `export PATH="$HOME/.local/bin:$PATH"` to your bashrc, or just run `python3 -m fetch_cord`.

Optionally for systemd users there is a user-side `fetchcord.service` in this repo that can be installed to `~/.local/share/systemd/user/`, started and enabled on boot using `systemctl --user enable --now fetchcord`.

## Installing on MacOS

To install FetchCord, run `pip3 install FetchCord`
NOTE: you need fastfetch to be also installed for this to work.

To install fetchcord via pip you can run `pip3 install fetchcord`

NOTE: you need neofetch to be also installed for this to work.
If you want to remove FetchCord you can run `pip3 uninstall fetchcord`

### Run on MacOS

### Run
Once installed, simply run `fetchcord`. The program is also daemonizable meaning you can start it on boot using any method you prefer.

simply run `fetchcord`
If you get `fetchcord: command not found`,add `export PATH="$HOME/.local/bin:$PATH"` to your zshrc, or just run `python3 -m fetch_cord`.

## Installing on Windows

To install fetchcord on Windows run `python -m pip install fetchcord neofetch-win`. Alternatively, you can use the neofetch package from scoop as well (show more info at the expense of possible GPU detection, for now).
To install fetchcord on Windows run `pip3 install fetchcord` or `python3 -m pip install fetchcord`.

### Run on Windows

### Run
To run Fetchcord run `fetchcord`

If you get `fetchcord: command not found`, add your python scripts folder to your PATH or use `python3 -m fetch_cord`.

### Configuration

On Linux you can use the neofetch config file to:
TODO Fastfetch config
<!-- On Linux you can use the neofetch config file to:

Show disk usage

Expand All @@ -129,9 +144,10 @@ Theme

And more

default config path should be `~/.config/neofetch/config.conf`
default config path should be `~/.config/neofetch/config.conf` -->

## Arguments

--nodistro, Don't show distro info.

--nohardware, Don't show hardware info.
Expand All @@ -144,7 +160,7 @@ default config path should be `~/.config/neofetch/config.conf`

--terminal, set custom terminal (useful if using a script or dmenu).

--termfont, set custom terminal font (useful if neofetch can't get it).
--termfont, set custom terminal font (useful if fastfetch can't get it).

--pause-cycle, Extra cycle that pauses FetchCord to show other activities.

Expand All @@ -155,13 +171,25 @@ default config path should be `~/.config/neofetch/config.conf`
--memtype, use GB or MB to show RAM.

-h or --help, shows this information above.

## Website

Fetchcord now has a website! You can find this site over at https://fetchcord.github.io/ - please keep in mind this site is still currently work in progress though.

## Examples

### Operating Systems

![MacOS bigsur](Examples/mac.png) ![Windows 10](Examples/windows.png) ![Ubuntu](Examples/ubuntu.png)

### Terminals

![Konsole](Examples/konsole.png) ![Gnome terminal](Examples/gnometerm.png) ![Apple terminal](Examples/appleterm.png)

### Cpus

![Ryzen 9](Examples/ryzencpu.png) ![Intel i7](Examples/intelcpu.png) ![Intel pentium](Examples/pent.png)

### Hosts

![HP laptop](Examples/hp.png) ![TUF gaming laptop](Examples/tuf.png) ![Lenovo desktop](Examples/len.png)
24 changes: 24 additions & 0 deletions fetch_cord/Config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python3

from importlib import resources
import yaml


class Config(dict):
def __init__(self, config_name: str = "fetchcord_conf.yml") -> None:
super(Config, self).__init__(
self.get_config(self.get_resource_path("fetch_cord.resources", config_name))
)

def get_resource_path(self, package, resource: str):
with resources.path(package, resource) as path:
return path

def get_config(self, path: str):
with open(path, "r") as stream:
try:
return yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)

return None
89 changes: 80 additions & 9 deletions fetch_cord/Cycle.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,91 @@
from .computer.Computer import Computer
# 1/usr/bin/env python3


from threading import Event
from typing import Dict
from pypresence import Presence, exceptions
import psutil


class Cycle:
name: str

app_id: str = None
top_line: str = None
bottom_line: str = None
small_icon: str = None
time: str = None

debug: bool = False
rpc: Presence = None

stop: Event = None

def __init__(self, config: Dict, stop: Event = None):
if stop is None:
stop = Event()

for key in config:
setattr(self, key, config[key])
self.stop = stop

def __del__(self) -> None:
if self.rpc is not None:
self.rpc.close()

def setup(self, client_id: str) -> None:
self.rpc = Presence(int(client_id))

def try_connect(self) -> None:
while not self.stop.is_set():
try:
if self.debug:
print('try_connect(name="{}")'.format(self.name))
self.rpc.connect()
break
except ConnectionRefusedError:
print(
"""
RPC connection refused (is Discord open?); trying again in 30 seconds"""
)
self.wait(30)

def update(
self, client_id: str, app: str, bottom: str, top: str, icon: str, icon_id: str
):
try:
self.rpc.update(
int(client_id),
state=bottom,
details=top,
large_image="big",
large_text=app,
small_image=icon_id,
small_text=icon,
start=psutil.boot_time(),
)

self.wait(int(self.time))

self.rpc.close()
# ConnectionResetError is here to avoid crashing
# if Discord is still just starting
except (ConnectionResetError, exceptions.InvalidID):
pass

def wait(self, n: float, interval_duration: float = 0.05) -> None:
"""Wait for n seconds or until interrupted."""

def __init__(self, name: str, config: Dict[str, str], computer: Computer):
self.name = name
intervals = int(n / interval_duration)
for _ in range(intervals):
if self.stop.wait(interval_duration):
break

if "top_line" in config["top_line"]:
self.top_line = config["top_line"]
if "bottom_line" in config["bottom_line"]:
self.bottom_line = config["bottom_line"]
if "small_icon" in config["small_icon"]:
self.small_icon = config["small_icon"]
def __repr__(self) -> str:
return f"""
{{name = {self.name}, \
app_id = {self.app_id}, \
top_line = {self.top_line}, \
bottom_line = {self.bottom_line}, \
small_icon = {self.small_icon}, \
time = {self.time}}}"""
Loading