Skip to content

Instantly share code, notes, and snippets.

@dmwit
Created July 6, 2020 23:03
Show Gist options
  • Save dmwit/5cf59fb83eb3c3019af251525f108176 to your computer and use it in GitHub Desktop.
Save dmwit/5cf59fb83eb3c3019af251525f108176 to your computer and use it in GitHub Desktop.
screen1LogHook :: D.Client -> PP
screen1LogHook dbus = def
{ ppOutput = dbusOutput dbus
, ppCurrent = wrap ("%{B#2f2f4a80}%{F" ++ cPink ++ "}%{o"++ cPurpBlue ++"}%{A4:xdotool key alt+shift+Right:}%{A5:xdotool key alt+shift+Left:} ") " %{A}%{A}%{-o}%{B- F-}" -- Focused wkspc
, ppVisible = wrap ("%{F" ++ cBlue ++ "} ") " %{F-}" -- not working
, ppVisibleNoWindows = Just (wrap ("%{F" ++ cMagenta ++ "} ") " %{F-}") -- not working
, ppUrgent = wrap ("%{F" ++ cRed ++ "}%{A4:xdotool key alt+shift+Right:}%{A5:xdotool key alt+shift+Left:} ") " %{A}%{A}%{F-}" -- Urgent wkspc
, ppHidden = wrap ("%{F" ++ cPurpBlue ++ "}%{A4:xdotool key alt+shift+Right:}%{A5:xdotool key alt+shift+Left:} ") " %{A}%{A}%{F-}" -- Hidden with windows
, ppHiddenNoWindows = wrap ("%{F" ++ cEmpty ++ "}%{A4:xdotool key alt+shift+Right:}%{A5:xdotool key alt+shift+Left:} ") " %{A}%{A}%{F-}" -- Hidden and empty
, ppWsSep = ""
, ppSep = " | "
-- , ppTitle = myAddSpaces 25
, ppLayout = \x -> case x of -- Changes layout name to be displayed
"Tall" -> "%{A4:xdotool key alt+space:}%{A5:xdotool key alt+space:}T %{A}%{A}|"
"Mirror Tall" -> "%{A4:xdotool key alt+space:}%{A5:xdotool key alt+space:}M %{A}%{A}|"
"Full" -> "%{A4:xdotool key alt+space:}%{A5:xdotool key alt+space:}F %{A}%{A}|"
"M Tab" -> "%{A4:xdotool key alt+space:}%{A5:xdotool key alt+space:}MT %{A}%{A}|"
_ -> "? |"
, ppOrder = \(ws:l:_) -> [ws,l] -- [workspace, layout] (Removed window title)
}
fullLogHook :: D.Client -> PP
fullLogHook dbus = (marshallPP 0 (screen1LogHook dbus))
{ ppSort = selectScreen 0 (ppSort def) }
selectScreen :: ScreenId -> X WorkspaceSort -> X WorkspaceSort
selectScreen s = fmap (fmap (filter onScreen)) where
onScreen ws = unmarshallS (tag ws) == s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment