forked from colonelpanic/dotfiles
[taffybar] Use sequence for swapping IO and Maybe
This commit is contained in:
parent
54df1e5d41
commit
23ff653304
@ -125,8 +125,6 @@ getInterfaces = do
|
|||||||
(_, output, _) <- readCreateProcessWithExitCode (shell "list_interfaces.sh") ""
|
(_, output, _) <- readCreateProcessWithExitCode (shell "list_interfaces.sh") ""
|
||||||
return $ splitOn "\n" output
|
return $ splitOn "\n" output
|
||||||
|
|
||||||
swapMaybeIO = maybe (return Nothing) (Just <$>)
|
|
||||||
|
|
||||||
main = do
|
main = do
|
||||||
monEither <-
|
monEither <-
|
||||||
(try $ getEnv "TAFFYBAR_MONITOR") :: IO (Either SomeException String)
|
(try $ getEnv "TAFFYBAR_MONITOR") :: IO (Either SomeException String)
|
||||||
@ -149,7 +147,7 @@ main = do
|
|||||||
cfg <- asks hudConfig
|
cfg <- asks hudConfig
|
||||||
lift $ do
|
lift $ do
|
||||||
img <- Gtk.imageNew
|
img <- Gtk.imageNew
|
||||||
pb <- swapMaybeIO $ getWorkspacePixBuf (windowIconSize cfg) ws
|
pb <- sequence $ getWorkspacePixBuf (windowIconSize cfg) ws
|
||||||
setImage (windowIconSize cfg) img pb
|
setImage (windowIconSize cfg) img pb
|
||||||
return $ WWC ConstantIconController { cicImage = img }
|
return $ WWC ConstantIconController { cicImage = img }
|
||||||
makeIcon = return . IIFilePath . inResourcesDirectory
|
makeIcon = return . IIFilePath . inResourcesDirectory
|
||||||
|
Loading…
Reference in New Issue
Block a user