#!/bin/sh # If the required desktop does not exists, create it bspc query --desktops --names | grep --quiet "$1" || bspc monitor --add-desktops "$1" # Switch to the desired desktop bspc desktop --focus "$1"