Browse Source

Some final touches before I leave this config alone for a bit

master
Peter J. Jones 2 years ago
parent
commit
7ee6402fd0
Signed by: Peter Jones <pjones@devalot.com> GPG Key ID: 9DAFAA8D01941E49
6 changed files with 71 additions and 47 deletions
  1. 1
    1
      LICENSE
  2. 12
    27
      README.md
  3. 7
    4
      doc/todo.org
  4. 10
    3
      src/XMonad/Local/Keys.hs
  5. 39
    10
      src/XMonad/Local/Workspaces.hs
  6. 2
    2
      xmonadrc.cabal

+ 1
- 1
LICENSE View File

@@ -1,4 +1,4 @@
Copyright (c) 2013-2016 Peter Jones <pjones@devalot.com>
Copyright (c) 2013-2017 Peter Jones <pjones@devalot.com>

All rights reserved.


+ 12
- 27
README.md View File

@@ -4,14 +4,18 @@ 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 [stack][] to build xmonad and compile my configuration into
an executable (`xmonadrc`). This allows me to easily use my
custom `xmonad` and `xmonad-contrib` sources (in `vendor`).
1. I use either [stack][] or Cabal to build xmonad and compile my
configuration into an executable (`xmonadrc`). This allows me to
easily use my custom `xmonad` and `xmonad-contrib` sources (in
`vendor`).

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 it to restart the running xmonad instance.
Thanks to changes in `xmonad` version 0.13, It's really easy for
me to use my `xmonadrc` executable in my `~/.xinitrc` instead of
starting `xmonad` directly.

Note: I actually compile everything
using [my custom nixpkgs script] [xmonadrc.nix]. This brings in
all the dependencies needed to build everything in this repo.

2. The `checkrc` executable that is built with [stack][] and boots a
mini xmonad environment in order to test my configuration before
@@ -48,26 +52,6 @@ interesting things:
* `src/XMonad/Local/Workspaces.hs`: The names of my workspaces plus
project configuration for `XMonad.Actions.DynamicProjects`.

## Using this Configuration

If you are interested in using `stack` 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 [stack][]

3. Use [stack][] via the makefile to build the xmonad configuration:

$ make

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

$ make restart

If you use [Nixpkgs][] or [NixOS][] you may be interested in the
`build/nixpkgs.nix` file which is used by [stack][] to install
non-Haskell dependencies.

## Screenshots

<div>
@@ -81,3 +65,4 @@ non-Haskell dependencies.
[stack]: http://docs.haskellstack.org/en/stable/README.html
[nixpkgs]: http://nixos.org/nixpkgs/
[nixos]: http://nixos.org/
[xmonadrc.nix]: https://github.com/pjones/nix-utils/blob/master/pkgs/haskell/xmonadrc.nix

+ 7
- 4
doc/todo.org View File

@@ -34,12 +34,15 @@
** DONE Bring in MPD prompt from xmonad-extras
CLOSED: [2013-04-20 Sat 19:04]
* Misc
** TODO Update the README now that I'm installing xmonad
** TODO Improve xrandr selection and switching
** DONE Update the README now that I'm installing xmonad
CLOSED: [2017-02-27 Mon 13:49]
- I'm installing cabal-dev/bin/xmonad to ~/bin now
- Document features of each file like urgency hints
** TODO Improve xrandr selection and switching
** TODO Add workspace projects for the classes I teach
** TODO Add workspace projects for existing workspaces
** DONE Add workspace projects for the classes I teach
CLOSED: [2017-02-27 Mon 14:10]
** DONE Add workspace projects for existing workspaces
CLOSED: [2017-02-27 Mon 14:10]
- rip
- docs
- scratch

+ 10
- 3
src/XMonad/Local/Keys.hs View File

