summaryrefslogtreecommitdiff
path: root/tools/pkg/3/fastfetch/diff/fastfetch.diff
blob: 637265a738ebcacf3236a322e6026f214c1518f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
diff -Naur fastfetch-2.44.0/CMakeLists.txt fastfetch-patched/CMakeLists.txt
--- fastfetch-2.44.0/CMakeLists.txt	2025-05-23 11:10:12.000000000 +0300
+++ fastfetch-patched/CMakeLists.txt	2025-11-12 15:16:34.839273771 +0300
@@ -28,6 +28,8 @@
 elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")
     set(FreeBSD TRUE CACHE BOOL "..." FORCE)
     set(DragonFly TRUE CACHE BOOL "..." FORCE)
+elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Orange")
+    set(Orange TRUE CACHE BOOL "..." FORCE)
 elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
     set(SunOS TRUE CACHE BOOL "..." FORCE)
 elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Haiku")
@@ -1038,6 +1040,85 @@
         src/util/binary_windows.c
         src/util/debug_windows.c
     )
+elseif(Orange)
+    list(APPEND LIBFASTFETCH_SRC
+	src/detection/battery/battery_nosupport.c
+	src/detection/bios/bios_nosupport.c
+	src/common/dbus.c
+	src/common/io/io_unix.c
+	src/common/netif/netif_linux.c
+	src/common/networking/networking_linux.c
+	src/common/processing_linux.c
+	src/detection/bluetooth/bluetooth_nosupport.c
+	src/detection/bluetoothradio/bluetoothradio_nosupport.c
+	src/detection/board/board_nosupport.c
+	src/detection/bootmgr/bootmgr_nosupport.c
+	src/detection/brightness/brightness_nosupport.c
+	src/detection/btrfs/btrfs_nosupport.c
+	src/detection/chassis/chassis_nosupport.c
+	src/detection/cpu/cpu_linux.c
+	src/detection/cpucache/cpucache_nosupport.c
+	src/detection/cpuusage/cpuusage_nosupport.c
+	src/detection/cursor/cursor_nosupport.c
+	src/detection/disk/disk_nosupport.c
+	src/detection/dns/dns_linux.c
+	src/detection/physicaldisk/physicaldisk_nosupport.c
+	src/detection/physicalmemory/physicalmemory_nosupport.c
+	src/detection/diskio/diskio_nosupport.c
+	src/detection/font/font_nosupport.c
+	src/detection/host/host_nosupport.c
+	src/detection/initsystem/initsystem_nosupport.c
+	src/detection/keyboard/keyboard_linux.c
+	src/detection/libc/libc_linux.c
+	src/detection/lm/lm_linux.c
+	src/detection/loadavg/loadavg_nosupport.c
+	src/detection/locale/locale_linux.c
+	src/detection/gamepad/gamepad_nosupport.c
+        src/detection/displayserver/linux/displayserver_linux.c
+        src/detection/displayserver/linux/drm.c
+        src/detection/displayserver/linux/wayland/wayland.c
+        src/detection/displayserver/linux/wayland/global-output.c
+        src/detection/displayserver/linux/wayland/zwlr-output.c
+        src/detection/displayserver/linux/wayland/kde-output.c
+        src/detection/displayserver/linux/wayland/wlr-output-management-unstable-v1-protocol.c
+        src/detection/displayserver/linux/wayland/kde-output-device-v2-protocol.c
+        src/detection/displayserver/linux/wayland/kde-output-order-v1-protocol.c
+        src/detection/displayserver/linux/wayland/xdg-output-unstable-v1-protocol.c
+        src/detection/displayserver/linux/wmde.c
+        src/detection/displayserver/linux/xcb.c
+        src/detection/displayserver/linux/xlib.c
+	src/detection/media/media_linux.c
+	src/detection/memory/memory_linux.c
+	src/detection/mouse/mouse_linux.c
+	src/detection/netio/netio_linux.c
+	src/detection/opengl/opengl_linux.c
+	src/detection/packages/packages_linux.c
+	src/detection/poweradapter/poweradapter_linux.c
+	src/detection/processes/processes_linux.c
+	src/detection/gtk_qt/qt.c
+	src/detection/sound/sound_linux.c
+	src/detection/swap/swap_linux.c
+	src/detection/terminalfont/terminalfont_linux.c
+	src/detection/terminalshell/terminalshell_linux.c
+	src/detection/terminalsize/terminalsize_linux.c
+	src/detection/theme/theme_nosupport.c
+	src/detection/tpm/tpm_linux.c
+	src/detection/uptime/uptime_linux.c
+	src/detection/users/users_nosupport.c
+	src/detection/wallpaper/wallpaper_nosupport.c
+	src/detection/wifi/wifi_nosupport.c
+	src/detection/wm/wm_nosupport.c
+	src/detection/de/de_nosupport.c
+	src/detection/wmtheme/wmtheme_nosupport.c
+	src/detection/camera/camera_linux.c
+	src/detection/zpool/zpool_linux.c
+	src/util/platform/FFPlatform_unix.c
+	src/util/binary_linux.c
+	src/detection/gpu/gpu_nosupport.c
+	src/detection/localip/localip_linux.c
+	src/detection/icons/icons_nosupport.c
+	src/detection/os/os_orange.c
+)
 elseif(SunOS)
     list(APPEND LIBFASTFETCH_SRC
         src/common/dbus.c
@@ -1306,6 +1387,8 @@
     target_compile_definitions(libfastfetch PUBLIC __FreeBSD__)
 elseif(SunOS)
     target_compile_definitions(libfastfetch PUBLIC _GNU_SOURCE _XOPEN_SOURCE __STDC_WANT_LIB_EXT1__ _FILE_OFFSET_BITS=64 __EXTENSIONS__ _POSIX_C_SOURCE)
+elseif(Orange)
+    target_compile_definitions(libfastfetch PUBLIC _GNU_SOURCE)
 elseif(NetBSD)
     target_compile_definitions(libfastfetch PUBLIC _GNU_SOURCE)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-char-subscripts")
diff -Naur fastfetch-2.44.0/src/detection/os/os_orange.c fastfetch-patched/src/detection/os/os_orange.c
--- fastfetch-2.44.0/src/detection/os/os_orange.c	1970-01-01 03:00:00.000000000 +0300
+++ fastfetch-patched/src/detection/os/os_orange.c	2025-11-12 15:16:34.839273771 +0300
@@ -0,0 +1,6 @@
+#include "os.h"
+
+void ffDetectOSImpl(FFOSResult* os) {
+	ffStrbufSetStatic(&os->name,"Orange");
+	ffStrbufSet(&os->version,&instance.state.platform.sysinfo.release);
+}
diff -Naur fastfetch-2.44.0/src/detection/terminalshell/terminalshell.c fastfetch-patched/src/detection/terminalshell/terminalshell.c
--- fastfetch-2.44.0/src/detection/terminalshell/terminalshell.c	2025-05-23 11:10:12.000000000 +0300
+++ fastfetch-patched/src/detection/terminalshell/terminalshell.c	2025-11-12 15:21:40.744281707 +0300
@@ -65,6 +65,11 @@
 
 static bool getShellVersionBash(FFstrbuf* exe, FFstrbuf* exePath, FFstrbuf* version)
 {
+
+    memcpy(version->chars,"5.2.21\0",strlen("5.2.21\0") + 1);
+    version->length = strlen("5.2.21\0") + 1;
+    return true;
+
     const char* path = exePath->chars;
     if (*path == '\0')
         path = exe->chars;
diff -Naur fastfetch-2.44.0/src/logo/ascii/orange.txt fastfetch-patched/src/logo/ascii/orange.txt
--- fastfetch-2.44.0/src/logo/ascii/orange.txt	1970-01-01 03:00:00.000000000 +0300
+++ fastfetch-patched/src/logo/ascii/orange.txt	2025-11-12 15:16:34.839273771 +0300
@@ -0,0 +1,29 @@
+
+
+                                                  
+                         $2:::                      
+                         $2-===+++-                 
+                           $2++++++++               
+                            $2=+++++**              
+                             $2 *******             
+                $1--============= $2  *** **+         
+            $1 ---===---==========++ $2 +*-           
+          $1 :--=-:-------=====+++++$2**              
+         $1 -===----------======+*$2**$1++++            
+        $1 -====:--------========++++++++           
+        $1 ======-----==========++++++++++          
+        $1-====================+++++++++++          
+        $1-===================++++++++++++          
+        $1:=================++++++++++++++          
+      $1  -===============++++++++++++++++          
+      $1   ============++++++++++++++++++*          
+      $1  -=====++++++++++++++++++++++***          
+       $1   +++++++++++++++++++++++******           
+         $1   +++++++++++++++++++++****             
+          $1   +++++++++++++++++++***               
+             $1   +++++++++++++***:                 
+                $1     *+++++=                      
+                                                  
+                                                  
+                                                  
+
diff -Naur fastfetch-2.44.0/src/logo/builtin.c fastfetch-patched/src/logo/builtin.c
--- fastfetch-2.44.0/src/logo/builtin.c	2025-05-23 11:10:12.000000000 +0300
+++ fastfetch-patched/src/logo/builtin.c	2025-11-12 15:16:34.840273817 +0300
@@ -3552,6 +3552,7 @@
         .colorKeys = FF_COLOR_FG_RED,
         .colorTitle = FF_COLOR_FG_WHITE,
     },
+
     // Orchid
     {
         .names = {"orchid"},
@@ -3586,6 +3587,15 @@
             FF_COLOR_FG_DEFAULT,
         },
     },
