2022-12-26 14:45:49 -05:00
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
|
2020-04-01 22:06:00 -04:00
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
-- | Intel backlight plugin
|
|
|
|
--
|
|
|
|
-- Use the custom DBus interface exported by the XMonad process so I can react
|
|
|
|
-- to signals spawned by commands
|
|
|
|
|
2021-06-21 23:41:57 -04:00
|
|
|
module Xmobar.Plugins.IntelBacklight
|
|
|
|
( IntelBacklight(..)
|
|
|
|
, blAlias
|
|
|
|
) where
|
2020-03-20 15:41:13 -04:00
|
|
|
|
2022-12-26 14:45:49 -05:00
|
|
|
import qualified RIO.Text as T
|
|
|
|
|
2020-04-01 20:17:47 -04:00
|
|
|
import Xmobar
|
2020-03-20 15:41:13 -04:00
|
|
|
|
2021-11-23 18:28:38 -05:00
|
|
|
import Xmobar.Plugins.BacklightCommon
|
|
|
|
|
2021-11-07 13:35:08 -05:00
|
|
|
import XMonad.Internal.DBus.Brightness.IntelBacklight
|
2020-03-20 15:41:13 -04:00
|
|
|
|
2022-12-26 14:45:49 -05:00
|
|
|
newtype IntelBacklight = IntelBacklight T.Text deriving (Read, Show)
|
2020-03-20 15:41:13 -04:00
|
|
|
|
2022-12-26 14:45:49 -05:00
|
|
|
blAlias :: T.Text
|
2021-06-21 23:41:57 -04:00
|
|
|
blAlias = "intelbacklight"
|
|
|
|
|
2020-03-20 15:41:13 -04:00
|
|
|
instance Exec IntelBacklight where
|
2022-12-26 14:45:49 -05:00
|
|
|
alias (IntelBacklight _) = T.unpack blAlias
|
2021-11-27 13:24:13 -05:00
|
|
|
start (IntelBacklight icon) =
|
|
|
|
startBacklight matchSignalIB callGetBrightnessIB icon
|