You are not logged in.
the key combination modkey + 1-9 doesn't seem to work at all for me
Um, I don't know if I could use XMonad without being about to change workspaces...
I recommend X.U.EZConfig.additionalKeys and X.U.EZConfig.additionalKeysP, then you only have to assign keys you wish to add/change from the default set. Let XMonad do what it does best re: M{,+S}+[0-9].
For the record, I thought you need to change myKeys in some way when you change the default modMask, but I just use additionalKeysP so I have no idea .
//github/
Offline
Well that's the thing you see, the combination of modkey + right/left does work for switching workspaces (nextWS/prevWS).
I've got EZConfig imported, and from what I see my code isn't any different from the other people.
This never worked, even from the start with the example config file the xmonad haskell wiki provides.
Maybe it's because I'm using the XMonad in the pacman repo instead of darcs? That would be rather bizarre though :S
Edit: here's the code:
-- other keybinds
, ((modm , xK_Left ), prevWS)
]
++
--
-- mod-[1..9], Switch to workspace N
-- mod-shift-[1..9], Move client to workspace N
--
[ ((m .|. modm, k), windows $ f i)
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_8]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]
]
Last edited by Aeva (2010-12-16 08:44:46)
Offline
Great that you've imported it, but it looks like you're not using it . You really don't need any of that.
For example:
import XMonad.Util.EZConfig
main = xmonad $ defaultConfig
{ terminal = myTerm
, logHook = myLogHook
, manageHook = myManageHook
, ...
} `additionalKeysP` myKeys
-- _just_ the keys you're adding or changing from defaults, M-[0-9] and M-S-[0-9]
-- are already included in the default config so don't worry about them.
--
-- additionalKeysP (P for pretty) allows you to use the nice "M-x" notation too
myKeys = [ "M-<Right>", nextWS
, "M-<Left>", prevWS
]
HTH
/edit:
This never worked, even from the start with the example config file the xmonad haskell wiki provides.
Don't use that, it's for reference. To use "default" or "out of the box" XMonad is to run it without any config. Test it this way first. Then test it with a config that only changes modMask to M4. Then gradually add in your other customizations. If and when M-[0-9] breaks, we can reevaluate next steps.
<rant>
I advise everyone to add only customizations and additions in your xmonad.hs. Copying that reference file and "going from there" is asking for trouble down the line. XMonad's defaultConfig and haskell's record updates exist for a reason.
</rant>
Last edited by brisbin33 (2010-12-16 14:28:45)
//github/
Offline
Oh, I see now. I've never used Haskell before, so symbols like "$" and "<+>" were unknown to me.
I think I understand now though, "$" means expand the second file, and "<+>" means concatenating both files to eachother?
I've cleaned things up a bit:
myKeys = [ ("M-e", goToSelected defaultGSConfig)
, ("M-<Right>", nextWS)
, ("M-<Left>", prevWS)
, ("M-S-<Right>", shiftToNext)
, ("M-S-<Left>", shiftToPrev)
]
main = do
dzen <- spawnPipe myStatusBar
tray <- spawnPipe myTrayBar
bottom <- spawnPipe myBottomBar
programs <- spawnPipe "sh /home/lilith/.xmonad/autostart.sh"
xmonad $ defaultConfig {
-- the basics
terminal = myTerminal,
focusFollowsMouse = myFocusFollowsMouse,
borderWidth = myBorderWidth,
modMask = myModMask,
workspaces = myWorkspaces,
focusedBorderColor = myFocusedBorderColor,
-- hooks & layouts
layoutHook = avoidStruts $ myLayoutHook,
manageHook = myManageHook,
logHook = (dynamicLogWithPP $ myDzenPP dzen)
} `additionalKeysP` myKeys
The key combinations added by myKeys all work, and the ones like Mod4-Q for recompile/restart work, but Mod4-[1-9] still doesn't seem to work though. :$
Last edited by Aeva (2010-12-16 16:13:36)
Offline
I think I understand now though, "$" means expand the second file, and "<+>" means concatenating both files to eachother?
No, nothing to do with files. defaultConfig is just a function that represents XMonad's default configuration. By placing lines in the { } you're overriding "records" of that function. You can override all, none, or some and anything that was already present as part of defaultConfig will be used.
$ is function application in haskell-at-large: f $ x = f (x). <+> is used to combine two manageHooks in XMonad-in-particular.
but Mod4-[1-9] still doesn't seem to work though
Verify (a) they do or don't work when running no config at all and (b) that they do or don't work when your only change is to use Mod4Mask (the distinction between the two is important). If no arch-user-xmonad-devs come along to help, I'd stop by the #xmonad IRC channel. Have your answers to a and b handy as well as an hpaste of the smallest/simplest config that produces your issue.
Last edited by brisbin33 (2010-12-16 17:37:53)
//github/
Offline
I asked on the IRC channel and found out it was because I have a french keyboard layout.
It's fixed now after importing XMonad.Config.Azerty, and in the main method using xmonad $ azertyConfig.
So, thank you very much for the help, brisbin33.
Offline
##EDIT##
Posted to soon. It is working fine. Sorry
##EDIT##
I borrowed serrghi config to get started but I am having prolems with urgent in xmonad. I thought I had everything setup right but it is not working. I have urxvt and weechat setup right.
-- ~/.xmonad/xmonad.hs
-- Imports {{{
import XMonad
-- Prompt
import XMonad.Prompt
import XMonad.Prompt.RunOrRaise (runOrRaisePrompt)
import XMonad.Prompt.AppendFile (appendFilePrompt)
-- Hooks
import XMonad.Operations
import System.IO
import System.Exit
import XMonad.Util.Run
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.SetWMName
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.FadeInactive
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.SetWMName
import XMonad.Layout.NoBorders (smartBorders, noBorders)
import XMonad.Layout.PerWorkspace (onWorkspace)
import XMonad.Layout.Reflect (reflectHoriz)
import XMonad.Layout.IM
import XMonad.Layout.SimpleFloat
import XMonad.Layout.Spacing
import XMonad.Layout.ResizableTile
import XMonad.Layout.Gaps
import XMonad.Actions.CycleWS
import qualified XMonad.StackSet as W
import qualified Data.Map as M
--}}}
-- Config {{{
-- Define Terminal
myTerminal = "urxvt"
-- Define modMask
modMask' :: KeyMask
modMask' = mod4Mask
-- Define workspaces
myWorkspaces = ["1:www","2:dev","3:vbox","4:main","5:void","6:chat"]
-- Dzen config
myStatusBarLeft = "dzen2 -x '0' -y '0' -h '16' -w '960' -ta 'l' -fg '#cccccc' -bg '#111111' -fn 'ubuntu:size=9'"
myStatusBarRight = "conky -c /home/bmartin/.xmonad/conky_bottom_dzen | dzen2 -x '960' -y '0' -w '960' -h '16' -ta 'r' -bg '#111111' -fg '#cccccc' -fn 'ubuntu:size=9'"
myBitmapsDir = "/home/bmartin/.xmonad/dzen"
--}}}
-- Main {{{
main = do
dzenTopBar <- spawnPipe myStatusBarLeft
dzenBtmBar <- spawnPipe myStatusBarRight
spawn "sh /home/bmartin/.xmonad/autostart.sh"
xmonad $ withUrgencyHook NoUrgencyHook $ defaultConfig
{ terminal = myTerminal
, workspaces = myWorkspaces
, keys = keys'
, modMask = modMask'
, startupHook = ewmhDesktopsStartup >> setWMName "LG3D"
, layoutHook = layoutHook'
, manageHook = manageHook'
, logHook = myLogHook dzenTopBar >> fadeInactiveLogHook 0xdddddddd >> setWMName "LG3D"
, normalBorderColor = "#444444"
, focusedBorderColor = "#bf7b26"
}
--}}}
-- Hooks {{{
-- ManageHook {{{
manageHook' :: ManageHook
manageHook' = (composeAll . concat $
[ [resource =? r --> doIgnore | r <- myIgnores] -- ignore desktop
, [resource =? r --> doShift "2:dev" | r <- myDevs ] -- move devs to devs
, [className =? c --> doShift "1:www" | c <- myWebs ] -- move webs to webs
, [className =? c --> doShift "6:chat" | c <- myChats ] -- move chats to chats
, [className =? c --> doCenterFloat | c <- myFloats ] -- float my floats
, [name =? n --> doCenterFloat | n <- myNames ] -- float my names
, [isFullscreen --> myDoFullFloat ]
])
where
role = stringProperty "WM_WINDOW_ROLE"
name = stringProperty "WM_NAME"
-- classnames
myFloats = ["MPlayer","Zenity","VirtualBox","Xmessage","Save As...","XFontSel","Downloads","Nm-connection-editor","Pidgin"]
myWebs = ["Google-chrome","Chromium"]
myDevs = ["Redcar","gvim","tmuxdev"]
myChats = ["Pidgin"]
-- resources
myIgnores = ["desktop","desktop_window","notify-osd","stalonetray","trayer","dzen2"]
-- names
myNames = ["bashrun","Google Chrome Options","Chromium Options"]
-- a trick for fullscreen but stil allow focusing of other WSs
myDoFullFloat :: ManageHook
myDoFullFloat = doF W.focusDown <+> doFullFloat
-- }}}
layoutHook' = customLayout
-- Bar
myLogHook :: Handle -> X ()
myLogHook h = dynamicLogWithPP $ defaultPP
{
ppCurrent = dzenColor "#cccccc" "#111111" . pad
, ppVisible = dzenColor "#bf7b26" "#111111" . pad
, ppHidden = dzenColor "#bf7b26" "#111111" . pad
, ppHiddenNoWindows = dzenColor "#444444" "#111111" . pad
, ppUrgent = dzenColor "#ff0000" "#111111" . pad . dzenStrip
, ppWsSep = " "
, ppSep = " | "
, ppLayout = dzenColor "#bf7b26" "#111111" .
(\x -> case x of
"ResizableTall" -> "^i(" ++ myBitmapsDir ++ "/tall.xbm)"
"Mirror ResizableTall" -> "^i(" ++ myBitmapsDir ++ "/mtall.xbm)"
"Full" -> "^i(" ++ myBitmapsDir ++ "/full.xbm)"
"Simple Float" -> "~"
_ -> x
)
, ppTitle = (" " ++) . dzenColor "#cccccc" "#111111" . dzenEscape
, ppOutput = hPutStrLn h
}
-- Layout
customLayout = avoidStruts $ smartBorders tiled ||| smartBorders (Mirror tiled) ||| noBorders Full ||| smartBorders simpleFloat
where
--tiled = ResizableTall 1 (2/100) (1/2) []
tiled = ResizableTall nmaster delta ratio []
nmaster = 1
delta = 2/100
ratio = 1/2
--}}}
-- Theme {{{
-- Color names are easier to remember:
colorOrange = "#ff7701"
colorDarkGray = "#171717"
colorPink = "#e3008d"
colorGreen = "#00aa4a"
colorBlue = "#008dd5"
colorYellow = "#fee100"
colorWhite = "#cfbfad"
colorNormalBorder = "#1c2636"
colorFocusedBorder = "#ebac54"
barFont = "Meslo LG M:size=10"
barXFont = "ubuntu:size=10"
xftFont = "xft: ubuntu-10"
--}}}
-- Prompt Config {{{
mXPConfig :: XPConfig
mXPConfig =
defaultXPConfig { font = barFont
, bgColor = "#111111"
, fgColor = "#cccccc"
, bgHLight = "#bf7b26"
, fgHLight = "#111111"
, promptBorderWidth = 0
, height = 16
, historyFilter = deleteConsecutive
}
-- Run or Raise Menu
largeXPConfig :: XPConfig
largeXPConfig = mXPConfig
{ font = xftFont
, height = 16
}
-- }}}
-- Key mapping {{{
keys' :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ())
keys' conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
[ ((mod1Mask, xK_x ), runOrRaisePrompt largeXPConfig)
, ((mod1Mask, xK_F2 ), spawn "gmrun")
, ((0, xK_Print ), spawn "screenshot scr")
-- Programs
, ((mod1Mask, xK_t ), spawn $ XMonad.terminal conf) -- spawn terminal
, ((mod1Mask, xK_d ), spawn "urxvt -name tmuxdev -e tmux new -s dev vim")
, ((mod1Mask .|. shiftMask, xK_d ), spawn "urxvt -name tmuxdev")
, ((mod1Mask, xK_c ), spawn "urxvt -name tmuxchat -e tmux new -s chat weechat-curses")
, ((mod1Mask .|. shiftMask, xK_c ), spawn "urxvt -name tmuxchat")
, ((mod1Mask, xK_w ), spawn "chromium")
, ((mod1Mask .|. shiftMask, xK_w ), spawn "firefox")
, ((mod1Mask, xK_r ), spawn "redcar")
, ((mod1Mask, xK_e ), spawn "thunderbird")
, ((mod1Mask, xK_v ), spawn "VirtualBox")
, ((mod1Mask, xK_g ), spawn "gvim")
, ((mod1Mask, xK_f ), spawn "thunar")
, ((mod1Mask, xK_p ), spawn "pidgin")
, ((mod1Mask, xK_b ), spawn "dbus-launch brasero")
--, ((mod1Mask, xK_q ), spawn "shutdown-dialog.py ")
-- Media Keys
, ((0, 0x1008ff12 ), spawn "/home/bmartin/.bin/changevol -t") -- XF86AudioMute
, ((0, 0x1008ff11 ), spawn "/home/bmartin/.bin/changevol -d 5") -- XF86AudioLowerVolume
, ((0, 0x1008ff13 ), spawn "/home/bmartin/.bin/changevol -i 5") -- XF86AudioRaiseVolume
-- layouts
, ((modMask, xK_space ), sendMessage NextLayout) -- Rotate through the available layout algorithms)
, ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf) -- reset layout on current desktop to default
, ((modMask, xK_b ), sendMessage ToggleStruts) -- Toggle the status bar gap. Use this binding with avoidStruts from Hooks.ManageDocks. See also the statusBar function from Hooks.DynamicLog.
, ((modMask, xK_n ), refresh) -- Resize viewed windows to the correct size)
, ((modMask, xK_Tab ), windows W.focusDown) -- Move focus to the next window
, ((modMask, xK_j ), windows W.focusDown) -- Move focus to the next window
, ((modMask, xK_k ), windows W.focusUp ) -- Move focus to the previous window
, ((modMask, xK_m ), windows W.focusMaster ) -- Move focus to the master window
, ((modMask, xK_Return ), windows W.swapMaster) -- Swap the focused window and the master window
, ((modMask .|. shiftMask, xK_j ), windows W.swapDown ) -- Swap the focused window with the next window
, ((modMask .|. shiftMask, xK_k ), windows W.swapUp ) -- Swap the focused window with the previous window
, ((modMask, xK_h ), sendMessage Shrink) -- Shrink the master area
, ((modMask, xK_l ), sendMessage Expand) -- Expand the master area
, ((modMask, xK_t ), withFocused $ windows . W.sink) -- Push window back into tiling
, ((modMask, xK_comma ), sendMessage (IncMasterN 1)) -- Increment the number of windows in the master area
, ((modMask, xK_period ), sendMessage (IncMasterN (-1))) -- Deincrement the number of windows in the master area
, ((modMask .|. shiftMask, xK_c ), kill) -- kill selected window
-- workspaces
, ((mod1Mask .|. controlMask, xK_Right ), nextWS)
, ((mod1Mask .|. shiftMask, xK_Right ), shiftToNext)
, ((mod1Mask .|. controlMask, xK_Left ), prevWS)
, ((mod1Mask .|. shiftMask, xK_Left ), shiftToPrev)
-- quit, or restart
, ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
, ((modMask , xK_q ), restart "xmonad" True)
, ((modMask .|. shiftMask, xK_r ), spawn "killall conky dzen2 && xmonad --recompile && xmonad --restart")
]
++
-- mod-[1..9] %! Switch to workspace N
-- mod-shift-[1..9] %! Move client to workspace N
[((m .|. modMask, k), windows $ f i)
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
--}}}
any help would be appreciated.
Last edited by zmbmartin (2010-12-17 17:19:22)
Offline
That's one hell of a battery you've got there, charged to 139%
Here's mine:
Last edited by w1ntermute (2010-12-23 23:53:55)
Offline
Haha yeah, that's because I calculate it with the "last full capacity" parameter from the battery info file. ^^
Too lazy to put in an if charged clause!
Last edited by Aeva (2010-12-27 21:03:45)
Offline
Offline
My XMonad + Gnome
Scrot fails epic with mplayer it seems, or this is some RIAA feature
-- mod edit: read the rules and only post thumbnails https://bbs.archlinux.org/viewtopic.php?id=61754 [jwr] --
Last edited by jelly (2011-01-17 19:45:24)
Offline
Sorry for the late response.
Tray bar (on the right of top bar):
#!/bin/zsh
# ~/.xmonad/traybarscript.zsh
## Variables ##
# Battery
BAT_CHARGE="charging"
BAT_CHARGED="charged"
BAT_LOW=25
BAT_INFO='/proc/acpi/battery/BAT0/info'
BAT_STATE='/proc/acpi/battery/BAT0/state'
# Date & Time
DATE_FORMAT='%a, %d/%m/%Y'
TIME_FORMAT='%R'
# Icons
#BAT_ICON='^i(/home/lilith/.dzen/dzen_bitmaps/battery.xbm)'
PAC_ICON='^i(/home/lilith/.dzen/xbm8x8/pacman.xbm)'
# Intervals
BATIVAL=15
INTERVAL=1
IVAL=1
PACIVAL=180
# Counters
BATCOUNTER=$BATIVAL
DATECOUNTER=$IVAL
PACCOUNTER=$PACIVAL
TIMECOUNTER=$IVAL
# Text
SEP="|"
PACTXT="Pacman Updates: "
## Functions ##
fbat()
{
BAT_FULL=`cat $BAT_INFO|grep last|line|cut -d " " -f 9`;
BAT_CAP=`cat $BAT_STATE|grep remaining|cut -d " " -f 8`;
BAT_CUR=`expr $BAT_CAP \* 100`;
BAT_PERC=`expr $BAT_CUR / $BAT_FULL`;
print "$BAT_PERC"
}
fdate() { date +$DATE_FORMAT }
fpacman() { pacman -Qu | wc -l }
ftime() { date +$TIME_FORMAT }
while true; do
if [ $BATCOUNTER -ge $BATIVAL ]; then
BAT_AC=`cat $BAT_STATE |grep "charging state"|cut -d " " -f 12`
if [ "$BAT_AC" = "$BAT_CHARGE" -o "$BAT_AC" = "$BAT_CHARGED" ]; then
BAT_ICON='^i(/home/lilith/.dzen/xbm8x8/ac.xbm)'
else
BAT_ICON='^i(/home/lilith/.dzen/dzen_bitmaps/battery.xbm)'
fi
TBBAT=$(fbat)
BATCOUNTER=0
fi
if [ $DATECOUNTER -ge $IVAL ]; then
TBDATE=$(fdate)
DATECOUNTER=0
fi
if [ $PACCOUNTER -ge $PACIVAL ]; then
TBPAC=$(fpacman)
PACCOUNTER=0
fi
if [ $TIMECOUNTER -ge $IVAL ]; then
TBTIME=$(ftime)
TIMECOUNTER=0
fi
print " $SEP $PAC_ICON $TBPAC $SEP $BAT_ICON $TBBAT% $SEP $TBDATE $SEP $TBTIME "
DATECOUNTER=$((DATECOUNTER+1))
BATCOUNTER=$((BATCOUNTER+1))
PACCOUNTER=$((PACCOUNTER+1))
TIMECOUNTER=$((TIMECOUNTER+1))
sleep $INTERVAL
done
Bottom bar:
# Fork to background?
background yes
# Send to console
out_to_console yes
out_to_x no
# Update every second
update_interval 1
# Double buffering, avoids flashing
double_buffer yes
# Output color
default_color white
#own_window yes
#own_window_transparent yes
#own_window_type override
TEXT
${color white}^fg(\#ffffff) ^i(/home/lilith/.dzen/xbm8x8/cpu.xbm) ${cpu}% @ ${freq 1}MHz ^i(/home/lilith/.dzen/xbm8x8/mem.xbm) ${mem}/${memmax} ^i(/home/lilith/.dzen/xbm8x8/diskette.xbm) root:${fs_used /}/${fs_size /} home:${fs_used /home}/${fs_size /home} ^i(/home/lilith/.dzen/xbm8x8/wifi_01.xbm) ${wireless_essid wlan0} @ ~${wireless_link_qual_perc wlan0}% ^i(/home/lilith/.dzen/dzen_bitmaps/arr_down.xbm) ${downspeed wlan0}/s ^i(/home/lilith/.dzen/dzen_bitmaps/arr_up.xbm) ${upspeed wlan0}/s ${if_mpd_playing}^i(/home/lilith/.dzen/xbm8x8/note.xbm) $mpd_smart${endif}
Edit: the bottom conky script is a bit different now, with upload/download and disk space added.
Last edited by Aeva (2011-01-25 03:56:17)
Offline
...a lot of stuff...
Thx a lot for sharing your desktop and your configuration files! I took the liberty of using it more or less as it was.
However, here is my screenshot and my configs.
xmonad.hs (make sure to check all paths if you are using it)
-- ~/.xmonad/xmonad.hs
-- Imports {{{
import XMonad
-- Prompt
import XMonad.Prompt
import XMonad.Prompt.RunOrRaise (runOrRaisePrompt)
import XMonad.Prompt.AppendFile (appendFilePrompt)
-- Hooks
import XMonad.Operations
import System.IO
import System.Exit
import XMonad.Util.Run
import XMonad.Actions.CycleWS
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.SetWMName
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.FadeInactive
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.SetWMName
import XMonad.Layout.NoBorders (smartBorders, noBorders)
import XMonad.Layout.PerWorkspace (onWorkspace)
import XMonad.Layout.Reflect (reflectHoriz)
import XMonad.Layout.IM
import XMonad.Layout.SimpleFloat
import XMonad.Layout.Spacing
import XMonad.Layout.ResizableTile
import XMonad.Layout.NoBorders
import XMonad.Layout.Gaps
import XMonad.Layout.Accordion
import qualified XMonad.StackSet as W
import qualified Data.Map as M
--}}}
-- Config {{{
-- Define Terminal
myTerminal = "urxvt"
-- Define modMask
modMask' :: KeyMask
modMask' = mod1Mask
-- Define workspaces
myWorkspaces = ["1:main","2:web","3:movie","4:music","5:div","6:wine"]
-- Dzen config
myStatusBar = "dzen2 -x '0' -y '0' -h '24' -w '1920' -ta 'l' -fg '#FFFFFF' -bg '#161616' -fn '-*-bitstream vera sans-medium-r-normal-*-11-*-*-*-*-*-*-*'"
myBtmStatusBar = "conky -c /home/johan/.conky_bottom_dzen | dzen2 -x '0' -w '1920' -h '24' -ta 'c' -bg '#161616' -fg '#FFFFFF' -fn '-*-bitstream vera sans-medium-r-normal-*-11-*-*-*-*-*-*-*' -y '1176'"
myBitmapsDir = "/home/johan/.xmonad/dzen"
--}}}
-- Main {{{
main = do
dzenTopBar <- spawnPipe myStatusBar
dzenBtmBar <- spawnPipe myBtmStatusBar
spawn "sh /home/johan/.xmonad/autostart.sh"
xmonad $ defaultConfig
{ terminal = myTerminal
, workspaces = myWorkspaces
, keys = keys'
, modMask = modMask'
, startupHook = ewmhDesktopsStartup >> setWMName "LG3D"
, layoutHook = layoutHook'
, manageHook = manageHook'
, logHook = myLogHook dzenTopBar >> fadeInactiveLogHook 0xdddddddd >> setWMName "LG3D"
, normalBorderColor = colorNormalBorder
, focusedBorderColor = colorFocusedBorder
}
--}}}
-- Hooks {{{
-- ManageHook {{{
manageHook' :: ManageHook
manageHook' = (composeAll . concat $
[ [resource =? r --> doIgnore | r <- myIgnores] -- ignore desktop
, [className =? c --> doShift "2:web" | c <- myWebs ] -- move webs to main
, [className =? c --> doShift "1:main" | c <- myDev ] -- move dev to main
, [className =? c --> doShift "3:movie" | c <- myMovie ] -- move movie to movie
, [className =? c --> doShift "4:music" | c <- myMusic ] -- move music to music
, [className =? c --> doShift "5:div" | c <- myWork ] -- move img to div
, [className =? c --> doF(W.shift "6:wine") | c <- myWines ] -- move wines to wine
, [className =? c --> doCenterFloat | c <- myFloats ] -- float my floats
, [name =? n --> doCenterFloat | n <- myNames ] -- float my names
, [isFullscreen --> myDoFullFloat ]
])
where
role = stringProperty "WM_WINDOW_ROLE"
name = stringProperty "WM_NAME"
-- classnames
myFloats = ["MPlayer","VirtualBox","Xmessage","Save As...","XFontSel","Downloads","Nm-connection-editor"]
myWebs = ["Navigator","Shiretoko","Firefox","Uzbl","uzbl","Uzbl-core","uzbl-core","Google-chrome","Chromium","Shredder","Mail"]
myMovie = ["Boxee"]
myMusic = ["Rhythmbox","Tomahawk"]
myWines = ["Wine"]
myWork = ["Gimp","libreoffice"]
myDev = ["urxvt"]
-- resources
myIgnores = ["desktop","desktop_window","notify-osd","stalonetray","trayer"]
-- names
myNames = ["bashrun","Google Chrome Options","Chromium Options"]
-- a trick for fullscreen but stil allow focusing of other WSs
myDoFullFloat :: ManageHook
myDoFullFloat = doF W.focusDown <+> doFullFloat
-- }}}
layoutHook' = customLayout
-- Bar
myLogHook :: Handle -> X ()
myLogHook h = dynamicLogWithPP $ defaultPP
{
ppCurrent = dzenColor "#ebac54" "#161616" . pad
, ppVisible = dzenColor "white" "#161616" . pad
, ppHidden = dzenColor "white" "#161616" . pad
, ppHiddenNoWindows = dzenColor "#444444" "#161616" . pad
, ppUrgent = dzenColor "red" "#161616" . pad
, ppWsSep = " "
, ppSep = " | "
, ppLayout = dzenColor "#ebac54" "#161616" .
(\x -> case x of
"ResizableTall" -> "^i(" ++ myBitmapsDir ++ "/tall.xbm)"
"Mirror ResizableTall" -> "^i(" ++ myBitmapsDir ++ "/mtall.xbm)"
"Full" -> "^i(" ++ myBitmapsDir ++ "/full.xbm)"
"Simple Float" -> "~"
_ -> x
)
, ppTitle = (" " ++) . dzenColor "white" "#161616" . dzenEscape
, ppOutput = hPutStrLn h
}
-- Layout
customLayout = gaps [(D,16)] $ avoidStruts $ smartBorders tiled ||| smartBorders (Mirror tiled) ||| noBorders Full ||| smartBorders simpleFloat
where
--tiled = ResizableTall 1 (2/100) (1/2) []
tiled = ResizableTall nmaster delta ratio []
nmaster = 1
delta = 2/100
ratio = 1/2
--}}}
-- Theme {{{
-- Color names are easier to remember:
colorOrange = "#ff7701"
colorDarkGray = "#171717"
colorPink = "#e3008d"
colorGreen = "#00aa4a"
colorBlue = "#008dd5"
colorYellow = "#fee100"
colorWhite = "#cfbfad"
colorNormalBorder = "#1c2636"
colorFocusedBorder = "#ebac54"
barFont = "terminus"
barXFont = "inconsolata:size=14"
xftFont = "xft: inconsolata-14"
--}}}
-- Prompt Config {{{
mXPConfig :: XPConfig
mXPConfig =
defaultXPConfig { font = barFont
, bgColor = colorDarkGray
, fgColor = colorGreen
, bgHLight = colorGreen
, fgHLight = colorDarkGray
, promptBorderWidth = 0
, height = 14
, historyFilter = deleteConsecutive
}
-- Run or Raise Menu
largeXPConfig :: XPConfig
largeXPConfig = mXPConfig
{ font = xftFont
, height = 20
}
-- }}}
-- Key mapping {{{
keys' :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ())
keys' conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
[ ((modMask, xK_p ), runOrRaisePrompt largeXPConfig)
, ((mod1Mask, xK_F2 ), spawn "gmrun")
, ((0, xK_Print ), spawn "screenshot scr")
-- Programs
, ((modMask, xK_r ), spawn $ XMonad.terminal conf) -- spawn terminal
, ((modMask, xK_w ), spawn "chromium")
, ((modMask .|. shiftMask, xK_p ), spawn "gimp")
, ((modMask .|. shiftMask, xK_n ), spawn "rhythmbox")
, ((modMask .|. shiftMask, xK_m ), spawn "tomahawk")
, ((modMask .|. shiftMask, xK_i ), spawn "gthumb")
, ((modMask, xK_e ), spawn "pcmanfm")
, ((modMask .|. shiftMask, xK_b ), spawn "/opt/boxee/Boxee")
-- Media Keys
, ((0, 0x1008ff12 ), spawn "amixer -q sset Master toggle") -- XF86AudioMute
, ((0, 0x1008ff11 ), spawn "amixer -q sset Master 655- unmute") -- XF86AudioLowerVolume
, ((0, 0x1008ff13 ), spawn "amixer -q sset Master 655+ unmute") -- XF86AudioRaiseVolume
-- layouts
, ((modMask, xK_space ), sendMessage NextLayout)
, ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf) -- reset layout on current desktop to default
, ((modMask, xK_b ), sendMessage ToggleStruts)
, ((mod1Mask, xK_Tab ), windows W.focusDown) -- move focus to next window
, ((modMask, xK_q ), kill) -- kill selected window
, ((modMask .|. shiftMask, xK_j ), windows W.swapDown) -- swap the focused window with the next window
, ((modMask .|. shiftMask, xK_k ), windows W.swapUp) -- swap the focused window with the previous window
, ((modMask .|. shiftMask, xK_t ), withFocused $ windows . W.sink) -- Push window back into tiling
-- workspaces
, ((mod1Mask .|. controlMask, xK_Right ), nextWS)
, ((mod1Mask .|. shiftMask, xK_Right ), shiftToNext)
, ((mod1Mask .|. controlMask, xK_Left ), prevWS)
, ((mod1Mask .|. shiftMask, xK_Left ), shiftToPrev)
-- quit, or restart
, ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
, ((modMask .|. shiftMask, xK_r ), spawn "killall conky dzen2 && xmonad --recompile && xmonad --restart")
]
++
-- mod-[1..9] %! Switch to workspace N
-- mod-shift-[1..9] %! Move client to workspace N
[((m .|. modMask, k), windows $ f i)
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
--}}}
-- vim:foldmethod=marker sw=4 sts=4 ts=4 tw=0 et ai nowrap
.conky_bottom_dzen (observe, the TEXT part must be in one single long line)
# ~/.conky_bottom_dzen
# Set to yes if you want Conky to be forked in the background
background yes
out_to_console yes
# Update interval in seconds
update_interval 1
TEXT
^fg(\#ebac54) ^i(/home/johan/.xmonad/dzen/arch_10x10.xbm) ^fg(\#FFFFFF)Linux $kernel ^fg(\#ebac54) ^i(/home/johan/.xmonad/dzen/pacman.xbm) ^fg(\#FFFFFF)up-to-date ^fg(\#ebac54) ^i(/home/johani/.xmonad/dzen/cpu.xbm) CPU ^fg(\#FFFFFF)${cpu}% ^fg(\#ebac54) ${if_existing /proc/net/route eth1} ^i(/home/johan/.xmonad/dzen/net_wired.xbm) ^fg(\#00aa4a) ^i(/home/johan/.xmonad/dzen/net_down_03.xbm)${downspeed eth1} ^fg(\#ff3333) ^i(/home/johan/.xmonad/dzen/net_up_03.xbm)${upspeed eth1} ^fg(\#ebac54) ^i(/home/johan/.xmonad/dzen/volume.xbm) ^fg(\#FFFFFF)Volume: ^fg(\#324c80)${exec amixer get Master | egrep -o "[0-9]+%" | head -1 | egrep -o "[0-9]*"}% ^fg(\#ebac54) ^i(/home/johan/.xmonad/dzen/clock.xbm) ^fg(\#FFFF)${time %A %d %B} ^fg(\#ebac54) ${time %R}
.xinitrc
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
setxkbmap -option terminate:ctrl_alt_bksp
xsetroot -cursor_name left_ptr
nitrogen --restore &
pulseaudio --kill && pulseaudio --start &
xmonad
.Xdefaults
Xcursor.theme: pCircle-24
URxvt.buffered: true
URxvt.geometry: 105x28
#URxvt.background: rgba:0000/0000/0000/bbbb
URxvt*background: [90]#000000
URxvt.foreground: White
URxvt.cursorColor: White
URxvt.underlineColor: White
URxvt.font: xft:Terminus:pixelsize=14:antialias:true
URxvt.boldFont: xft:Terminus:bold:pixelsize=14:antialias:true
URxvt.transparent: true
URxvt.scrollBar: false
URxvt.tintColor: White
URxvt.shading: 40
URxvt.depth: 32
!black
*color0: rgb:4f/4f/4f
*color8: rgb:25/25/25
!!red
*color1: rgb:85/0d/0d
*color9: rgb:98/2b/2b
!!green
*color2: rgb:88/be/32
*color10: rgb:af/f7/3e
!!yellow (orange)
*color3: rgb:ff/7e/00
*color11: rgb:fa/d4/3d
!!blue
*color4: rgb:32/4c/80
*color12: rgb:2b/4f/98
!!magenta
*color5: rgb:70/6c/9a
*color13: rgb:82/6a/b1
!!cyan
*color6: rgb:92/b1/9e
*color14: rgb:a1/cd/cd
!!white
Last edited by kveras (2011-03-27 13:09:01)
Offline
Xmonad, dzen2, conky, stalonetray.
I have made many improvements to my config this month. With IM layout for my chat workspace and a nice gimp layout.
xmonad.hs
-- ~/.xmonad/xmonad.hs
-- Imports {{{
import XMonad
-- Prompt
import XMonad.Prompt
import XMonad.Prompt.RunOrRaise (runOrRaisePrompt)
import XMonad.Prompt.AppendFile (appendFilePrompt)
-- Hooks
import XMonad.Operations
import System.IO
import System.Exit
import XMonad.Util.Run
import XMonad.Actions.CycleWS
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.SetWMName
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.FadeInactive
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.SetWMName
import XMonad.Layout.NoBorders (smartBorders, noBorders)
import XMonad.Layout.PerWorkspace (onWorkspace, onWorkspaces)
import XMonad.Layout.Reflect (reflectHoriz)
import XMonad.Layout.IM
import XMonad.Layout.SimpleFloat
import XMonad.Layout.Spacing
import XMonad.Layout.ResizableTile
import XMonad.Layout.NoBorders
import XMonad.Layout.Gaps
import XMonad.Layout.LayoutHints
import XMonad.Layout.LayoutModifier
import XMonad.Layout.Reflect
import XMonad.Layout.Grid
import Data.Ratio ((%))
import qualified XMonad.StackSet as W
import qualified Data.Map as M
--}}}
-- Config {{{
-- Define Terminal
myTerminal = "urxvt"
-- Define modMask
modMask' :: KeyMask
modMask' = mod1Mask
-- Define workspaces
myWorkspaces = ["1:main","2:web","3:movie","4:music","5:gimp","6:chat"]
-- Dzen config
myStatusBar = "dzen2 -x '0' -y '0' -h '24' -w '1920' -ta 'l' -fg '#FFFFFF' -bg '#161616' -fn '-*-bitstream vera sans-medium-r-normal-*-11-*-*-*-*-*-*-*'"
myBtmStatusBar = "conky -c /home/johan/.conky_bottom_dzen | dzen2 -x '0' -w '1920' -h '24' -ta 'c' -bg '#161616' -fg '#FFFFFF' -fn '-*-bitstream vera sans-medium-r-normal-*-11-*-*-*-*-*-*-*' -y '1176'"
myBitmapsDir = "/home/johan/.xmonad/dzen"
--}}}
-- Main {{{
main = do
dzenTopBar <- spawnPipe myStatusBar
dzenBtmBar <- spawnPipe myBtmStatusBar
spawn "sh /home/johan/.xmonad/autostart.sh"
xmonad $ defaultConfig
{ terminal = myTerminal
, workspaces = myWorkspaces
, keys = keys'
, modMask = modMask'
, startupHook = ewmhDesktopsStartup >> setWMName "LG3D"
, layoutHook = layoutHook'
, manageHook = manageHook'
, logHook = myLogHook dzenTopBar >> fadeInactiveLogHook 0xdddddddd >> setWMName "LG3D"
, normalBorderColor = colorNormalBorder
, focusedBorderColor = colorFocusedBorder
}
--}}}
-- Hooks {{{
-- ManageHook {{{
manageHook' :: ManageHook
manageHook' = (composeAll . concat $
[ [resource =? r --> doIgnore | r <- myIgnores] -- ignore desktop
, [className =? c --> doShift "2:web" | c <- myWebs ] -- move webs to main
, [className =? c --> doShift "1:main" | c <- myDev ] -- move dev to main
, [className =? c --> doShift "3:movie" | c <- myMovie ] -- move movie to movie
, [className =? c --> doShift "4:music" | c <- myMusic ] -- move music to music
, [className =? c --> doShift "5:gimp" | c <- myWork ] -- move img to div
, [className =? c --> doShift "6:chat" | c <- myChat ] -- move chat to chat
, [className =? c --> doCenterFloat | c <- myFloats ] -- float my floats
, [name =? n --> doCenterFloat | n <- myNames ] -- float my names
, [isFullscreen --> myDoFullFloat ]
])
where
role = stringProperty "WM_WINDOW_ROLE"
name = stringProperty "WM_NAME"
-- classnames
myFloats = ["Smplayer","MPlayer","VirtualBox","Xmessage","Save As...","XFontSel","Downloads","Nm-connection-editor"]
myWebs = ["Navigator","Shiretoko","Firefox","Uzbl","uzbl","Uzbl-core","uzbl-core","Google-chrome","Chromium","Shredder","Mail"]
myMovie = ["Boxee"]
myMusic = ["Rhythmbox","Tomahawk","Banshee","Banshee Media Player","banshee-1","Exaile","Spotify"]
myChat = ["Pidgin","Buddy List"]
myWork = ["Gimp"]
myDev = ["urxvt"]
-- resources
myIgnores = ["desktop","desktop_window","notify-osd","stalonetray","trayer"]
-- names
myNames = ["bashrun","Google Chrome Options","Chromium Options"]
-- a trick for fullscreen but stil allow focusing of other WSs
myDoFullFloat :: ManageHook
myDoFullFloat = doF W.focusDown <+> doFullFloat
-- }}}
-- layoutHook' = customLayout
layoutHook' = onWorkspaces ["1:main","4:music"] customLayout $ onWorkspaces ["5:gimp"] gimpLayout $ onWorkspaces ["6:chat"] imLayout $
customLayout2
-- Bar
myLogHook :: Handle -> X ()
myLogHook h = dynamicLogWithPP $ defaultPP
{
ppCurrent = dzenColor "#ebac54" "#161616" . pad
, ppVisible = dzenColor "white" "#161616" . pad
, ppHidden = dzenColor "white" "#161616" . pad
, ppHiddenNoWindows = dzenColor "#444444" "#161616" . pad
, ppUrgent = dzenColor "red" "#161616" . pad
, ppWsSep = " "
, ppSep = " | "
, ppLayout = dzenColor "#ebac54" "#161616" .
(\x -> case x of
"ResizableTall" -> "^i(" ++ myBitmapsDir ++ "/tall.xbm)"
"Mirror ResizableTall" -> "^i(" ++ myBitmapsDir ++ "/mtall.xbm)"
"Full" -> "^i(" ++ myBitmapsDir ++ "/full.xbm)"
"Simple Float" -> "~"
_ -> x
)
, ppTitle = (" " ++) . dzenColor "white" "#161616" . dzenEscape
, ppOutput = hPutStrLn h
}
-- Layout
customLayout = gaps [(D,16)] $ avoidStruts $ smartBorders tiled ||| smartBorders (Mirror tiled) ||| noBorders Full ||| smartBorders simpleFloat
where
--tiled = ResizableTall 1 (2/100) (1/2) []
tiled = spacing pxl $ ResizableTall 1 (2/100) (1/2) []
-- nmaster = 1
-- delta = 2/100
-- ratio = 1/2
pxl = 5
customLayout2 = avoidStruts $ noBorders Full ||| smartBorders tiled ||| smartBorders (Mirror tiled) ||| smartBorders simpleFloat
where
--tiled = ResizableTall 1 (2/100) (1/2) []
tiled = spacing pxl $ ResizableTall nmaster delta ratio []
nmaster = 1
delta = 2/100
ratio = 1/2
pxl = 5
gimpLayout = gaps [(D,16)] $ avoidStruts $ withIM (0.11) (Role "gimp-toolbox") $
reflectHoriz $
withIM (0.15) (Role "gimp-dock") Full
imLayout = gaps [(D,16)] $ avoidStruts $ withIM (1%5) (And (ClassName "Pidgin") (Role "buddy_list")) Grid
-- where
-- tiled = spacing pxl $ ResizableTall 1 (2/100) (1/2) []
-- nmaster = 1
-- delta = 2/100
-- ratio = 1/2
-- pxl = 5
--}}}
-- Theme {{{
-- Color names are easier to remember:
colorOrange = "#ff7701"
colorDarkGray = "#171717"
colorPink = "#e3008d"
colorGreen = "#00aa4a"
colorBlue = "#008dd5"
colorYellow = "#fee100"
colorWhite = "#cfbfad"
colorNormalBorder = "#1c2636"
colorFocusedBorder = "#ebac54"
barFont = "terminus"
barXFont = "inconsolata:size=14"
xftFont = "xft: inconsolata-14"
--}}}
-- Prompt Config {{{
mXPConfig :: XPConfig
mXPConfig =
defaultXPConfig { font = barFont
, bgColor = colorDarkGray
, fgColor = colorGreen
, bgHLight = colorGreen
, fgHLight = colorDarkGray
, promptBorderWidth = 0
, height = 14
, historyFilter = deleteConsecutive
}
-- Run or Raise Menu
largeXPConfig :: XPConfig
largeXPConfig = mXPConfig
{ font = xftFont
, height = 20
}
-- }}}
-- Key mapping {{{
keys' :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ())
keys' conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
[ ((modMask, xK_p ), runOrRaisePrompt largeXPConfig)
, ((mod1Mask, xK_F2 ), spawn "gmrun")
, ((0, xK_Print ), spawn "screenshot scr")
-- Programs
, ((modMask, xK_r ), spawn $ XMonad.terminal conf) -- spawn terminal
, ((modMask, xK_w ), spawn "chromium")
, ((modMask .|. shiftMask, xK_p ), spawn "gimp")
, ((modMask .|. shiftMask, xK_n ), spawn "spotify")
, ((modMask .|. shiftMask, xK_m ), spawn "exaile")
, ((modMask .|. shiftMask, xK_i ), spawn "gthumb")
, ((modMask, xK_e ), spawn "nautilus --no-desktop --browser")
, ((modMask .|. shiftMask, xK_b ), spawn "/opt/boxee/Boxee")
-- Media Keys
, ((0, 0x1008ff12 ), spawn "amixer -q sset Master toggle") -- XF86AudioMute
, ((0, 0x1008ff11 ), spawn "amixer -q sset Master 655- unmute") -- XF86AudioLowerVolume
, ((0, 0x1008ff13 ), spawn "amixer -q sset Master 655+ unmute") -- XF86AudioRaiseVolume
-- layouts
, ((modMask, xK_space ), sendMessage NextLayout)
, ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf) -- reset layout on current desktop to default
, ((modMask, xK_b ), sendMessage ToggleStruts)
, ((mod1Mask, xK_Tab ), windows W.focusDown) -- move focus to next window
, ((modMask, xK_q ), kill) -- kill selected window
, ((modMask .|. shiftMask, xK_j ), windows W.swapDown) -- swap the focused window with the next window
, ((modMask .|. shiftMask, xK_k ), windows W.swapUp) -- swap the focused window with the previous window
, ((modMask .|. shiftMask, xK_t ), withFocused $ windows . W.sink) -- Push window back into tiling
, ((modMask, xK_u ), sendMessage Shrink) -- %! Shrink a master area
, ((modMask, xK_i ), sendMessage Expand) -- %! Expand a master area
, ((modMask, xK_j ), sendMessage MirrorShrink) -- %! Shrink a slave area
, ((modMask, xK_k ), sendMessage MirrorExpand) -- %! Expand a slave area
-- workspaces
, ((mod1Mask .|. controlMask, xK_Right ), nextWS)
, ((mod1Mask .|. shiftMask, xK_Right ), shiftToNext)
, ((mod1Mask .|. controlMask, xK_Left ), prevWS)
, ((mod1Mask .|. shiftMask, xK_Left ), shiftToPrev)
-- quit, or restart
, ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
, ((modMask .|. shiftMask, xK_r ), spawn "killall conky dzen2 && xmonad --recompile && xmonad --restart")
]
++
-- mod-[1..9] %! Switch to workspace N
-- mod-shift-[1..9] %! Move client to workspace N
[((m .|. modMask, k), windows $ f i)
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
--}}}
-- vim:foldmethod=marker sw=4 sts=4 ts=4 tw=0 et ai nowrap
.Xdefaults
Xcursor.theme: pCircle-24
URxvt.buffered: true
URxvt.geometry: 105x28
#URxvt.background: rgba:0000/0000/0000/bbbb
URxvt*background: [90]#000000
URxvt.foreground: White
URxvt.cursorColor: White
URxvt.underlineColor: White
URxvt.font: xft:Terminus:pixelsize=14:antialias:true
URxvt.boldFont: xft:Terminus:bold:pixelsize=14:antialias:true
URxvt.transparent: true
URxvt.scrollBar: false
URxvt.tintColor: White
URxvt.shading: 25
URxvt.depth: 32
!black
*color0: rgb:4f/4f/4f
*color8: rgb:67/67/67
!!red
*color1: rgb:85/0d/0d
*color9: rgb:98/2b/2b
!!green
*color2: rgb:88/be/32
*color10: rgb:af/f7/3e
!!yellow (orange)
*color3: rgb:ff/7e/00
*color11: rgb:fa/d4/3d
!!blue
*color4: rgb:4d/6e/b0
*color12: rgb:2b/4f/98
!!magenta
*color5: rgb:70/6c/9a
*color13: rgb:82/6a/b1
!!cyan
*color6: rgb:92/b1/9e
*color14: rgb:a1/cd/cd
!!white
conky (MUST be 1 long line after TEXT)
# ~/.conky_bottom_dzen
# Set to yes if you want Conky to be forked in the background
background yes
out_to_console yes
# Update interval in seconds
update_interval 1
TEXT
^fg(\#ebac54) ^i(/home/johan/.xmonad/dzen/arch_10x10.xbm) ^fg(\#FFFFFF)Linux $kernel ^fg(\#ebac54) ^i(/home/johan/.xmonad/dzen/cpu.xbm) CPU ^fg(\#FFFFFF)${cpu}% ^fg(\#ebac54) ${if_existing /proc/net/route eth1} ^i(/home/johan/.xmonad/dzen/net_wired.xbm) ^fg(\#00aa4a) ^i(/home/johan/.xmonad/dzen/net_down_03.xbm)${downspeed eth1} ^fg(\#ff3333) ^i(/home/johan/.xmonad/dzen/net_up_03.xbm)${upspeed eth1} ^fg(\#ebac54) ^i(/home/johan/.xmonad/dzen/volume.xbm) ^fg(\#FFFFFF)Volume: ^fg(\#324c80)${exec amixer get Master | egrep -o "[0-9]+%" | head -1 | egrep -o "[0-9]*"}% ^fg(\#ebac54) ^i(/home/johan/.xmonad/dzen/clock.xbm) ^fg(\#FFFFFF) ${time %A %d %B} ^fg(\#ebac54) ${time %R}
Offline
Pretty nice Kveras!
Unyttig.INFO - Your source to not so useless information
My github - Various configs, dotfiles and nifty scripts
Offline
Pretty nice Kveras!
Cheers. It's still mostly your xmonad.hs doing the job. Newer pictures and configs on my blog, but I noticed you found your way there.
Offline
Tony's xmonad screenshot by foxanthony, on Flickr
This is my xmonad. The left side is a 19" widescreen, and the right is a 10" Eee pc. On the right the apps are fullscreen and the space below them doesn't show on the monitor.
The transparent terminals are to show off the wallpaper. It's hard to find wallpaper that makes any sense in this context. I'm pretty happy with this.
My xrandr script wouldn't work in .xinitrc and thanks to serrghi for the autostart.sh.
If you look closely you'll notice the xmobar font isn't ugly. xft fonts work (e.g. xft:Georgia:Bold:pixelsize=13).
I'm not a dev. I chose xmonad so I could have lastfm running on the Eee pc while I used the bigger monitor. And, I guess I was getting bored with Openbox (a gui for keybindings? Bah.)
Xmonad is great. The tiling feature is cool, but there is so much more to it. I'm a huge control freak (that's why I run Linux, specifically Arch) and xmonad is crazy control. I love it.
.xmobarrc
Config { font = "xft:Georgia:Bold:pixelsize=13"
, bgColor = "black"
, fgColor = "grey"
, position = TopW L 90
, commands = [ Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
, Run Date "%a %b %_d %l:%M" "date" 10
, Run StdinReader
]
, sepChar = "%"
, alignSep = "}{"
, template = "%StdinReader% }{ %cpu% | <fc=#ee9a00>%date%</fc>"
}
.xmonad.hs
import XMonad
import XMonad.Layout.IndependentScreens
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import qualified XMonad.StackSet as W
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
myTerminal = "lxterminal"
-- Whether focus follows the mouse pointer.
myFocusFollowsMouse :: Bool
myFocusFollowsMouse = True
main = do
nScreens <- countScreens
xmproc <- spawnPipe "xmobar"
spawn "sh /home/tony/.xmonad/autostart.sh"
xmonad $ defaultConfig
{ manageHook = manageDocks <+> manageHook defaultConfig
, layoutHook = avoidStruts $ layoutHook defaultConfig
, logHook = dynamicLogWithPP xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "steelblue" "" . shorten 50
}
, workspaces = withScreens nScreens (workspaces defaultConfig)
, modMask = mod4Mask -- Rebind Mod to the Windows key
} `additionalKeys`
[ ((mod4Mask .|. shiftMask, xK_z), spawn "xscreensaver-command -activate")
, ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
, ((0, xK_Print), spawn "scrot")
, ((mod4Mask .|. shiftMask, xK_F12), spawn ".screenlayout/external.sh")
, ((mod4Mask .|. shiftMask, xK_F1), spawn "lastfm")
, ((mod4Mask .|. shiftMask, xK_F2), spawn "chromium-browser")
, ((mod4Mask .|. shiftMask, xK_F3), spawn "lxterminal -e packer -Syyu --noedit --noconfirm --devel")
, ((mod4Mask .|. shiftMask, xK_F4), spawn "gedit")
, ((mod4Mask .|. shiftMask, xK_F5), spawn "thunar")
, ((mod4Mask .|. shiftMask, xK_F6), spawn "gpodder")
, ((mod4Mask .|. shiftMask, xK_F7), spawn "lxterminal")
, ((mod4Mask .|. shiftMask, xK_F8), spawn "oblogout")
, ((mod4Mask .|. shiftMask, xK_F9), spawn "Ted")
, ((mod4Mask .|. shiftMask, xK_F10), spawn "emacs")
]
I think Lisp is funny, double semi-colons and unmatched parentheses crack me up.
Offline
Offline
Awesome background!
Unyttig.INFO - Your source to not so useless information
My github - Various configs, dotfiles and nifty scripts
Offline
Added another dzen statusbar and stalonetray. Its pretty much perfect for me on my netbook.
Cheers
Paul-S
Offline
import XMonad
import qualified XMonad.StackSet as W
import qualified Data.Map as M
import System.Exit
import XMonad.Util.EZConfig (additionalKeysP)
import XMonad.Actions.GridSelect
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.InsertPosition
import XMonad.Layout.NoBorders
import XMonad.Layout.ResizableTile
import XMonad.Layout.Named
main :: IO ()
main = xmonad =<< statusBar cmd pp kb conf
where
uhook = withUrgencyHookC NoUrgencyHook myUrgentConfig
cmd = "dzen2 -ta l -fn -xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso8859-15"
pp = myPP
kb = myToggleStrutsKey
conf = uhook myConfig
myUrgentConfig = UrgencyConfig { suppressWhen = Focused, remindWhen = Dont }
myPP = defaultPP { ppCurrent = dzenColor "#429942" "" . wrap "<" ">"
, ppHidden = dzenColor "#B2BEB5" ""
, ppHiddenNoWindows = dzenColor "#888888" ""
, ppUrgent = dzenColor "#FFFFAF" "" . wrap "[" "]"
, ppLayout = dzenColor "#B2BEB5" ""
, ppTitle = dzenColor "#B2BEB5" "" . shorten 80
, ppSep = dzenColor "#429942" "" " | "
}
myConfig = defaultConfig { workspaces = map show [1..4]
, modMask = mod4Mask
, normalBorderColor = "#333333"
, focusedBorderColor = "#AFAF87"
, terminal = "urxvt"
, layoutHook = myLayoutHook
, manageHook = myManageHook
} `additionalKeysP` myKeys
myManageHook = composeAll [ isFullscreen --> doFullFloat
, className =? "MPlayer" --> doFloat
, className =? "Gimp" --> doFloat
, insertPosition Below Newer
, transience'
]
myLayoutHook = tile ||| mtile ||| full
where
tall = Tall 1 (3/100) (1/2) -- nmaster delta ratio
tile = named "[]=" $ smartBorders tall
mtile = named "M[]=" $ smartBorders $ Mirror tall
full = named "[]" $ noBorders Full
myKeys = [ ("M4-p", spawn "dmenu_run")
, ("M4-g", goToSelected myGSConfig)
]
myToggleStrutsKey :: XConfig Layout -> (KeyMask, KeySym)
myToggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b)
myGSConfig = defaultGSConfig { gs_cellwidth = 160 }
#!/bin/mksh
sep='^fg(#429942)|^fg()'
dzen2='dzen2 -ta r -expand l -fn -xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso8859-15'
if whence -p acpi >&-; then
while :; do
echo "$(date +'%A %d/%m/%y %H:%M') $sep $(acpi -b | cut -d ' ' -f 4 | tr -d ',')"
sleep 30
done | $dzen2
else
while :; do
echo "$(date +'%A %d/%m/%y %H:%M')"
sleep 30
done | $dzen2
fi
Last edited by JohannesSM64 (2011-08-24 02:20:40)
Offline
After using a config that had icons for just about everything, I decided it was time for a change. I modified my xmonad.hs to remove all icons and to go with only text! The configs for this specific setup are on my github, along with the configs for the old setup as well.
#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.
Offline
Clean(sort of):
http://imageshack.us/photo/my-images/56 … ot1gy.jpg/
Last edited by airbus001 (2011-10-01 06:04:27)
Offline