You are not logged in.

#1 2022-07-10 21:31:05

ratzfatz
Member
From: KL, Germany
Registered: 2011-06-03
Posts: 30

[SOLVED] Could anyone help me fixing my "xmonad.hs" please?

Hi guys,

I am using XMonad since around 10 years and as everything worked pretty smooth to me, I've never changed my configuration file over the last recent years. However, I don't really know Haskell and cobbled together my configuration by referring to some manuals and files of others until I had a result I was pleased with. Since my today's update, though, my file now contains Syntax errors. Apparently some used variables of the used modules vanished but due to my lack of knowledge in Haskell, I cannot fix this without help.

Maybe there's an easy solution for someone with Haskell-experience, so I'd appreciate very much if there's someone who'd glance at my file and maybe corrects it for me smile. That would really help me a lot. Thanks in advance!!! And kind regards, Michael smile

This is the compiling error

XMonad recompiling (forced).
Errors detected while compiling xmonad config: /home/michael/.xmonad/xmonad.hs
$ ghc --make xmonad.hs -i -ilib -fforce-recomp -main-is main -dynamic -v0 -outputdir /home/michael/.xmonad/build-x86_64-linux -o /home/michael/.xmonad/xmonad-x86_64-linux

xmonad.hs:203:11: error:
    • Variable not in scope: defaultTheme :: Theme
    • Perhaps you meant ‘defaultText’ (imported from XMonad.Prompt)
    |
