[taffybar] Config cleanup

This commit is contained in:
Ivan Malison 2019-01-05 18:42:16 -08:00
parent 7bf9b088e9
commit 4763811bbb
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
2 changed files with 7 additions and 20 deletions

View File

@ -14,8 +14,8 @@ executable imalison-taffybar
hs-source-dirs: . hs-source-dirs: .
main-is: taffybar.hs main-is: taffybar.hs
ghc-options: -threaded -rtsopts -with-rtsopts=-N ghc-options: -threaded -rtsopts -with-rtsopts=-N
-- ghc-options: -threaded -debug -g -- ghc-options: -threaded -g -rtsopts
-- cpp-options: +RTS -DS ghc-prof-options: -fprof-auto
build-depends: base build-depends: base
, X11>=1.8 , X11>=1.8
, bytestring , bytestring

View File

@ -1,4 +1,3 @@
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
module Main where module Main where
@ -100,10 +99,6 @@ logDebug = do
workspacesLogger <- getLogger "System.Taffybar.Widget.Workspaces" workspacesLogger <- getLogger "System.Taffybar.Widget.Workspaces"
saveGlobalLogger $ setLevel WARNING workspacesLogger saveGlobalLogger $ setLevel WARNING workspacesLogger
-- github = do
-- Right (token, _) <- passGet "github-token"
-- githubNotificationsNew $ defaultGithubConfig $ Auth.OAuth $ BS.pack token
main = do main = do
homeDirectory <- getHomeDirectory homeDirectory <- getHomeDirectory
-- logDebug -- logDebug
@ -116,14 +111,6 @@ main = do
highContrastDirectory = highContrastDirectory =
"/" </> "usr" </> "share" </> "icons" </> "HighContrast" </> "256x256" "/" </> "usr" </> "share" </> "icons" </> "HighContrast" </> "256x256"
inHighContrastDirectory file = highContrastDirectory </> file inHighContrastDirectory file = highContrastDirectory </> file
getIconFileName w@WindowData {windowTitle = title, windowClass = klass}
-- | "URxvt" `isInfixOf` klass = Just "urxvt.png"
-- | "Termite" `isInfixOf` klass = Just "urxvt.png"
-- | "Kodi" `isInfixOf` klass = Just "kodi.png"
| "@gmail.com" `isInfixOf` title &&
"chrome" `isInfixOf` klass && "Gmail" `isInfixOf` title =
Just "gmail.png"
| otherwise = Nothing
myIcons = scaledWindowIconPixbufGetter $ myIcons = scaledWindowIconPixbufGetter $
getWindowIconPixbufFromChrome <|||> getWindowIconPixbufFromChrome <|||>
unscaledDefaultGetWindowIconPixbuf <|||> unscaledDefaultGetWindowIconPixbuf <|||>
@ -157,12 +144,11 @@ main = do
, batteryIconNew , batteryIconNew
, textClockNew Nothing "%a %b %_d %r" 1 , textClockNew Nothing "%a %b %_d %r" 1
, sniTrayNew , sniTrayNew
-- , github
, cpu , cpu
, mem , mem
, networkGraphNew netCfg Nothing , networkGraphNew netCfg Nothing
-- , networkMonitorNew defaultNetFormat Nothing >>= setMinWidth 200 -- , networkMonitorNew defaultNetFormat Nothing >>= setMinWidth 200
-- , fsMonitorNew 60 ["/dev/sdd2"] -- , fsMonitorNew 60 ["/dev/sdd2"]
, mpris2New , mpris2New
] ]
, barPosition = Top , barPosition = Top
@ -170,9 +156,10 @@ main = do
, barHeight = 45 , barHeight = 45
} }
simpleTaffyConfig = baseConfig simpleTaffyConfig = baseConfig
-- { endWidgets = [] { centerWidgets = map (>>= buildContentsBox) []
-- , endWidgets = map (>>= buildContentsBox) [ sniTrayNew, mpris2New ]
-- , startWidgets = [flip widgetSetClass "Workspaces" =<< workspaces] -- , startWidgets = [flip widgetSetClass "Workspaces" =<< workspaces]
-- } }
startTaffybar $ startTaffybar $
appendHook notifySystemD $ appendHook notifySystemD $
appendHook (void $ getHost False) $ appendHook (void $ getHost False) $