[taffybar] Add Multi-monitor config

This commit is contained in:
Ivan Malison 2017-03-04 03:42:30 -08:00
parent d9e0e5802a
commit b22303dd0c
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
2 changed files with 17 additions and 3 deletions

View File

@ -1,7 +1,10 @@
module Main where
import Data.Char (toLower)
import Text.Read
import Data.List
import Data.Maybe
import System.Directory
import System.FilePath.Posix
import System.Information.CPU
@ -15,6 +18,7 @@ import System.Taffybar.Systray
import System.Taffybar.TaffyPager
import System.Taffybar.Widgets.PollingGraph
import System.Taffybar.WorkspaceHUD
import System.Environment
memCallback = do
mi <- parseMeminfo
@ -34,6 +38,8 @@ myGetIconInfo =
windowTitleClassIconGetter False fallbackIcons
main = do
monString <- getEnv "TAFFYBAR_MONITOR"
let monitorNumber = fromMaybe 1 $ readMaybe monString
let memCfg =
defaultGraphConfig
{graphDataColors = [(1, 0, 0, 1)], graphLabel = Just "mem"}
@ -51,6 +57,7 @@ main = do
hudConfig =
defaultWorkspaceHUDConfig
{ underlineHeight = 3
, underlinePadding = 0
, minWSWidgetSize = Nothing
, minIcons = 3
, getIconInfo = myGetIconInfo
@ -62,6 +69,7 @@ main = do
, updateIconsOnTitleChange = True
, updateOnWMIconChange = True
, debugMode = True
, redrawIconsOnStateChange = True
}
hudPagerConfig = hudFromPagerConfig pagerConfig
hud = taffyPagerHUDNew pagerConfig hudConfig
@ -70,7 +78,8 @@ main = do
defaultTaffybarConfig
{ startWidgets = [hud]
, endWidgets = [tray, clock, mem, cpu, mpris]
, monitorNumber = 1
, monitorNumber = monitorNumber
, monitorFilter = allMonitors
, barPosition = Top
, barHeight = 40
}

View File

@ -12,6 +12,8 @@ style "taffybar-default" {
color["teal"] = "#80CBC4"
color["bgrey"] = "#37474F"
color["bgreyl"] = "#546E7A"
color["activeWS"] = @yellow
color["visibleWS"] = @red
bg[NORMAL] = @dgrey
fg[NORMAL] = @white
@ -22,7 +24,11 @@ style "taffybar-default" {
style "taffybar-active-window" = "taffybar-default" {
bg[NORMAL] = @black
bg[PRELIGHT] = @black
bg[SELECTED] = @black
bg[ACTIVE] = @black
fg[NORMAL] = @yellow
text[NORMAL] = @red
}
style "taffybar-notification-button" = "taffybar-default" {
@ -34,7 +40,6 @@ style "taffybar-workspace-border-active" = "taffybar-default" {
bg[NORMAL] = @yellow
}
style "taffybar-workspace-border-visible" = "taffybar-default" {
bg[NORMAL] = @red
}
style "taffybar-workspace-border-empty" = "taffybar-default" {
@ -60,7 +65,7 @@ style "taffybar-hover-button" = "taffybar-default" {
}
widget "Taffybar*" style "taffybar-default"
widget "Taffybar*WindowSwitcher*label" style "taffybar-active-window"
widget "Taffybar*WindowSwitcher*" style "taffybar-active-window"
widget "*NotificationCloseButton" style "taffybar-notification-button"
widget "*Workspace-underline*-active*" style "taffybar-workspace-border-active"