203 | myTheme = defaultTheme {  decoHeight          = 19
    |           ^^^^^^^^^^^^

xmonad.hs:235:14: error:
    • Variable not in scope: defaultXPConfig :: XPConfig
    • Perhaps you meant ‘defaultConfig’ (imported from XMonad)
    |
235 | myXPConfig = defaultXPConfig
    |              ^^^^^^^^^^^^^^^

xmonad.hs:303:40: error:
    • Variable not in scope: defaultGSConfig :: GSConfig Window
    • Perhaps you meant ‘defaultConfig’ (imported from XMonad)
    |
303 |     , ((modMask,   xK_a), goToSelected defaultGSConfig)                   -- Programm-Auswahl
    |                                        ^^^^^^^^^^^^^^^

Please check the file for errors.

This is my xmonad.hs

-------------------------------------------------------------------------------------------------------
----- ~/.xmonad/xmonad.hs                                                                06.04.2012 ---
---- ratzfatz                                                                                       ---
-------------------------------------------------------------------------------------------------------



--- Laden von Bibliotheken: ---------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------

-- Sonstiges:
import XMonad hiding ( (|||) )                     -- import XMonad
import qualified XMonad.StackSet as W 
import qualified Data.Map as M
import XMonad.Util.EZConfig(additionalKeys)
import System.Exit
import Graphics.X11.Xlib
import System.IO
import XMonad.Prompt                               -- Notizen
import XMonad.Prompt.AppendFile

-- Aktionen:
import XMonad.Actions.CycleWS 
import XMonad.Actions.WindowGo
import qualified XMonad.Actions.Search as S
import XMonad.Actions.Search
import qualified XMonad.Actions.Submap as SM
import XMonad.Actions.GridSelect
import XMonad.Actions.MouseResize                  -- Fenstergröße mit Maus anpassen
import XMonad.Actions.CycleWS                      -- bequemes wechseln zwischen Arbeitsflächen
import XMonad.Actions.DwmPromote                   -- mit Masterfenster tauschen

-- Werkzeuge:
import XMonad.Util.Scratchpad (scratchpadSpawnAction, scratchpadManageHook,
                               scratchpadFilterOutWorkspace)
import XMonad.Util.Run(spawnPipe)
import qualified XMonad.Prompt    as P
import XMonad.Prompt.Shell
import XMonad.Prompt

-- Haken:
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.SetWMName
import XMonad.Hooks.FadeInactive

-- Layout:
import XMonad.Layout.LayoutScreens                 -- mehrere Bildschirme
import XMonad.Layout.TwoPane
import XMonad.Layout.NoBorders
import XMonad.Layout.ResizableTile
import XMonad.Layout.Reflect
import XMonad.Layout.IM
import XMonad.Layout.Tabbed
import XMonad.Layout.PerWorkspace (onWorkspace)
import XMonad.Layout.Grid
import XMonad.Layout.LimitWindows
import XMonad.Layout.WindowNavigation
import XMonad.Layout.WindowArranger                -- Fenstergröße mit Maus anpassen
import XMonad.Layout.LayoutCombinators
import XMonad.Layout.ThreeColumns                  -- für webL

import Data.Ratio ((%))                            -- benötigt für IM-Layout
import Control.Monad (liftM2)                      -- benötigt für viewShift


--- hier geht die eigentliche Konfigurationsdatei los: ------------------------------------------------
-------------------------------------------------------------------------------------------------------

--- Hauptteil:
main = do
        status <- spawnPipe myDzenStatus           -- XMond-Status (links)
        xmonad  $ withUrgencyHook NoUrgencyHook $ defaultConfig
                { manageHook         = myManageHook
                , layoutHook         = myLayoutHook
                , handleEventHook    = mconcat
                                     [ docksEventHook
                                     , handleEventHook defaultConfig ]
                , borderWidth        = myBorderWidth
                , normalBorderColor  = myNormalBorderColor
                , focusedBorderColor = myFocusedBorderColor
                , keys               = myKeys              -- benötigt xcompmgr
                , logHook            = myLogHook status >> fadeInactiveLogHook 0.90
                , modMask            = myModMask
                , terminal           = myTerminal
                , workspaces         = myWorkspaces
                , focusFollowsMouse  = False
                , startupHook        = startup
                }


--- Autostartprogramme:
startup :: X ()
startup = do
          setWMName "LG3D"                         -- löst Problem mit Java-Programmen
          -- spawn "xcompmgr -c -C -t-5 -l-5 -r4.2 -o0.1"
          spawn "~/.xmonad/myxrandr.sh"
          spawn "~/.xmonad/conky/conkys.sh"
          spawn "urxvtd -f"
          spawn "udiskie &"
          spawn "tilda"
          spawn "~/Prog/Shell/Skripte/dpms.sh"
          -- spawn "setxkbmap MICHAEL"
          spawn "fcitx&"
          -- spawn "setxkbmap -option grp:alt_shift_toggle -option grp_led:scroll de,fr"
          spawn "thunderbird"
          spawn "xbacklight -set 70"


--- Arbeitsflächen:
myWorkspaces :: [WorkspaceId]

myWorkspaces = [supWsNum "1" "work" ,supWsNum "2" "web", supWsNum "3" "code",supWsNum "4" "gimp",
                supWsNum "5" "wuala",supWsNum "6" "mail",supWsNum "7" "media",supWsNum "8" "WinXP"]
              where
                supWsNum wsName wsNum =" " ++ wsName ++ "^p(;_TOP)^fn(" ++ "xft:monospace:size=7"
                                           ++ ")" ++ wsNum ++ "  ^fn()^p()"


--- Anwendungen auf bestimmten Arbeitsflächen starten:
myManageHook :: ManageHook
myManageHook = scratchpadManageHook (W.RationalRect 0.25 0.375 0.5 0.35) <+>
              ( composeAll . concat $
                [[isFullscreen                     --> doFullFloat
                , className   =? "xbmc.bin"        --> doFullFloat
                , className   =? "Gnuplot"         --> doCenterFloat
                , className   =? "MPlayer"         --> doCenterFloat
                , className   =? "Exaile"          --> doCenterFloat
                , className   =? "Pidgin"          --> doF (W.shift      (myWorkspaces !! 1))
                , className   =? "Gedit"           --> doF (W.greedyView (myWorkspaces !! 2))
                , className   =? "Gedit"           --> doF (W.shift      (myWorkspaces !! 2))
                , className   =? "Kile"            --> doF (W.greedyView (myWorkspaces !! 2))
                , className   =? "Kile"            --> doF (W.shift      (myWorkspaces !! 2))
                , className   =? "Gimp"            --> doF (W.greedyView (myWorkspaces !! 3))
                , className   =? "Gimp"            --> doF (W.shift      (myWorkspaces !! 3))
                , className   =? "Inkscape"        --> doF (W.greedyView (myWorkspaces !! 3))
                , className   =? "Inkscape"        --> doF (W.shift      (myWorkspaces !! 3))
                , className   =? "Wuala"           --> doF (W.greedyView (myWorkspaces !! 4))
                , className   =? "Wuala"           --> doF (W.shift      (myWorkspaces !! 4))
                , className   =? "Thunderbird"     --> doF (W.shift      (myWorkspaces !! 5))
                , className   =? "xbmc.bin"        --> doF (W.greedyView (myWorkspaces !! 6))
                , className   =? "xbmc.bin"        --> doF (W.shift      (myWorkspaces !! 6))
                , className   =? "MPlayer"         --> doF (W.greedyView (myWorkspaces !! 6))
                , className   =? "MPlayer"         --> doF (W.shift      (myWorkspaces !! 6))
                , className   =? "VirtualBox"      --> doF (W.shift      (myWorkspaces !! 7))
                , className   =? "VirtualBox"      --> doF (W.greedyView (myWorkspaces !! 7))]
                , [ title     =? t --> doFloat | t <- myTitleFloats]
                ]
              )  <+> manageDocks
  where myTitleFloats = ["Downloads", "Wiedergabeliste", "tilda"]


--- arbeitsflächenspezifische Teilungseinstellungen: --------------------------------------------------
-------------------------------------------------------------------------------------------------------

myLayoutHook  = mouseResize $ windowArrange        -- Fenstergröße mit Maus variieren.
              $ onWorkspace (myWorkspaces !! 1) imL
              $ onWorkspace (myWorkspaces !! 2) kileL
              $ onWorkspace (myWorkspaces !! 3) gimpL
              $ onWorkspace (myWorkspaces !! 4) tabL
              $ onWorkspace (myWorkspaces !! 5) tabL
              $ onWorkspace (myWorkspaces !! 6) fullL
              $ onWorkspace (myWorkspaces !! 7) fullL
              $ standardLayouts 
   where --- mein Standardlayout:
        standardLayouts = ( avoidStruts $ windowNavigation $ limitWindows 6 $ -- max. Fensterzahl
                            tiled                  |||
                            Mirror tiled           |||
                            tabLayout                          
                          )

        --- Layout-Definitionen:
        tiled        = (ResizableTall 1 (2/100) (1/2) [])
        reflectTiled = (reflectHoriz tiled)
        tabLayout    = (noBorders $ tabbed shrinkText myTheme)
        full         = smartBorders Full


        --- IM Layout (pidgin):
        imL  = avoidStruts  $ windowNavigation     $ reflectHoriz
                            $ smartBorders         $ withIM (1/7) (Role "buddy_list") -- (1/10 groß. B)
                            $ reflectHoriz         
                            $ tabLayout ||| tiled ||| Mirror tiled ||| ThreeColMid 1 (3/100) (1/2)

        --- Gimp Layout:
        gimpL = avoidStruts $ windowNavigation
                            $ smartBorders         $ withIM (0.15) (Role "gimp-toolbox")
                            $ reflectHoriz         $ withIM (0.15) (Role "gimp-dock")
                            $ reflectHoriz         $ tabLayout     ||| tiled ||| Mirror tiled

        --- Tabbing-Layout:
        tabL  = avoidStruts $ windowNavigation     $ tabLayout     ||| tiled ||| Mirror tiled

        --- Vollbild (vlc):
        fullL = avoidStruts $ full

        --- kile Layout (zum ermitteln des Fensternamens: xprop_|_grep_WM_WINDOW_ROLE):
        kileL = avoidStruts $ windowNavigation
                            $ withIM (0.43)  (Role "MainWindow#1") $ tabLayout ||| tiled
                                 --- $ withIM (0.57)  (ClassName "URxvt")
                                 --- (0.57)  -- für kleinen Bildschirm (vim)
                                 --- (0.60)  -- für kleinen Bildschirm (kile)
                                 --- (0.41)  -- für großen  Bildschirm (vim)
                                 --- (0.43)  -- für großen  Bildschirm (kile)


--- Einstellungen für getabbtes Layout:
myTheme = defaultTheme {  decoHeight          = 19
                        , fontName            = "xft:terminus:size=10"
                        , activeColor         = "#4C4C4C"
                        , activeBorderColor   = "#465657"
                        , activeTextColor     = "#F5F5F5"
                        , inactiveColor       = "#333333"
                        , inactiveBorderColor = "#333333"
                        , inactiveTextColor   = "#6A9598"
                        }


--- Sonstige: -----------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------


--- Dzen2 (Taskleiste):
myLogHook h = dynamicLogWithPP $ myDzenPP { ppOutput = hPutStrLn h }

                        --1366
myDzenStatus = "dzen2 -dock -w '3286' -ta 'l' " ++ myDzenStyle
myDzenStyle  = " -h '21' -fg '#000FFF' -bg '#282725' -fn 'Droid Sans:xft:size=10'"

myDzenPP = dzenPP
    { ppCurrent = wrap "^fg(snow1)^bg(#1987BE) " " ^fg()^bg()"
    , ppHidden  = dzenColor "#78AEB1" "" .wrap " " " "
    , ppUrgent  = wrap "^fg(snow1)^bg(#FE5764) " " ^fg()^bg()"
    , ppSep     = " "
    , ppLayout  = const ""
    , ppTitle   = const ""
    }

--- Farbschema dmenu:
myXPConfig = defaultXPConfig
    { font     = "xft:terminus:size=8"
    , fgColor  = "#00FFFF"
    , bgColor  = "#000000"
    , bgHLight = "#000000"
    , fgHLight = "#FF0000"
    , position = Top
    , height   = 21
    }


--- Terminal:
myTerminal :: String
myTerminal = "urxvt"


--- Umrandung:
myBorderWidth :: Dimension
myBorderWidth = 0

myNormalBorderColor, myFocusedBorderColor :: String
myNormalBorderColor  = "#333333"
myFocusedBorderColor = "#1987BE"


--- Tastaturbelegung: ---------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------

--- Modtaste:
myModMask :: KeyMask
myModMask = mod4Mask


-- Tastenkombinationen: (teilweise Doppelbelegungen - finde ich aber so ganz angenehm)
myKeys :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ())
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
    --- Programme öffnen, schließen, ...
    [ ((modMask .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)  -- Terminal
    , ((modMask .|. shiftMask, xK_BackSpace), spawn "xfce4-terminal")     -- Terminal 2
    , ((modMask .|. shiftMask, xK_c )    , kill)                          -- schließen
    , ((modMask    , xK_p ), shellPrompt myXPConfig)                      -- dmenu
    , ((modMask    , xK_o ), spawn "bash ~/Prog/Shell/Skripte/dmenu/translate.sh")


    --- multimonitoring:
    , ((modMask, xK_b), layoutScreens 2 (fixedLayout [Rectangle 0 0 1024 768]))
    , ((modMask, xK_v), rescreen)


    --- Abmelden, XMonad neustarten: 
    , ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
                                    -- spawn "killall -QUIT X")           -- abmelden (X beenden)
    , ((modMask , xK_q              ), restart "xmonad" True)             -- XMonad neustarten
    , ((modMask , xK_w              ), spawn "sh /home/michael/.xmonad/killbar.sh")
    , ((modMask .|. shiftMask, xK_s ), spawn "poweroff")             -- auschalten
    , ((modMask .|. shiftMask, xK_r ), spawn "reboot")               -- neustarten
    , ((modMask .|. shiftMask, xK_a ), spawn "/usr/lib/kde4/libexec/kscreenlocker_greet")


    --- Tyling-Funktionen:
    , ((modMask , xK_t ), withFocused $ windows . W.sink)                 -- Fenster in Tyling einb.
    , ((modMask , xK_space ), sendMessage NextLayout)                     --  Tylinglayout wechseln
    , ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf) -- Standardlayout
    , ((modMask , xK_comma ), sendMessage (IncMasterN 1))                 -- +1 akt. Fenster
    , ((modMask , xK_period), sendMessage (IncMasterN (-1)))              -- -1 akt. Fenster


    --- Fokus:
    , ((modMask,   xK_a), goToSelected defaultGSConfig)                   -- Programm-Auswahl
    , ((modMask,   xK_m    ), windows W.focusMaster)                      -- Master-Fenster Fokus
    , ((modMask,   xK_Tab  ), windows W.focusDown)
    , ((modMask,   xK_u    ), windows W.focusUp)
    , ((modMask,   xK_i    ), windows W.focusDown)
    , ((modMask,   xK_h    ), sendMessage $ Go L)                         -- Fokus nach links 
    , ((modMask,   xK_j    ), sendMessage $ Go D)                         -- Fokus nach unten
    , ((modMask,   xK_k    ), sendMessage $ Go U)                         -- Fokus nach oben
    , ((modMask,   xK_l    ), sendMessage $ Go R)                         -- Fokus nach rechts 
    , ((modMask,   xK_Left ), sendMessage $ Go L)                         -- alt. Tastenbelegungen
    , ((modMask,   xK_Down ), sendMessage $ Go D)
    , ((modMask,   xK_Up   ), sendMessage $ Go U)
    , ((modMask,   xK_Right), sendMessage $ Go R) 


    --- Fenster tauschen:
    , ((modMask .|. shiftMask, xK_u     ), windows W.swapUp)
    , ((modMask .|. shiftMask, xK_i     ), windows W.swapDown)
    , ((modMask .|. shiftMask, xK_h     ), sendMessage $ Swap L)
    , ((modMask .|. shiftMask, xK_j     ), sendMessage $ Swap D)
    , ((modMask .|. shiftMask, xK_k     ), sendMessage $ Swap U)
    , ((modMask .|. shiftMask, xK_l     ), sendMessage $ Swap R)
    , ((modMask .|. shiftMask, xK_Left  ), sendMessage $ Swap L)
    , ((modMask .|. shiftMask, xK_Down  ), sendMessage $ Swap D)
    , ((modMask .|. shiftMask, xK_Up    ), sendMessage $ Swap U)
    , ((modMask .|. shiftMask, xK_Right ), sendMessage $ Swap R)
    , ((modMask,               xK_Return), dwmpromote)                    -- mit Mast.-F. tauschen


    --- zwischen Arbeitsflächen wechseln, Fenster auf Arbeitsflächen rumschieben:
    , ((mod1Mask .|. controlMask, xK_Right),  nextWS)
    , ((mod1Mask .|. controlMask, xK_Left ),  prevWS)
    , ((mod1Mask .|. shiftMask  , xK_Right),  shiftToNext >> nextWS)
    , ((mod1Mask .|. shiftMask  , xK_Left ),  shiftToPrev >> prevWS)
    , ((modMask                 , xK_z    ),  toggleWS)


    -- Fenstergröße bearbeiten:
    , ((modMask .|. mod1Mask, xK_h    ), sendMessage Shrink)
    , ((modMask .|. mod1Mask, xK_j    ), sendMessage MirrorShrink)
    , ((modMask .|. mod1Mask, xK_k    ), sendMessage MirrorExpand)
    , ((modMask .|. mod1Mask, xK_l    ), sendMessage Expand)
    , ((modMask .|. mod1Mask, xK_Left ), sendMessage Shrink)              -- alt. Tastenbelegungen
    , ((modMask .|. mod1Mask, xK_Down ), sendMessage MirrorShrink)
    , ((modMask .|. mod1Mask, xK_Up   ), sendMessage MirrorExpand)
    , ((modMask .|. mod1Mask, xK_Right), sendMessage Expand)
    -- schnell zu Vollbild wechseln (und zurück zum Standard):
    , ((modMask .|. shiftMask, xK_m   ), sendMessage $ JumpToLayout "Full")
    , ((modMask .|. shiftMask, xK_n   ), sendMessage $ JumpToLayout "ResizableTall")
    , ((modMask .|. shiftMask, xK_b   ), sendMessage $ JumpToLayout "Tabbed Simplest")


    --- Programm-Start (h,j,k,l nicht verwenden s.o.):
    , ((modMask .|. mod1Mask, xK_a), spawn "jumanji")                     --  JumA*nji
    , ((modMask .|. mod1Mask, xK_b), spawn "kile")                        -- kile 
    , ((modMask .|. mod1Mask, xK_c), spawn "bash ~/Prog/Shell/Skripte/xbmcmount.sh") -- xbmC* 
    , ((modMask .|. mod1Mask, xK_d), spawn "mplayer dvdnav://")           --  D*VD abspielen
    , ((modMask .|. mod1Mask, xK_e), spawn "exaile")                      --  E*xaile
    , ((modMask .|. mod1Mask, xK_f), spawn "firefox")                     --  F*irefox
    , ((modMask .|. mod1Mask, xK_g), spawn "gimp")                        --  G*imp
    , ((modMask .|. mod1Mask, xK_i), spawn "inkscape")                    --  I*nkscape
    , ((modMask .|. mod1Mask, xK_m), spawn "xmaple -cw")                  --  M*aple
    , ((modMask .|. mod1Mask, xK_n), spawn "nautilus")                    --  N*autilus
    , ((modMask .|. mod1Mask, xK_p), spawn "pidgin")                      --  P*idgin
    , ((modMask .|. mod1Mask, xK_r), spawn "bash ~/.xmonad/myxrandr.sh")  -- Bildschirmeinstellung
    , ((modMask .|. mod1Mask, xK_s), spawn "skill pdflatex")              --  S*kill pdflatex
    , ((modMask .|. mod1Mask, xK_t), spawn "thunderbird")                 --  T*hunderbird
    , ((modMask .|. mod1Mask, xK_u), spawn "vlc Kaiserslautern.conf")     -- tv  (KaiserslaU*tern)
    , ((modMask .|. mod1Mask, xK_v), spawn "vlc http://michael:leahcim@192.168.0.20:9981/playlist/channels")
    , ((modMask .|. mod1Mask, xK_w), spawn "virtualbox --startvm 'Windows XP'")
    , ((modMask .|. mod1Mask, xK_x), spawn "xkill")                       --  X*kill
    , ((modMask .|. mod1Mask, xK_h), spawn "bash ~/Test.sh") 

    , ((modMask .|. mod1Mask, xK_F1), spawn "tilda")
    , ((modMask .|. mod1Mask, xK_F2), spawn "tilda")

    -- Skripte lesen:
    , ((modMask .|. controlMask, xK_a), spawn "evince ~/Daten/Michael/TU_KL/Skripte/MG_AgS.pdf")
    , ((modMask .|. controlMask, xK_b), spawn "evince ~/Daten/Michael/TU_KL/Skripte/BA.pdf")
    , ((modMask .|. controlMask, xK_c), spawn "evince ~/Daten/Michael/TU_KL/Skripte/L_chemfig.pdf")
    , ((modMask .|. controlMask, xK_d), spawn "evince ~/Daten/Michael/TU_KL/Skripte/NumODE.pdf") 
    , ((modMask .|. controlMask, xK_e), spawn "evince ~/Daten/Michael/TU_KL/Skripte/L_cTikZ.pdf")
    , ((modMask .|. controlMask, xK_f), spawn "evince ~/Daten/Michael/TU_KL/Skripte/Bt_FuTu.pdf")
    , ((modMask .|. controlMask, xK_g), spawn "evince ~/Daten/Michael/TU_KL/Skripte/Wirth_GdM.pdf")
    , ((modMask .|. controlMask, xK_k), spawn "evince ~/Daten/Michael/TU_KL/Skripte/L_KOMA.pdf")
    , ((modMask .|. controlMask, xK_l), spawn "evince ~/Daten/Michael/TU_KL/Skripte/L_LaTeX.pdf")
    , ((modMask .|. controlMask, xK_m), spawn "evince ~/Daten/Michael/TU_KL/Skripte/MG_eZt.pdf")
    , ((modMask .|. controlMask, xK_n), spawn "evince ~/Daten/Michael/TU_KL/Skripte/Damm_N.pdf")
    , ((modMask .|. controlMask, xK_o), spawn "evince ~/Daten/Michael/privat/Openbook/Linux/Gentoo.pdf")
    , ((modMask .|. controlMask, xK_p), spawn "evince ~/Daten/Michael/TU_KL/Skripte/L_PPt.pdf")
    , ((modMask .|. controlMask, xK_s), spawn "evince ~/Daten/Michael/TU_KL/Skripte/VW_S.pdf")
    , ((modMask .|. controlMask, xK_t), spawn "evince ~/Daten/Michael/TU_KL/Skripte/L_TikZ.pdf")
    , ((modMask .|. controlMask, xK_u), spawn "evince ~/Daten/Michael/TU_KL/Skripte/gnuplot.pdf")
    , ((modMask .|. controlMask, xK_w), spawn "evince ~/Daten/Michael/TU_KL/Skripte/Rr_PTu.pdf")
    , ((modMask .|. controlMask, xK_y), spawn "evince ~/Daten/Michael/TU_KL/Skripte/L_Symb.pdf")
    , ((modMask .|. controlMask, xK_z), spawn "evince ~/Daten/Michael/TU_KL/Skripte/PDE.pdf")


    --- Screenshot:
    , ((0,        xK_Print), spawn "scrot")                               -- normal
    , ((modMask,  xK_Print), spawn "scrot -s")                            -- fokussiertes Fenster


    --- exaile:
    , ((controlMask, xK_Right ), spawn "exaile -n")
    , ((controlMask, xK_Left  ), spawn "exaile -p")
    , ((controlMask, xK_Down  ), spawn "exaile -t")

    --- Lautstärkeregelung:
    , ((0                , 0x1008ff13 ), spawn "amixer -q set Master 2dB+")
    , ((0                , 0x1008ff11 ), spawn "amixer -q set Master 2dB-")
    , ((0                , 0x1008ff12 ), spawn "~/.xmonad/conky/mute.sh")
    ]
    ++
    -- mod-[1..9]       %! zu Arbeitsfläche 1 - 9 wechseln:
    -- mod-shift-[1..9] %! Fenster auf Arbeitsfläche 1 - 9 verschieben:
    [((m .|. modMask, k), windows $ f i)
          | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
          , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]

