2021-11-05 21:15:37 -04:00
|
|
|
--------------------------------------------------------------------------------
|
2022-12-30 14:58:23 -05:00
|
|
|
-- Clevo Keyboard plugin
|
2021-11-05 21:15:37 -04:00
|
|
|
--
|
|
|
|
-- Use the custom DBus interface exported by the XMonad process so I can react
|
|
|
|
-- to signals spawned by commands
|
|
|
|
|
|
|
|
module Xmobar.Plugins.ClevoKeyboard
|
2022-12-30 14:58:23 -05:00
|
|
|
( ClevoKeyboard (..)
|
2021-11-05 21:15:37 -04:00
|
|
|
, ckAlias
|
2022-12-30 14:58:23 -05:00
|
|
|
)
|
|
|
|
where
|
2021-11-05 21:15:37 -04:00
|
|
|
|
2023-02-12 23:08:05 -05:00
|
|
|
import RIO
|
2022-12-30 14:58:23 -05:00
|
|
|
import qualified RIO.Text as T
|
|
|
|
import XMonad.Internal.DBus.Brightness.ClevoKeyboard
|
|
|
|
import Xmobar
|
|
|
|
import Xmobar.Plugins.BacklightCommon
|
2021-11-05 21:15:37 -04:00
|
|
|
|
2022-12-26 14:45:49 -05:00
|
|
|
newtype ClevoKeyboard = ClevoKeyboard T.Text deriving (Read, Show)
|
2021-11-05 21:15:37 -04:00
|
|
|
|
2022-12-26 14:45:49 -05:00
|
|
|
ckAlias :: T.Text
|
2021-11-05 21:15:37 -04:00
|
|
|
ckAlias = "clevokeyboard"
|
|
|
|
|
|
|
|
instance Exec ClevoKeyboard where
|
2022-12-26 14:45:49 -05:00
|
|
|
alias (ClevoKeyboard _) = T.unpack ckAlias
|
2021-11-27 13:24:13 -05:00
|
|
|
start (ClevoKeyboard icon) =
|
2023-10-27 23:12:22 -04:00
|
|
|
startBacklight
|
|
|
|
(Just "org.xmobar.clevo")
|
|
|
|
(Just "clevo_kbd.log")
|
|
|
|
matchSignalCK
|
|
|
|
callGetBrightnessCK
|
|
|
|
icon
|