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.
 
 

2.5 KiB

---
output: rmarkdown::github_document
editor_options:
chunk_output_type: console
---
```{r pkg-knitr-opts, include=FALSE}
hrbrpkghelpr::global_opts()
```

```{r badges, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::stinking_badges()
```

```{r description, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::yank_title_and_description()
```

## 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.

## What's Inside The Tin

The following functions are implemented:

```{r ingredients, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::describe_ingredients()
```

## Installation

```{r install-ex, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::install_block()
```

## Usage

```{r use, message=FALSE, warning=FALSE, error=FALSE}
library(mactheknife)

# current verison
packageVersion("mactheknife")

```

### `mdls` info

```{r mdls}
res <- mdls(list.files(here::here("R"), full.names = TRUE))

res

dplyr::glimpse(res)
```

### Kernel state vars

```{r ks}
kernel_state()
```

### `.DS_Store` example

Using built-in data

```{r ds1}
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

```{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).

```{r ds-dir, cache = FALSE}
library(magrittr)

list.files(
path = "~/projects", pattern = "\\.DS_Store",
all.files = TRUE, recursive = TRUE, full.names = TRUE
) %>%
lapply(read_dsstore) -> x

str(x)
```

### "Software Update" History

```{r suh}
software_update_history()
```

### macOS Version Info (short)

```{r swv}
sw_vers()
```

### Applescript

```{r applescript}
res <- applescript('
tell application "Music"
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)
```

### App info

```{r app}
check_sig("/Applications/RSwitch.app") %>%
print(n=nrow(.))

check_notarization("/Applications/RSwitch.app")
```

## mactheknife Metrics

```{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.