Last edited by ratzfatz (2022-07-11 14:37:19)


The common language in modern science is broken english wink

Offline

#2 2022-07-11 07:33:32

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,244

Re: [SOLVED] Could anyone help me fixing my "xmonad.hs" please?

Looking at the 0.16 code, those functions were deprecated then and warned you to

Use def (from Data.Default, and re-exported from XMonad.Prompt) instead." #-}

Offline

#3 2022-07-11 13:16:34

ratzfatz
Member
From: KL, Germany
Registered: 2011-06-03
Posts: 30

Re: [SOLVED] Could anyone help me fixing my "xmonad.hs" please?

So if I understand it right, I can replace defaultConfig from XMonad.Prompt by def from Data.Default? But what can I replace defaultTheme, defaultXPConfig and defaultGSConfig with? Sorry for my silly questions. As I told, I'm not really familiar with Haskell. I just hope I can fix my WM.

Thanks a lot for any further advice in advance!

Regards, Michael


The common language in modern science is broken english wink

Offline

#4 2022-07-11 13:26:52

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: [SOLVED] Could anyone help me fixing my "xmonad.hs" please?

You might get better answers if you try the xmonad wiki or their IRC channel: https://xmonad.org/community.html

Offline

#5 2022-07-11 13:29:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,244

Re: [SOLVED] Could anyone help me fixing my "xmonad.hs" please?