@@ -31,7 +31,7 @@ import XMonad.Actions.GroupNavigation (Direction (..), nextMatch)
import XMonad.Actions.Navigation2D
import XMonad.Actions.PhysicalScreens (onNextNeighbour)
import XMonad.Actions.Promote (promote)
import XMonad.Actions.TagWindows (addTag, delTag, withTaggedGlobal)
import XMonad.Actions.TagWindows (addTag, delTag, withTagged)
import XMonad.Actions.UpdatePointer (updatePointer)
import XMonad.Hooks.ManageDocks (ToggleStruts(..))
import XMonad.Hooks.UrgencyHook (focusUrgent)
@@ -169,11 +169,18 @@ windowTagKeys _ =
, ("C-z C-j", primaryJumpTagDown)
, ("C-z j", primaryJumpTagDown)
, ("M-j", secondaryJumpTagDown)
, ("M-f f", withFocused (addTag "focus"))
, ("M-f r", withTaggedGlobal "focus" (delTag "focus"))
, ("M-f f", addFocusTag)
, ("M-f S-f", rmFocusTag >> addFocusTag)
, ("M-f r", rmFocusTag)
, ("M-f n", sendMessage (JumpToLayout "Focus"))
] ++ numberedTags
where
addFocusTag :: X ()
addFocusTag = withFocused (addTag "focus")

rmFocusTag :: X ()
rmFocusTag = withTagged "focus" (delTag "focus")

numberedTags :: [(String, X ())]
numberedTags = do
key <- map show ([0 .. 9] :: [Int]) ++

+ 39
- 10
src/XMonad/Local/Workspaces.hs View File

@@ -34,17 +34,13 @@ projects =
spawn "urxvtc"
}

, Project { projectName = "tasks"
, projectDirectory = "~/"
, projectStartHook = Just $ spawn "urxvtc -e ncmpcpp"
}

, Project { projectName = "clocks"
, projectDirectory = "~/"
, projectStartHook = Just $ do
sendMessage (JumpToLayout "BSP")
spawn "urxvtc -name BigTerm -e tty-clock -c -C 4 -f '%b. %d, %Y'"
spawn "urxvtc -e ncmpcpp"
spawn "urxvtc -name BigTerm -e env TZ=America/New_York tty-clock -C 0 -c -f 'South Carolina'"
spawn "urxvtc -name BigTerm -e tty-clock -c -C 4 -f '%b. %d, %Y'"
}

, Project { projectName = "browsers"
@@ -59,25 +55,58 @@ projects =
, projectDirectory = "~/"
, projectStartHook = Just $ do
sendMessage (JumpToLayout "3C")
spawn "e -cs irc -- -F '((name . \"[irc]\"))'"
spawn "e -cs irc -- -F '((name . \"irc\"))'"
spawn "e -cs gnus"
}

, Project { projectName = "emacs"
, projectDirectory = "~/core/emacs"
, projectStartHook = Nothing
}

, Project { projectName = "rip"
, projectDirectory = "~/documents/ripping"
, projectStartHook = Nothing
}

, Project { projectName = "xmonad"
, projectDirectory = "~/core/xmonadrc"
, projectStartHook = Nothing
}

, Project { projectName = "rfa"
, projectDirectory = "~/develop/rfa"
, projectStartHook = Nothing
}

-- Classes I teach:
, Project { projectName = "training"
, projectDirectory = "~/training/courses"
, projectStartHook = Nothing
}

, Project { projectName = "rfa"
, projectDirectory = "~/develop/rfa"
, projectStartHook = Nothing
, Project { projectName = "advjs"
, projectDirectory = "~/training/courses/src/javascript/advjs"
, projectStartHook = Just workshopHook
}

, Project { projectName = "corejs"
, projectDirectory = "~/training/courses/src/javascript/corejs"
, projectStartHook = Just workshopHook
}

, Project { projectName = "intcss"
, projectDirectory = "~/training/courses/src/css/intcss"
, projectStartHook = Just workshopHook
}
]
where
workshopHook = do
sendMessage (JumpToLayout "Projector")
spawn "e -c"
spawn "urxvtc -name BigTerm -e clockdown"
spawn "zathura"



--------------------------------------------------------------------------------

+ 2
- 2
xmonadrc.cabal View File

@@ -1,8 +1,8 @@
------------------------------------------------------------------------------
name: xmonadrc
version: 0.2.1.0
version: 17.02.27.00
synopsis: Peter's XMonad Configuration
homepage: http://www.pmade.com
homepage: https://github.com/pjones/xmonadrc
license: BSD3
license-file: LICENSE
author: Peter Jones <pjones@pmade.com>

Loading…
Cancel
Save