Closed HokieGeek closed 9 years ago
Brainstorming on the AddNextWorkspace :: String
function. This function should make addWorkspace :: String
do most of the heavy lifting.
Basic algorithm:
addWorkspace head unusedWorkspaces
currentWorkspaces = currentWorkspaces ++ head unusedWorkspaces
unusedWorkspaces = tail unusedWorkspaces
Brainstorming on the removal of empty workspaces:
Need to modify the following to make use of removeEmptyWorkspaceAfter :: X()
++
[((m .|. modm, k), windows $ f i)
| (i, k) <- zip myWorkspaces myWorkspaceKeys
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
Whatever this does, it will probably need to do the following:
unusedWorkspaces = last currentWorkspaces : unusedWorkspaces
currentWorkspaces = init currentWorkspaces
Looks like addWorkspace
adds the new workspace to the front of the list, which is very lispy/haskelly but not the way humans think so you wind up with a weird discontinuity between the displayed workspaces and their keys. In other words, if I add 3 workspaces, I will access them by pressing 1, 2, or 3 on my keyboard, but they'll be displayed on the dzen bar as 3, 2, 1. sigh
Any way to force that list to be sorted, I wonder?
Maybe a solution here would be to force dzen to display just a symbol - the same one - for each workspace, instead if its name
How about using black circle (http://unicodelookup.com/#black circle/1) as the label to use for all of the workspaces?
So, two potential ideas:
(myWorkspaces !! 1)
), ppLayout = dzenColor "#ebac54" "#161616" .
(\x -> case x of
"ResizableTall" -> "^i(" ++ myBitmapsDir ++ "/tall.xbm)"
"Mirror ResizableTall" -> "^i(" ++ myBitmapsDir ++ "/mtall.xbm)"
"Full" -> "^i(" ++ myBitmapsDir ++ "/full.xbm)"
"Simple Float" -> "~"
_ -> x
)
http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-DynamicLog.html#v:dynamicLogWithPP
ppSort = reverse getSortByIndex
Will create an XBM dot (just copy unicode black circle? .... although maybe smaller would be better) and use that instead of a unicode character, since dzen is dumb.
dzenWorkspaceSymbol :: WorkspaceId -> String
dzenWorkspaceSymbol x = "^i($HOME/.xmonad/imgs/workspace.xbm)"
Try this, instead:
, ppOutput = hPutStrLn h
}
where dzenWorkspaceSymbol x = "^i(\$HOME/.xmonad/imgs/workspace.xbm)"
Ok, so next step: have the keys up top match up to a position in the list of known workspaces
So refactor this:
++
[((m .|. modm, k), windows $ f i)
| (i, k) <- zip myWorkspaces myWorkspaceKeys
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
So that it goes back to doing something like this:
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
Could it be as easy as:
| (i, k) <- zip (XMonad.workspaces conf) myWorkspaceKeys
What would happen to the above if len(XMonad.workspaces conf) < len(myWorkspaceKeys)?
I am currently really liking seeing all 12 desktops (as symbols) and won't focus so much on the JIT workspaces.
This is interesting.
rotate [] = []
rotate (x:xs) = xs ++ [x]
rotate' = reverse . rotate . reverse
Maybe use it with the dzen log:
ppSort = rotate
Take a look at this:
Ok, so the thing above is dumb, what I need is something more like this:
addSpecialWorkspace :: X()
addSpecialWorkspace n = addWorkspace n >> rotate [WORKSPACES]
I might, at some point, come back to this. But after months of using Xmonad, I'm not really seeing a need for this. If I do come back to this, it'll be as an exercise in learning to write in Haskell.
Ideal solution here: Mod + = Creates it if it doesn't exist and navigates to it
Mod + n = Create a new workspace (and navigate there?)
Current empty workspace is deleted when navigating away from it