forked from colonelpanic/dotfiles
Merge branch 'master' of github.com:IvanMalison/dotfiles
This commit is contained in:
commit
8e82c4b014
@ -1 +1 @@
|
|||||||
Subproject commit 1c2dbadc40ce23a54a465bc072b1fce208c9be7e
|
Subproject commit accf7df727f20f030dc91d7648f9b6f2cd68ca9a
|
@ -5,6 +5,7 @@ import qualified Control.Concurrent.MVar as MV
|
|||||||
import Control.Exception.Base
|
import Control.Exception.Base
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
import Control.Monad.Reader
|
import Control.Monad.Reader
|
||||||
|
import Control.Monad.Trans
|
||||||
import Data.GI.Base
|
import Data.GI.Base
|
||||||
import Data.GI.Base.ManagedPtr
|
import Data.GI.Base.ManagedPtr
|
||||||
import Data.List
|
import Data.List
|
||||||
@ -38,9 +39,9 @@ import System.Taffybar.IconImages
|
|||||||
import System.Taffybar.LayoutSwitcher
|
import System.Taffybar.LayoutSwitcher
|
||||||
import System.Taffybar.MPRIS2
|
import System.Taffybar.MPRIS2
|
||||||
import System.Taffybar.NetMonitor
|
import System.Taffybar.NetMonitor
|
||||||
|
import System.Taffybar.SNITray
|
||||||
import System.Taffybar.SimpleClock
|
import System.Taffybar.SimpleClock
|
||||||
import System.Taffybar.SimpleConfig
|
import System.Taffybar.SimpleConfig
|
||||||
import System.Taffybar.Systray
|
|
||||||
import System.Taffybar.ToggleMonitor
|
import System.Taffybar.ToggleMonitor
|
||||||
import System.Taffybar.Widgets.PollingGraph
|
import System.Taffybar.Widgets.PollingGraph
|
||||||
import System.Taffybar.WindowSwitcher
|
import System.Taffybar.WindowSwitcher
|
||||||
@ -49,7 +50,7 @@ import Text.Printf
|
|||||||
import Text.Read hiding (lift)
|
import Text.Read hiding (lift)
|
||||||
import Unsafe.Coerce
|
import Unsafe.Coerce
|
||||||
|
|
||||||
data ConstantIconController = ConstantIconController { cicImage :: Gtk.Image }
|
newtype ConstantIconController = ConstantIconController { cicImage :: Gtk.Image }
|
||||||
|
|
||||||
instance WorkspaceWidgetController ConstantIconController where
|
instance WorkspaceWidgetController ConstantIconController where
|
||||||
updateWidget cic _ = return cic
|
updateWidget cic _ = return cic
|
||||||
@ -61,6 +62,7 @@ instance WorkspaceWidgetController Gtk.Widget where
|
|||||||
|
|
||||||
makeContents waction klass = do
|
makeContents waction klass = do
|
||||||
widget <- waction
|
widget <- waction
|
||||||
|
liftIO $ do
|
||||||
widgetSetClass widget "Contents"
|
widgetSetClass widget "Contents"
|
||||||
widgetSetClass widget klass
|
widgetSetClass widget klass
|
||||||
b <- buildPadBox widget
|
b <- buildPadBox widget
|
||||||
@ -108,7 +110,7 @@ cpuCallback = do
|
|||||||
return [totalLoad, systemLoad]
|
return [totalLoad, systemLoad]
|
||||||
|
|
||||||
containerAddReturn c w =
|
containerAddReturn c w =
|
||||||
Gtk.containerAdd c w >> Gtk.widgetShowAll c >> (return $ Gtk.toWidget c)
|
Gtk.containerAdd c w >> Gtk.widgetShowAll c >> return (Gtk.toWidget c)
|
||||||
|
|
||||||
underlineWidget cfg buildWidget name = do
|
underlineWidget cfg buildWidget name = do
|
||||||
w <- buildWidget
|
w <- buildWidget
|
||||||
@ -143,17 +145,9 @@ addClass klass action = do
|
|||||||
|
|
||||||
(buildWidgetCons, _) = mkWidget
|
(buildWidgetCons, _) = mkWidget
|
||||||
|
|
||||||
buildSNITray = do
|
|
||||||
-- XXX: this won't work for multiple taffybars because it will attempt to
|
|
||||||
-- register a second host with a name that already exists on the dbus tray.
|
|
||||||
-- Need to take an approach similar to that of gtk-sni-tray to get that to
|
|
||||||
-- work.
|
|
||||||
GI.Widget trayGIWidgetMP <- buildTrayWithHost GI.OrientationHorizontal
|
|
||||||
wrapNewGObject mkWidget (castPtr <$> disownManagedPtr trayGIWidgetMP)
|
|
||||||
|
|
||||||
logDebug = do
|
logDebug = do
|
||||||
handler <- streamHandler stdout DEBUG
|
handler <- streamHandler stdout DEBUG
|
||||||
logger <- getLogger "System.Taffybar"
|
logger <- getLogger "System"
|
||||||
saveGlobalLogger $ setLevel DEBUG logger
|
saveGlobalLogger $ setLevel DEBUG logger
|
||||||
|
|
||||||
main = do
|
main = do
|
||||||
@ -238,21 +232,13 @@ main = do
|
|||||||
{ startWidgets = [hud, los, addClass "WindowSwitcher" wnd]
|
{ startWidgets = [hud, los, addClass "WindowSwitcher" wnd]
|
||||||
, endWidgets =
|
, endWidgets =
|
||||||
[ batteryBarNewWithFormat defaultBatteryConfig "$percentage$% ($time$) - $status$" 1.0
|
[ batteryBarNewWithFormat defaultBatteryConfig "$percentage$% ($time$) - $status$" 1.0
|
||||||
||||||| merged common ancestors
|
, makeContents buildSNITray "Cpu"
|
||||||
, endWidgets =
|
|
||||||
[ batteryBarNew defaultBatteryConfig 1.0
|
|
||||||
=======
|
|
||||||
, centerWidgets = []
|
|
||||||
, endWidgets = map lift
|
|
||||||
[ batteryBarNew defaultBatteryConfig 1.0
|
|
||||||
>>>>>>> b44e57a9f4ec822e99649b1ccc5516cbcbad4fb8
|
|
||||||
, makeContents clock "Cpu"
|
, makeContents clock "Cpu"
|
||||||
-- , makeContents systrayNew "Cpu"
|
-- , makeContents systrayNew "Cpu"
|
||||||
, makeContents buildSNITray "Cpu"
|
|
||||||
, makeContents cpu "Cpu"
|
, makeContents cpu "Cpu"
|
||||||
, makeContents mem "Cpu"
|
, makeContents mem "Cpu"
|
||||||
, makeContents netMonitor "Cpu"
|
, makeContents netMonitor "Cpu"
|
||||||
, makeContents (join $ containerAddReturn <$> Gtk.eventBoxNew <*> mpris) "Cpu"
|
, mpris
|
||||||
]
|
]
|
||||||
, barPosition = Top
|
, barPosition = Top
|
||||||
, barPadding = 5
|
, barPadding = 5
|
||||||
|
@ -7,6 +7,7 @@ library
|
|||||||
build-depends: base >= 4.7 && < 5
|
build-depends: base >= 4.7 && < 5
|
||||||
, split
|
, split
|
||||||
, text
|
, text
|
||||||
|
, bifunctors
|
||||||
, containers
|
, containers
|
||||||
, regex-compat
|
, regex-compat
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
Loading…
Reference in New Issue
Block a user