disable lid sleep in mojave
Use the latest version of KeepingYouAwake. It works pretty well in macOS Mojave. It's a GUI based wrapper around Apple's caffeniate command line utility. All current versions of macOS ship with caffeniate tool built-in. So, it should be safe to use.

Courtesy: https://github.com/newmarcel/KeepingYouAwake/#how-does-it-work

For installation:


You can download latest version from here, or
Install it using Homebrew by running: brew cask install keepingyouawake


Reference: https://github.com/newmarcel/KeepingYouAwake/#installation