termonad: Terminal emulator configurable in Haskell

[ bsd3, library, program, text ] [ Propose Tags ]
Versions [RSS] 0.1.0.0, 0.2.0.0, 0.2.1.0, 1.0.0.0, 1.0.1.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 2.0.0.0, 2.1.0.0, 3.0.0.0, 3.1.0.0, 3.1.0.1, 4.0.0.0, 4.0.0.1, 4.0.1.0, 4.0.1.1, 4.0.1.2, 4.1.0.0, 4.1.1.0, 4.2.0.0, 4.2.0.1, 4.3.0.0, 4.4.0.0, 4.5.0.0, 4.6.0.0
Change log CHANGELOG.md
Dependencies base (>=4.7 && <5), classy-prelude, colour, constraints, data-default, directory (>=1.3.1.0), dyre, filepath, gi-gdk, gi-gio, gi-glib, gi-gtk (>=3.0.24), gi-pango, gi-vte (>=2.91.18), haskell-gi-base, lens, pretty-simple, QuickCheck, termonad, xml-conduit, xml-html-qq [details]
License BSD-3-Clause
Copyright 2017 Dennis Gosnell
Author Dennis Gosnell
Maintainer cdep.illabout@gmail.com
Category Text
Home page https://github.com/cdepillabout/termonad
Source repo head: git clone git@github.com:cdepillabout/termonad.git
Uploaded by cdepillabout at 2018-08-08T01:16:58Z
Distributions Debian:4.0.0.1, LTSHaskell:4.5.0.0, NixOS:4.5.0.0, Stackage:4.6.0.0
Executables termonad
Downloads 7785 total (109 in the last 30 days)
Rating 2.5 (votes: 4) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user [build log]
All reported builds failed as of 2018-08-08 [all 3 reports]

Readme for termonad-0.2.0.0

[back to package description]

Termonad

Build Status Hackage Stackage LTS Stackage Nightly BSD3 license

Termonad is a terminal emulator configurable in Haskell. It is extremely customizable and provides hooks to modify the default behavior. It can be thought of as the "XMonad" of terminal emulators.

Table of Contents

Installation

Termonad can be able to be installed on any system as long as the necessary GTK libraries are installed. The following lists instructions for a few distributions. If the given steps don't work for you, or you want to add instructions for an additional distribution, please send a pull request.

The following steps use the stack build tool to build Termonad, but cabal can be used as well. If cabal doesn't work for you, please open an issue or send a pull request.

Arch Linux

First, you must install the required GTK system libraries:

$ pacman -S vte3

You must have stack to be able to build Termonad. Steps for installing stack can be found on this page.

In order to install Termonad, clone this repository and run stack install. This will install the termonad binary to ~/.local/bin/:

$ git clone https://github.com/cdepillabout/termonad
$ cd termonad/
$ stack install

Ubuntu / Debian

First, you must install the required GTK system libraries:

$ apt-get install gobject-introspection libgirepository1.0-dev libgtk-3-dev libvte-2.91-dev

You must have stack to be able to build Termonad. Steps for installing stack can be found on this page.

In order to install Termonad, clone this repository and run stack install. This will install the termonad binary to ~/.local/bin/:

$ git clone https://github.com/cdepillabout/termonad
$ cd termonad/
$ stack install

NixOS

There are two methods to build Termonad on NixOS.

The first is using stack. The following commands install stack for your user, clone this repository, and install the termonad binary to ~/.local/bin/:

$ nix-env -i stack
$ git clone https://github.com/cdepillabout/termonad
$ cd termonad/
$ stack --nix install

The second is using the normal nix-build machinery. The following commands clone this repository and build the termonad binary at ./result/bin/:

$ git clone https://github.com/cdepillabout/termonad
$ cd termonad/
$ nix-build

How to use Termonad

Termonad is similar to XMonad. The above steps will install a termonad binary somewhere on your system. If you have installed Termonad using stack, the termonad binary will be in ~/.local/bin/. This binary is a version of Termonad configured with default settings. You can try running it to get an idea of what Termonad is like:

$ ~/.local/bin/termonad

If you would like to configure termonad with your own settings, first you will need to create a Haskell file called ~/.config/termonad/termonad.hs. The next section gives an example configuration file.

If this file exists, when the ~/.local/bin/termonad binary launches, it will try to compile it. If it succeeds, it will create a separate binary file called something like ~/.cache/termonad/termonad-linux-x86_64. This binary file can be thought of as your own personal Termonad, configured with all your own settings.

When you run ~/.local/bin/termonad, it will re-exec ~/.cache/termonad/termonad-linux-x86_64 if it exists.

However, there is one difficulty with this setup. In order for the ~/.local/bin/termonad binary to be able to compile your ~/.config/termonad/termonad.hs file, it needs to know where GHC is, as well as where all your Haskell packages live. This presents some difficulties that will be discussed in a following section.

Configuring Termonad

The following is an example Termonad configuration file. You should save this to ~/.config/termonad/termonad.hs. You can find more information on the available configuration options within the Termonad.Config module.

{-# LANGUAGE OverloadedStrings #-}

module Main where

import Data.Colour.SRGB (Colour, sRGB24)
import Termonad.App (defaultMain)
import Termonad.Config
  ( FontConfig, ShowScrollbar(ShowScrollbarAlways), cursorColor
  , defaultFontConfig, defaultTMConfig, fontConfig, fontFamily
  , fontSize, showScrollbar
  )

-- | This sets the color of the cursor in the terminal.
--
-- This uses the "Data.Colour" module to define a dark-red color.
-- There are many default colors defined in "Data.Colour.Names".
cursColor :: Colour Double
cursColor = sRGB24 204 0 0

-- | This defines the font for the terminal.
fontConf :: FontConfig
fontConf =
  defaultFontConfig
    { fontFamily = "DejaVu Sans Mono"
    , fontSize = 13
    }

main :: IO ()
main = do
  let termonadConf =
        defaultTMConfig
          { cursorColor = cursColor
          , fontConfig = fontConf
          , showScrollbar = ShowScrollbarAlways
          }
  defaultMain termonadConf

Goals

Maintainers