Assume I would open a new workspace e.g. to run a terminal in the next unused workspace.
i3-msg workspace $(($(i3-msg -t get_workspaces | tr , '\n' | grep '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1)) && /usr/bin/x-terminal-emulator
Additionally I also want to specify for this workspace that if I stroke $mod+D the program dmenu runs with a custom list of applications like dmenu -i "app1\napp2\napp3".
And if I switch to an other workspace and stroke $mod+D dmenu should run in default mode unless I defined a specific list of applications.