You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add variable support that generates a list of facts about a device that is able to be used wherever text can be used.
For example, common variables might be:
computername
computermodel
serialnumber
username
osversion
osname
osrevision
...etc
It could also be possible to use any named environment variable, including any custom ones.
Example usage
You could specify a line of text or .md file with variables you wish to populate:
You are running macOS {osname} on revision {osrevision} and your hardware is a {computermodel}
This would result in the following (example):
You are running macOS Sonoma on revision 14.4.1 and your hardware is a MacBookPro18,3
Custom variables could be supported provided they were exported prior to execution. unpopulated variables would result in blank output
export custominformation="<custom content here>"
which could then be used
Custom information contents is {custominformation}
Use case?
Rather than generating this info on the fly and customising content to be displayed prior to running swiftDialog, you could use boilerplate text that calls on this information and populates it for you.
If everything is contained in a shell script this might be less useful but given the capability of using a markdown file sourced from a URL, it could be desirable to populate the markdown file with variable names that swiftDialog will replace on the fly and reducing the need to include any pre-processing of text to populate dynamic content.
The text was updated successfully, but these errors were encountered:
…sname}` can be present in any location where strings are used
Also, any environemtn variable can be accessed in a string with {VARNAME} - so `export MY_VAR="Some Value"` can be accessed in a string as `--message "MY_VAR is {MY_VAR}` - Useful? you could just as easily use `${MY_VAR}` but this is a added benefit to the built in system variable support.
Moved the `<br>` and `<hr>` detection to the string processing function
Fixed an issue with Infobox where short text was not topleft justified.
Not directly related but inspired by SecondSonConsulting/Baseline#46 @BigMacAdmin
Add variable support that generates a list of facts about a device that is able to be used wherever text can be used.
For example, common variables might be:
...etc
It could also be possible to use any named environment variable, including any custom ones.
Example usage
You could specify a line of text or
.md
file with variables you wish to populate:This would result in the following (example):
Custom variables could be supported provided they were exported prior to execution. unpopulated variables would result in blank output
which could then be used
Use case?
Rather than generating this info on the fly and customising content to be displayed prior to running swiftDialog, you could use boilerplate text that calls on this information and populates it for you.
If everything is contained in a shell script this might be less useful but given the capability of using a markdown file sourced from a URL, it could be desirable to populate the markdown file with variable names that swiftDialog will replace on the fly and reducing the need to include any pre-processing of text to populate dynamic content.
The text was updated successfully, but these errors were encountered: