Код: Выделить всё
import Graphics.X11.Xlib.Extras
import Graphics.X11.ExtraTypes.XF86
Может, в этом дело?
Модератор: Модераторы разделов
Код: Выделить всё
import Graphics.X11.Xlib.Extras
import Graphics.X11.ExtraTypes.XF86
Portnov писал(а): ↑13.11.2009 11:47По-моему, я здесь давал уже эту ссылку... Мой конфиг, работающий, правда, с версией из darcs: http://iportnov.ru/files/xmonad.hs .
а Вы можете показать что выдает ghc --make .xmonad/xmonad.hs?
Код: Выделить всё
$ ghc ~/.xmonad/xmonad.hs
~/.xmonad/xmonad.hs:139:7:
Couldn't match expected type `(KeyMask, KeySym)'
against inferred type `[Char]'
In the expression: "<XF86Search>"
In the expression: ("<XF86Search>", (spawn "camx"))
In the first argument of `(++)', namely
`[((modm .|. shiftMask, xK_Return), spawn $ terminal conf),
((modm, xK_p),
spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\""),
((0, 269025040), spawn "slock"), ((0, xK_Print), spawn "scrot"),
....]'
Код: Выделить всё
import XMonad.Util.CustomKeys
, ((mod4Mask, xK_e ), spawn "terminal")
Код: Выделить всё
--XF86Mail
, ((0, 0x1008ff19 ), spawn "firefox")
--XF86Home
, ((0, 0x1008ff33 ), spawn "konqueror $HOME")
--XF86WebCam
, ((0, 0x1008ff8f ), spawn "camx")
Код: Выделить всё
import Graphics.X11.ExtraTypes.XF86
...
, ((0, xF86XK_Mail ), spawn "firefox")
...
Код: Выделить всё
main=do
xmonad $ defaultConfig
{ ...
,layoutHook=smartBorders $
--avoidStruts $
gaps [(U,24), (R,0)] $
onWorkspace "system" (mosaic 2 [3,2] ||| ResizableTall 1 (3/100) (1/2) [] ||| TwoPane) $
onWorkspace "im" (withIM (1%7) (ClassName "Pidgin") Grid ||| mosaic 2 [3,2] ||| ResizableTall 1 (3/100) (1/2) []) $
onWorkspace "sip" (withIM (1%7) (ClassName "Skype") Grid ||| mosaic 2 [3,2] ||| ResizableTall 1 (3/100) (1/2) []) $
onWorkspace "www" (mosaic 2 [3,2] ||| noBorders Full ||| simpleTabbed ||| Circle) $
onWorkspace "files" (mosaic 2 [3,2] ||| spiral (6/7) ||| Circle ||| noBorders Full) $
onWorkspace "text" (mosaic 2 [3,2] ||| StackTile 1 (3/100) (1/2) ||| noBorders Full ||| Circle) $
onWorkspace "media" (mosaic 2 [3,2] ||| noBorders Full ||| Circle ||| simpleTabbed) $
onWorkspace "code" (mosaic 2 [3,2] ||| noBorders Full ||| ResizableTall 1 (3/100) (1/2) []) $
onWorkspace "graphics" (mosaic 2 [3,2] ||| noBorders Full) $
onWorkspace "office" (mosaic 2 [3,2] ||| StackTile 1 (3/100) (1/2) ||| noBorders Full ||| simpleTabbed)
}
Код: Выделить всё
Couldn't match expected type `GHC.Word.Word32'
against inferred type `PerWorkspace
(Choose
XMonad.Layout.Mosaic.Mosaic
(Choose
StackTile
(Choose
(ModifiedLayout
XMonad.Layout.NoBorders.WithBorder Full)
(ModifiedLayout
(Decoration TabbedDecoration DefaultShrinker)
XMonad.Layout.Simplest.Simplest))))
l2
Window'
Expected type: l2 Window -> Window
Inferred type: l2 Window
-> PerWorkspace
(Choose
XMonad.Layout.Mosaic.Mosaic
(Choose
StackTile
(Choose
(ModifiedLayout XMonad.Layout.NoBorders.WithBorder Full)
(ModifiedLayout
(Decoration TabbedDecoration DefaultShrinker)
XMonad.Layout.Simplest.Simplest))))
l2
Window
In the second argument of `($)', namely
`onWorkspace
"office"
(mosaic 2 [3, 2]
||| StackTile 1 (3 / 100) (1 / 2)
||| noBorders Full ||| simpleTabbed)'
In the second argument of `($)', namely
`onWorkspace "graphics" (mosaic 2 [3, 2] ||| noBorders Full)
$ onWorkspace
"office"
(mosaic 2 [3, 2]
||| StackTile 1 (3 / 100) (1 / 2)
||| noBorders Full ||| simpleTabbed)'
Код: Выделить всё
onWorkspace ... $ onWorkspace ... $ onWorkspace ... Full
Код: Выделить всё
myLayout = smartBorders $ onWorkspace "im" (gridIM 0.25 empathyRoster) $ Mirror tiled ||| tiled ||| Full
where
-- default tiling algorithm partitions the screen into two panes
tiled = Tall nmaster delta ratio
-- The default number of windows in the master pane
nmaster = 1
-- Default proportion of screen occupied by master pane
ratio = 1/2
-- Percent of screen to increment by when resizing panes
delta = 3/100
-- Pidgin Roster
pidginRoster = And (ClassName "Pidgin") (Role "buddy_list")
empathyRoster = And (ClassName "Empathy") (Role "contact_list")
[eugene@komm ~]$ xmonad --recompile
Error detected while loading xmonad configuration file: /home/eugene/.xmonad/xmonad.hs
on the commandline:
Warning: -no-recomp is deprecated: Use -fforce-recomp instead
xmonad.hs:29:10:
The last statement in a 'do' construct must be an expression
Please check the file for errors.
Код: Выделить всё
import XMonad
import System.Exit
import qualified XMonad.StackSet as W
import qualified Data.Map as M
-------------------------------------
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
-------------------------------------
import XMonad.Layout.ResizableTile
import XMonad.Layout.NoBorders
-------------------------------------
import XMonad.Actions.Warp
import XMonad.Actions.WindowGo
import XMonad.Actions.UpdatePointer
-------------------------------------
import XMonad.Util.Run
import XMonad.Util.Loggers
-------------------------------------
main = do h <- spawnPipe "dzen2 -fn -*-terminus-medium-r-*-*-14-*-*-*-*-*-*-u -bg black -fg '#a8a3f7' -ta l -e 'onstart=lower'"
xmonad $ kommunistConfig h
kommunistConfig h = myUrgencyHook $
defaultConfig
{
borderWidth = 2
, terminal = "urxvt"
, workspaces = myWorkspaces
, normalBorderColor = "#0090ff"
, focusedBorderColor = "#000000"
, logHook = myDynamicLog h >> updatePointer (Relative 1 1)
, mouseBindings = myMouseBindings
, manageHook = manageHook defaultConfig <+> myManageHook
, layoutHook = myLayoutHook
, focusFollowsMouse = True
, startupHook = return ()
, keys = myKeys
, modMask = mod1Mask
, startupHook = return()
}
myUrgencyHook = withUrgencyHook dzenUrgencyHook
{ args = ["-bg", "yellow", "-fg", "black"] }
myWorkspaces :: [String]
myWorkspaces = ["1:internets","2:jabber","3:music","4:configs","5:video","6","7","8","9"]
myDynamicLog h = dynamicLogWithPP $ kommunistPP
{ ppExtras = [ date "%a %b %d %I:%M %p"
, loadAvg
]
, ppOrder = \(ws:l:t:exs) -> [t,l,ws]++exs
, ppOutput = hPutStrLn h
o, ppTitle = shorten 45
}
myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $
-- mod-button1, Set the window to floating mode and move by dragging
[ ((modMask, button1), (\w -> focus w >> mouseMoveWindow w))
-- mod-button2, Raise the window to the top of the stack
, ((modMask, button2), (\w -> focus w >> windows W.swapMaster))
-- mod-button3, Set the window to floating mode and resize by dragging
, ((modMask, button3), (\w -> focus w >> mouseResizeWindow w))
-- you may also bind events to the mouse scroll wheel (button4 and button5)
]
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
-- launch a terminal
[ ((modMask, xK_Return), spawn $ XMonad.terminal conf)
-- launch dmenu
--, ((modMask, xK_p ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
-- launch gmrun
--, ((modMask .|. shiftMask, xK_p ), spawn "gmrun")
, ((modMask , xK_F2 ), spawn "gmrun")
-- close focused window
, ((modMask .|. shiftMask, xK_c ), kill)
-- Rotate through the available layout algorithms
, ((modMask, xK_space ), sendMessage NextLayout)
-- Reset the layouts on the current workspace to default
, ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
-- Resize viewed windows to the correct size
, ((modMask, xK_n ), refresh)
-- Move focus to the next window
, ((modMask, xK_Tab ), windows W.focusDown)
-- Move focus to the next window
--, ((modMask, xK_j ), windows W.focusDown)
-- Move focus to the previous window
-- , ((modMask, xK_k ), windows W.focusUp )
-- Run Exaile music player
--, ((modMask, xK_m ), spawn "exaile" )
-- Swap the focused window and the master window
--, ((modMask, xK_Return), windows W.swapMaster)
-- Swap the focused window with the next window
, ((modMask .|. shiftMask, xK_j ), windows W.swapDown )
-- Swap the focused window with the previous window
, ((modMask .|. shiftMask, xK_k ), windows W.swapUp )
-- Shrink the master area
, ((modMask, xK_h ), sendMessage Shrink)
-- Expand the master area
, ((modMask, xK_l ), sendMessage Expand)
-- Expand non-master window
, ((modMask, xK_e ), sendMessage MirrorExpand)
-- Shrink non-master window
, ((modMask, xK_s ), sendMessage MirrorShrink)
-- Push window back into tiling
, ((modMask, xK_t ), withFocused $ windows . W.sink)
-- Increment the number of windows in the master area
--, ((modMask , xK_comma ), sendMessage (IncMasterN 1))
-- Deincrement the number of windows in the master area
--, ((modMask , xK_period), sendMessage (IncMasterN (-1)))
-- toggle the status bar gap
-- TODO, update this binding with avoidStruts , ((modMask , xK_b ),
-- Quit xmonad
, ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
-- Restart xmonad
, ((modMask , xK_q ), restart "xmonad" True)
-- run web-browser
, ((modMask , xK_i ), spawn "opera")
-- run MCabber in urxvt
, ((modMask , xK_j ), spawn "urxvt -e mcabber")
]
++
--
-- 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)]]
myManageHook :: ManageHook -- (0)
myManageHook = composeAll $
-- auto-float certain windows
[ className =? c --> doCenterFloat | c <- myFloats ] -- (4)
++
--[ title =? t --> doFloat | t <- myFloatTitles ]
-- send certain windows to certain workspaces
[ className =? "Opera" --> doF (W.shift "1:internets") -- (0,0a)
--, className =? "XDvi" --> doF (W.shift "dv") -- (0,0a)
-- unmanage docks such as gnome-panel and dzen
, manageDocks -- (3)
]
-- windows to auto-float
where myFloats = [-- "Volume"
"XClock"
--, "Network-admin"
, "Xmessage"
--, "gnome-search-tool"
]
-- myFloatTitles = ["Bridge Bid", "xbuffy"]
myLayoutHool = avoidStruts (tiled ||| Mirror tiled ||| Full) ||| Full
where
-- default tiling algorithm partitions the screen into two panes
tiled = Tall nmaster delta ratio
-- The default number of windows in the master pane
nmaster = 1
-- Default proportion of screen occupied by master pane
ratio = 3/5
-- Percent of screen to increment by when resizing panes
delta = 3/100
-------------------------------------------------------------
AlexYeCu писал(а): ↑05.12.2009 00:12Обнаружил занятный баг. Если окно «растайлировать», проще говоря потащить с зажатым alt`ом и сделать «плавающим», то до тех пор пока окно не подвергнется ресайзу (мышью или обратным помещением во фрейм и сменой раскладки), на него невозможно установить фокус. И окно при этом не перерисовывается. После ресайза в нём отображается всё, что было введено во время «подвисания». Кто-нибудь сталкивался, победил?
Код: Выделить всё
gimp = withIM (0.11) (Role "gimp-toolbox") $
reflectHoriz $
withIM (0.15) (Role "gimp-dock") (Dishes 2 (1/6))
--iml = withIM (1%4) (ClassName "Pidgin" `And` Role "buddy_list") $
-- reflectHoriz $
-- withIM (1%4) (ClassName "Skype" `And` Role "MainWindow") (mosaic 1.5 [])
Код: Выделить всё
ghc .xmonad/xmonad.hs
.xmonad/xmonad.hs:450:6:
No instance for (LayoutModifier XMonad.Layout.IM.AddRoster a)
arising from a use of `withIM' at .xmonad/xmonad.hs:450:6-63
Possible fix:
add an instance declaration for
(LayoutModifier XMonad.Layout.IM.AddRoster a)
Код: Выделить всё
xcompmgr -CFS
AlexYeCu писал(а): ↑03.01.2010 01:13А можно как-нибудь gaps отключить на одном рабочем столе? Т.е. чтобы все рабочие столы с gaps стартовали, а один без?
И как игнорить док на всех воркспейсах кроме одного?
И такой момент: позиционирование курсора в меню java-приложений. Обычно выделяется пункт над курсором. Это решаемо? На официальном форуме говорится о возможных проблемах с java, но там только про «серые блобы» вместо окон. Про позиционирование курсорра нет ничего.