boB Rudis 4年前
コミット
1c08c3b025
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: 1D7529BE14E2BBA9
  1. 1
      NAMESPACE
  2. 21
      R/addin.R
  3. 4
      README.Rmd
  4. 24
      README.md
  5. 5
      inst/rstudio/addins.dcf
  6. 11
      man/open_bitbar_dir.Rd

1
NAMESPACE

@ -6,6 +6,7 @@ export(add_separator)
export(b64_image)
export(bitbar_plugins_dir)
export(new_bitbar_script)
export(open_bitbar_dir)
export(r_logo_small)
import(httr)
import(miniUI)

21
R/addin.R

@ -50,7 +50,19 @@ create_new_bitbar_script <- function() {
about_url = input$about_url
)
stopApp(returnValue)
stopApp(
list(
save_as = input$save_as,
title = input$title,
version = input$version,
author = input$author,
github_user = input$github_user,
description = input$description,
dependencies = input$dependencies,
image_url = input$image_url,
about_url = input$about_url
)
)
})
@ -62,4 +74,9 @@ create_new_bitbar_script <- function() {
}
#' Open BitBar Plugins Directory in the Finder
#'
#' @export
open_bitbar_dir <- function() {
system(sprintf("open %s", shQuote(bitbar_plugins_dir())))
}

4
README.Rmd

@ -37,6 +37,8 @@ The following functions are implemented:
hrbrpkghelpr::describe_ingredients()
```
There are also two RStudio Addins, one with a GUI for entering in the script metadata & starting a new BitBar {bitbar} script and one for opening up the BitBar plugins directory in the Finder.
## Installation
```{r install-ex, results='asis', echo=FALSE, cache=FALSE}
@ -59,7 +61,7 @@ This will open up a `my-awesome-bitbar-script.R` in RStudio (if available) or wh
new_bitbar_script(
save_as = file.path(bitbar_plugins_dir(), "my-awesome-bitbar-script.R"),
title = ":blue_heart:",
description = "Example BitBar Script")
description = "Example BitBar Script"
)
```

24
README.md

@ -9,7 +9,7 @@ by](https://img.shields.io/badge/Keybase-Verified-brightgreen.svg)](https://keyb
[![Linux build
Status](https://travis-ci.org/hrbrmstr/bitbar.svg?branch=master)](https://travis-ci.org/hrbrmstr/bitbar)
![Minimal R
Version](https://img.shields.io/badge/R%3E%3D-3.5.0-blue.svg)
Version](https://img.shields.io/badge/R%3E%3D-3.6.0-blue.svg)
![License](https://img.shields.io/badge/License-MIT-blue.svg)
# bitbar
@ -36,18 +36,26 @@ it the hard way.
Open the application and choose the directory you want to be your
plugins directory. This is where your menubar scripts will go. (I use
`~/Library/Application Support/BitBar/Plugins` but you can pick any
directory; just make sure it isn’t one with a gazillion files as that
impacts BitBar’s performance).
`~/Library/BitBar/Plugins` but you can pick any directory; just make
sure it isn’t one with a gazillion files as that impacts BitBar’s
performance).
## What’s Inside The Tin
The following functions are implemented:
- `add_entry`: Add an entry to the menu
- `b64_image`: Return a base64 encoded string of an image (local
filesystem or URL)
- `bitbar_plugins_dir`: BitBar plugins directory
- `new_bitbar_script`: Helper to get started with a new BitBar bitbar
script
- `open_bitbar_dir`: Open BitBar Plugins Directory in the Finder
- `r_logo_small`: Images that come with the package
There are also two RStudio Addins, one with a GUI for entering in the
script metadata & starting a new BitBar {bitbar} script and one for
opening up the BitBar plugins directory in the Finder.
## Installation
@ -59,6 +67,8 @@ remotes::install_git("https://git.sr.ht/~hrbrmstr/bitbar")
remotes::install_gitlab("hrbrmstr/bitbar")
# or
remotes::install_bitbucket("hrbrmstr/bitbar")
# or
remotes::install_github("hrbrmstr/bitbar")
```
NOTE: To use the ‘remotes’ install options you will need to have the
@ -81,7 +91,7 @@ available) or whatever editor `file.edit()` is configured to use.
new_bitbar_script(
save_as = file.path(bitbar_plugins_dir(), "my-awesome-bitbar-script.R"),
title = ":blue_heart:",
description = "Example BitBar Script")
description = "Example BitBar Script"
)
```
@ -89,8 +99,8 @@ new_bitbar_script(
| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) |
| :--- | -------: | ---: | --: | ---: | ----------: | ---: | -------: | ---: |
| R | 7 | 0.88 | 96 | 0.88 | 29 | 0.57 | 68 | 0.63 |
| Rmd | 1 | 0.12 | 13 | 0.12 | 22 | 0.43 | 40 | 0.37 |
| R | 10 | 0.91 | 191 | 0.94 | 51 | 0.69 | 79 | 0.66 |
| Rmd | 1 | 0.09 | 13 | 0.06 | 23 | 0.31 | 41 | 0.34 |
## Code of Conduct

5
inst/rstudio/addins.dcf

@ -2,3 +2,8 @@ Name: Create a new {bitbar} script
Description: Create a new {bitbar} script
Binding: create_new_bitbar_script
Interactive: true
Name: Open {bitbar} Plugins Directory
Description: Open {bitbar} Plugins Directory in the Finder
Binding: open_bitbar_dir
Interactive: false

11
man/open_bitbar_dir.Rd

@ -0,0 +1,11 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/addin.R
\name{open_bitbar_dir}
\alias{open_bitbar_dir}
\title{Open BitBar Plugins Directory in the Finder}
\usage{
open_bitbar_dir()
}
\description{
Open BitBar Plugins Directory in the Finder
}
読み込み中…
キャンセル
保存