ENH use rio in (one) interactive command
This commit is contained in:
parent
b64742b925
commit
9ec24b63a0
|
@ -123,7 +123,7 @@ run = do
|
||||||
dws <- startDynWorkspaces fs
|
dws <- startDynWorkspaces fs
|
||||||
runIO <- askRunInIO
|
runIO <- askRunInIO
|
||||||
let cleanup = runCleanup runIO toClean db
|
let cleanup = runCleanup runIO toClean db
|
||||||
kbs <- filterExternal <$> evalExternal (fsKeys fs cleanup db)
|
kbs <- filterExternal <$> evalExternal (fsKeys fs runIO cleanup db)
|
||||||
sk <- evalAlways $ fsShowKeys fs
|
sk <- evalAlways $ fsShowKeys fs
|
||||||
ha <- evalAlways $ fsACPIHandler fs
|
ha <- evalAlways $ fsACPIHandler fs
|
||||||
tt <- evalAlways $ fsTabbedTheme fs
|
tt <- evalAlways $ fsTabbedTheme fs
|
||||||
|
@ -171,7 +171,7 @@ getCreateDirectories = do
|
||||||
_ -> return ()
|
_ -> return ()
|
||||||
|
|
||||||
data FeatureSet = FeatureSet
|
data FeatureSet = FeatureSet
|
||||||
{ fsKeys :: X () -> DBusState -> [KeyGroup FeatureX]
|
{ fsKeys :: (XIO () -> IO ()) -> X () -> DBusState -> [KeyGroup FeatureX]
|
||||||
, fsDBusExporters :: [Maybe SesClient -> Sometimes (XIO (), XIO ())]
|
, fsDBusExporters :: [Maybe SesClient -> Sometimes (XIO (), XIO ())]
|
||||||
, fsPowerMon :: SometimesIO
|
, fsPowerMon :: SometimesIO
|
||||||
, fsRemovableMon :: Maybe SysClient -> SometimesIO
|
, fsRemovableMon :: Maybe SysClient -> SometimesIO
|
||||||
|
@ -262,7 +262,7 @@ printDeps = withDBus_ $ \db -> do
|
||||||
let mockCleanup = runCleanup runIO mockClean db
|
let mockCleanup = runCleanup runIO mockClean db
|
||||||
let bfs =
|
let bfs =
|
||||||
concatMap (fmap kbMaybeAction . kgBindings) $
|
concatMap (fmap kbMaybeAction . kgBindings) $
|
||||||
externalBindings mockCleanup db
|
externalBindings runIO mockCleanup db
|
||||||
let dbus =
|
let dbus =
|
||||||
fmap (\f -> f $ dbSesClient db) dbusExporters
|
fmap (\f -> f $ dbSesClient db) dbusExporters
|
||||||
:: [Sometimes (XIO (), XIO ())]
|
:: [Sometimes (XIO (), XIO ())]
|
||||||
|
@ -794,8 +794,8 @@ filterExternal = fmap go
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
externalBindings :: X () -> DBusState -> [KeyGroup FeatureX]
|
externalBindings :: (XIO () -> IO ()) -> X () -> DBusState -> [KeyGroup FeatureX]
|
||||||
externalBindings cleanup db =
|
externalBindings runIO cleanup db =
|
||||||
[ KeyGroup
|
[ KeyGroup
|
||||||
"Launchers"
|
"Launchers"
|
||||||
[ KeyBinding "<XF86Search>" "select/launch app" $ Left runAppMenu
|
[ KeyBinding "<XF86Search>" "select/launch app" $ Left runAppMenu
|
||||||
|
@ -860,7 +860,7 @@ externalBindings cleanup db =
|
||||||
, KeyBinding "M-<F8>" "select autorandr profile" $ Left runAutorandrMenu
|
, KeyBinding "M-<F8>" "select autorandr profile" $ Left runAutorandrMenu
|
||||||
, KeyBinding "M-<F9>" "toggle ethernet" $ Left runToggleEthernet
|
, KeyBinding "M-<F9>" "toggle ethernet" $ Left runToggleEthernet
|
||||||
, KeyBinding "M-<F10>" "toggle bluetooth" $ Left $ runToggleBluetooth sys
|
, KeyBinding "M-<F10>" "toggle bluetooth" $ Left $ runToggleBluetooth sys
|
||||||
, KeyBinding "M-<F11>" "toggle screensaver" $ Left $ callToggle ses
|
, KeyBinding "M-<F11>" "toggle screensaver" $ Left $ (liftIO . runIO) <$> callToggle ses
|
||||||
, KeyBinding "M-<F12>" "switch gpu" $ Left runOptimusPrompt
|
, KeyBinding "M-<F12>" "switch gpu" $ Left runOptimusPrompt
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
|
@ -124,7 +124,7 @@ exportScreensaver ses =
|
||||||
bus = Bus [] xmonadBusName
|
bus = Bus [] xmonadBusName
|
||||||
ssx = DBusIO $ sysExe [Package Official "xorg-xset"] ssExecutable
|
ssx = DBusIO $ sysExe [Package Official "xorg-xset"] ssExecutable
|
||||||
|
|
||||||
callToggle :: Maybe SesClient -> SometimesX
|
callToggle :: MonadUnliftIO m => Maybe SesClient -> Sometimes (m ())
|
||||||
callToggle =
|
callToggle =
|
||||||
sometimesEndpoint
|
sometimesEndpoint
|
||||||
"screensaver toggle"
|
"screensaver toggle"
|
||||||
|
|
Loading…
Reference in New Issue