diff --git a/dotfiles/config/taffybar/taffybar.hs b/dotfiles/config/taffybar/taffybar.hs index 345b82a7..93e87bda 100644 --- a/dotfiles/config/taffybar/taffybar.hs +++ b/dotfiles/config/taffybar/taffybar.hs @@ -39,12 +39,12 @@ fallbackIcons _ klass | isInfixOf "Kodi" klass = IIFilePath $ resourcesDirectory "kodi.png" | otherwise = IIColor $ (0xFF, 0xFF, 0, 0xFF) -underlineWidget buildWidget name = do +underlineWidget cfg buildWidget name = do w <- buildWidget t <- T.tableNew 2 1 False u <- Gtk.eventBoxNew - W.widgetSetSizeRequest u (-1) $ 2 + W.widgetSetSizeRequest u (-1) $ underlineHeight cfg T.tableAttach t w 0 1 0 1 [T.Expand] [T.Expand] 0 0 T.tableAttach t u 0 1 1 2 [T.Fill] [T.Shrink] 0 0 @@ -59,12 +59,12 @@ myGetIconInfo = windowTitleClassIconGetter False fallbackIcons main = do - monEither <- (try $ getEnv "TAFFYBAR_MONITOR") :: IO (Either SomeException String) + monEither <- + (try $ getEnv "TAFFYBAR_MONITOR") :: IO (Either SomeException String) let monNumber = case monEither of Left _ -> 0 Right monString -> fromMaybe 0 $ readMaybe monString - let memCfg = defaultGraphConfig {graphDataColors = [(1, 0, 0, 1)], graphLabel = Just "mem"} @@ -99,10 +99,17 @@ main = do hudPagerConfig = hudFromPagerConfig pagerConfig hud = taffyPagerHUDNew pagerConfig hudConfig pager = taffyPagerNew pagerConfig + let underline = underlineWidget hudConfig defaultTaffybar defaultTaffybarConfig { startWidgets = [hud] - , endWidgets = [underlineWidget tray "tray", underlineWidget clock "clock", mem, cpu, mpris] + , endWidgets = + [ underline tray "yellow" + , underline clock "blue" + , underline mem "orange" + , underline cpu "green" + , underline mpris "red" + ] , monitorNumber = monNumber , monitorFilter = allMonitors , barPosition = Top diff --git a/dotfiles/config/taffybar/taffybar.rc b/dotfiles/config/taffybar/taffybar.rc index e35baea4..9abf7968 100644 --- a/dotfiles/config/taffybar/taffybar.rc +++ b/dotfiles/config/taffybar/taffybar.rc @@ -4,6 +4,7 @@ style "taffybar-default" { color["green"] = "#4caf50" color["yellow"] = "#ffeb3b" + color["orange"] = "#f4511e" color["blue"] = "#2196f3" color["red"] = "#E57373" color["dgrey"] = "#212121" @@ -64,6 +65,19 @@ style "taffybar-hover-button" = "taffybar-default" { text[PRELIGHT] = @yellow } +style "blue" = "taffybar-default" { + bg[NORMAL]= @blue +} +style "orange" = "taffybar-default" { + bg[NORMAL]= @orange +} +style "red" = "taffybar-default" { + bg[NORMAL]= @red +} +style "yellow" = "taffybar-default" { + bg[NORMAL]= @yellow +} + widget "Taffybar*" style "taffybar-default" widget "Taffybar*WindowSwitcher*" style "taffybar-active-window" widget "*NotificationCloseButton" style "taffybar-notification-button" @@ -87,3 +101,8 @@ widget "*WorkspaceHUD-*" style "taffybar-hover-button" widget "*clock-underline*" style "taffybar-workspace-border-active" widget "*tray-underline*" style "taffybar-workspace-border-hidden" +widget "*blue-underline*" style "blue" +widget "*red-underline*" style "red" +widget "*yellow-underline*" style "yellow" +widget "*orange-underline*" style "orange" +widget "*green-underline*" style "green"