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

29 lines
769 B
Haskell
Raw Permalink Normal View History

{-# LANGUAGE OverloadedStrings #-}
2020-04-01 22:06:00 -04:00
--------------------------------------------------------------------------------
2022-12-30 14:58:23 -05:00
-- Intel backlight plugin
2020-04-01 22:06:00 -04:00
--
-- Use the custom DBus interface exported by the XMonad process so I can react
-- to signals spawned by commands
module Xmobar.Plugins.IntelBacklight
2022-12-30 14:58:23 -05:00
( IntelBacklight (..)
, blAlias
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.IntelBacklight
import Xmobar
import Xmobar.Plugins.BacklightCommon
newtype IntelBacklight = IntelBacklight T.Text deriving (Read, Show)
blAlias :: T.Text
blAlias = "intelbacklight"
instance Exec IntelBacklight where
alias (IntelBacklight _) = T.unpack blAlias
2021-11-27 13:24:13 -05:00
start (IntelBacklight icon) =
2022-12-30 14:58:23 -05:00
startBacklight matchSignalIB callGetBrightnessIB icon