Compare commits

6 Commits
Author SHA1 Message Date
EnumDev 8cafe93b33 Update README.md 2026-02-15 20:12:48 +02:00
EnumDev adcf06c149 Reduce gif quality for faster playback 2026-02-15 19:55:49 +02:00
EnumDev 5ef39f89cc Update preview gif 2026-02-15 19:52:35 +02:00
EnumDev 738d2c2086 Disale local IP module if no ip is available 2026-02-15 19:42:18 +02:00
EnumDevandGitHub 637bd2c3e3 Merge pull request #1 from EnumeratedDev/experimental
Merge experimental changes
2026-02-15 17:39:04 +00:00
EnumDev 08035010c9 Add used and total GPU vram variables 2025-12-29 19:30:28 +02:00
4 changed files with 22 additions and 7 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
### Project Information
Stormfetch is a program that can read your system's information and display it in the terminal along with the ASCII art of the Linux distribution you are running.
Stormfetch is still in beta, so distro compatibility is limited. If you would like to contribute ASCII art or add other compatibility features feel free to create a pull request or notify me through GitLab Issues.
At the moment ascii art for different distributions is limited. If you would like to contribute ascii art feel free to make a pull request.
### How it looks
![Stormfetch gif](media/stormfetch.gif)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 12 MiB

+12 -4
View File
@@ -24,7 +24,8 @@ type GPU struct {
Product string
Subsystem string
Driver string
VRAM string
VramTotal string
VramUsed string
}
type Monitor struct {
@@ -136,11 +137,17 @@ func GetGPUModels(hiddenGPUs []int) []GPU {
}
// Get VRAM
vram := "Unknown"
vramTotal := "Unknown"
bytes, err := os.ReadFile("/sys/class/drm/card" + strconv.Itoa(gpu.Index) + "/device/mem_info_vram_total")
if err == nil {
vramUint, _ := strconv.ParseUint(strings.TrimSpace(string(bytes)), 10, 64)
vram = FormatBytes(vramUint)
vramTotal = FormatBytes(vramUint)
}
vramUsed := "Unknown"
bytes, err = os.ReadFile("/sys/class/drm/card" + strconv.Itoa(gpu.Index) + "/device/mem_info_vram_used")
if err == nil {
vramUint, _ := strconv.ParseUint(strings.TrimSpace(string(bytes)), 10, 64)
vramUsed = FormatBytes(vramUint)
}
ret = append(ret, GPU{
@@ -150,7 +157,8 @@ func GetGPUModels(hiddenGPUs []int) []GPU {
Product: gpu.DeviceInfo.Product.Name,
Subsystem: gpu.DeviceInfo.Subsystem.Name,
Driver: gpu.DeviceInfo.Driver,
VRAM: vram,
VramTotal: vramTotal,
VramUsed: vramUsed,
})
}
+9 -2
View File
@@ -246,8 +246,10 @@ func initializeModuleMap() {
return gpu.Subsystem
case "GPU_DRIVER":
return gpu.Driver
case "GPU_VRAM":
return gpu.VRAM
case "GPU_VRAM_TOTAL":
return gpu.VramTotal
case "GPU_VRAM_USED":
return gpu.VramUsed
default:
return ""
}
@@ -356,6 +358,11 @@ func initializeModuleMap() {
localIpModule := StormfetchModule{stormfetchModuleConfig: stormfetchModuleConfig{Name: "local_ip", Format: "%3Local IP: %4$LOCAL_IP"}, Execute: func(sm StormfetchModule) string {
localIP := GetLocalIP()
// Return empty string if local IP is unavailable
if localIP == "Unknown" {
return ""
}
return os.Expand(sm.Format, func(s string) string {
switch s {
case "LOCAL_IP":