forked from colonelpanic/dotfiles
[taffybar] Add my own window switcher entry formatting
This commit is contained in:
parent
e0cea5ef10
commit
53ef31a072
@ -3,6 +3,7 @@ import Control.Exception.Base
|
|||||||
import Control.Monad
|
import Control.Monad
|
||||||
import Data.List
|
import Data.List
|
||||||
import Data.List.Split
|
import Data.List.Split
|
||||||
|
import qualified Data.Map as M
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import qualified Graphics.UI.Gtk as Gtk
|
import qualified Graphics.UI.Gtk as Gtk
|
||||||
import qualified Graphics.UI.Gtk.Abstract.Widget as W
|
import qualified Graphics.UI.Gtk.Abstract.Widget as W
|
||||||
@ -11,6 +12,7 @@ import System.Directory
|
|||||||
import System.Environment
|
import System.Environment
|
||||||
import System.FilePath.Posix
|
import System.FilePath.Posix
|
||||||
import System.Information.CPU
|
import System.Information.CPU
|
||||||
|
import System.Information.EWMHDesktopInfo
|
||||||
import System.Information.Memory
|
import System.Information.Memory
|
||||||
import System.Process
|
import System.Process
|
||||||
import System.Taffybar
|
import System.Taffybar
|
||||||
@ -95,6 +97,13 @@ movableWidget builder =
|
|||||||
return $ Gtk.toWidget hbox
|
return $ Gtk.toWidget hbox
|
||||||
return moveWidget
|
return moveWidget
|
||||||
|
|
||||||
|
myFormatEntry wsNames ((ws, wtitle, wclass), _) =
|
||||||
|
printf "%s: %s - %s" wsName wtitle wclass
|
||||||
|
where
|
||||||
|
wsName = M.findWithDefault ("WS#" ++ show wsN) ws wsNames
|
||||||
|
WSIdx wsN = ws
|
||||||
|
|
||||||
|
|
||||||
getInterfaces = do
|
getInterfaces = do
|
||||||
(_, output, _) <- readCreateProcessWithExitCode (shell "list_interfaces.sh") ""
|
(_, output, _) <- readCreateProcessWithExitCode (shell "list_interfaces.sh") ""
|
||||||
return $ splitOn "\n" output
|
return $ splitOn "\n" output
|
||||||
@ -159,7 +168,11 @@ main = do
|
|||||||
, outerPadding = 5
|
, outerPadding = 5
|
||||||
}
|
}
|
||||||
netMonitor = netMonitorMultiNew 1.5 interfaceNames
|
netMonitor = netMonitorMultiNew 1.5 interfaceNames
|
||||||
pagerConfig = defaultPagerConfig {useImages = True}
|
pagerConfig =
|
||||||
|
defaultPagerConfig
|
||||||
|
{ useImages = True
|
||||||
|
, windowSwitcherFormatter = myFormatEntry
|
||||||
|
}
|
||||||
-- pager = taffyPagerNew pagerConfig
|
-- pager = taffyPagerNew pagerConfig
|
||||||
makeUnderline = underlineWidget hudConfig
|
makeUnderline = underlineWidget hudConfig
|
||||||
pgr <- pagerNew pagerConfig
|
pgr <- pagerNew pagerConfig
|
||||||
|
Loading…
Reference in New Issue
Block a user