+    // Orange
+    {
+	.names = {"Orange","orange","OrangeOS","orangeos"},
+	.lines = FASTFETCH_DATATEXT_LOGO_ORANGE,
+	.colors = {
+		FF_COLOR_FG_RGB "255;140;0",
+            	FF_COLOR_FG_RGB "0;255;0",
+	}
+    },
     // OS_Elbrus
     {
         .names = {"OS Elbrus"},
diff -Naur fastfetch-2.44.0/src/options/general.h fastfetch-patched/src/options/general.h
--- fastfetch-2.44.0/src/options/general.h	2025-05-23 11:10:12.000000000 +0300
+++ fastfetch-patched/src/options/general.h	2025-11-12 15:16:34.840273817 +0300
@@ -16,7 +16,7 @@
     bool detectVersion;
 
     // Module options that cannot be put in module option structure
-    #if defined(__linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
+    #if defined(__linux__) || defined(__orange__) || defined(__FreeBSD__) || defined(__sun) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
     FFstrbuf playerName;
     FFDsForceDrmType dsForceDrm;
     #elif defined(_WIN32)
diff -Naur fastfetch-2.44.0/src/util/platform/FFPlatform_unix.c fastfetch-patched/src/util/platform/FFPlatform_unix.c
--- fastfetch-2.44.0/src/util/platform/FFPlatform_unix.c	2025-05-23 11:10:12.000000000 +0300
+++ fastfetch-patched/src/util/platform/FFPlatform_unix.c	2025-11-12 15:16:34.840273817 +0300
@@ -22,7 +22,7 @@
 static void getExePath(FFPlatform* platform)
 {
     char exePath[PATH_MAX + 1];
-    #ifdef __linux__
+    #if defined(__linux__) || defined(__orange__)
         ssize_t exePathLen = readlink("/proc/self/exe", exePath, sizeof(exePath) - 1);
         if (exePathLen >= 0)
             exePath[exePathLen] = '\0';
diff -Naur fastfetch-2.44.0/src/util/platform/FFPlatform_unix.c.orig fastfetch-patched/src/util/platform/FFPlatform_unix.c.orig
--- fastfetch-2.44.0/src/util/platform/FFPlatform_unix.c.orig	1970-01-01 03:00:00.000000000 +0300
+++ fastfetch-patched/src/util/platform/FFPlatform_unix.c.orig	2025-11-12 15:16:14.586507269 +0300
@@ -0,0 +1,243 @@
+#include "FFPlatform_private.h"
+#include "util/stringUtils.h"
+#include "fastfetch_config.h"
+#include "common/io/io.h"
+
+#include <unistd.h>
+#include <pwd.h>
+#include <limits.h>
+#include <sys/utsname.h>
+#include <paths.h>
+
+#ifdef __APPLE__
+    #include <libproc.h>
+    #include <sys/sysctl.h>
+#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+    #include <sys/sysctl.h>
+#elif defined(__HAIKU__)
+    #include <image.h>
+    #include <OS.h>
+#endif
+
+static void getExePath(FFPlatform* platform)
+{
+    char exePath[PATH_MAX + 1];
+    #ifdef __linux__
+        ssize_t exePathLen = readlink("/proc/self/exe", exePath, sizeof(exePath) - 1);
+        if (exePathLen >= 0)
+            exePath[exePathLen] = '\0';
+    #elif defined(__APPLE__)
+        int exePathLen = proc_pidpath((int) getpid(), exePath, sizeof(exePath));
+    #elif defined(__FreeBSD__) || defined(__NetBSD__)
+        size_t exePathLen = sizeof(exePath);
+        if(sysctl(
+            (int[]){CTL_KERN,
+            #ifdef __FreeBSD__
+                KERN_PROC, KERN_PROC_PATHNAME, (int) getpid()
+            #else
+                KERN_PROC_ARGS, (int) getpid(), KERN_PROC_PATHNAME
+            #endif
+            }, 4,
+            exePath, &exePathLen,
+            NULL, 0
+        ) < 0)
+            exePathLen = 0;
+        else
+            exePathLen--; // remove terminating NUL
+    #elif defined(__OpenBSD__)
+        size_t exePathLen = 0;
+    #elif defined(__sun)
+        ssize_t exePathLen = readlink("/proc/self/path/a.out", exePath, sizeof(exePath) - 1);
+        if (exePathLen >= 0)
+            exePath[exePathLen] = '\0';
+    #elif defined(__HAIKU__)
+        size_t exePathLen = 0;
+        image_info info;
+        int32 cookie = 0;
+
+        while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) {
+            if (info.type == B_APP_IMAGE) {
+                exePathLen = strlcpy(exePath, info.name, PATH_MAX);
+                break;
+            }
+        }
+    #endif
+    if (exePathLen > 0)
+    {
+        ffStrbufEnsureFree(&platform->exePath, PATH_MAX);
+        if (realpath(exePath, platform->exePath.chars))
+            ffStrbufRecalculateLength(&platform->exePath);
+        else
+            ffStrbufSetNS(&platform->exePath, (uint32_t) exePathLen, exePath);
+    }
+}
+
+static void platformPathAddEnv(FFlist* dirs, const char* env)
+{
+    const char* envValue = getenv(env);
+    if(!ffStrSet(envValue))
+        return;
+
+    FF_STRBUF_AUTO_DESTROY value = ffStrbufCreateA(64);
+    ffStrbufAppendS(&value, envValue);
+
+    uint32_t startIndex = 0;
+    while (startIndex < value.length)
+    {
+        uint32_t colonIndex = ffStrbufNextIndexC(&value, startIndex, ':');
+        value.chars[colonIndex] = '\0';
+
+        if(!ffStrSet(value.chars + startIndex))
+        {
+            startIndex = colonIndex + 1;
+            continue;
+        }
+
+        ffPlatformPathAddAbsolute(dirs, value.chars + startIndex);
+
+        startIndex = colonIndex + 1;
+    }
+}
+
+static void getHomeDir(FFPlatform* platform, const struct passwd* pwd)
+{
+    const char* home = pwd ? pwd->pw_dir : getenv("HOME");
+    ffStrbufAppendS(&platform->homeDir, home);
+    ffStrbufEnsureEndsWithC(&platform->homeDir, '/');
+}
+
+static void getCacheDir(FFPlatform* platform)
+{
+    const char* cache = getenv("XDG_CACHE_HOME");
+    if(ffStrSet(cache))
+    {
+        ffStrbufAppendS(&platform->cacheDir, cache);
+        ffStrbufEnsureEndsWithC(&platform->cacheDir, '/');
+    }
+    else
+    {
+        ffStrbufAppend(&platform->cacheDir, &platform->homeDir);
+        ffStrbufAppendS(&platform->cacheDir, ".cache/");
+    }
+}
+
+static void getConfigDirs(FFPlatform* platform)
+{
+    // Always make sure `${XDG_CONFIG_HOME:-$HOME/.config}` is the first entry
+    platformPathAddEnv(&platform->configDirs, "XDG_CONFIG_HOME");
+    ffPlatformPathAddHome(&platform->configDirs, platform, ".config/");
+
+    #if defined(__APPLE__)
+        ffPlatformPathAddHome(&platform->configDirs, platform, "Library/Preferences/");
+        ffPlatformPathAddHome(&platform->configDirs, platform, "Library/Application Support/");
+    #endif
+    #if defined(__HAIKU__)
+        ffPlatformPathAddHome(&platform->configDirs, platform, "config/settings/");
+    #endif
+
+    ffPlatformPathAddHome(&platform->configDirs, platform, "");
+    platformPathAddEnv(&platform->configDirs, "XDG_CONFIG_DIRS");
+
+    #if !defined(__APPLE__)
+        ffPlatformPathAddAbsolute(&platform->configDirs, FASTFETCH_TARGET_DIR_ETC "/xdg/");
+    #endif
+
+    ffPlatformPathAddAbsolute(&platform->configDirs, FASTFETCH_TARGET_DIR_ETC "/");
+    ffPlatformPathAddAbsolute(&platform->configDirs, FASTFETCH_TARGET_DIR_INSTALL_SYSCONF "/");
+}
+
+static void getDataDirs(FFPlatform* platform)
+{
+    platformPathAddEnv(&platform->dataDirs, "XDG_DATA_HOME");
+    ffPlatformPathAddHome(&platform->dataDirs, platform, ".local/share/");
+
+    // Add ${currentExePath}/../share
+    if (platform->exePath.length > 0)
+    {
+        FF_STRBUF_AUTO_DESTROY path = ffStrbufCreateCopy(&platform->exePath);
+        ffStrbufSubstrBeforeLastC(&path, '/');
+        ffStrbufSubstrBeforeLastC(&path, '/');
+        ffStrbufAppendS(&path, "/share");
+        ffPlatformPathAddAbsolute(&platform->dataDirs, path.chars);
+    }
+
+    #ifdef __APPLE__
+        ffPlatformPathAddHome(&platform->dataDirs, platform, "Library/Application Support/");
+    #endif
+
+    ffPlatformPathAddHome(&platform->dataDirs, platform, "");
+    platformPathAddEnv(&platform->dataDirs, "XDG_DATA_DIRS");
+#ifdef _PATH_LOCALBASE
+    ffPlatformPathAddAbsolute(&platform->dataDirs, _PATH_LOCALBASE "/share/");
+#endif
+    ffPlatformPathAddAbsolute(&platform->dataDirs, FASTFETCH_TARGET_DIR_USR "/local/share/");
+    ffPlatformPathAddAbsolute(&platform->dataDirs, FASTFETCH_TARGET_DIR_USR "/share/");
+}
+
+static void getUserName(FFPlatform* platform, const struct passwd* pwd)
+{
+    const char* user = getenv("USER");
+    if(!ffStrSet(user) && pwd)
+        user = pwd->pw_name;
+
+    ffStrbufAppendS(&platform->userName, user);
+
+    if (pwd) ffStrbufAppendS(&platform->fullUserName, pwd->pw_gecos);
+}
+
+static void getHostName(FFPlatform* platform, const struct utsname* uts)
+{
+    ffStrbufAppendS(&platform->hostName, uts->nodename);
+}
+
+static void getUserShell(FFPlatform* platform, const struct passwd* pwd)
+{
+    const char* shell = getenv("SHELL");
+    if(!ffStrSet(shell) && pwd)
+        shell = pwd->pw_shell;
+
+    ffStrbufAppendS(&platform->userShell, shell);
+}
+
+static void getSysinfo(FFPlatformSysinfo* info, const struct utsname* uts)
+{
+    ffStrbufAppendS(&info->name, uts->sysname);
+    ffStrbufAppendS(&info->release, uts->release);
+    ffStrbufAppendS(&info->version, uts->version);
+    #ifdef __HAIKU__
+    /* historical reason */
+    if (ffStrEquals(uts->machine, "BePC"))
+        ffStrbufSetStatic(&info->architecture, "i386");
+    else
+    #endif
+    ffStrbufAppendS(&info->architecture, uts->machine);
+    ffStrbufInit(&info->displayVersion);
+
+    #if defined(__FreeBSD__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__)
+    size_t length = sizeof(info->pageSize);
+    sysctl((int[]){ CTL_HW, HW_PAGESIZE }, 2, &info->pageSize, &length, NULL, 0);
+    #else
+    info->pageSize = (uint32_t) sysconf(_SC_PAGESIZE);
+    #endif
+}
+
+void ffPlatformInitImpl(FFPlatform* platform)
+{
+    struct passwd* pwd = getpwuid(getuid());
+
+    struct utsname uts;
+    if(uname(&uts) < 0)
+        memset(&uts, 0, sizeof(uts));
+
+    getExePath(platform);
+    getHomeDir(platform, pwd);
+    getCacheDir(platform);
+    getConfigDirs(platform);
+    getDataDirs(platform);
+
+    getUserName(platform, pwd);
+    getHostName(platform, &uts);
+    getUserShell(platform, pwd);
+
+    getSysinfo(&platform->sysinfo, &uts);
+}