Skip to content
/ Spoons Public

Personal Hammerspoon Spoons Repository

License

Notifications You must be signed in to change notification settings

jsfr/Spoons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsfr's Spoons 🥄

Personal Hammerspoon Spoons Repository

To use this you are expected to be running Hammerspoon and it is recommended to set up SpoonInstall for easy use of Spoons. See e.g. this guide for easy setup.

PullRequests

A menubar item containg the Github Pull Requests the user is part of. The list is split into three parts:

  1. Users own PRs
  2. PRs with review requests to be done
  3. PRs with review requests done

An entry is marked read when new activity has happened on it, and a checkmark on or dash indicates whether the PR is approved or has requests for change.

Clicking an entry opens the PR in the default browser.

The menubar item is simply a count of the number of PRs currently tracked.

How to install

If you are using SpoonInstall you can simply add this repo and use the andUse function. A minimal setup example looks like this

hs.loadSpoon("SpoonInstall")

spoon.SpoonInstall.repos.jsfr = {
  url = "https://github.com/jsfr/Spoons",
  desc = "jsfr's Spoons,
  branch = "main"
}

spoon.SpoonInstall:andUse(
  "PullRequests", {
    config = {
      username = "[INSERT GITHUB USERNAME]",
      keychainItem = "github_api_token"
    },
    repo = "jsfr",
    start = true
  }
)

You will also need a Personal Access Token stored in the Keychain under the name you chose in the setup. This token should have the repo scope

Once you have the token ready you can store it in the the keychain using the following command

security add-generic-password -a github_api_token -s github_api_token -w [INSERT API TOKEN]

YabaiSpaces

A menubar item showing a list of spaces currently containing windows, as well as highlighting the currently active window.

The item comes with the expectation that you are using yabai as a window manager, and that you have between 1 and 10 spaces.

How to install

If you are using SpoonInstall you can simply add this repo and use the andUse function. A minimal setup example looks like this

require("hs.ipc")

hs.loadSpoon("SpoonInstall")

spoon.SpoonInstall.repos.jsfr = {
  url = "https://github.com/jsfr/Spoons",
  desc = "jsfr's Spoons",
  branch = "main"
}

spoon.SpoonInstall:andUse("YabaiSpaces", {repo = "jsfr"})

You will need to ensure that the hs IPC cli is installed on your system which can be done by using the hs.ipc.cliInstall

To ensure that the signals which the spoon adds to yabai are always present you may also want to add the following command to your .yabairc

## Add signals for Hammerspoon Yabai Widget
hs -c "spoon.YabaiSpaces:add_signals()"

# go through all spaces to pick up all windows
active_space=$(yabai -m query --spaces --space | jq -r ".index")
last_space=$(yabai -m query --spaces | jq -r "[.[] | .index] | max")
for i in $(seq 1 "$last_space"); do yabai -m space --focus "$i"; sleep 0.1; done
yabai -m space --focus "$active_space"

About

Personal Hammerspoon Spoons Repository

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published