5

When I create a new desktop it has all the same crud on it that my original desktop has on it.

How do I create a new desktop that's empty, and use that as a new work area... like a new desktop?


The source of my confusion is that they're named "DESKTOPS", and given unique numbers, yet they completely fail to follow the ideas of their own metaphor:

Look at the names of these **DESKTOPS**

Desktop 1 is exactly the same as Desktop 2, only it's got the possibility of having different app windows in it. That's not a new desktop. It's the same desktop.

5
  • If you litter the desktop with files, folders etc, they will always follow you, because the Finder is always in the background.
    – Tetsujin
    Commented Sep 2, 2015 at 15:31
  • Litter is a grotesque understatement. I'm more like an object sprayer. This inability to have true virtual and alternative desktops seems like a missed opportunity for those of us not into constantly organising files.
    – Confused
    Commented Sep 2, 2015 at 15:33
  • Files only need organising once ;) i do know what you mean, but actually for many years they were called Spaces, to save getting them confused with 'desktops'. They're for putting distinct apps in, not creating further confusion from a file-sprayed multi-desktop scenario.
    – Tetsujin
    Commented Sep 2, 2015 at 15:39
  • I can't help thinking they should have been called Views instead of Spaces. i.e. looking at the same desktop from a different perspective. View_1 through Photoshop and Notes, View 2 through Excel and Word, both looking through to the desktop beneath. But Spaces is definitely better than Desktops. ANYTHING is better than iteratively numbering them as multiple Desktops for this feature.
    – Confused
    Commented Sep 2, 2015 at 16:01
  • 1
    The simple answer is you're 100% correct. (A) how they did it is ridiculous and (B) the wording they use in the feature name and doco, is ridiculous. You're Right.
    – Fattie
    Commented Jan 3, 2023 at 18:17

3 Answers 3

4

@Confused I too had the same issue. I wanted different desktops for different projects. So, I made an Python/Applescript app which allows you to have multiple desktops in the "true sense" that you refer to:

http://www.shirt-ediss.me/clarity/

It should serve your purpose, but please see the "Tips" sections for caveats with my approach. It works simply by moving files and folders from the Desktop to a storage folder, and recording their icon positions. This means that this desktop can be restored to exactly the same state later. There is still only one Desktop/ folder on the Mac, and Mission Control works just as it did before.

I now have about 20 different desktops and switch between them all of the time - great for productivity.

4
  • Why not just have a 'Desktop2' folder, instead of moving files in and out of the original 'Desktop' folder? Commented Nov 1, 2020 at 7:55
  • I've tried the changing folders approach. It requires, as far as I can tell, that you restart Finder to change the Desktop contents. When you remove the Desktop folder, the icons disappear, but when you replace it, they do not reappear until I restart Finder. That takes several seconds and is uncomfortably slow to use whenever the whim strikes.
    – August
    Commented Jan 10, 2021 at 2:03
  • 1
    @August, killing Finder is also not desirable if you have multiple Finder windows open, or if you are doing long file copying operations in the background. Symlinking a different folder for Desktop may not play well with applications like Dropbox.
    – edison1093
    Commented Jan 11, 2021 at 9:53
  • I installed and explored Clarity as suggested in this answer. I was wrong; Clarity does not require restarting Finder. Rather than rename and replace the Desktop folder, it copies the contents of the Desktop folder to a backup folder, or several, "desktop1", "desktop2", etc, in your chosen location. @edison1093 uses a Dropbox destination, I presume so that he can use the same desktops on different machines. His method does not require restarting all open Finder windows as well. Various restarting-Finder methods took me 12-16 seconds to get all Finder windows back, while Clarity took 2-4 secs.
    – August
    Commented Jan 11, 2021 at 20:59
3

Here's an easy shell script I wrote to implement multiple desktops (tested up to Sonoma). It does require root permissions to initially configure and works nicely when mapped to "hot keys" using Automator.

