Code Monkey home page Code Monkey logo

xmonadrc's Introduction

XMonad Configuration

This repository contains my XMonad [] configuration. I thought I'd share it with the rest of the world because I'm doing a few interesting things:

  1. I use cabal sandboxes to build XMonad and compile my configuration into an executable (xmonadrc). This means I don't have to rely on packages from my operating system vendor and I also don't have to install any packages in ~/.cabal, which I'm likely to delete at some point when I get into cabal hell.

    This presents an interesting challenge since XMonad by default tries to compile your ~/.xmonad/xmonad.hs file when it starts. Therefore I install my generated xmonadrc binary where XMonad expects it and use .cabal-sandbox/bin/xmonad to restart the running XMonad. I've also updated my ~/.xinitrc to exec my xmonadrc directly without using the xmonad binary.

    All the details for this process are in the GNUmakefile.

  2. The checkrc executable that is built with cabal boots a mini XMoand environment in order to test my configuration before restarting XMonad. Right now it's only testing the key bindings.

  3. The majority of my key bindings are underneath a prefix key: C-z. Being a long time user of tools like GNU screen, tmux, and Emacs, I've become very accustomed to prefix keys. I quite like them.

Source Code Organization

  • xmonadrc.hs: This is where the main function lives.

  • src/XMonad/Local/Action.hs: Event handling. I have an interesting function in there called focusFollowsTiledOnly that enables focus-follows-mouse in the tiled layer but not in the floating layer. I found that:

    focus-follows-mouse + update-pointer + floating-windows = weird-stuff
    
  • src/XMonad/Local/Keys.hs: All of my key bindings, grouped by functionality.

  • src/XMonad/Local/Layout.hs: Layout rules.

  • src/XMonad/Local/Log.hs: Log hook, window fading, writing XMonad status information to xmobar.

  • src/XMonad/Local/Music.hs: Functions to switch radio stations and select albums to play in MPD.

  • src/XMonad/Local/Prompt.hs: XPrompt configuration.

  • src/XMonad/Local/Workspaces.hs: The names of my workspaces plus some functions that decide if the workspace name should show up in xmobar and to convert workspace names into key bindings.

Using this Configuration

If you are interested in using cabal to build your XMonad configuration then you might also be interested in the following outline of the steps I take to build, install, and restart XMonad.

  1. Install the Haskell Platform [].

  2. Install cabal-install >= 0.18:

    $ cabal update $ cabal install cabal-install

  3. Use the GNUmakefile and xmonadrc.cabal files in this directory to build your XMonad configuration.

    $ make

  4. Install and restart XMonad (assumes XMonad is currently running):

    $ make restart

The details about how this works are in the GNUmakefile (correctly naming the xmonad executable, installing, restarting) and xmonadrc.cabal (which source files are included, build dependencies, etc.)

Screenshots

xmonadrc's People

Contributors

pjones avatar lionelyoung avatar dackerman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.