mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c4824b2b5d | |||
| dcbda6c0d5 | |||
| 91e4e94aaa | |||
| 1504e26e38 | |||
| a9c5c2892c | |||
| 923997f0a2 | |||
| 0182e32f00 | |||
| bd40205427 | |||
| 30b9f95b49 | |||
| 74b9fd01ff | |||
| 03f4ffb9d7 | |||
| a00cb2aede | |||
| 6799076fa6 | |||
| 573a315d61 | |||
| 0cd6cb841d | |||
| af94cf4d0d |
@@ -152,9 +152,8 @@ jobs:
|
|||||||
|
|
||||||
- name: install required packages
|
- name: install required packages
|
||||||
run: |
|
run: |
|
||||||
brew uninstall aws-sam-cli azure-cli qemu lima colima gradle kotlin maven pipx aria2 || true
|
|
||||||
brew update
|
brew update
|
||||||
brew install vulkan-loader vulkan-headers molten-vk imagemagick chafa
|
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install vulkan-loader vulkan-headers molten-vk imagemagick chafa
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@v2
|
||||||
|
|||||||
+23
-1
@@ -1,7 +1,29 @@
|
|||||||
|
# 2.3.4
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
* Fix `--help` doesn't work when built without python
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* Use `MemAvailable` if available (Memory, Linux)
|
||||||
|
* Improve performance of detecting dpkg package count (Packages, Linux)
|
||||||
|
|
||||||
|
# 2.3.3
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
* Fix `--help` doesn't work in Windows and some other platforms
|
||||||
|
|
||||||
|
# 2.3.2
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
* Fix fish completion script, and install the script correctly
|
||||||
|
|
||||||
|
Logo:
|
||||||
|
* Fix Xray-OS logo name
|
||||||
|
|
||||||
# 2.3.1
|
# 2.3.1
|
||||||
|
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
* Man page install location
|
* Fix man page install location
|
||||||
|
|
||||||
# 2.3.0
|
# 2.3.0
|
||||||
|
|
||||||
|
|||||||
+14
-5
@@ -1,7 +1,7 @@
|
|||||||
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url
|
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url
|
||||||
|
|
||||||
project(fastfetch
|
project(fastfetch
|
||||||
VERSION 2.3.1
|
VERSION 2.3.4
|
||||||
LANGUAGES C
|
LANGUAGES C
|
||||||
DESCRIPTION "Fast neofetch-like system information tool"
|
DESCRIPTION "Fast neofetch-like system information tool"
|
||||||
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
|
HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"
|
||||||
@@ -206,7 +206,7 @@ endif()
|
|||||||
#############
|
#############
|
||||||
|
|
||||||
function(fastfetch_encode_c_string STR OUTVAR)
|
function(fastfetch_encode_c_string STR OUTVAR)
|
||||||
string(REGEX REPLACE "\n$" "" TEMP "${STR}") # Remove trailing newline
|
string(REGEX REPLACE "\n$" "" TEMP "${STR}") # Remove trailing newline
|
||||||
string(REPLACE "\\" "\\\\" TEMP "${TEMP}") # Escape backslashes
|
string(REPLACE "\\" "\\\\" TEMP "${TEMP}") # Escape backslashes
|
||||||
string(REPLACE "\n" "\\n" TEMP "${TEMP}") # Replace newlines with \n
|
string(REPLACE "\n" "\\n" TEMP "${TEMP}") # Replace newlines with \n
|
||||||
string(REPLACE "\"" "\\\"" TEMP "${TEMP}") # Replace quotes with \"
|
string(REPLACE "\"" "\\\"" TEMP "${TEMP}") # Replace quotes with \"
|
||||||
@@ -221,12 +221,15 @@ endfunction(fastfetch_load_text)
|
|||||||
|
|
||||||
find_package(Python)
|
find_package(Python)
|
||||||
if(Python_FOUND)
|
if(Python_FOUND)
|
||||||
# Minify JSON string. `io.open(0,encoding='utf-8')` is needed to avoid encoding issues on Windows
|
execute_process(COMMAND ${Python_EXECUTABLE} -c "import json,sys;json.dump(json.load(sys.stdin),sys.stdout,separators=(',',':'))"
|
||||||
execute_process(COMMAND ${Python_EXECUTABLE} -c "import io,json,sys;json.dump(json.load(io.open(0,encoding='utf-8')),sys.stdout,separators=(',', ':'),ensure_ascii=False)"
|
|
||||||
INPUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/src/data/help.json"
|
INPUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/src/data/help.json"
|
||||||
OUTPUT_VARIABLE DATATEXT_JSON_HELP)
|
OUTPUT_VARIABLE DATATEXT_JSON_HELP)
|
||||||
|
if(DATATEXT_JSON_HELP STREQUAL "")
|
||||||
|
message(ERROR "DATATEXT_JSON_HELP is empty, which should not happen!")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
file(READ "src/data/help.json" TEMP)
|
message(STATUS "Python3 is not found, 'help.json' will not be minified")
|
||||||
|
file(READ "src/data/help.json" DATATEXT_JSON_HELP)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
fastfetch_encode_c_string("${DATATEXT_JSON_HELP}" DATATEXT_JSON_HELP)
|
fastfetch_encode_c_string("${DATATEXT_JSON_HELP}" DATATEXT_JSON_HELP)
|
||||||
@@ -1040,6 +1043,12 @@ install(
|
|||||||
RENAME "${CMAKE_PROJECT_NAME}"
|
RENAME "${CMAKE_PROJECT_NAME}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES "${CMAKE_SOURCE_DIR}/completions/fish"
|
||||||
|
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/fish/vendor_completions.d"
|
||||||
|
RENAME "${CMAKE_PROJECT_NAME}.fish"
|
||||||
|
)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
DIRECTORY "${CMAKE_SOURCE_DIR}/presets"
|
DIRECTORY "${CMAKE_SOURCE_DIR}/presets"
|
||||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${CMAKE_PROJECT_NAME}"
|
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${CMAKE_PROJECT_NAME}"
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env fish
|
#!/usr/bin/env fish
|
||||||
|
|
||||||
if not test -x fastfetch
|
if not type -q fastfetch
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -545,15 +545,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"long": "bar-char-elapsed",
|
"long": "bar-char-elapsed",
|
||||||
"desc": "Set the character to use in elapsed part",
|
"desc": "Set the character to use in elapsed part of percentage bars",
|
||||||
"arg": {
|
"arg": {
|
||||||
"type": "str",
|
"type": "str",
|
||||||
"default": "■"
|
"default": "\u25a0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"long": "bar-char-total",
|
"long": "bar-char-total",
|
||||||
"desc": "Set the character to use in total part",
|
"desc": "Set the character to use in total part of percentage bars",
|
||||||
"arg": {
|
"arg": {
|
||||||
"type": "str",
|
"type": "str",
|
||||||
"default": "-"
|
"default": "-"
|
||||||
@@ -561,7 +561,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"long": "bar-width",
|
"long": "bar-width",
|
||||||
"desc": "Set the width of the bar, in number of characters",
|
"desc": "Set the width of percentage bars, in number of characters",
|
||||||
"arg": {
|
"arg": {
|
||||||
"type": "num",
|
"type": "num",
|
||||||
"default": 10
|
"default": 10
|
||||||
@@ -569,7 +569,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"long": "bar-border",
|
"long": "bar-border",
|
||||||
"desc": "Whether to show a border around the bar",
|
"desc": "Whether to show a border around percentage bars",
|
||||||
"arg": {
|
"arg": {
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
@@ -1290,12 +1290,12 @@
|
|||||||
"arg": {
|
"arg": {
|
||||||
"type": "enum",
|
"type": "enum",
|
||||||
"enum": {
|
"enum": {
|
||||||
"block": "███",
|
"block": "\u2588\u2588\u2588",
|
||||||
"circle": "●",
|
"circle": "\u25cf",
|
||||||
"diamond": "◆",
|
"diamond": "\u25c6",
|
||||||
"triangle": "▲",
|
"triangle": "\u25b2",
|
||||||
"square": "■",
|
"square": "\u25a0",
|
||||||
"star": "★"
|
"star": "\u2605"
|
||||||
},
|
},
|
||||||
"default": "block"
|
"default": "block"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,33 +13,43 @@ const char* ffDetectMemory(FFMemoryResult* ram)
|
|||||||
buf[nRead] = '\0';
|
buf[nRead] = '\0';
|
||||||
|
|
||||||
uint64_t memTotal = 0,
|
uint64_t memTotal = 0,
|
||||||
|
memAvailable = 0,
|
||||||
shmem = 0,
|
shmem = 0,
|
||||||
memFree = 0,
|
memFree = 0,
|
||||||
buffers = 0,
|
buffers = 0,
|
||||||
cached = 0,
|
cached = 0,
|
||||||
sReclaimable = 0;
|
sReclaimable = 0;
|
||||||
|
|
||||||
char *token = NULL;
|
char *token = NULL;
|
||||||
if((token = strstr(buf, "MemTotal:")) != NULL)
|
if((token = strstr(buf, "MemTotal:")) != NULL)
|
||||||
memTotal = strtoul(token + strlen("MemTotal:"), NULL, 10);
|
memTotal = strtoul(token + strlen("MemTotal:"), NULL, 10);
|
||||||
|
else
|
||||||
|
return "MemTotal not found in /proc/meminfo";
|
||||||
|
|
||||||
if((token = strstr(buf, "MemFree:")) != NULL)
|
if((token = strstr(buf, "MemAvailable:")) != NULL)
|
||||||
memFree = strtoul(token + strlen("MemFree:"), NULL, 10);
|
memAvailable = strtoul(token + strlen("MemAvailable:"), NULL, 10);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if((token = strstr(buf, "MemFree:")) != NULL)
|
||||||
|
memFree = strtoul(token + strlen("MemFree:"), NULL, 10);
|
||||||
|
|
||||||
if((token = strstr(buf, "Buffers:")) != NULL)
|
if((token = strstr(buf, "Buffers:")) != NULL)
|
||||||
buffers = strtoul(token + strlen("Buffers:"), NULL, 10);
|
buffers = strtoul(token + strlen("Buffers:"), NULL, 10);
|
||||||
|
|
||||||
if((token = strstr(buf, "Cached:")) != NULL)
|
if((token = strstr(buf, "Cached:")) != NULL)
|
||||||
cached = strtoul(token + strlen("Cached:"), NULL, 10);
|
cached = strtoul(token + strlen("Cached:"), NULL, 10);
|
||||||
|
|
||||||
if((token = strstr(buf, "Shmem:")) != NULL)
|
if((token = strstr(buf, "Shmem:")) != NULL)
|
||||||
shmem = strtoul(token + strlen("Shmem:"), NULL, 10);
|
shmem = strtoul(token + strlen("Shmem:"), NULL, 10);
|
||||||
|
|
||||||
if((token = strstr(buf, "SReclaimable:")) != NULL)
|
if((token = strstr(buf, "SReclaimable:")) != NULL)
|
||||||
sReclaimable = strtoul(token + strlen("SReclaimable:"), NULL, 10);
|
sReclaimable = strtoul(token + strlen("SReclaimable:"), NULL, 10);
|
||||||
|
|
||||||
|
memAvailable = memFree + buffers + cached + sReclaimable - shmem;
|
||||||
|
}
|
||||||
|
|
||||||
ram->bytesTotal = memTotal * 1024lu;
|
ram->bytesTotal = memTotal * 1024lu;
|
||||||
ram->bytesUsed = (memTotal + shmem - memFree - buffers - cached - sReclaimable) * 1024lu;
|
ram->bytesUsed = (memTotal - memAvailable) * 1024lu;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,26 +42,19 @@ static uint32_t getNumElements(FFstrbuf* baseDir, const char* dirname, unsigned
|
|||||||
|
|
||||||
static uint32_t getNumStringsImpl(const char* filename, const char* needle)
|
static uint32_t getNumStringsImpl(const char* filename, const char* needle)
|
||||||
{
|
{
|
||||||
FILE* file = fopen(filename, "r");
|
FF_STRBUF_AUTO_DESTROY content = ffStrbufCreate();
|
||||||
if(file == NULL)
|
if (!ffReadFileBuffer(filename, &content))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
uint32_t count = 0;
|
uint32_t count = 0;
|
||||||
|
char *iter = content.chars;
|
||||||
char* line = NULL;
|
size_t needleLength = strlen(needle);
|
||||||
size_t len = 0;
|
while ((iter = memmem(iter, content.length - (size_t)(iter - content.chars), needle, needleLength)) != NULL)
|
||||||
|
|
||||||
while(getline(&line, &len, file) != EOF)
|
|
||||||
{
|
{
|
||||||
if(strstr(line, needle) != NULL)
|
++count;
|
||||||
++count;
|
iter += needleLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(line != NULL)
|
|
||||||
free(line);
|
|
||||||
|
|
||||||
fclose(file);
|
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -4279,10 +4279,10 @@ static const FFlogo X[] = {
|
|||||||
FF_COLOR_FG_CYAN,
|
FF_COLOR_FG_CYAN,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
//XrayOS
|
//Xray_OS
|
||||||
{
|
{
|
||||||
.names = {"XrayOS"},
|
.names = {"Xray_OS"},
|
||||||
.lines = FASTFETCH_DATATEXT_LOGO_XRAYOS,
|
.lines = FASTFETCH_DATATEXT_LOGO_XRAY_OS,
|
||||||
.colors = {
|
.colors = {
|
||||||
FF_COLOR_FG_256 "15",
|
FF_COLOR_FG_256 "15",
|
||||||
FF_COLOR_FG_256 "14",
|
FF_COLOR_FG_256 "14",
|
||||||
|
|||||||
Reference in New Issue
Block a user