ENH generalize keyboard stuff

This commit is contained in:
Nathan Dwarshuis 2022-12-31 15:26:22 -05:00
parent 98358983de
commit 71c875702f
2 changed files with 14 additions and 7 deletions

View File

@ -13,11 +13,10 @@ module XMonad.Internal.DBus.Brightness.ClevoKeyboard
)
where
import Control.Monad (when)
import DBus
import Data.Int (Int32)
import Data.Internal.DBus
import Data.Internal.Dependency
import RIO
import RIO.FilePath
import XMonad.Internal.DBus.Brightness.Common
import XMonad.Internal.IO
@ -127,8 +126,12 @@ exportClevoKeyboard =
clevoKeyboardControls :: Maybe SesClient -> BrightnessControls
clevoKeyboardControls = brightnessControls xpfClevoBacklight clevoKeyboardConfig
callGetBrightnessCK :: SesClient -> IO (Maybe Brightness)
callGetBrightnessCK :: MonadUnliftIO m => SesClient -> m (Maybe Brightness)
callGetBrightnessCK = callGetBrightness clevoKeyboardConfig
matchSignalCK :: (Maybe Brightness -> IO ()) -> SesClient -> IO ()
matchSignalCK
:: MonadUnliftIO m
=> (Maybe Brightness -> m ())
-> SesClient
-> m ()
matchSignalCK = matchSignal clevoKeyboardConfig

View File

@ -14,9 +14,9 @@ module XMonad.Internal.DBus.Brightness.IntelBacklight
where
import DBus
import Data.Int (Int32)
import Data.Internal.DBus
import Data.Internal.Dependency
import RIO
import RIO.FilePath
import XMonad.Internal.DBus.Brightness.Common
import XMonad.Internal.IO
@ -110,8 +110,12 @@ exportIntelBacklight =
intelBacklightControls :: Maybe SesClient -> BrightnessControls
intelBacklightControls = brightnessControls xpfIntelBacklight intelBacklightConfig
callGetBrightnessIB :: SesClient -> IO (Maybe Brightness)
callGetBrightnessIB :: MonadUnliftIO m => SesClient -> m (Maybe Brightness)
callGetBrightnessIB = callGetBrightness intelBacklightConfig
matchSignalIB :: (Maybe Brightness -> IO ()) -> SesClient -> IO ()
matchSignalIB
:: MonadUnliftIO m
=> (Maybe Brightness -> m ())
-> SesClient
-> m ()
matchSignalIB = matchSignal intelBacklightConfig