{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
module XMonad.Config.Kde (
kdeConfig,
kde4Config,
desktopLayoutModifiers
) where
import XMonad
import XMonad.Config.Desktop
import qualified Data.Map as M
kdeConfig :: XConfig
(ModifiedLayout
AvoidStruts (Choose Tall (Choose (Mirror Tall) Full)))
kdeConfig = XConfig
(ModifiedLayout
AvoidStruts (Choose Tall (Choose (Mirror Tall) Full)))
desktopConfig
{ terminal :: String
terminal = String
"konsole"
, keys :: XConfig Layout -> Map (KeyMask, KeySym) (X ())
keys = XConfig Layout -> Map (KeyMask, KeySym) (X ())
forall {m :: * -> *} {l :: * -> *}.
MonadIO m =>
XConfig l -> Map (KeyMask, KeySym) (m ())
kdeKeys (XConfig Layout -> Map (KeyMask, KeySym) (X ()))
-> (XConfig Layout -> Map (KeyMask, KeySym) (X ()))
-> XConfig Layout
-> Map (KeyMask, KeySym) (X ())
forall a. Semigroup a => a -> a -> a
<> XConfig
(ModifiedLayout
AvoidStruts (Choose Tall (Choose (Mirror Tall) Full)))
-> XConfig Layout -> Map (KeyMask, KeySym) (X ())
forall (l :: * -> *).
XConfig l -> XConfig Layout -> Map (KeyMask, KeySym) (X ())
keys XConfig
(ModifiedLayout
AvoidStruts (Choose Tall (Choose (Mirror Tall) Full)))
desktopConfig }
kde4Config :: XConfig
(ModifiedLayout
AvoidStruts (Choose Tall (Choose (Mirror Tall) Full)))
kde4Config = XConfig
(ModifiedLayout
AvoidStruts (Choose Tall (Choose (Mirror Tall) Full)))
desktopConfig
{ terminal :: String
terminal = String
"konsole"
, keys :: XConfig Layout -> Map (KeyMask, KeySym) (X ())
keys = XConfig Layout -> Map (KeyMask, KeySym) (X ())
forall {m :: * -> *} {l :: * -> *}.
MonadIO m =>
XConfig l -> Map (KeyMask, KeySym) (m ())
kde4Keys (XConfig Layout -> Map (KeyMask, KeySym) (X ()))
-> (XConfig Layout -> Map (KeyMask, KeySym) (X ()))
-> XConfig Layout
-> Map (KeyMask, KeySym) (X ())
forall a. Semigroup a => a -> a -> a
<> XConfig
(ModifiedLayout
AvoidStruts (Choose Tall (Choose (Mirror Tall) Full)))
-> XConfig Layout -> Map (KeyMask, KeySym) (X ())
forall (l :: * -> *).
XConfig l -> XConfig Layout -> Map (KeyMask, KeySym) (X ())
keys XConfig
(ModifiedLayout
AvoidStruts (Choose Tall (Choose (Mirror Tall) Full)))
desktopConfig }
kdeKeys :: XConfig l -> Map (KeyMask, KeySym) (m ())
kdeKeys XConfig{modMask :: forall (l :: * -> *). XConfig l -> KeyMask
modMask = KeyMask
modm} = [((KeyMask, KeySym), m ())] -> Map (KeyMask, KeySym) (m ())
forall k a. Ord k => [(k, a)] -> Map k a
M.fromList
[ ((KeyMask
modm, KeySym
xK_p), String -> m ()
forall (m :: * -> *). MonadIO m => String -> m ()
spawn String
"dcop kdesktop default popupExecuteCommand")
, ((KeyMask
modm KeyMask -> KeyMask -> KeyMask
forall a. Bits a => a -> a -> a
.|. KeyMask
shiftMask, KeySym
xK_q), String -> m ()
forall (m :: * -> *). MonadIO m => String -> m ()
spawn String
"dcop kdesktop default logout")
]
kde4Keys :: XConfig l -> Map (KeyMask, KeySym) (m ())
kde4Keys XConfig{modMask :: forall (l :: * -> *). XConfig l -> KeyMask
modMask = KeyMask
modm} = [((KeyMask, KeySym), m ())] -> Map (KeyMask, KeySym) (m ())
forall k a. Ord k => [(k, a)] -> Map k a
M.fromList
[ ((KeyMask
modm, KeySym
xK_p), String -> m ()
forall (m :: * -> *). MonadIO m => String -> m ()
spawn String
"krunner")
, ((KeyMask
modm KeyMask -> KeyMask -> KeyMask
forall a. Bits a => a -> a -> a
.|. KeyMask
shiftMask, KeySym
xK_q), String -> m ()
forall (m :: * -> *). MonadIO m => String -> m ()
spawn String
"dbus-send --print-reply --dest=org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout int32:1 int32:0 int32:1")
]