This repository was archived by the owner on Sep 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +28
-16
lines changed
Expand file tree Collapse file tree 4 files changed +28
-16
lines changed Original file line number Diff line number Diff line change 11/Makefile
22src /config.h
33src /procfetch
4+ ascii /Makefile
45* .o
56dist /
67docs /
Original file line number Diff line number Diff line change @@ -238,6 +238,14 @@ string getDE()
238238 return getenv (" XDG_CURRENT_DESKTOP" );
239239}
240240
241+ /* *
242+ * @returns checks for Resolution file
243+ */
244+ bool resCheck ()
245+ {
246+ return Path::of (" /sys/class/graphics/fb0/modes" s).isRegularFile ();
247+ }
248+
241249/* *
242250 * @returns gets current Screen Resolution
243251 * @param path
@@ -298,6 +306,14 @@ string getCPU(string path)
298306 return cpu;
299307}
300308
309+ /* *
310+ * @returns checks for CPUtemp file
311+ */
312+ bool CpuTempCheck ()
313+ {
314+ return Path::of (" /sys/class/thermal/thermal_zone1" s).isDirectory ();
315+ }
316+
301317/* *
302318 * @returns gets CPU temp
303319 * @param path
@@ -311,18 +327,6 @@ int getCPUtemp(string path)
311327 return stoi (temp);
312328}
313329
314- /* *
315- * @returns checks for CPUtemp file
316- */
317- bool CpuTempCheck ()
318- {
319- if (Path::of (" /sys/class/thermal/thermal_zone1" s).isDirectory ())
320- {
321- return true ;
322- }
323- return false ;
324- }
325-
326330/* *
327331 * @returns gets vendor of Internal and External GPU
328332 */
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ string getSHELL(string path);
4141
4242string getDE ();
4343
44+ bool resCheck ();
45+
4446string getRES (string path);
4547
4648string getTheme ();
@@ -49,10 +51,10 @@ string getIcons();
4951
5052string getCPU (string path);
5153
52- int getCPUtemp (string path);
53-
5454bool CpuTempCheck ();
5555
56+ int getCPUtemp (string path);
57+
5658vector<string> getGPU ();
5759
5860string getPackages ();
Original file line number Diff line number Diff line change @@ -96,8 +96,13 @@ void DisplayInfo(bool show_battery)
9696 cout << title.text (" RAM : " ) << getRAM (" /proc/meminfo" ) << endl;
9797 cout << title.text (" shell : " ) << getSHELL (" /etc/passwd" ) << endl;
9898 cout << title.text (" DE : " ) << getDE () << endl;
99- cout << title.text (" Resolution : " )
100- << getRES (" /sys/class/graphics/fb0/modes" ) << endl;
99+
100+ if (resCheck ())
101+ {
102+ cout << title.text (" Resolution : " )
103+ << getRES (" /sys/class/graphics/fb0/modes" ) << endl;
104+ }
105+
101106 cout << title.text (" Theme : " ) << getTheme () << endl;
102107 cout << title.text (" Icons : " ) << getIcons () << endl;
103108 cout << title.text (" CPU : " ) << getCPU (" /proc/cpuinfo" ) << endl;
You can’t perform that action at this time.
0 commit comments