You are not logged in.
Paul-S: Use "Sans:pixelsize=9" instead. "Sans" defaults to either "Bitstream Vera Sans" or "Deja Vu Sans" I can not recall exactly, but personally I can not tell the difference between these two fonts.
Offline
have you tried other xft fonts? do none work or just this one?
/edit: whoops, didn't see new post on next page... ignore me if Ashren's solution works out .
Last edited by brisbin33 (2009-12-03 15:05:26)
//github/
Offline
Hi Ashren, brisbin33 I tried multiple different xft fonts too, it just uses some default font. The prompt is at the bottom of the screen.
Cheers
Paul-S
Last edited by Paul-S (2009-12-03 15:14:43)
Offline
jtemple wrote:I'm trying to get xmonad playing nicely with my dual monitors. Basic functionality works fine, but how do I get xmobar and trayer to work? When I specific xmobar to be on the "left" it puts it on my default monitor, and trayer on the right it will put it all the way on the other side of my desktop, on the second monitor. I want them both on the same screen in this configuration
On my setup, I have trayer on my far right hand monitor, so this isn't a problem. .xmobar by default goes to the main monitor. Trayer goes to the far left or far right of the setup. So an easy fix (if you like it), might be to left-align trayer, and then setup xmobar to go right. It should stay on screen 0 but be right aligned, and trayer should be all the way to the right. Maybe...
If this is not acceptable or flat out doesn't work, then maybe you can do something with the --distance option. It is a width in pixels, so perhaps if you did --distance [width of second monitor] it would place it in the right place?
The manpage for trayer is included in this post, if you need it:
http://bbs.archlinux.org/viewtopic.php?id=46818
Thanks! I just realized that xmonad is trying to use my external display as screen 0 (probably because xrandr is too, for that matter). Is there any way to force xrandr to use LVDS1 as screen 0 always and VGA1, when it's present be screen 1?
edit: found the answer myself: just use --primary with xrandr after the display you want as primary
Last edited by jtemple (2009-12-03 17:01:02)
Offline
Say you have have a window that is set to float, you resize it to your liking. How do you make it stay that size the next time its opened or maximized?
Offline
Paul-S: I've tried find a solution to your problem. The following works for me:
appFontXft :: String
appFontXft = "xft:Sans:pixelsize=9"
myXPConfig = defaultXPConfig
{ font = appFontXft
, bgColor = "#333333"
, fgColor = "#FFFFFF"
, fgHLight = "#000000"
, bgHLight = "#BBBBBB"
, borderColor = "#FFFFFF"
, promptBorderWidth = 1
, position = Bottom
, height = 18
, historySize = 256
, historyFilter = id
, defaultText = []
}
...
, ((modMask, xK_x ), shellPrompt myXPConfig)
...
This does not work with dzen2 btw. So just create a separate variable for dzen2.
And also you need to have haskell-xft-x11 installed as well.
I hope it will work for you.
Last edited by Ashren (2009-12-03 21:51:04)
Offline
Cheers for that Ashren, my config was fine after all, it was the haskell-xft-x11 that was missing. I had haskell-x11-darcs installed, my own damn fault Yay now it works
Thanks
Paul-S
Last edited by Paul-S (2009-12-03 22:27:46)
Offline
I have one in my ~/bin file that I call dmrun, and is very handy to have around.
#!/bin/sh $(dmenu_path | \ dmenu -b -fn '-*-liberation mono-*-*-*-*-25-*-*-*-*-*-*-*' \ -nb '#000066' -nf '#FFFF00' -sb '#002200' -sf '#00ffff')
HTH
I have a little script like that, my problem is I do not know how to add custom keys to my xmonad.hs, it doesnt seem to resemble other peoples that are posted.
Offline
I have a little script like that, my problem is I do not know how to add custom keys to my xmonad.hs, it doesnt seem to resemble other peoples that are posted.
(went back to look for the posted xmonad.hs file)
-- Imports. import XMonad import XMonad.Hooks.DynamicLog -- MY STUFF myTerminal = "urxvtc" myWorkspaces = ["1", "2" ,"3", "4", "5", "6", "7", "8", "9"] myNormalBorderColor = "#3F3F3F" myFocusedBorderColor = "#DCA3A3" myBorderWidth = 4 -- The main function. main = xmonad =<< statusBar myBar myPP toggleStrutsKey myConfig -- Command to launch the bar. myBar = "xmobar" -- Custom PP, configure it as you like. It determines what's being written to the bar. myPP = xmobarPP { ppCurrent = xmobarColor "#DCDCCC" "" . wrap "<" ">" } [color=#FF0000]-- Keybinding to toggle the gap for the bar. toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b)[/color] -- Main configuration, override the defaults to your liking. myConfig = defaultConfig { terminal = myTerminal, borderWidth = myBorderWidth, normalBorderColor = myNormalBorderColor, focusedBorderColor = myFocusedBorderColor, modMask = mod4Mask -- use the Windows button as mod }
Ok, from comparing your code to mine, it looks like all that you will need to do is to change your toggleStrutsKey (colored red above) a little bit and you can make it a list of keys.
Mine is called myKeys and I will post the line and some of the bindings:
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
[ ((mod4Mask, xK_Print), spawn "scrot screen_%Y-%m-%d.png -d 1") -- take screenshot
, ((modMask .|. controlMask, xK_r), spawn "killall dzen2 && killall conky && sleep 0.5" >> restart "xmonad" True) -- restart xmonad
-- Restart xmonad
, ((modMask , xK_q ), spawn "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)]]
++
-- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
-- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
[((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
| (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
So if you make some changes to yours, you should be able to add the other keybindings without much trouble.
Knute
Offline
Knute, thanks for the help. I get an out of scope error when I recompile this.
Error detected while loading xmonad configuration file: /home/justin87/.xmonad/xmonad.hs
xmonad.hs:27:51: Not in scope: `M.fromList'
Please check the file for errors.
-- Imports.
import XMonad
import XMonad.Hooks.DynamicLog
-- MY STUFF
myTerminal = "urxvtc"
myWorkspaces = ["1", "2" ,"3", "4", "5", "6", "7", "8", "9"]
myNormalBorderColor = "#3F3F3F"
myFocusedBorderColor = "#DCA3A3"
myBorderWidth = 4
-- The main function.
main = xmonad =<< statusBar myBar myPP myKeys myConfig
-- Command to launch the bar.
myBar = "xmobar"
-- Custom PP, configure it as you like. It determines what's being written to the bar.
myPP = xmobarPP { ppCurrent = xmobarColor "#DCDCCC" "" . wrap "<" ">" }
-- Keybinding to toggle the gap for the bar.
--toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b)
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
[ ((mod4Mask, xK_Print), spawn "scrot screen_%Y-%m-%d.png -d 1") -- take screenshot
,((mod4Mask, xK_p), spawn "dmrun") -- launch dmenu
]
-- Main configuration, override the defaults to your liking.
myConfig = defaultConfig {
terminal = myTerminal,
borderWidth = myBorderWidth,
normalBorderColor = myNormalBorderColor,
focusedBorderColor = myFocusedBorderColor,
modMask = mod4Mask -- use the Windows button as mod
}
dmrun is in my path.
Offline
hehehe.... That error means that it doesn't have a definition for M.
Like an idiot I didn't mention the import, simply because it's been quite a while since I set it up.
I think this is the right one, but if it's not....
import qualified Data.Map as M
I'm not sure if there are other dependancies or not, if you get any more, post them, and we can try to figure them out.
Knute
Offline
after adding that import, i now get.
Error detected while loading xmonad configuration file: /home/justin87/.xmonad/xmonad.hs
xmonad.hs:17:39:
Couldn't match expected type `(KeyMask, KeySym)'
against inferred type `M.Map (KeyMask, KeySym) (m ())'
In the third argument of `statusBar', namely `myKeys'
In the second argument of `(=<<)', namely
`statusBar myBar myPP myKeys myConfig'
In the expression: xmonad =<< statusBar myBar myPP myKeys myConfig
Please check the file for errors.
Offline
I thought I would share my newer xmoand.hs for Xfce4 using Xmoand.
For conky and xfce4-panel (thanks to Knute): http://xmonad.org/xmonad-docs/xmonad-co … -Gaps.html
For my numpad keys: http://haskell.org/haskellwiki/Xmonad/F … ot_working
For viewShift: http://www.haskell.org/haskellwiki/Xmon … nd_view_it
import XMonad
import XMonad.Config.Xfce
import qualified XMonad.StackSet as W
import XMonad.Util.EZConfig
import XMonad.Hooks.ManageDocks
import XMonad.Layout.Gaps
import Control.Monad (liftM2)
-- Width of the window border in pixels.
--
myBorderWidth = 1
-- modMask lets you specify which modkey you want to use. The default
-- is mod1Mask ("left alt"). You may also consider using mod3Mask
-- ("right alt"), which does not conflict with emacs keybindings. The
-- "windows key" is usually mod4Mask.
--
myModMask = mod1Mask
-- other imports
myWorkspaces = ["1","2","3","4","5","6","7","8","9","0"]
modm = mod1Mask -- for numpad workspaces
myKeys = -- use with EZConfig.additionalKeys or edit to match your key binding method
[
((modm .|. shiftMask, xK_KP_Add ), kill),
((modm .|. shiftMask, xK_KP_Enter ), spawn "/home/seventy3/firefox_start.sh"),
((modm .|. shiftMask, xK_KP_Delete ), spawn "Thunar"),
((modm .|. shiftMask, xK_Home ), spawn "sudo shutdown -h now"),
((modm .|. shiftMask, xK_End ), spawn "sudo shutdown -r now"),
((modm, xK_KP_Subtract ), windows W.focusDown),
((modm .|. shiftMask, xK_KP_Subtract ), windows W.swapDown),
((modm .|. shiftMask, xK_KP_Multiply ), windows W.swapUp),
((modm, xK_KP_Multiply ), windows W.focusUp),
((modm, xK_Page_Up ), sendMessage Shrink),
((modm, xK_Page_Down ), sendMessage Expand)
]
++
[((m .|. modm, k), windows $ f i)
| (i, k) <- zip myWorkspaces numPadKeys
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]
]
-- Non-numeric num pad keys, sorted by number
numPadKeys = [ xK_KP_End, xK_KP_Down, xK_KP_Page_Down -- 1, 2, 3
, xK_KP_Left, xK_KP_Begin, xK_KP_Right -- 4, 5, 6
, xK_KP_Home, xK_KP_Up, xK_KP_Page_Up -- 7, 8, 9
, xK_KP_Insert] -- 0
-- The mask for the numlock key. Numlock status is "masked" from the
-- current modifier status, so the keybindings will work with numlock on or
-- off. You may need to change this on some systems.
--
-- You can find the numlock modifier by running "xmodmap" and looking for a
-- modifier with Num_Lock bound to it:
--
-- > $ xmodmap | grep Num
-- > mod2 Num_Lock (0x4d)
--
-- Set numlockMask = 0 if you don't have a numlock key, or want to treat
-- numlock status separately.
--
myNumlockMask = mod2Mask
-- Border colors for unfocused and focused windows, respectively.
--
myNormalBorderColor = "#66458F"
myFocusedBorderColor = "#AE75F6"
-- manage hooks attempt
--
myManageHook = composeAll
[ className =? "Gimp-2.6" --> (doFloat <+> viewShift "9"),
className =? "Inkscape" --> viewShift "8",
className =? "Googleearth-bin" --> viewShift "7",
className =? "Stellarium" --> viewShift "7",
className =? "Celestia" --> viewShift "7",
className =? "Gpredict" --> viewShift "7",
className =? "Mirage" --> viewShift "6",
className =? "Ristretto" --> viewShift "6",
className =? "Xfce4-appearance-settings" --> doFloat,
className =? "Agave" --> doFloat,
className =? "Xfce4-screenshooter-plugin" --> doFloat,
className =? "Xfrun4" --> doFloat,
className =? "Gcalctool" --> doFloat,
className =? "Xarchiver" --> doFloat,
className =? "File-roller" --> doFloat,
className =? "Firefox" <&&> resource =? "Dialog" --> doFloat,
className =? "Firefox" <&&> resource =? "Extension" --> doFloat,
className =? "Firefox" <&&> resource =? "Browser" --> doFloat,
className =? "Firefox" <&&> resource =? "Download" --> doFloat
]
where viewShift = doF . liftM2 (.) W.greedyView W.shift
------------------------------------------------------------------------
main = xmonad $ xfceConfig
{
borderWidth = myBorderWidth,
normalBorderColor = myNormalBorderColor,
modMask = myModMask,
workspaces = myWorkspaces,
manageHook = myManageHook <+> manageHook xfceConfig,
layoutHook = gaps [(D,29), (U,20)] $ Tall 1 (3/100) (1/2) ||| Full,
focusedBorderColor = myFocusedBorderColor
}`additionalKeys` myKeys
I couldn't get my xfce4-session-logout to work so I used the sudoers file for /sbin/shutdown (using Slim also worked for reboot and halt, but it seemed better to just skip it and log out directly using "sudo shutdown -h now").
Offline
What is the best way to launch new programs that you don't have a keyboard shortcut for? I'm tired of starting a new terminal to launch everything I want and then closing it when I'm done. Has anyone written up a little run dialog script using Xmonad's prompt/input modules?
Offline
Offline
What is the best way to launch new programs that you don't have a keyboard shortcut for? I'm tired of starting a new terminal to launch everything I want and then closing it when I'm done. Has anyone written up a little run dialog script using Xmonad's prompt/input modules?
dmenu will work automatically if you install it. Xmonad.Prompt.Shell is nicer in my opinion, but it takes some configuration.
Offline
Thanks to this thread, I'm into xmonad too!
I just have a few questions about xmonad and conky:
-Is it possible to resize an applications in a different direction than the default one? For example if I'm in tall layout and I want to resize one of the applications on the right vertically, instead of horizzontally, what should I do?
- Can I specify a different default size for some applications? For example I want the terminal to always start smaller than my browser when I only have my browser open.
- I can't specify hex colors in conky. If I try to put into conkyrc something like ^fg(#ffffff) conky doesn't display anything. ^fg(white) works perfectly. I use conky-cli
- Is there a nice weather script for conky to use with conky piped in dzen?
That's my config btw (basically a mix of the first two posts and other things from the net )
import XMonad
import XMonad.Hooks.ManageDocks
import XMonad.Config.Xfce
import XMonad.ManageHook
import XMonad.Hooks.DynamicLog ( PP(..), dynamicLogWithPP, dzenColor, wrap, defaultPP )
import XMonad.Util.Run (spawnPipe)
import System.IO (hPutStrLn)
import XMonad.Layout.NoBorders
import qualified Data.Map as M
import Data.Ratio
import qualified XMonad.StackSet as W
statusBarCmd = "dzen2 -bg '#000000' -fg 'grey70' -sa c -fn '-*-terminus-*-*-*-*-12-*-*-*-*-*-iso8859' -e '' -ta l -w 540 -x 152 -h 21"
conkyBar = "sleep 1 && conky -c /home/astroboy/.conkyrcdzen | dzen2 -fn '-*-terminus-bold-r-normal-*-12-*-*-*-*-*-*-*' -bg black -fg grey70 -h 21 -sa c -x 692 -e '' -ta r"
main :: IO ()
main = do
statusBarPipe <- spawnPipe statusBarCmd
conkyBarPipe <- spawnPipe conkyBar
xmonad $ xfceConfig
{ borderWidth = 1
, normalBorderColor = "black"
, focusedBorderColor = "blue"
, modMask = mod4Mask
, logHook = dynamicLogWithPP $ myPP statusBarPipe
, workspaces = ["main", "work", "im", "music"] ++ map show [5..9 :: Int]
, manageHook = manageHook xfceConfig <+> myManageHook
, keys = \c -> myKeys c `M.union` keys defaultConfig c
, layoutHook = smartBorders $ avoidStruts ( Mirror tiled ||| Full ||| tiled)
}
where
tiled = Tall 1 0.03 0.6
myKeys (XConfig {modMask = modm}) = M.fromList $
[
-- custom dmenu
((mod4Mask, xK_p), spawn "exe=`dmenu_path | dmenu -b -fn '-*-terminus-*-r-*-*-*-*-*-*-*-*-*-*' -nb '#000000' -nf '#FFFFFF'` && eval \"exec $exe\"")
, ((mod4Mask, xK_w), spawn "google_chrome")
]
myManageHook :: ManageHook
myManageHook = composeAll . concat $
[ [ className =? "Pidgin" --> doF (W.shift "im") ]
, [ className =? "banshee-1" --> doF (W.shift "music") ]
, [ className =? "Lyx" --> doF (W.shift "work") ]
, [ className =? c --> doFloat | c <- myFloats ]
, [ title =? t --> doFloat | t <- myOtherFloats ]
, [ title =? t --> doIgnore | t <- myIgnores ]
]
where
myFloats = ["Gimp", "Wicd"]
myOtherFloats = ["VLC media player", "Wicd Network Manager"]
myIgnores = ["exe"]
-- dynamiclog pretty printer for dzen
--
myPP h = defaultPP
{ ppCurrent = wrap "^fg(#ffffff)^bg(#2962B6)^p(2)^i(/home/astroboy/.bitmaps/has_win.xbm)" "^p(2)^fg()^bg()" . \wsId -> if (':' `elem` wsId) then drop 2 wsId else wsId -- Trim the '[Int]:' from workspace tags
, ppVisible = wrap "^bg(grey30)^fg(grey75)^p(2)" "^p(2)^fg()^bg()"
, ppHidden = wrap "^fg(#ffffff)^bg()^p(2)^i(/home/astroboy/.bitmaps/has_win.xbm)" "^p(2)^fg()^bg()" . \wsId -> if (':' `elem` wsId) then drop 2 wsId else wsId
, ppHiddenNoWindows = id . \wsId -> if (':' `elem` wsId) then drop 2 wsId else wsId
, ppSep = " ^fg(#ffffff)^r(2x2)^fg() "
, ppWsSep = " "
, ppLayout = dzenColor "#cccccc" "" .
(\x -> case x of
"Tall" -> "tall ^i(/home/astroboy/.bitmaps/tall.xbm)"
"Mirror Tall" -> "mirror ^i(/home/astroboy/.bitmaps/mtall.xbm)"
"Full" -> "full ^i(/home/astroboy/.bitmaps/full.xbm)"
"Grid" -> "grid"
"Tabbed" -> "tabbed"
)
-- , ppTitle = dzenColor "white" "" . wrap "< " " >"
, ppTitle = dzenColor "white" ""
, ppOutput = hPutStrLn h
}
and that's .conkyrc
background no
out_to_console yes
update_interval 1
total_run_times 0
uppercase no
use_spacer yes
TEXT
^fg(white)${execi 320 /home/astroboy/.scripts/weather.sh "EUR|UK|UK241|LONDON"} ^r(6x6) ^fg(white)$mem^i(/home/astroboy/.bitmaps/mem.xpm) ^fg(white)^r(2x2) ${cpu cpu1}% ^i(/home/astroboy/.bitmaps/cpu.xpm) ${cpu cpu2}% ^fg(white)^r(6x6) ^fg(blue)${execi 320 /home/astroboy/.scripts/netimp.py} ^fg(white)^r(2x2) ^fg(red)${downspeed wlan0}^i(/home/astroboy/.bitmaps/arr_down.xpm) ^fg(white)^r(2x2) ^fg(green)${upspeed wlan0}^i(/home/astroboy/.bitmaps/arr_up.xpm) ^fg(white)^r(6x6) ^fg(white)${time %m.%d.%y %l:%M}^fg(grey)${time %p}
and a screenshot:
http://img16.imageshack.us/img16/2588/screenshot1np.png
Last edited by katzen (2009-12-10 14:40:53)
Offline
I can't answer your conky questions. For resizing however you can try XMonad.Layout.ResizableTile. It's not great, trying to resize multiple windows in the same column or row is quite awkward, but its workable.
Offline
I can't answer your conky questions. For resizing however you can try XMonad.Layout.ResizableTile. It's not great, trying to resize multiple windows in the same column or row is quite awkward, but its workable.
thanks for the answer.
If I undestand how this module work, it adds anothe layout to tall full and mirror where you can resize things. What I was searching for is much simpler, I'd simply like to have a keybinding to resize a window in the non default direction, but since there is an additional module to do this, I guess it's not possible...
Offline
katzen: After conky version 1.6 you need to use double #'s in order to use hex colors, since conky now sees single #'s as comment indicators. Example: "^fg(##ffffff).
Offline
katzen: After conky version 1.6 you need to use double #'s in order to use hex colors, since conky now sees single #'s as comment indicators. Example: "^fg(##ffffff).
mhm it doesn't work for me...
Last edited by katzen (2009-12-10 17:38:28)
Offline
katzen: You're right it doesn't work. I wrote the above by memory. Try adding a \ before the color instead like this; "^fg(\#ffffff)"
http://bbs.archlinux.org/viewtopic.php?id=77209
http://bbs.archlinux.org/viewtopic.php?id=75374
Since you are using conky-cli you might as well use an earlier version of conky.
So here is a modified PKGBUILD if you don't want to use the above approach:
# Contributor: Karol Cichy <slothck@gmail.com>
pkgname=conky-cli
pkgver=1.6.1
pkgrel=1
pkgdesc="Conky command line, without X11 dependencies"
arch=(i686 x86_64)
url="http://conky.sourceforge.net/"
license="custom"
replaces=('torsmo')
provides=('conky')
conflicts=('conky')
depends=('glib2')
makedepends=('pkgconfig')
source=(http://downloads.sourceforge.net/conky/conky-$pkgver.tar.gz)
md5sums=('c55e4229b71d3856cad093cefe8cd38b')
build() {
cd $startdir/src/conky-$pkgver
touch ./data/conky_no_x11.conf
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--disable-lua \
--disable-double-buffer \
--disable-x11 \
--disable-xdamage \
--disable-own-window \
--disable-xft \
--disable-hddtemp \
--disable-portmon
make || return 1
make DESTDIR=$startdir/pkg install
install -D -m644 COPYING $startdir/pkg/usr/share/licenses/conky/LICENSE
}
Last edited by Ashren (2009-12-10 19:09:20)
Offline
katzen: You're right it doesn't work. I wrote the above by memory. Try adding a \ before the color instead like this; "^fg(\#ffffff)"
it works, thanks!
Offline
could someone tell me how to find out the "className" of a specific program? finding the "resource" is fairly easy but just won't do sometimes...
Offline
could someone tell me how to find out the "className" of a specific program? finding the "resource" is fairly easy but just won't do sometimes...
I have an alias that I use in my ~/.zshrc (but if you use bash you would need to put your alias in your ~/.bashrc):
alias xp='echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\"" && xprop | grep "WM_WINDOW_ROLE\|WM_CLASS"'
When I type in xp into a terminal, my mouse pointer will change to a cross, and when I click on the appropriate window, xprop will will show the info for that window in the following format:
8:47PM % xp ~ (knute) pts/0
WM_CLASS(STRING) = "NAME", "CLASS"
WM_WINDOW_ROLE(STRING) = "browser"
WM_CLASS(STRING) = "Navigator", "Minefield"
8:49PM % xp ~ (knute) pts/0
WM_CLASS(STRING) = "NAME", "CLASS"
WM_CLASS(STRING) = "urxvt", "URxvt"
8:50PM % ~ (knute) pts/0
HTH,
Last edited by Knute (2009-12-13 02:52:15)
Knute
Offline