forked from colonelpanic/dotfiles
[taffybar] Add stablename stuff to toggleable server
This commit is contained in:
parent
ecf5b1e588
commit
f8461d7a87
@ -13,16 +13,21 @@ import qualified Data.Map as M
|
|||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import qualified Graphics.UI.Gtk as Gtk
|
import qualified Graphics.UI.Gtk as Gtk
|
||||||
import Graphics.UI.Gtk.Gdk.Screen
|
import Graphics.UI.Gtk.Gdk.Screen
|
||||||
|
import System.Mem.StableName
|
||||||
import System.Taffybar
|
import System.Taffybar
|
||||||
import Text.Read hiding (get, lift)
|
import Text.Read hiding (get, lift)
|
||||||
import Web.Scotty
|
import Web.Scotty
|
||||||
import XMonad.Core ( whenJust )
|
import XMonad.Core ( whenJust )
|
||||||
|
|
||||||
toggleableMonitors :: MV.MVar (M.Map Int Bool) -> Int -> TaffybarConfig -> IO (Maybe TaffybarConfig)
|
toggleableMonitors :: MV.MVar (M.Map Int Bool)
|
||||||
toggleableMonitors enabledVar monNumber cfg = do
|
-> TaffybarConfigEQ -> IO (Int -> (Maybe TaffybarConfigEQ))
|
||||||
|
toggleableMonitors enabledVar cfg = do
|
||||||
numToEnabled <- MV.readMVar enabledVar
|
numToEnabled <- MV.readMVar enabledVar
|
||||||
let enabled = fromMaybe True $ M.lookup monNumber numToEnabled
|
let fn monNumber =
|
||||||
return $ if enabled then Just cfg else Nothing
|
if fromMaybe True $ M.lookup monNumber numToEnabled
|
||||||
|
then Just cfg
|
||||||
|
else Nothing
|
||||||
|
return fn
|
||||||
|
|
||||||
getActiveScreenNumber :: MaybeT IO Int
|
getActiveScreenNumber :: MaybeT IO Int
|
||||||
getActiveScreenNumber = do
|
getActiveScreenNumber = do
|
||||||
|
Loading…
Reference in New Issue
Block a user