Afaiu the deprecation comments, you can replace them *all* w/ just "def" and they're aliased below those comments.
Just try and see.

Offline

#6 2022-07-11 14:34:50

ratzfatz
Member
From: KL, Germany
Registered: 2011-06-03
Posts: 30

Re: [SOLVED] Could anyone help me fixing my "xmonad.hs" please?

Thank you guys,


due to your further explanations I could finally sort out all the Syntax errors. In case anyone stumbles over the same issue, here's a short explanation of what I did:

1.) As @seth suggested, I replaced "defaultConfig", "defaultTheme", "defaultXPConfig" and "defaultGSConfig" all by just "def"
After this, the compiling was already free of errors, but there was a warning left.

XMonad will use ghc to recompile, because neither "/home/michael/.xmonad/build" nor "/home/michael/.xmonad/stack.yaml" exists.
XMonad recompiling (forced).
Deprecations detected while compiling xmonad config: /home/michael/.xmonad/xmonad.hs
$ ghc --make xmonad.hs -i -ilib -fforce-recomp -main-is main -dynamic -v0 -outputdir /home/michael/.xmonad/build-x86_64-linux -o /home/michael/.xmonad/xmonad-x86_64-linux

xmonad.hs:79:40: warning: [-Wdeprecations]
    In the use of ‘docksEventHook’
    (imported from XMonad.Hooks.ManageDocks):
    Deprecated: "Use docks instead."
   |
