[taffybar] Add battery widget

This commit is contained in:
Ivan Malison 2017-10-24 21:03:33 -07:00
parent 473d6efdf9
commit a25d555bd0
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
2 changed files with 28 additions and 8 deletions

View File

@ -7,22 +7,40 @@
border-radius: 1px;
}
.IconContainer {
border-radius: 5px;
}
.IconContainer.Active {
background-color: @taffybar_highlight_color;
border-radius: 5px;
}
.IconContainer.Minimized {
opacity: .3;
}
.Active.Container {
.IconContainer.Urgent {
background-color: #ffffff;
}
.Active.Container, .Visible.Container {
background-color: @taffybar_bg_tone;
border-radius: 5px;
}
.Taffybar {
background-color: @taffybar_bg_color;
border-radius: 5px;
}
.Taffybar * {
font-family: "Fira Sans", sans-serif;
font-size: 12pt;
}
.Taffybar .Container * {
font-family: 'Source Code Pro';
font-size: 16pt;
}
#WindowSwitcher {

View File

@ -20,6 +20,7 @@ import System.Information.Memory
import System.Information.X11DesktopInfo
import System.Process
import System.Taffybar
import System.Taffybar.Battery
import System.Taffybar.IconImages
import System.Taffybar.LayoutSwitcher
import System.Taffybar.MPRIS2
@ -136,10 +137,10 @@ main = do
getWorkspacePixBuf size Workspace {workspaceIdx = WSIdx wsId} =
pixBufFromFile size . inHighContrastDirectory <$>
case wsId + 1 of
1 -> Just $ "apps" </> "utilities-terminal.png"
2 -> Just $ "emblems" </> "emblem-documents.png"
3 -> Just $ "actions" </> "bookmark-add.png"
4 -> Just $ "devices" </> "video-display.png"
-- 1 -> Just $ "apps" </> "utilities-terminal.png"
-- 2 -> Just $ "emblems" </> "emblem-documents.png"
-- 3 -> Just $ "actions" </> "bookmark-add.png"
-- 4 -> Just $ "devices" </> "video-display.png"
_ -> Nothing
buildConstantIconController :: ControllerConstructor
buildConstantIconController ws = do
@ -210,9 +211,10 @@ main = do
wnd = makeUnderline (windowSwitcherNew pgr) "teal"
taffyConfig =
defaultTaffybarConfig
{ startWidgets = [hud, los, wnd]
{ startWidgets = [los, hud, wnd]
, endWidgets =
[ makeUnderline clock "teal"
[ batteryBarNew defaultBatteryConfig 1.0
, makeUnderline clock "teal"
, makeUnderline systrayNew "yellow"
, makeUnderline mem "blue"
, makeUnderline cpu "green"