Various ‘macOS’-oriented Tools and Utilities
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
2.5 KiB

6 years ago
---
output: rmarkdown::github_document
4 years ago
editor_options:
chunk_output_type: console
6 years ago
---
5 years ago
```{r pkg-knitr-opts, include=FALSE}
hrbrpkghelpr::global_opts()
```
6 years ago
5 years ago
```{r badges, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::stinking_badges()
```
6 years ago
5 years ago
```{r description, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::yank_title_and_description()
```
6 years ago
## NOTE
- Uses `reticulate` so a working Python *3* implementation is needed. Consider setting `RETICULATE_PYTHON` to a valid, working Python 3 installation if this package is not working for you.
6 years ago
## What's Inside The Tin
6 years ago
The following functions are implemented:
5 years ago
```{r ingredients, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::describe_ingredients()
```
6 years ago
## Installation
5 years ago
```{r install-ex, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::install_block()
6 years ago
```
## Usage
5 years ago
```{r use, message=FALSE, warning=FALSE, error=FALSE}
6 years ago
library(mactheknife)
# current verison
packageVersion("mactheknife")
```
4 years ago
### `mdls` info
```{r mdls}
res <- mdls(list.files(here::here("R"), full.names = TRUE))
res
dplyr::glimpse(res)
```
6 years ago
### Kernel state vars
5 years ago
```{r ks}
6 years ago
kernel_state()
```
### `.DS_Store` example
Using built-in data
6 years ago
5 years ago
```{r ds1}
6 years ago
read_dsstore(
path = system.file("extdat", "DS_Store.ctf", package = "mactheknife")
)
```
### From a URL
A URL I should not have let a `.DS_Store` file lying around in
5 years ago
```{r ds2}
read_dsstore("https://rud.is/books/21-recipes/.DS_Store")
```
### A Directory of`.DS_Store`s
A larger example using my "~/projects" folder (use your own dir as an example).
6 years ago
5 years ago
```{r ds-dir, cache = FALSE}
6 years ago
library(magrittr)
list.files(
path = "~/projects", pattern = "\\.DS_Store",
5 years ago
all.files = TRUE, recursive = TRUE, full.names = TRUE
6 years ago
) %>%
lapply(read_dsstore) -> x
str(x)
```
### "Software Update" History
5 years ago
```{r suh}
software_update_history()
```
6 years ago
### macOS Version Info (short)
5 years ago
```{r swv}
6 years ago
sw_vers()
```
6 years ago
5 years ago
### Applescript
6 years ago
6 years ago
```{r applescript}
res <- applescript('
5 years ago
tell application "Music"
6 years ago
set r_name to name of current track
set r_artist to artist of current track
end
return "artist=" & r_artist & "\ntrack=" & r_name
')
print(res)
```
5 years ago
### App info
```{r app}
check_sig("/Applications/RSwitch.app") %>%
print(n=nrow(.))
check_notarization("/Applications/RSwitch.app")
```
4 years ago
## mactheknife Metrics
5 years ago
```{r cloc, echo=FALSE}
cloc::cloc_pkg_md()
```
## Code of Conduct
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.