79 |                                      [ docksEventHook
   |                                        ^^^^^^^^^^^^^^

Please correct them or silence using {-# OPTIONS_GHC -Wno-deprecations #-}.

2.) I did some further research and found the solution explained here (Link).
I replaced the old coding ...

main = do
        status <- spawnPipe myDzenStatus           -- XMond-Status (links)
        xmonad  $ withUrgencyHook NoUrgencyHook $ defaultConfig
                { manageHook         = myManageHook
                , layoutHook         = myLayoutHook
                , handleEventHook    = mconcat
                                     [ docksEventHook
                                     , handleEventHook defaultConfig ]
                , borderWidth        = myBorderWidth
                , normalBorderColor  = myNormalBorderColor
                , focusedBorderColor = myFocusedBorderColor
                , keys               = myKeys              -- benötigt xcompmgr
                , logHook            = myLogHook status >> fadeInactiveLogHook 0.90
                , modMask            = myModMask
                , terminal           = myTerminal
                , workspaces         = myWorkspaces
                , focusFollowsMouse  = False
                , startupHook        = startup
                }

... by this new coding

main = do
        status <- spawnPipe myDzenStatus           -- XMond-Status (links)
        xmonad  $ docks $ withUrgencyHook NoUrgencyHook $ def
                { manageHook         = myManageHook
                , layoutHook         = myLayoutHook
                , handleEventHook    = mconcat [ handleEventHook def ]
                , borderWidth        = myBorderWidth
                , normalBorderColor  = myNormalBorderColor
                , focusedBorderColor = myFocusedBorderColor
                , keys               = myKeys              -- benötigt xcompmgr
                , logHook            = myLogHook status >> fadeInactiveLogHook 0.90
                , modMask            = myModMask
                , terminal           = myTerminal
                , workspaces         = myWorkspaces
                , focusFollowsMouse  = False
                , startupHook        = startup
                }

Now my XMonad is working again perfectly. Thank for your help again and we see us in 10 years again, when I have the next problem with my Arch installation. cool wink (or maybe earlier if one day I have more time again to try out and learn new things around Linux)


Kind regards,

Michael


The common language in modern science is broken english wink

Offline

Board footer

Powered by FluxBB