[taffybar] Misc. cleanup

This commit is contained in:
Ivan Malison 2017-07-27 19:59:23 -07:00
parent 5dabb9a79a
commit fa5115f62b
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -3,7 +3,6 @@ import Control.Exception.Base
import Control.Monad import Control.Monad
import Data.List import Data.List
import Data.List.Split import Data.List.Split
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 qualified Graphics.UI.Gtk.Abstract.Widget as W import qualified Graphics.UI.Gtk.Abstract.Widget as W
@ -11,7 +10,6 @@ import qualified Graphics.UI.Gtk.Layout.Table as T
import System.Directory import System.Directory
import System.Environment import System.Environment
import System.FilePath.Posix import System.FilePath.Posix
import System.IO
import System.Information.CPU import System.Information.CPU
import System.Information.Memory import System.Information.Memory
import System.Process import System.Process
@ -22,14 +20,12 @@ import System.Taffybar.NetMonitor
import System.Taffybar.Pager import System.Taffybar.Pager
import System.Taffybar.SimpleClock import System.Taffybar.SimpleClock
import System.Taffybar.Systray import System.Taffybar.Systray
import System.Taffybar.TaffyPager
import System.Taffybar.ToggleMonitor import System.Taffybar.ToggleMonitor
import System.Taffybar.Widgets.PollingGraph import System.Taffybar.Widgets.PollingGraph
import System.Taffybar.WindowSwitcher import System.Taffybar.WindowSwitcher
import System.Taffybar.WorkspaceHUD import System.Taffybar.WorkspaceHUD
import Text.Printf import Text.Printf
import Text.Read hiding (get) import Text.Read hiding (get)
import XMonad.Core ( whenJust )
memCfg = memCfg =
@ -55,8 +51,7 @@ mem = do
return $ Gtk.toWidget ebox return $ Gtk.toWidget ebox
systemEvents :: Gtk.EventM Gtk.EButton Bool systemEvents :: Gtk.EventM Gtk.EButton Bool
systemEvents = do systemEvents = return True
return True
cpuCallback = do cpuCallback = do
(_, systemLoad, totalLoad) <- cpuLoad (_, systemLoad, totalLoad) <- cpuLoad
@ -121,7 +116,7 @@ main = do
"Gmail" `isInfixOf` title = makeIcon "gmail.png" "Gmail" `isInfixOf` title = makeIcon "gmail.png"
| otherwise = IINone | otherwise = IINone
myGetIconInfo = windowTitleClassIconGetter True myCustomIcon myGetIconInfo = windowTitleClassIconGetter True myCustomIcon
(monFilter, monNumber) = (_, monNumber) =
case monEither of case monEither of
Left _ -> (allMonitors, 0) Left _ -> (allMonitors, 0)
Right monString -> Right monString ->
@ -147,7 +142,7 @@ main = do
hudConfig = hudConfig =
defaultWorkspaceHUDConfig defaultWorkspaceHUDConfig
{ underlineHeight = 3 { underlineHeight = 3
, underlinePadding = 5 , underlinePadding = 2
, minWSWidgetSize = Nothing , minWSWidgetSize = Nothing
, minIcons = 3 , minIcons = 3
, getIconInfo = myGetIconInfo , getIconInfo = myGetIconInfo
@ -165,7 +160,7 @@ main = do
} }
netMonitor = netMonitorMultiNew 1.5 interfaceNames netMonitor = netMonitorMultiNew 1.5 interfaceNames
pagerConfig = defaultPagerConfig {useImages = True} pagerConfig = defaultPagerConfig {useImages = True}
pager = taffyPagerNew pagerConfig -- pager = taffyPagerNew pagerConfig
makeUnderline = underlineWidget hudConfig makeUnderline = underlineWidget hudConfig
pgr <- pagerNew pagerConfig pgr <- pagerNew pagerConfig
tray2 <- movableWidget tray tray2 <- movableWidget tray