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 @@
1
-Copyright (c) 2013-2016 Peter Jones <pjones@devalot.com>
1
+Copyright (c) 2013-2017 Peter Jones <pjones@devalot.com>
2 2
 
3 3
 All rights reserved.
4 4
 

+ 12
- 27
README.md View File

@@ -4,14 +4,18 @@ This repository contains my [xmonad] [] configuration.  I thought I'd
4 4
 share it with the rest of the world because I'm doing a few
5 5
 interesting things:
6 6
 
7
-  1. I use [stack][] to build xmonad and compile my configuration into
8
-     an executable (`xmonadrc`).  This allows me to easily use my
9
-     custom `xmonad` and `xmonad-contrib` sources (in `vendor`).
7
+  1. I use either [stack][] or Cabal to build xmonad and compile my
8
+     configuration into an executable (`xmonadrc`).  This allows me to
9
+     easily use my custom `xmonad` and `xmonad-contrib` sources (in
10
+     `vendor`).
10 11
 
11
-     This presents an interesting challenge since xmonad by default
12
-     tries to compile your `~/.xmonad/xmonad.hs` file when it starts.
13
-     Therefore I install my generated `xmonadrc` binary where xmonad
14
-     expects it and use it to restart the running xmonad instance.
12
+     Thanks to changes in `xmonad` version 0.13, It's really easy for
13
+     me to use my `xmonadrc` executable in my `~/.xinitrc` instead of
14
+     starting `xmonad` directly.
15
+
16
+     Note: I actually compile everything
17
+     using [my custom nixpkgs script] [xmonadrc.nix].  This brings in
18
+     all the dependencies needed to build everything in this repo.
15 19
 
16 20
   2. The `checkrc` executable that is built with [stack][] and boots a
17 21
      mini xmonad environment in order to test my configuration before
@@ -48,26 +52,6 @@ interesting things:
48 52
   * `src/XMonad/Local/Workspaces.hs`: The names of my workspaces plus
49 53
      project configuration for `XMonad.Actions.DynamicProjects`.
50 54
 
51
-## Using this Configuration
52
-
53
-If you are interested in using `stack` to build your xmonad
54
-configuration then you might also be interested in the following
55
-outline of the steps I take to build, install, and restart xmonad.
56
-
57
-  1. Install [stack][]
58
-
59
-  3. Use [stack][] via the makefile to build the xmonad configuration:
60
-
61
-        $ make
62
-
63
-  4. Install and restart xmonad (assumes xmonad is currently running):
64
-
65
-        $ make restart
66
-
67
-If you use [Nixpkgs][] or [NixOS][] you may be interested in the
68
-`build/nixpkgs.nix` file which is used by [stack][] to install
69
-non-Haskell dependencies.
70
-
71 55
 ## Screenshots
72 56
 
73 57
 <div>
@@ -81,3 +65,4 @@ non-Haskell dependencies.
81 65
 [stack]: http://docs.haskellstack.org/en/stable/README.html
82 66
 [nixpkgs]: http://nixos.org/nixpkgs/
83 67
 [nixos]: http://nixos.org/
68
+[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 @@
34 34
 ** DONE Bring in MPD prompt from xmonad-extras
35 35
    CLOSED: [2013-04-20 Sat 19:04]
36 36
 * Misc
37
-** TODO Update the README now that I'm installing xmonad
37
+** TODO Improve xrandr selection and switching
38
+** DONE Update the README now that I'm installing xmonad
39
+   CLOSED: [2017-02-27 Mon 13:49]
38 40
    - I'm installing cabal-dev/bin/xmonad to ~/bin now
39 41
    - Document features of each file like urgency hints
40
-** TODO Improve xrandr selection and switching
41
-** TODO Add workspace projects for the classes I teach
42
-** TODO Add workspace projects for existing workspaces
42
+** DONE Add workspace projects for the classes I teach
43
+   CLOSED: [2017-02-27 Mon 14:10]
44
+** DONE Add workspace projects for existing workspaces
45
+   CLOSED: [2017-02-27 Mon 14:10]
43 46
    - rip
44 47
    - docs
45 48
    - scratch

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

@@ -31,7 +31,7 @@ import XMonad.Actions.GroupNavigation (Direction (..), nextMatch)
31 31
 import XMonad.Actions.Navigation2D
32 32
 import XMonad.Actions.PhysicalScreens (onNextNeighbour)
33 33
 import XMonad.Actions.Promote (promote)
34
-import XMonad.Actions.TagWindows (addTag, delTag, withTaggedGlobal)
34
+import XMonad.Actions.TagWindows (addTag, delTag, withTagged)
35 35
 import XMonad.Actions.UpdatePointer (updatePointer)
36 36
 import XMonad.Hooks.ManageDocks (ToggleStruts(..))
37 37
 import XMonad.Hooks.UrgencyHook (focusUrgent)
@@ -169,11 +169,18 @@ windowTagKeys _ =
169 169
   , ("C-z C-j",    primaryJumpTagDown)
170 170
   , ("C-z j",      primaryJumpTagDown)
171 171
   , ("M-j",        secondaryJumpTagDown)
172
-  , ("M-f f",      withFocused (addTag "focus"))
173
-  , ("M-f r",      withTaggedGlobal "focus" (delTag "focus"))
172
+  , ("M-f f",      addFocusTag)
173
+  , ("M-f S-f",    rmFocusTag >> addFocusTag)
174
+  , ("M-f r",      rmFocusTag)
174 175
   , ("M-f n",      sendMessage (JumpToLayout "Focus"))
175 176
   ] ++ numberedTags
