npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

osx-app-spaces-manager

v1.0.4

Published

OSX App-Spaces Manager ======================

Downloads

3

Readme

OSX App-Spaces Manager

Run Apps and Spaces(Desktops) related tasks in OSX. If you want to open to open specific app in a specific space via command line, that's a good place to start.

Installation

npm install -g osx-app-spaces-manager

Configuration

1. Set up spaces shortcuts

There is no direct API for switching spaces in OSX, so we have to use hack to switch spaces via shortcuts. Go to:

System PreferecesKeyboardShortcutsMission Control

And make sure you've got shortcuts there.

!Keyboard

2. Create configuration file

Create .osx-app-spaces-config.js in your home dir. You can use coffeescript as well for that. File should export a config object i.e:

config = {
  essentialApps: [...],
  ensureKillApps: [...],
  ensureRunningApps: [...],
  spaceActions: {...},
  spaceKeys: [...]
};

module.exports = config; ``` Notice `spaceKeys`, it's the array with keys for
switching to spaces from first to the last. As per screenshot it will be equal
to:

```js
{
  spaceKeys: [
    [ 'g', { using: ['command down', 'control down'] } ],
    [ 'c', { using: ['command down', 'control down'] } ],
    [ 'r', { using: ['command down', 'control down'] } ],
    [ 'h', { using: ['command down', 'control down'] } ],
    ...
  ]

Note, because arrays in JS start with 0, Space 0 is same as Desktop 1 in OSX.

You can use command down, ‌control down, ‌option down, ‌shift down as key modifiers(it comes from AppleScript/System Events Dictionary/keystroke).

Ok, the next thing you would want to setup is spaceActions. spaceActions are actions you would want to do for each specific space. It, is an object containing functions for each space in format:

{ spaceActions: 3: function(options, done) { done(); }, 4: function(options, done) { // OSX Desktop 5 done(); } }

options right now doesn't contain anyhing. And done should be called when you finish doing your actions on specific space. Thus you can have nested callbacks inside. You can define as many spaceActions as you want, and skip defining if you don't want any actions for specific space

About rest options(essentialApps, ensureKillApps, ensureRunningApps), written lower in the page.

Usage

Run the action for specific space:

osx-app-spaces-manager -s=3

Run all the actions for all spaces in order. For example this way you can prepare your working enivronment on startup: open editor, browser, else. Usually it takes time to finish the action, so you probalbly will need to play with delays to avoid glitches:

osx-app-spaces-manager -i

Run shell command on each space, for example set up wallpaper:

osx-app-spaces-manager --each-space="wallpaper '$HOME/.wallpaper.png'"

Kill all non essential apps(essentialApps) which has got windows and all the apps from the list ensureKillApps:

osx-app-spaces-manager -k

Run the applications from the list ensureRunningApps:

osx-app-spaces-manager -r