Here's an easy shell script I wrote to implement multiple desktops (tested on High Sierra and Mojave). 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
# chdt - Trivial script for multiple Deskops a la X-Windows for MacOS
# (smoke and mirrors using rm and ln -s)
#
# Jeff Bloomfield - 2/23/2021
# [email protected]
#
# Setup Instructions:
# 1. Make the directory $DESKTOP_DIRS as $USER with rwxr-xr-x permissions.
# 2. As root, mv $HOME/Desktop $DESKTOP_DIRS
# Root needed because of existing extended permissions "everyone deny delete".
# You can see extended permissions with ls -led.
# The mv should keep the directory permissions and ownership as they are.
# 3. As $USER, make the empty directories for your new alternate desktops in
# $DESKTOP_DIRS
# Name the alternate desktop directories DesktopN, where N is the desktop
# number (or character, I suppose) you intend to pass in chdt's argument.
# 4. You might want to give your alternate desktops the same extended perms as
# your original Desktop directory. See ls(1) for pointers to more information
# on this [squirrley] topic.
# 5. You can map chdt to hot keys using Automator workflow scripts.
# Usage:
# chdt N
# where N is the desktop number or suffix
#
# Example:
# chdt 2
# Changes the active desktop to the contents of
$DESKTOP_DIRS/${DESKTOP_NAME}2
PROG=$(basename $0)
DESKTOP_SYMLINK=$HOME/Desktop
DESKTOP_DIRS=$HOME/Desktops
DESKTOP_NAME=Desktop # Used here to set the basename of the desktop
# as in Desktop1, Desktop2...DesktopN, etc.
DesktopNum=$1
# Catch some errors and exit with an error message:
# Warn me in case the OS does some sneaky things like recreate the Desktop
# directory or some other untoward behavior I don't know about yet.
if [ ! -L $DESKTOP_SYMLINK ]; then
echo "$PROG: $DESKTOP_SYMLINK is not symlink or does not exist."
exit 1
fi
if [ ! "$DesktopNum" ]; then echo "$PROG: Missing desktop argument:"; \
echo " $PROG desktop"
exit 1
fi
if [ ! -d $DESKTOP_DIRS/$DESKTOP_NAME${DesktopNum} ]; then
echo "$PROG: Desktop${DesktopNum} is not a directory or does not exist."
echo exiting...
exit 1
fi
# Do the work:
if ! /bin/rm $DESKTOP_SYMLINK; then
echo "$PROG: Failed to remove symlink \"$DESKTOP_SYMLINK\""
echo exiting...
exit 1
fi
if ! /bin/ln -s $DESKTOP_DIRS/$DESKTOP_NAME${DesktopNum} $HOME/Desktop; then
echo "$PROG: Failed to create symlink $DESKTOP_DIRS/$DesktopNum -> $DESKTOP_SYMLINK"
exit 1
fi
sleep 1 # Avoid possible race conditions w/the Finder on fast machines
if ! killall Finder; then
echo "$PROG: Failed to restart the Finder for possibly unknown reason to point to Desktop${DesktopNum}"
echo exiting...
exit 1
fi
exit 0 #success