Comments (42)
Hi @0xCUB3
Bootloader issue with Clover comes from HCBootloader.swift
Code line 20 : BootloaderInfo = run("cat ~/.ath/scr.txt | grep \"Clover\" | awk '{print $4,\"r\" $6,\"(\" $9,\" \"}' | tr -d '\n'")
- "scr.txt" doesn't contain Clover needed infos but "hw.txt" does it.
- No need to use "cat" command to open/read the file "grep" do it itself. So it could be
Code line 20 : BootloaderInfo = run("grep \"Clover\" ~/.ath/hw.txt | awk '{print $4,\"r\" $6,\"(\" $9,\" \"}' | tr -d '\n'")
and the result is (correct Clover Bootloader info(s))
Regards
from about-this-hack.
In HardwareCollector.swift you have to replace
"diskutil info "(name)" | grep ..."
with
"grep ... ~/.ath/sysvolname.txt"
HardwareCollector.swift
...
static func getStorageType() -> Bool {
let name = "(HCStartupDisk.getStartupDisk())"
print("Startup Disk Name " + name)
// let storageType = run("diskutil info "(name)" | grep 'Solid State'")
let storageType = run("grep 'Solid State' ~/.ath/sysvolname.txt")
return storageType.contains("Yes")
}
static func getStorageData() -> [String] {
let name = "\(HCStartupDisk.getStartupDisk())"
// let size = run("diskutil info "(name)" | grep 'Disk Size' | sed 's/.:[[:space:]]//' | cut -f1 -d'(' | tr -d '\n'")
let size = run("grep 'Disk Size' ~/.ath/sysvolname.txt | sed 's/.:[[:space:]]//' | cut -f1 -d'(' | tr -d '\n'")
// let available = run("diskutil info "(name)" | Grep 'Container Free Space' | sed 's/.:[[:space:]]//' | cut -f1 -d'(' | tr -d '\n'")
let available = run("grep 'Container Free Space' ~/.ath/sysvolname.txt | sed 's/.:[[:space:]]//' | cut -f1 -d'(' | tr -d '\n'")
let sizeTrimmed = run("echo "(size)" | cut -f1 -d" "").dropLast(1)
let availableTrimmed = run("echo "(available)" | cut -f1 -d" "").dropLast(1)
print("Size: (sizeTrimmed)")
print("Available: (availableTrimmed)")
let percent = (Double(availableTrimmed)!) / Double(sizeTrimmed)!
print("%: (1 - percent)")
return ["""
(name)
(size)((available)Available)
""", String(1 - percent)]
}
...
And the result is at the first launch or not with one disk "Macintosh HD" or more than one called "Macintosh HD"
The data file and his content "/.ath/sysvolname.txt" are created by the execution of the command "diskutil info /" in ViewController.swift./.ath/sysvolname.txt".
The aim of the tab Storage is to show detailed info from StartupDisk (ie. /) those detailed info must come from "
PS: i don't know why words or sentences are crossed out and "~" is lost (github editor Pbm ?!, it hates the "~" car and I have to protect it with a backslash ?.)
And please every time the stack of commands " cat ~/.ath/xxxxxxxx.txt | grep <word(s)> | cut or sed or tr" is used replace it with "grep <word(s)> ~/.ath/xxxxxxxx.txt | cut or sed or tr" reducing the commands stack is to optimize.
Regards
from about-this-hack.
Ok, i've done others modif.
- No more text file for oclp datas, directly extracted from "OpenCore-Legacy-Patcher.plist"
- Overview i added info (Metal N) at Graphics and add graphicstoolTip too
- Storage i added bootdisk storage info
Push : I can't sync (password authentication was removed on August 13, 2021.) with SmartGit (23.1 preview 12 #20104)
~/0xCUB3/About-This-Hack matxpa> git -c credential.helper=/Applications/SmartGit.app/Contents/Resources/credentials.sh push --porcelain --progress origin refs/heads/main:refs/heads/main
...
remote: Support for password authentication was removed on August 13, 2021.
Authentication failed for 'https://github.com/matxpa/About-This-Hack.git/'
I've created a new branch (from your main branch) called Storage-Tab-added-Data and i've modified components
be carefull project.pbx is with "Provisioning Profile" = None, no "Team" and "Signing Certficate" = ...Run Locally
Modified components (in new branch "Storage-Tab-added-Data")
About This Hack.xcodeproj
About This Hack/ViewController.swift
About This Hack/Tooltips.swift
About This Hack/HardwareCollector.swift (OLD one replaced by the current one)
About This Hack/HardwareCollectors/HCGPU.swift
About This Hack/HardwareCollectors/HCBootloader.swift
About This Hack/HardwareCollectors/HCStartupDisk.swift
Regards
from about-this-hack.
I think I have a satisfactory amount of stuff done here. I am closing this issue and am ready for stable release :)
from about-this-hack.
Can you send me the output of
sysctl -n machdep.cpu.brand_string
in your Terminal?
from about-this-hack.
Hi
A second launch and a better result (?), but not for bootloader, and with a third launch no right bootloader value
And the result of sysctl -n machdep.cpu.brand_string is right
Intel(R) Core(TM) i5-3340M CPU @ 2.70GHz
Regards
from about-this-hack.
Hmm this is interesting. It's possible that the values aren't being stored quickly enough in the text file. I will try to create a fix for the next minor release.
from about-this-hack.
Hi
edit : to hide S.N on two screenshots.
Regards
from about-this-hack.
Hmm this is interesting. It's possible that the values aren't being stored quickly enough in the text file. I will try to create a fix for the next minor release.
Hi
you're wright it happens only when "~/.ath" doesn't exist when you launch "About this Hack"
and with this test (sleep(1)), it's ok
ViewController.swift
...
createFileIfNeeded(atPath: scrXmlFilePath, withCommand: "system_profiler SPDisplaysDataType -xml > "(scrXmlFilePath)"")
print("Files created...")
sleep(1)
// Call Functions to init Overview
HCVersion.getVersion()
...
but sleep 1 (second) is too long
so it will be better to replace sleep(1) with Thread.sleep(forTimeInterval: 0.500) // half-second
...
createFileIfNeeded(atPath: scrXmlFilePath, withCommand: "system_profiler SPDisplaysDataType -xml > "(scrXmlFilePath)"")
print("Files created...")
Thread.sleep(forTimeInterval: 0.500) // half-second (0.250 a quarter of a second is not enough)
// Call Functions to init Overview
HCVersion.getVersion()
...
Regards
from about-this-hack.
Hey @matxpa
Could you try the latest commit? I think I fixed this bug along with some other issues.
from about-this-hack.
Hi @0xCUB3
I've just got the latest commits build "About this Hack"
Issue #41 missing compiled version resolved
But #42 Strange 0.9.1 Release behavior is not resolved
First launch (without /.ath dir and data files needed)/.ath dir and data files needed already present)
The timing doesn't work
Second launch (
But the lack of Clover BootLoader is not correct
I don' know why lines or words are crossed
Regards
from about-this-hack.
This is very strange. I don't have Clover on any mac, so it is difficult for me to debug. Could you take a look into this issue if you have some time?
from about-this-hack.
Bootloader issue with Clover comes from HCBootloader.swift
Code line 20 is not correct
Code line 20 : BootloaderInfo = run("cat ~/.ath/scr.txt | grep "Clover" | awk '{print $4,"r" $6,"(" $9," "}' | tr -d '\n'")
the data file "scr.txt" doesn't contain Clover needed infos but data file "hw.txt" does it and no need to use "cat" command to open/read the file "grep" do it itself.
So it could be
Code line 20 : BootloaderInfo = run("grep "Clover" ~/.ath/hw.txt | awk '{print $4,"r" $6,"(" $9," "}' | tr -d '\n'")
Be careful don't copy that line, it's not WYSIWYG (Preview is not what it was Written), but modify it directly in the component. The right code is below on the screenshot
And to resolve the lack of detailed info at the first launch of the Appli (ie. without ~/.ath and needed data files)
In ViewController.swift I moved line code Thread.sleep(forTimeInterval: 0.500) from 63rd position to 59th.
And the result is OK
I applied those two corrections in
- HCBootloader.swift to resolve the lack of Clover Bootloader info
- ViewController.swift to resolve the lack of Memory, Display, Graphics detailed info (at a first launch in the absence of ~/.ath dir and data files)
And the result is ...
And we all have to help each others
Regards
from about-this-hack.
@matxpa I implemented your fixes; thank you so much!!!!!
I also have a bunch of other changes. Would you mind testing this latest build to see if everything is resolved? (You may also notice that the other tabs load much more quickly :) )
https://drive.google.com/file/d/1Yq_M2M6xOI0SOXwh1JlagsrzdC6XGxk0/view?usp=sharing
from about-this-hack.
Sorry I'm late.
Fixes seem to be right on Overview
but at the first launch (without ~/.ath and the data files) one time the display is OK another time with partial content. I suspect the line 69 self.start(), in previous release self.start() was in override func viewDidAppear() {
Otherwise at first launch even if OverView info are correctly displayed others tabs detail content isn't shown (Displays and Storage tabs)
With the previous release 0.9.1 he content of those two tabs was correct
But that disk is not my startup disk, but an external ssd (USB3) empty (erased after a bad sonoma beta6 to beta7 update )
Her is my startup disk
Regards
from about-this-hack.
With the app you put on Google Drive the result is (at the first launch)
May be increase the sleep from 0.5 to 1 seconde, or the moment when each tab self.start() is executed.
FIY: The way to get OCLP info is detailed in #24 closed issue
Regards
from about-this-hack.
@matxpa Thanks for this. Could you see if changing to 1 second works for you? I never have this issue.
from about-this-hack.
With your second version put on Google Drive the result is (at the first launch)
Is OK for Overview and Displays tabs, but not for Storage.
My startup disk is a SSD and the picture shown is a HDD.
I tried a build with self.start() moved from line 69 to 82 in func viewDidAppear() and let sleep to 0.5 and at first launch Overview and Displays tabs content is OK.
from about-this-hack.
so everything is fine if you put it there? No issues at all?
from about-this-hack.
I've done the same thing on ViewControllerStorage.swift (start() moved in func viewDidAppear()) the result is partial not completely OK as this (Stratup is a SSD not a HDD)
from about-this-hack.
Interesting. I will have to look into why this is.
from about-this-hack.
Storage tab shows more details but Displays now is empty it's absolutely strange.
I'll suspect Ventura 13.6 (22G115) or Xcode 14.3.1 (14E300c)
from about-this-hack.
Maybe. I wish I had this issue so I could dig deeper into its roots.
from about-this-hack.
@0xCUB3
Hi
About Storage tab : doesn't work if two or more Disk internal and/or external have the same name (ex: "Macintosh HD")
HardwareCollector.swift
...
static func getStorageType() -> Bool {
let name = "(HCStartupDisk.getStartupDisk())"
print("Startup Disk Name " + name)
let storageType = run("diskutil info "(name)" | grep 'Solid State'")
return storageType.contains("Yes")
...
Startup disk is (and always were) "/" and (mine) is called "Macintosh HD"
So if i execute the command diskutil info "Macintosh HD" | grep "Solid State") as in HardwareCollector.swift
where "name" = "Macintosh HD", result is " Solid State: Info not available" so picture will be HDD (default)
'coz there are two SSD called "Macintosh HD", so
-Picture (startupDiskImage.image) has default value (HDD)
-storageValue.stringValue (startup disk name) is empty
-storageAmount.doubleValue is empty
With your first zipped App dowloaded yesterday Storage tab doesn't work with one or two SSD called "Macintosh HD"
With your second zipped App dowloaded yesterday Storage tab works fine with one SSD but doesn't with two SSD called "Macintosh HD".
Another thing:
I launch "About This Hack" (first launch) "/.ath" and data files are created Overview is shown with detailed data i change tab and launch Displays in remove (delete) "/.ath" ("About This Hack" always active) I come back to Overview I lost detailed info.
In ViewController.swift (line +/- 85 if (!HardwareCollector.dataHasBeenSet) {HardwareCollector.getAllData()}
I moved terminating bracket "}" after all variables init, (line +/- 149 after the line code serialToggle.isTransparent = true) and each time you show Overview variables content is not reloaded (it had been done at launch of the appli) so removing "~/.ath" causes No Problem.
And why "~/.ath" is not removed when you leave "About This Hack" between two launches data may have change.
PS: i don't know why words or sentences are crossed out and "~" is lost (github editor Pbm ?!)
Regards
from about-this-hack.
@matxpa the latest commit should have all of the fixes you mentioned. Thank you for all the help. Please test if you can and let me know if there's anything else I should add.
from about-this-hack.
@0xCUB3
Hi
I've seen component HardwareCollector.swift had not been modified
All or part of the "cat" commands remain
In func getStorageData() remain use of diskutil instead of "grep .... ~/.ath/sysvolname.txt"
HardwareCollector.swift, is there a reason why two components called HardwareCollector.swift
One inside the group "About This Hack" (old version from 0.9.0) and not used
The other outside the group "About This Hack", this is the one in use and declared in TARGETS/Build Phases/Compile Sources.
Just cosmetic remarques
In HCMacModelswift the "cartouche" remains (ie. // HCMacModel.swift ...)
mea-culpa In ViewController.swift : line 174 blVersion.toolTip = blVersiontoolTip (there's two spaces before =), it's my fault my own fault.
I'll clone your proj , build it, test it and report to you.
Regards
from about-this-hack.
I didn't add that change because it was causing nil value errors.
from about-this-hack.
So with the component HardwareCollector.swift (outside of group "About This Hack") with remaining "cat" and "diskutil"
My material environment is
a 256 GB SSD with 22.9 GB free with Ventura it's the current macOS, it's the boot disk,
a 120 GB SSD with 46.3 GB free, external SSD with Sonoma
the result is
the first screenshot (upper one) is OK (SSD 256 GB) and component HardwareCollector.swift (outside of group "About This Hack") with "grep .... ~/.ath/sysvolname.txt" and not "diskutil"
the second screenshot (lower one) is KO (119.8 GB) it's not the boot disk and it's with component HardwareCollector.swift (outside of group "About This Hack") with remaining "cat" and "diskutil"
That situation 'cause the two SSD are called "Macintosh HD", and "diskutil info "(name)" | Grep ..." is not "diskutil info /" | grep ..." (/ ie. boot disk)
PS : second "diskutil into ... | Grep ... (Grep need to be replaced with grep)
Two others tabs (I suppose Support remains OK (I joke))
Displays (OK) event with "Unknown Dsiplay" (it's a just Hack not a 120% Mac) Resolution is OK (same as the one on Overview)
Sorry, I didn't see you answer
A "nil value" when you open Displays tab or at ATH launch ?
I don't have this issue
~/.ath/sysvolname.txt contains only boot disk datas, this file can't be empty
~/.ath/scrXml.txt and ~/.ath/scr.txt contain Graphics/Displays datas and can't be empty
I remarked that the creation of file "~/.ath/version.txt" takes 1/2 seconde after all the others files creation
so in UpdateController.swift, create version.txt is not necessary
if you replace the two lines below
_ = run("curl -o ~/.ath/version.txt https://raw.githubusercontent.com/0xCUB3/Website/main/content/ath.txt")
let latestVersion = run("tr -d '[:space:]' < ~/.ath/version.txt")
with
let latestVersion = run("curl -s https://raw.githubusercontent.com/0xCUB3/Website/main/content/ath.txt | tr -d '[:space:]' ") or | tr -d '\n' (same result)
and
replace (second run with latestVersion variable, and in the second run" tr -d ..." is not necessary it was all ready done at creation of file "~/.ath/version.txt" content)
_ = run("curl -L https://github.com/0xCUB3/About-This-Hack/releases/download/" + run("tr -d '[:space:]' < ~/.ath/version.txt") + "/About.This.Hack.zip -o ~/.ath/new_ath.zip")
with
_ = run("curl -L https://github.com/0xCUB3/About-This-Hack/releases/download/" + latestVersion + "/About.This.Hack.zip -o ~/.ath/new_ath.zip")
In a local ATH project (clone yours with your last modifications) I rename the inside group HardwareCollector.swift in OLD-HardwareCollector.swift and move the outside group HardwareCollector.swift into group " About This Hack" and replace HardwareCollector.swift localisation (Path) in TARGETS/Build Phases/Compile Sources
Regards
from about-this-hack.
So without correction of HardwareCollector.swift to replace at minima "diskutil info \"\(name)\" whit "diskutil info /" the content of the tab Storage may be false (if two or more disks have same name)
Others traitements are (seem to be) OK so you could GO
I would like to avoid the creation and use of file ~/.ath/oclp.txt and replace it with NSBundle.mainBundle().infoDictionary?["KeyName"] for each of the three variables.
Regards
from about-this-hack.
Hi
A new Storage tab (ATH build Xcode 15.0 b8)
HardwareCollector.swift component content modified
In my local Repo (a clone of yours)
I removed HardwareCollector.swift component from project TARGETS/Build Phases/Compile Sources section
I removed the inside group HardwareCollector.swift component
I moved the outside group HardwareCollector.swift component into "About This Hack" group
I added HardwareCollector.swift reference project TARGETS/Build Phases/Compile Sources section
Regards
from about-this-hack.
could you push your changes to your repo? They are not currently visible. Thank you!
from about-this-hack.
Alright I added the storage view and bootloader changes. I am keeping the GPU the same tho because I don't feel the need for a tooltip.
from about-this-hack.
@0xCUB3
Hi
ToolTip on GPU, not sure, some Hack with ATI GPU may have along Description.
'cause with OC or Clover you can set in your config.plist in Devices/Properties section a long model content
mine is "Intel HD Graphics 4000" and if i would i could set it to "Intel HD Graphics 4000 (Metal 5) iGPU from Intel(R) Core(TM) i5-3340M CPU @ 2.70GHz" (it's improbable I grant it, but ...)
An other thing in HardwareCollector getStorageData() func
lines 130 & 131
let percentfree = NSString(format: "%.2f",(((Double(availableTrimmed)!) / Double(sizeTrimmed)!) * 100))
let percent = (Double(availableTrimmed)!) / Double(sizeTrimmed)!
may be replaced with somtehing like this to avoid two same calculation use
let percent = (Double(availableTrimmed)!) / Double(sizeTrimmed)!
let percentfree = NSString(format: "%.2f",(percent * 100))
Work fine, I tested it
And to finish is there a good reason to keep a component called HardwareCollector in "About This Hack" group unused component and not to move the component with same name from outside "About This Hack" group to inside group.
PS: OCLP is placed with BootLoader but it's logically relative to the OS with Version content (it's a System patch not a BootLoader patch).
Like this
Regards
from about-this-hack.
You can try this latest version: https://drive.google.com/file/d/1Yq_M2M6xOI0SOXwh1JlagsrzdC6XGxk0/view?usp=sharing
from about-this-hack.
@0xCUB3 Hi
https://drive.google.com/file/d/1Yq_M2M6xOI0SOXwh1JlagsrzdC6XGxk0/view?usp=sharing
I can't DL your Pre Release
Cette page ne fonctionne pas
Impossible de traiter cette demande via doc-0o-2s-docs.googleusercontent.com à l'heure actuelle.
HTTP ERROR 500
from about-this-hack.
@0xCUB3 Hi
https://drive.google.com/file/d/1Yq_M2M6xOI0SOXwh1JlagsrzdC6XGxk0/view?usp=sharing
I can't DL your Pre Release
Cette page ne fonctionne pas
Impossible de traiter cette demande via doc-0o-2s-docs.googleusercontent.com à l'heure actuelle.
HTTP ERROR 500
This is because I replaced it with a newer version in #39
from about-this-hack.
from about-this-hack.
from about-this-hack.
yeah all seems good except that people on older versions of macOS (high sierra) can't open the app because of the weird crash. I will need to fix that before a release.
from about-this-hack.
from about-this-hack.
They seem to be having a different issue, though. We just have the wrong version. idk
from about-this-hack.
from about-this-hack.
Related Issues (20)
- Display Bug HOT 31
- Storage Config > 2TB bug HOT 34
- App crashes immediately after launch HOT 5
- Immediate crash after opening HOT 1
- App update function not working HOT 1
- App crashes when clicking on "Displays" HOT 2
- No displays info - v1.0.0 HOT 24
- Display Preferences button does nothing HOT 3
- "Bootloader" section says "Apple UEFI" if Clover is used as a Bootloader HOT 4
- "Software Update..." not properly redirecting HOT 12
- Crashing when clicking on "Displays" HOT 21
- I think the inbuilt-updater hasn't been fixed yet? HOT 1
- When I click on Hackintosh Guide it opens Apple Help Home page HOT 5
- GPU and Displays do not appear HOT 6
- Reporting a model name issue HOT 2
- Cannot install on Windows HOT 1
- There is no image on Storage tab HOT 6
- The latest version is 404:NotFound. You are currently running 1.2.0. HOT 3
- ATH v1.1.1 Update HOT 4
- Code signature changed? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from about-this-hack.