The only downside I've found is that you'll have to create an alias on the Finder sidebar to the folder containing the desktops, since the old "Desktop" Finder alias will only point to desktop1.

    #!/bin/bash

    # This Software and related documentation are provided “AS IS”
    # and without any warranty of any kind and Seller EXPRESSLY   
    # DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT      
    # NOT LIMITED TO,THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
    # FITNESS FOR APARTICULAR #PURPOSE.
    
    # chdt - Multiple Desktops à la X-Windows for MacOS
    # Why: I needed more desktops to clutter.
    # Copyright (c) 2022, 2024 by Jeff Bloomfield
    # [email protected]

    # Jeff Bloomfield - 2/23/2021
    # REVISED 2/28/2022 hopefully fixing potential Automator hotkey mapping race
    # condition when rapidly toggling between desktops.
    # REVISED 11/15/2022: Damn if I know what I did. Didn't document the changes.
    # Have to check backups and diff.

    #    Usage:
    #       chdt N
    #    where N is the desktop number or suffix
    #
    #    Example:
    #       chdt 2
    #    Changes active desktop to the contents of $DESKTOP_DIRS/${DESKTOP_NAME}2

    # Set some useful variables
        PROG=$(basename $0)
        DESKTOP_SYMLINK=$HOME/CurrentDesktop
        DESKTOP_DIRS=$HOME/Desktops
        DESKTOP_NAME=Desktop    # The basename of the desktop(s), e.g., Desktop

        DEBUG=0
        if [ $DEBUG = 1 ]; then
            ERR=/tmp/chdt_error_$LOGNAME
        else
            ERR=/dev/null
        fi

    # Setup Instructions (example):
    #
    # 0. Make sure the user owning the hierarchy where chdt will be configured is
    #    -->NOT<-- logged in to the GUI. From this point use sudo to do the
    #    following steps.
    #
    # 1. Make the directory $DESKTOP_DIRS as username in the users home directory:
    #
    #        sudo --user=username --login mkdir Desktops
    #
    # 2. As root, move the user's present Desktop directory to its new home, e.g.,
    #
    #        sudo mv ~username/Desktop ~username/Desktops/Desktop1
    #    
    #    Do the above as root because all permissions and ownership--including
    #    existing extended permissions are preserved ("everyone deny delete"),
    #    which is the OEM default). You can see extended permissions with ls -led *.
    #    Using mv as root keeps the directory permissions and ownership as they are.
    #
    #    NOTE: This is ->only<- command done as root. The remaining commands
    #    are executed as the owner of the hierarchy where chdt is being installed.
    #
    # 3. As username, make the symlink $DESKTOP_SYMLINK pointing to the new location
    #    of your original desktop folder, e.g.,
    #
    #        sudo --user=$USERNAME --login ln -s Desktops/Desktop1 CurrentDesktop
    #
    # 4. In $HOME make the symlink $HOME/Desktop:
    #        sudo --user=$USERNAME --login ln -s CurrentDesktop Desktop
    #
    # 5. Important!!! Protect the above symlink from the OS GUI turning it back into
    #     an empty directory (named Desktop) using chflags(1):
    #
    #        sudo --user=$USERNAME chflags -h uchg Desktop
    #
    #    -h acts on the symlink itself and not the directory it points to. The 
    #    uchg flag prevents any changes to the symlink (like the OS deleteing it).
    #
    #    NOTE: The reason for requiring a symlink pointing to a symlink is
    #          because chflags has Apple's undocumented "restricted" flag set,
    #          which disallows chflags (among other things) changing or deleting
    #          flags in $HOME/Desktop. [Fuck you, Apple].
    #
    #    Check your work to see that the uchg flag is present with
    #
    #        sudo --user=$USERNAME --login ls -Ol Desktop
    #        O = letter "O"
    #
    # 6. Have $USERNAME log in to the GUI and make empty directories for the new
    #    additional desktop(s) in the username's Desktops directory. Name these
    #    alternate desktop directories DesktopN, where N is the desktop number
    #    (or character(s) sequence(s)) you intend to pass in chdt's desktop
    #    argument (see $DESKTOP_NAME).
    #
    # 7. It's good practice to have the user (or you) use chmod(1) to give the
    #    additional desktop root directories the same extended permissions as the
    #    original desktop directory using chmod:
    #    
    #        chmod +a "everyone deny delete" DesktopN
    #    where N is the desktop number (or character sequence)
    #
    #    See ls(1) and chmod(1) for more info on this somewhat arcane
    #    (and squirrelly) topic.
    #
    # 8. You can map chdt to hotkeys using Automator workflow (service) scripts or
    #    with similar third-pary software. (Automator is a squirrelly topic for 
    #    another time.)
    #
    # Big Sur, Monterey Note: The OS has become more aggressive (especially on
    # M-chip machines) about replacing the $HOME/Desktop symlink with an empty
    # Desktop directory. So the best implementation strategy is implementing the
    # changes to the Desktop symlink while the user isn't logged in to the GUI. 

    #
    # Do the work:
    #

    # Get first (and only) command line argument:
        DesktopNum=$1

    # Catch some errors and exit with an error message:

        # Warn me in case the OS has exhibited some sneaky, antisocial behavior,
        # such as removing the symlink and recreating the Desktop directory or some
        # other untoward behavior I don't know about yet.
        if [ -e $DESKTOP_SYMNLINK] && [ ! -L $DESKTOP_SYMLINK ]; then
            echo "$PROG: $DESKTOP_SYMLINK does not exist or is not symlink."\
              | tee -a $ERR
            exit 1
        fi

        
        if [ ! -e "${DESKTOP_DIRS}/${DESKTOP_NAME}$DesktopNum" ]; then
            echo \
            $PROG: ${DESKTOP_DIRS}/${DESKTOP_NAME}${DesktopNum} does not exist.\
              | tee -a $ERR
            exit 3 
        fi

        if [ ! -d "${DESKTOP_DIRS}/${DESKTOP_NAME}$DesktopNum" ]; then
            echo \
            $PROG: ${DESKTOP_DIRS}/${DESKTOP_NAME}${DesktopNum} is not a directory.\
              | tee -a $ERR
            exit 4
        fi

        # Silently ignore attempts to chdt to the current desktop
        if \
        [ $(readlink $DESKTOP_SYMLINK) = $DESKTOP_DIRS/$DESKTOP_NAME${DesktopNum} ]
        then
            exit 0  # Not an error; just do nothing and exit with no error (exit 0)
                    # Otherwise automator throws an error if exit() is non-zero.
        fi

        # Remake $DESKTOP_SYMLINK to point to the new desktop 
        if ! /bin/ln -hfs $DESKTOP_DIRS/$DESKTOP_NAME${DesktopNum} $DESKTOP_SYMLINK
        then
            echo "$PROG: ln -hfs failed to create symlink 
            $DESKTOP_DIRS/$DESKTOP_NAME${DesktopNum} -> $DESKTOP_SYMLINK" \
               | tee -a $ERR
            exit 5
        fi

        if ! pkill -U $(id -u) '^Finder$'; then
            echo "Failed to restart finder for some unknown reason (so sue me)."
            exit 6
        fi
        exit 0

0
+50

Files, folders, aliases, etc. on the OS X desktop remain "stuck" to all desktops assigned to that monitor. On a second monitor, the desktop will not be replicated from the first but again it will be repeated for all of its assigned desktops or spaces. Desktops are primarily useful for organizing apps and windows—not file system objects.

While I'm sure you have an intuitive understanding of how your proposal would work for 95% of your use case, I think there are a number of edge cases that would lead to very unpredictable behavior for many, many users (possibly even yourself).

10
  • 1
    That last paragraph is bizarre. Consider the desktop for what it is. A metaphorical space to place things and work on them. It's a workspace, just like the real world. A "DESK"top.
    – Confused
    Commented Sep 2, 2015 at 15:44
  • 1
    In the real world, when I make a new desktop, it's specifically so I have a new desktop to work on. Not so that I'm working on a duplicate of the current Desktop. They way Apple's done this it should not be named a second, third or umpteenth desktop. They're providing virtual app screen spaces, not multiple desktops. It's a complete and horrid misnomer to name them as desktopS.
    – Confused
    Commented Sep 2, 2015 at 15:46
  • 1
    The desktop isn't meant to be your collecting place for everything you can't be bothered to organize. For example, nothing defaults to being saved or download there. Just because it doesn't work the way you want it to work, doesn't make it unfathomable.
    – samh
    Commented Sep 2, 2015 at 15:50
  • 1
    What would happen if you delete a desktop? Should its files be deleted? Should they be merged with an adjacent space? What if the files don't fit because the source and destination were both full? How is this workflow less confusing for the majority of users? Your proposal is far less fluid for what most people want—workspaces for windows (which is why the feature was originally called Spaces, I suppose). You object to the name change—I suggest you contact Apple with your feedback.
    – samh
    Commented Sep 2, 2015 at 15:51
  • 1
    As for "deleting desktops", obviously if they're virtual realisations of the metaphor then you couldn't delete a desktop that's being used. relax.
    – Confused
    Commented Sep 2, 2015 at 15:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .