Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] command line app #25

Open
fabrizziosoares opened this issue Mar 23, 2021 · 9 comments
Open

[feature request] command line app #25

fabrizziosoares opened this issue Mar 23, 2021 · 9 comments

Comments

@fabrizziosoares
Copy link

is it possible to make is a command line app to print the current space?

@vemv
Copy link

vemv commented Sep 2, 2021

+1, I'd love this and am willing to sponsor this feature

@davidpurnell
Copy link

Hello,

I had a need for a command line utility as well so I grabbed the WhichSpace function that queries the spaces info and wrapped it in a command line swift app.

You can find it here: https://github.com/davidpurnell/SpaceInfo

@vemv
Copy link

vemv commented Sep 23, 2021

Cheers! Starred, will give it a spin

I discovered / was using https://github.com/alt-jero/McSpaces in the meantime, it works fine, but bit of a raw one.

@davidpurnell
Copy link

Ah, McSpaces is giving UUIDs. My version outputs integers incremented from 1. I'm using it in some Keyboard Maestro macros so my use case required simple numbering of spaces. Hope that works for you!

@vemv
Copy link

vemv commented Sep 23, 2021

Yes actually my usage of McSpaces was pretty hacky. It gives you a blank UUID for Space #1, and an actual UUID for the rest.

By coincidence, I was only interested in querying "am I in space #1?" so getting a blank UUID was enough 😄

A number-based approach is more robust and allows more use cases.

@ChristinWhite
Copy link

If you guys don’t mind sharing, what kinds of things are you using this for? KM macros sound interesting.

@davidpurnell
Copy link

I have several KM macros that move windows around between multiple displays and spaces. These macros need to know what current space and/or display index the frontmost window is located on.

Just trying to keep my hands on the keyboard and off the mouse as much as possible...

If you want to take a look at my macros, they are here: github.com/davidpurnell/km-macros

@jim-sauer
Copy link

I have several KM macros that move windows around between multiple displays and spaces. These macros need to know what current space and/or display index the frontmost window is located on.

@davidpurnell, SpaceInfo looks cool. You may know this already, but if WhichSpace is running, you can get the current space with AppleScript:

tell application "System Events" to tell process "WhichSpace" to set temp to (title of menu bar items of menu bar 1)
return item 1 of temp

I'm going to check out your macros on GitHub. Have you shared them on the KM Forum? If not consider doing so. It's a great place to share KM ideas.

I've also developed a set of KM macros to manage spaces; there are on the forum: Desktop Spaces • Macros for Navigation and Window Management

@davidpurnell
Copy link

Yep. I used to query Whichspace this way to get the current space index and then used that in earlier versions of my KM macros. Pretty sure I've seen some of your macros on the forum. I'm a lurker there but perhaps it's time to start posting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants