XMonad 0.13

Там же кажется нашел ответ на предыдущий вопрос, пытаюсь прикрутить...

1.1.2 Shift an app to a workspace and view it
The following will put new FocusMeNow windows on the "doc" workspace and also greedyView that workspace.
import Control.Monad (liftM2)

myManageHook = composeAll
    [ className = "FocusMeNow" --> viewShift "doc"
    -- more hooks
    ]
  where viewShift = doF . liftM2 (.) W.greedyView W.shift
Haron_Prime
Сам искал подобное - не нашёл
У мну заработало!!! запускает на заданном ws и перекидывает на него
В импорты пишем
import Control.Monad (liftM2)
и далее код такой:

myManageHook :: ManageHook
myManageHook = scratchpadManageHook ( W.RationalRect 0.25 0.25 0.5 0.5 ) <+> ( composeAll . concat $
      [
      [ isDialog --> doCenterFloat ]
    , [ isFullscreen --> doFullFloat ]
    , [(className =? c <||> title =? c <||> resource =? c) --> doIgnore                       | c <- bars   ]
    , [(className =? c <||> title =? c <||> resource =? c) --> doFloat                        | c <- float  ]
    , [(className =? c <||> title =? c <||> resource =? c) --> doCenterFloat                  | c <- cfloat ]
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 0) <+> viewShift (myWorkspaces !! 0)   | c <- web    ]    -- i
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 1) <+> viewShift (myWorkspaces !! 1)   | c <- text   ]    -- ii
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 2) <+> viewShift (myWorkspaces !! 2)   | c <- term   ]    -- iii
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 3) <+> viewShift (myWorkspaces !! 3)   | c <- mail   ]    -- iv
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 4) <+> viewShift (myWorkspaces !! 4)   | c <- movi   ]    -- v
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 5) <+> viewShift (myWorkspaces !! 5)   | c <- docs   ]    -- vi
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 6) <+> viewShift (myWorkspaces !! 6)   | c <- graph  ]    -- vii
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 7) <+> viewShift (myWorkspaces !! 7)   | c <- media  ]    -- vii
    , [(className =? c <||> title =? c <||> resource =? c) --> doShift (myWorkspaces !! 8) <+> viewShift (myWorkspaces !! 8)   | c <- chat   ]    -- ix
    , [role =? c --> doFloat | c <- im ]     -- place roles on im
      ] )
    where
        bars      = ["xmobar","dzen2","desktop_window"]
        float     = ["feh"]
        cfloat    = ["Xmessage","Gxmessage","Eog","Xscreensaver-demo","Brasero","xclock","Xscreensaver-demo","xfreerdp"]
            ++ ["SimpleScreenRecorder","Evolution-alarm-notify","Evolution","Gns3","Mtpaint","Leafpad","Запустить файл"]
        web       = ["Chromium"]
        text      = ["Geany","Atom"]
        term      = ["lxterminal"]
        mail      = ["Thunderbird"]
        movi      = ["Pithos","Ario","Vlc","Ncmpcpp"]
        docs      = ["libreoffice-calc","libreoffice-writer","VirtualBox","libreoffice"]
        graph     = ["Gimp"]
        media     = ["Wine"]
        chat      = ["Pidgin","Skype"]
        im        = ["nothing"]
        role      = stringProperty "WM_WINDOW_ROLE"
        viewShift = doF . liftM2 (.) W.greedyView W.shift
