[taffybar] Use Borders instead of underlines

This commit is contained in:
Ivan Malison 2017-02-21 06:57:03 -08:00
parent 782a709728
commit 0cda2324a1
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
2 changed files with 38 additions and 9 deletions

View File

@ -1,16 +1,17 @@
import System.Taffybar
module Main where
import qualified Data.Word8 as W
import System.Information.CPU
import System.Information.Memory
import System.Taffybar
import System.Taffybar.IconImages
import System.Taffybar.MPRIS2
import System.Taffybar.Pager
import System.Taffybar.SimpleClock
import System.Taffybar.WorkspaceHUD
import System.Taffybar.Systray
import System.Taffybar.TaffyPager
import System.Taffybar.Widgets.PollingGraph
import System.Information.Memory
import System.Information.CPU
import System.Taffybar.WorkspaceHUD
memCallback = do
mi <- parseMeminfo
@ -20,6 +21,15 @@ cpuCallback = do
(_, systemLoad, totalLoad) <- cpuLoad
return [totalLoad, systemLoad]
zero :: W.Word8
zero = fromIntegral 0
alwaysTransparent _ _ =
IIColor $ (fromIntegral 0xFF, fromIntegral 0, zero, fromIntegral 0xFF)
myGetIconInfo =
windowTitleClassIconGetter False alwaysTransparent
main = do
let memCfg = defaultGraphConfig { graphDataColors = [(1, 0, 0, 1)]
, graphLabel = Just "mem"
@ -36,8 +46,14 @@ main = do
cpu = pollingGraphNew cpuCfg 0.5 cpuCallback
tray = systrayNew
hudConfig = defaultWorkspaceHUDConfig { underlineHeight = 3
, minWSWidgetSize = Just 50
, minWSWidgetSize = Nothing
, minIcons = 3
, getIconInfo = myGetIconInfo
, updateIconsOnTitleChange = False
, widgetBuilder = buildBorderButtonController
-- , showWorkspaceFn = hideEmpty
}
hudPagerConfig = hudFromPagerConfig pagerConfig
hud = taffyPagerHUDNew pagerConfig hudConfig
defaultTaffybar defaultTaffybarConfig { startWidgets = [ hud ]

View File

@ -36,10 +36,10 @@ style "taffybar-workspace-border-visible" = "taffybar-default" {
fg[NORMAL] = @black
}
style "taffybar-workspace-border-empty" = "taffybar-default" {
bg[NORMAL] = @teal
bg[NORMAL] = @black
}
style "taffybar-workspace-border-hidden" = "taffybar-default" {
bg[NORMAL] = @blue
bg[NORMAL] = @black
fg[NORMAL] = @black
}
style "taffybar-workspace-border-urgent" = "taffybar-default" {
@ -50,6 +50,11 @@ style "taffybar-icon-urgent" = "taffybar-default" {
bg[NORMAL] = @yellow
}
style "taffybar-active-label" = "taffybar-default" {
bg[NORMAL] = @teal
fg[NORMAL] = @red
}
widget "Taffybar*" style "taffybar-default"
widget "Taffybar*WindowSwitcher*label" style "taffybar-active-window"
widget "*NotificationCloseButton" style "taffybar-notification-button"
@ -60,4 +65,12 @@ widget "*Workspace-underline*-empty*" style "taffybar-workspace-border-empty"
widget "*Workspace-underline*-hidden*" style "taffybar-workspace-border-hidden"
widget "*Workspace-underline*-urgent*" style "taffybar-workspace-border-urgent"
widget "*Workspace-Border*-active*" style "taffybar-workspace-border-active"
widget "*Workspace-Container-*-active*" style "taffybar-default"
widget "*Workspace-Border*-visible*" style "taffybar-workspace-border-visible"
widget "*Workspace-Container-*-visible*" style "taffybar-default"
widget "*Workspace-Container-*-hidden*" style "taffybar-default"
widget "*Workspace-Container-*-empty*" style "taffybar-default"
widget "*Workspace-icon*-urgent*" style "taffybar-icon-urgent"