Set default apps using the commandline

To look up what the current default is:

xdg-mime query default inode/directory

To set the new default:

xdg-mime default nemo.desktop inode/directory