[email protected],
Спасибо за наводку.
Применил у себя.
Правда у меня синтаксис чуть отличается
-- Windows rules:
myManageHook :: ManageHook
myManageHook = composeAll . concat $
    [
      [className =? c             --> doF (W.shift "W")   <+> viewShift ("W")   | c <- myWeb]
    , [className =? c             --> doF (W.shift "M")   <+> viewShift ("M")   | c <- myMail]
    , [className =? c             --> doF (W.shift "E")   <+> viewShift ("E")   | c <- myEdit]
    , [className =? c             --> doF (W.shift "F")   <+> viewShift ("F")   | c <- myFile]
    , [className =? c             --> doF (W.shift "S")   <+> viewShift ("S")   | c <- mySystem]
    , [className =? c             --> doF (W.shift "V")   <+> viewShift ("V")   | c <- myVideo]
    , [className =? c             --> doF (W.shift "P")   <+> viewShift ("P")   | c <- myPic]
    , [className =? c             --> doF (W.shift "J")   <+> viewShift ("J")   | c <- myWork]
    , [className =? c             --> doF (W.shift "T")   <+> viewShift ("T")   | c <- myTorrent]
    , [className =? c             --> doF (W.shift "X")   <+> viewShift ("X")   | c <- myVM]
    , [className =? c             --> doF (W.shift "XI")  <+> viewShift ("XI")  | c <- myIM]
    , [appName   =? c             --> doF (W.shift "XII") <+> viewShift ("XII") | c <- myTerm]

    , [className =? c             --> doCenterFloat                             | c <- myFloatC]
    , [appName   =? a             --> doCenterFloat                             | a <- myFloatA]
    , [title     =? t             --> doCenterFloat                             | t <- myFloatT]
    , [role      =? r             --> doCenterFloat                             | r <- myFloatR]

    , [currentWs =? "W"              --> insertPosition Below Newer]
    , [currentWs =? "M"              --> insertPosition Below Newer]
    , [currentWs =? "E"              --> insertPosition Below Newer]
    , [currentWs =? "F"              --> insertPosition Below Newer]
    , [currentWs =? "T"              --> insertPosition Below Newer]
    , [currentWs =? "X"              --> insertPosition Below Newer]
    , [currentWs =? "XII"            --> insertPosition Below Newer]

    , [resource  =? "stalonetray"    --> doIgnore]

    , [className =? "Gis-weather.py" --> doIgnore]

    , [isDialog                      --> doCenterFloat]

    , [isFullscreen                  --> doFullFloat]

    , [transience']

    , [manageDocks]

    ]
    where
    myWeb     = ["Firefox","Opera","Tor Browser","Vivaldi-snapshot"]
    myMail    = ["Thunderbird"]
    myEdit    = ["Subl3","Et","Wps","Wpp","Acroread","FoxitReader"]
    myFile    = ["Pcmanfm"]
    mySystem  = ["pacmanxg","GParted","Sysinfo","PkgBrowser","Systemadm","Tk","Zenmap"]
    myVideo   = ["mpv","Vlc","Sopcast-player.py","Cheese","Easytag"]
    myPic     = ["Gimp","Gimp-2.8","Inkscape"]
    myWork    = ["Wine"]
    myTorrent = ["Tixati","Transgui","Transmission-gtk","Transmission-remote-gtk"]
    myVM      = ["VirtualBox"]
    myIM      = ["Hexchat","psi","Psi","Viber","TelegramDesktop"]
    myTerm    = ["term","TMUX","termux"]

    -- CenterFloat

    myFloatC  = ["Galculator","Shutter","Zenity","Nvidia-settings","Pulseaudio-equalizer.py","Gnome-alsamixer","Gsmartcontrol","feh"]
    myFloatA  = ["lxappearance","xarchiver","gmrun","Update"]
    myFloatT  = ["Software Update"]
    myFloatR  = ["task_dialog","messages","pop-up","^conversation$","About"]

    role      = stringProperty "WM_WINDOW_ROLE"

    viewShift = doF . liftM2 (.) W.greedyView W.shift
Gnome 2 >> Unity >> KDE 4 >> Openbox >> Awesome >> Xmonad
GitHub , BitBuket
Haron_Prime
Правда у меня синтаксис чуть отличается
Главное что заработало) А у меня синтаксис такой потому что сделал кликабельные ws на xmobar по вот этому ману, ну захотелось... ведь в других wm они кликабельны, а мы что - хуже? но... после этого doF перестает работать, хотя с doFloat все норм., и вот нашлось решение с таким синтаксисом.
ну, мне такое не надо, я и в awesome/i3wm этим не пользуюсь, хоть там это искаропки )))
Gnome 2 >> Unity >> KDE 4 >> Openbox >> Awesome >> Xmonad
GitHub , BitBuket
Вот тут еще зацепился - хочу чтобы на каждом ws был свой layout.
Есть такой код:
Но почему-то не работает, везде по полной, т.е. все layout работают.

-- layout
myLayoutHook = gaps [(U,18)] $ onWorkspace "1" webL
                $ onWorkspace "4" imL
                $ onWorkspace "5" fullL
                $ onWorkspace "6" webL
                $ onWorkspace "9" gimpL
                $ standardLayouts
    where
        standardLayouts = avoidStruts $ smartBorders $ (tiled ||| reflectTiled ||| Mirror tiled ||| Circle ||| Grid ||| Full ||| tabbed shrinkText myTabConfig)

        --Layouts
        tiled = layoutHintsWithPlacement (0.5, 0.5) (Tall 1 (3/100) (1/2))
        reflectTiled = (reflectHoriz tiled)
        full = noBorders Full
        fullL = avoidStruts $ smartBorders $ full
        tabs = tabbed shrinkText myTabConfig

        --Im Layout
        imL = avoidStruts $
              smartBorders $
              withIM ratio pidginRoster $
              withIM ratio emeseneRoster $
              withIM ratio gajimRoster $
              reflectHoriz $ withIM skypeRatio skypeRoster (reflectTiled ||| Grid) where
                ratio = (1%9)
                -- pidgin
                pidginRoster = And (ClassName "Pidgin") (Role "buddy_list")
                -- skype
                skypeRatio = (1%8)
                skypeRoster = (And (ClassName "Skype") (Not (Role "ConversationsWindow")))
                -- emesene
                emeseneRoster = (Resource "emesene" `And` Title "emesene" `And` ClassName "Emesene")
                -- gajim
                gajimRoster = And (ClassName "Gajim.py") (Role "roster")
        webL = avoidStruts $ smartBorders $ (tabs ||| tiled ||| Circle)

        gimpL = avoidStruts $ withIM (0.11) (Role "gimp-toolbox") $ reflectHoriz $ withIM (0.15) (Role "gimp-dock") (fullL ||| tabs)
у меня так
-- Layouts:
myLayoutHook =  avoidStruts
            $ Tog.toggleLayouts (noBorders Full)
            $ smartBorders
            $ onWorkspace "W"  (Full ||| mouseResizableTile ||| Mirror tiled)
            $ onWorkspace "M"  (mouseResizableTile ||| Mirror tiled ||| Full)
            $ onWorkspace "E"  (Mirror tiled ||| mouseResizableTile ||| Full)
            $ onWorkspace "F"  (Mirror tiled ||| mouseResizableTile ||| Full)
            $ onWorkspace "S"  (Mirror tiled ||| mouseResizableTile ||| Full)
            $ onWorkspace "V"  (Full ||| mouseResizableTile)
            $ onWorkspace "P"  (Mirror tiled ||| mouseResizableTile ||| Full)
            $ onWorkspace "J"  (Full ||| Grid)
            $ onWorkspace "T"  (Full ||| mouseResizableTile)
            $ onWorkspace "X"  (Mirror tiled ||| mouseResizableTile ||| Full)
            $ onWorkspace "XI" (smartSpacing 2 $ withIM 0.17 (ClassName "psi") (GridRatio 1))
            $ onWorkspace "XII"(Mirror tiled ||| mouseResizableTile ||| Full)
            $ tiled ||| Mirror tiled  ||| Full
  where
    tiled   = Tall nmaster delta ratio
    nmaster = 1
    ratio   = 0.5
    delta   = 0.01

-- IMLayout
myIMLayout = withIM (1%7) psi Grid
    where
      psi   = And (ClassName "psi") (Role "main")
Gnome 2 >> Unity >> KDE 4 >> Openbox >> Awesome >> Xmonad
GitHub , BitBuket
а если вместо
$ standardLayouts
сразу прописать то, что требуется
$ avoidStruts $ smartBorders $ (tiled ||| reflectTiled ||| Mirror tiled ||| Circle ||| Grid ||| Full ||| tabbed shrinkText myTabConfig)
?
Gnome 2 >> Unity >> KDE 4 >> Openbox >> Awesome >> Xmonad
GitHub , BitBuket
как-то вообще непонятно для меня организовано...
почему не прописать $ avoidStruts и $ smartBorders отдельно?
типа
$ avoidStruts
$ smartBorders
$ tiled ||| reflectTiled ||| Mirror tiled ||| Circle ||| Grid ||| Full ||| tabbed shrinkText myTabConfig
Gnome 2 >> Unity >> KDE 4 >> Openbox >> Awesome >> Xmonad
GitHub , BitBuket
Да, тут огород нагорожен, но есть и интересные моменты, взял готовый конфиг, допиливаю под себя
 
Зарегистрироваться или войдите чтобы оставить сообщение.