Permalink
Browse files

Merge branch 'master' of github.com:uberj/puppet

  • Loading branch information...
2 parents b1ea5ad + e8e995f commit 57048766965c0063a3f72b79de900409235c1340 @mythmon mythmon committed Apr 4, 2012
@@ -1,4 +1,11 @@
node "batty" inherits laptop {
include users::uberj
include bash
+ include wget
+ include htop
+ include strace
+ include xmonad
+ include xmonad::xmobar
+ include keychain
+ include network_manager
}
@@ -0,0 +1,5 @@
+class keychain {
+ package { "keychain":
+ ensure => latest,
+ }
+}
@@ -0,0 +1,7 @@
+class network_manager {
+ include network_manager::params
+ package { "network_manager":
+ name => "${network_manager::params::nm_package}",
+ ensure => purged,
+ }
+}
@@ -0,0 +1,7 @@
+class network_manager::params {
+ $nm_package = $::operatingsystem ? {
+ /Fedora/ => 'NetworkManager',
+ /Ubuntu/ => 'network-manager',
+ default => 'network-manager',
+ }
+}
@@ -20,6 +20,10 @@
#os::user_config { "$ { username}": }
bash::user_config { "${username}": }
+ xmonad::user_config { "${username}":
+ xmonad_template => "users/uberj/xmonad.erb",
+ xmobar_template => "users/uberj/xmobar.erb",
+ }
ruby::dev::user_config { "${username}": }
puppet::dev::user_config { "${username}": }
}
@@ -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% "
+ }
+
@@ -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")
+ ]
@@ -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" |>
+}
@@ -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",
+ }
+}
@@ -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}");
+ }
+}
@@ -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" |>
+}
@@ -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% "
+ }
+
@@ -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 5704876

Please sign in to comment.