ENH use rio in (one) interactive command

This commit is contained in:
Nathan Dwarshuis 2023-01-02 12:33:37 -05:00
parent b64742b925
commit 9ec24b63a0
2 changed files with 7 additions and 7 deletions

View File

@ -123,7 +123,7 @@ run = do
dws <- startDynWorkspaces fs
runIO <- askRunInIO
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
ha <- evalAlways $ fsACPIHandler fs
tt <- evalAlways $ fsTabbedTheme fs
@ -171,7 +171,7 @@ getCreateDirectories = do
_ -> return ()
data FeatureSet = FeatureSet
{ fsKeys :: X () -> DBusState -> [KeyGroup FeatureX]
{ fsKeys :: (XIO () -> IO ()) -> X () -> DBusState -> [KeyGroup FeatureX]
, fsDBusExporters :: [Maybe SesClient -> Sometimes (XIO (), XIO ())]
, fsPowerMon :: SometimesIO
, fsRemovableMon :: Maybe SysClient -> SometimesIO
@ -262,7 +262,7 @@ printDeps = withDBus_ $ \db -> do
let mockCleanup = runCleanup runIO mockClean db
let bfs =
concatMap (fmap kbMaybeAction . kgBindings) $
externalBindings mockCleanup db
externalBindings runIO mockCleanup db
let dbus =
fmap (\f -> f $ dbSesClient db) dbusExporters
:: [Sometimes (XIO (), XIO ())]
@ -794,8 +794,8 @@ filterExternal = fmap go
]
}
externalBindings :: X () -> DBusState -> [KeyGroup FeatureX]
externalBindings cleanup db =
externalBindings :: (XIO () -> IO ()) -> X () -> DBusState -> [KeyGroup FeatureX]
externalBindings runIO cleanup db =
[ KeyGroup
"Launchers"
[ KeyBinding "<XF86Search>" "select/launch app" $ Left runAppMenu
@ -860,7 +860,7 @@ externalBindings cleanup db =
, KeyBinding "M-<F8>" "select autorandr profile" $ Left runAutorandrMenu
, KeyBinding "M-<F9>" "toggle ethernet" $ Left runToggleEthernet
, 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
]
]

View File

@ -124,7 +124,7 @@ exportScreensaver ses =
bus = Bus [] xmonadBusName
ssx = DBusIO $ sysExe [Package Official "xorg-xset"] ssExecutable
callToggle :: Maybe SesClient -> SometimesX
callToggle :: MonadUnliftIO m => Maybe SesClient -> Sometimes (m ())
callToggle =
sometimesEndpoint
"screensaver toggle"