176 177
   where
178
+    addFocusTag :: X ()
179
+    addFocusTag =  withFocused (addTag "focus")
180
+
181
+    rmFocusTag :: X ()
182
+    rmFocusTag = withTagged "focus" (delTag "focus")
183
+
177 184
     numberedTags :: [(String, X ())]
178 185
     numberedTags = do
179 186
       key              <- map show ([0 .. 9] :: [Int]) ++

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

@@ -34,17 +34,13 @@ projects =
34 34
                 spawn "urxvtc"
35 35
             }
36 36
 
37
-  , Project { projectName      = "tasks"
38
-            , projectDirectory = "~/"
39
-            , projectStartHook = Just $ spawn "urxvtc -e ncmpcpp"
40
-            }
41
-
42 37
   , Project { projectName      = "clocks"
43 38
             , projectDirectory = "~/"
44 39
             , projectStartHook = Just $ do
45 40
                 sendMessage (JumpToLayout "BSP")
46
-                spawn "urxvtc -name BigTerm -e tty-clock -c -C 4 -f '%b. %d, %Y'"
41
+                spawn "urxvtc -e ncmpcpp"
47 42
                 spawn "urxvtc -name BigTerm -e env TZ=America/New_York tty-clock -C 0 -c -f 'South Carolina'"
43
+                spawn "urxvtc -name BigTerm -e tty-clock -c -C 4 -f '%b. %d, %Y'"
48 44
             }
49 45
 
50 46
   , Project { projectName      = "browsers"
@@ -59,25 +55,58 @@ projects =
59 55
             , projectDirectory = "~/"
60 56
             , projectStartHook = Just $ do
61 57
                 sendMessage (JumpToLayout "3C")
62
-                spawn "e -cs irc -- -F '((name . \"[irc]\"))'"
58
+                spawn "e -cs irc -- -F '((name . \"irc\"))'"
63 59
                 spawn "e -cs gnus"
64 60
             }
65 61
 
62
+  , Project { projectName      = "emacs"
63
+            , projectDirectory = "~/core/emacs"
64
+            , projectStartHook = Nothing
65
+            }
66
+
67
+  , Project { projectName      = "rip"
68
+            , projectDirectory = "~/documents/ripping"
69
+            , projectStartHook = Nothing
70
+            }
71
+
66 72
   , Project { projectName      = "xmonad"
67 73
             , projectDirectory = "~/core/xmonadrc"
68 74
             , projectStartHook = Nothing
69 75
             }
70 76
 
77
+  , Project { projectName      = "rfa"
78
+            , projectDirectory = "~/develop/rfa"
79
+            , projectStartHook = Nothing
80
+            }
81
+
82
+    -- Classes I teach:
71 83
   , Project { projectName      = "training"
72 84
             , projectDirectory = "~/training/courses"
73 85
             , projectStartHook = Nothing
74 86
             }
75 87
 
76
-  , Project { projectName      = "rfa"
77
-            , projectDirectory = "~/develop/rfa"
78
-            , projectStartHook = Nothing
88
+  , Project { projectName      = "advjs"
89
+            , projectDirectory = "~/training/courses/src/javascript/advjs"
90
+            , projectStartHook = Just workshopHook
91
+            }
92
+
93
+  , Project { projectName      = "corejs"
94
+            , projectDirectory = "~/training/courses/src/javascript/corejs"
95
+            , projectStartHook = Just workshopHook
96
+            }
97
+
98
+  , Project { projectName      = "intcss"
99
+            , projectDirectory = "~/training/courses/src/css/intcss"
100
+            , projectStartHook = Just workshopHook
79 101
             }
80 102
   ]
103
+  where
104
+    workshopHook = do
105
+      sendMessage (JumpToLayout "Projector")
106
+      spawn "e -c"
107
+      spawn "urxvtc -name BigTerm -e clockdown"
108
+      spawn "zathura"
109
+
81 110
 
82 111
 
83 112
 --------------------------------------------------------------------------------

+ 2
- 2
xmonadrc.cabal View File

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

Loading…
Cancel
Save