A shell prompt with infinite customization.
- Extensible: Configure your prompt with a Haskell domain specific language (eDSL)
- High performance: Your prompt runs in parallel with traditional compiled Haskell
- Easy to use: Don't worry about monads if you don't want, just copy a config and get going
By default the CLI will follow the XDG specification
and use $XDG_CONFIG_HOME
for configuration files.
If the path does not yet exist you can start by creating a shmonad
directory in your configuration path.
For example:
mkdir -p ~/.config/shmonad
cd ~/.config/shmonad
You can then create a new config.hs
file, which will be the entrypoint of your configuration.
import ShMonad
main = do
shmonad $
path $
segment Dull Magenta userModule
<> ( currentDirectoryModule
>>= \dir -> segment Dull Blue $ textModule $ " \xf07b " ++ dir
)
<> ( gitBranchModule
>>= \branch -> segment Dull Cyan $ textModule $ " \xe725 " ++ branch
)
In your shmonad
configuration directory, you can now clone the latest source code.
git clone https://github.com/matthunz/shmonad
First create a new stack project in the same configuration directory.
stack init
Then edit your stack.yml
to include the shmonad
source code.
resolver:
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/25.yaml
packages:
- shmonad
Finally, you can install the CLI with:
stack install
In your .zshrc
add
eval "$(shmonad init)"
You can recompile your configuration by running:
shmonad recompile
Huge thanks to other shell prompts that inspired this project!
The idea to use Haskell as a configuration language comes from xmonad (which pairs great with this project).