[taffybar] Small fixes for ToggleMonitor

This commit is contained in:
Ivan Malison 2017-03-14 13:10:15 -07:00
parent 8d3e6e27fa
commit 7350a36597
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -11,10 +11,7 @@ import Control.Monad.Trans
import Control.Monad.Trans.Maybe
import qualified Data.Map as M
import Data.Maybe
import Data.String
import qualified Data.Text.Internal.Lazy as T
import qualified Graphics.UI.Gtk as Gtk
import Graphics.UI.Gtk.Gdk.DrawWindow
import Graphics.UI.Gtk.Gdk.Screen
import System.Taffybar
import Text.Read hiding (get, lift)
@ -42,8 +39,7 @@ handleToggleRequests enabledVar refreshTaffyWindows = do
refreshTaffyWindows
toggleTaffy = do
num <- liftIO $ runMaybeT getActiveScreenNumber
let monitorNumber = fromMaybe 0 num
liftIO $ toggleTaffyOnMon not $ monitorNumber
liftIO $ toggleTaffyOnMon not $ fromMaybe 0 num
runScotty =
scotty 3000 $ do
get "/toggle/:monNum" $ do