Skip to content
Browse files

Added xmonad modules. Note that I install xmonad-gnome which adds a x…

…monad option in the GDM (I use gnome).
  • Loading branch information...
1 parent ac73e56 commit ec8fd6466e9bf4b7a2f60b8aad158a0dffebcafd @uberj committed Apr 3, 2012
View
20 modules/users/templates/uberj/xmobar.erb
@@ -0,0 +1,20 @@
+Config {
+ font = "-Misc-Fixed-Normal--13-120-75-75-C-70-ISO8859-1"
+ , bgColor = "black"
+ , fgColor = "grey"
+ , position = TopW C 100
+ , commands = [
+ Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
+ , Run Memory ["-t","Mem: <usedratio>%"] 10
+ , Run Swap [] 10
+ , Run Date "%a %b %_d %l:%M" "date" 10
+ , Run Com "date" ["--uct","+'%H:%M:%S'"] "UTC" 1
+ , Run Com "date" ["+%s"] "EPOC" 1
+ , Run Com "mpstat -P 1 | awk 'NR == 4 {print $4}'" [] "Core1" 1
+ , Run StdinReader
+ ]
+ , sepChar = "%"
+ , alignSep = "}{"
+ , template = "%StdinReader% }{ <fc=#ee9a00>%date%</fc> | EPOC:<fc=#ee9a00>%EPOC%</fc> | UTC:<fc=#ee9a00>%UTC%</fc> | %cpu% | %memory% "
+ }
+
View
31 modules/users/templates/uberj/xmonad.erb
@@ -0,0 +1,31 @@
+import XMonad
+import XMonad.Hooks.DynamicLog
+import XMonad.Hooks.ManageDocks
+import XMonad.Util.Run(spawnPipe)
+import XMonad.Util.EZConfig(additionalKeys)
+import System.IO
+
+myManageHook = composeAll [
+ className =? "Gimp" --> doFloat,
+ className =? "Pidgin" --> doFloat,
+ className =? "MPlayer" --> doFloat
+ ]
+
+main::IO()
+main = do
+ xmproc <- spawnPipe "/usr/bin/xmobar ~/.xmonad/xmobar"
+ xmonad $ defaultConfig{
+ terminal = "gnome-terminal",
+ manageHook = manageDocks <+> myManageHook <+>
+ manageHook defaultConfig,
+ layoutHook = avoidStruts $ layoutHook defaultConfig,
+ logHook = dynamicLogWithPP $ xmobarPP {
+ ppOutput = hPutStrLn xmproc
+ , ppTitle = xmobarColor "green" "" . shorten 50
+ }
+ } `additionalKeys`
+ [ ((mod4Mask, xK_c), kill),
+ ((mod1Mask, xK_F3), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\""), -- %! Launch dmenu
+ ((controlMask .|. mod1Mask, xK_l), spawn "xscreensaver-command -lock")
+ -- ((mod4mask, xK_l), spawn "xscreensaver-command -lock")
+ ]
View
14 modules/xmonad/manifests/init.pp
@@ -0,0 +1,14 @@
+class xmonad {
+ include xmonad::params
+
+ package {
+ "xmonad-core":
+ name => "${xmonad::params::package_xmonad_core}",
+ ensure => latest;
+ "xmonad-gnome":
+ name => "${xmonad::params::package_xmonad_gnome}",
+ ensure => latest,
+ }
+
+ File <| tag == "xmonad" |>
+}
View
14 modules/xmonad/manifests/params.pp
@@ -0,0 +1,14 @@
+class xmonad::params {
+ $package_xmonad_core = $::operatingsystem ? {
+ /Fedora/ => "xmonad-core",
+ default => "xmonad-core",
+ }
+ $package_xmonad_gnome = $::operatingsystem ? {
+ /Fedora/ => "xmonad-gnome",
+ default => "xmonad-gnome",
+ }
+ $package_xmobar = $::operatingsystem ? {
+ /Fedora/ => "xmobar",
+ default => "xmobar",
+ }
+}
View
30 modules/xmonad/manifests/user_config.pp
@@ -0,0 +1,30 @@
+define xmonad::user_config (
+ $home="/home/${title}",
+ $xmonad_template="xmonad/xmonad.erb",
+ $xmobar_template="xmonad/xmobar.erb"
+) {
+ @file {
+ "xmonad_dir_${title}":
+ tag => "xmonad",
+ owner => "${title}",
+ group => "users",
+ path => "${home}/.xmonad",
+ ensure => directory;
+
+ "xmonadhs_${title}":
+ tag => "xmonad",
+ owner => "${title}",
+ group => "users",
+ path => "${home}/.xmonad/xmonad.hs",
+ content => template("${xmonad_template}");
+ }
+
+ @file {
+ "xmobarhs_${title}":
+ tag => "xmobar",
+ owner => "${title}",
+ group => "users",
+ path => "${home}/.xmonad/xmobar",
+ content => template("${xmobar_template}");
+ }
+}
View
15 modules/xmonad/manifests/xmobar.pp
@@ -0,0 +1,15 @@
+class xmonad::xmobar (
+ $home="/home/${title}",
+ $template="xmonad/xmobar.erb"
+)
+{
+ include xmonad::params
+
+ package {
+ "xmobar":
+ name => "${xmonad::params::package_xmobar}",
+ ensure => latest,
+ }
+
+ File <| tag == "xmobar" |>
+}
View
20 modules/xmonad/templates/xmobar.erb
@@ -0,0 +1,20 @@
+Config {
+ font = "-Misc-Fixed-Normal--13-120-75-75-C-70-ISO8859-1"
+ , bgColor = "black"
+ , fgColor = "grey"
+ , position = TopW C 100
+ , commands = [
+ Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
+ , Run Memory ["-t","Mem: <usedratio>%"] 10
+ , Run Swap [] 10
+ , Run Date "%a %b %_d %l:%M" "date" 10
+ , Run Com "date" ["--uct","+'%H:%M:%S'"] "UTC" 1
+ , Run Com "date" ["+%s"] "EPOC" 1
+ , Run Com "mpstat -P 1 | awk 'NR == 4 {print $4}'" [] "Core1" 1
+ , Run StdinReader
+ ]
+ , sepChar = "%"
+ , alignSep = "}{"
+ , template = "%StdinReader% }{ <fc=#ee9a00>%date%</fc> | EPOC:<fc=#ee9a00>%EPOC%</fc> | UTC:<fc=#ee9a00>%UTC%</fc> | %cpu% | %memory% "
+ }
+
View
30 modules/xmonad/templates/xmonad.erb
@@ -0,0 +1,30 @@
+import XMonad
+import XMonad.Hooks.DynamicLog
+import XMonad.Hooks.ManageDocks
+import XMonad.Util.Run(spawnPipe)
+import XMonad.Util.EZConfig(additionalKeys)
+import System.IO
+
+myManageHook = composeAll [
+ className =? "Gimp" --> doFloat,
+ className =? "Pidgin" --> doFloat,
+ className =? "MPlayer" --> doFloat
+ ]
+
+main::IO()
+main = do
+ xmproc <- spawnPipe "/usr/bin/xmobar ~/.xmonad/xmobar"
+ xmonad $ defaultConfig{
+ manageHook = manageDocks <+> myManageHook <+>
+ manageHook defaultConfig,
+ layoutHook = avoidStruts $ layoutHook defaultConfig,
+ logHook = dynamicLogWithPP $ xmobarPP {
+ ppOutput = hPutStrLn xmproc
+ , ppTitle = xmobarColor "green" "" . shorten 50
+ }
+ } `additionalKeys`
+ [ ((mod4Mask, xK_c), kill),
+ ((mod1Mask, xK_F3), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\""), -- %! Launch dmenu
+ ((controlMask .|. mod1Mask, xK_l), spawn "xscreensaver-command -lock")
+ -- ((mod4mask, xK_l), spawn "xscreensaver-command -lock")
+ ]

0 comments on commit ec8fd64

Please sign in to comment.
Something went wrong with that request. Please try again.