Giter Club home page Giter Club logo

Comments (5)

jonathanlaniado avatar jonathanlaniado commented on June 3, 2024 1

Thanks Alex! See, I've come across a similar command to this, but both retrieve the leftmost desktop of the display, not the one that's currently being used (active desktop).

My use case is that if I create a new desktop, which by default is named Desktop #, I'd like to rename this new desktop, and to do that I need to get the UUID for that active desktop, not the leftmost one.

And I agree, if I can identify the current active desktop, then I could tell Alfred what to name it and work around using AppleScript.

from spaces-renamer.

dado3212 avatar dado3212 commented on June 3, 2024 1

Ah, Spaces Renamer actually keeps track of it properly in the currentspaces.plist, which is how it knows which one to select when you open the window. You can get at it with a slightly modified command as long as Spaces Renamer is installed: /usr/libexec/PlistBuddy -c "print :Monitors:0:Current\ Space:uuid" ~/Library/Containers/com.alexbeals.spacesrenamer/com.alexbeals.spacesrenamer.currentspaces.plist

from spaces-renamer.

jonathanlaniado avatar jonathanlaniado commented on June 3, 2024 1

Uh-oh, looks like it's working... thank you! I will write a quick script tonight or this week and re-open if there are any issues. But this looks very promising. Thank you! 👊

from spaces-renamer.

jonathanlaniado avatar jonathanlaniado commented on June 3, 2024

In addition to that, any way I can trigger the window with a keyboard shortcut?

I've tried using AppleScript, but for whatever reason this clicks on the menu bar icon, but does not open the window.

tell application "System Events"
    tell process "SpacesRenamer"
        click menu bar item 1 of menu bar 2
    end tell
end tell

from spaces-renamer.

dado3212 avatar dado3212 commented on June 3, 2024

From the command line, this command will give you the current space's UUID (in the first monitor, not sure how this plays with multiple monitor setups).

/usr/libexec/PlistBuddy -c "print :SpacesDisplayConfiguration:Management\ Data:Monitors:0:Current\ Space:uuid" ~/Library/Preferences/com.apple.spaces.plist

If you're trying to programmatically do this, you're probably better off writing to the raw plist file than opening the window. Not sure how to open the window with AppleScript 😕, but if you point me to an open source project that has support, I can see what I'm doing differently.

from spaces-renamer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.