xmonad-config/lib/Xmobar/Plugins/ClevoKeyboard.hs

29 lines
776 B
Haskell
Raw Normal View History

{-# LANGUAGE OverloadedStrings #-}
--------------------------------------------------------------------------------
2022-12-30 14:58:23 -05:00
-- Clevo Keyboard plugin
--
-- 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 (..)
, ckAlias
2022-12-30 14:58:23 -05:00
)
where
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
newtype ClevoKeyboard = ClevoKeyboard T.Text deriving (Read, Show)
ckAlias :: T.Text
ckAlias = "clevokeyboard"
instance Exec ClevoKeyboard where
alias (ClevoKeyboard _) = T.unpack ckAlias
2021-11-27 13:24:13 -05:00
start (ClevoKeyboard icon) =
2023-01-01 22:29:29 -05:00
startBacklight "clevo keyboard" matchSignalCK callGetBrightnessCK icon