Dear All,
I use XMonad on different machines. The configuration is identical, except for the default workspaces, so I'd like to have the config file set the default workspaces automagically. Haskell ignorant here, but googling around I think I am almost there. These are, I think, the relevant pieces
myWorkspaces = map show[1..7]
myWorkspacesPhelsuma = map show[1..3] ++ ["top", "sync", "zot", "whats"]
myWorkspacesTriturus = map show[1..2] ++ ["top", "sync"]
main :: IO ()
main = do
hostname <- io (getEnv "HOSTNAME")
let myWorkspaces = case hostname of
"Phelsuma" -> myWorkspacesPhelsuma
"Triturus" -> myWorkspacesTriturus
_ -> myWorkspaces
xmonad
$ ewmh
$ dynamicProjects myProjects
$ withNavigation2DConfig def
$ docks
$ withEasySB (statusBarProp "xmobar ~/.xmonad/.xmobarrc" (pure myXmobarPP)) defToggleStrutsKey
$ myConfig
myConfig = def {
--- blablabla
workspaces = myWorkspaces
}
However, I keep getting an error:
• Couldn't match expected type ‘Maybe String’
with actual type ‘[Char]’
• In the pattern: "Phelsuma"
In a case alternative: "Phelsuma" -> myWorkspacesPhelsuma
In the expression:
case hostname of
"Phelsuma" -> myWorkspacesPhelsuma
"Triturus" -> myWorkspacesTriturus
_ -> myWorkspaces
|
882 | "Phelsuma" -> myWorkspacesPhelsuma
| ^^^^^^^^^^
(and the same error for the second entry, "Triturus")
This I think should be fairly easy to fix, but I can't find how. I tried writing the case section as
let myWorkspaces = case hostname of
Just "Phelsuma" -> myWorkspacesPhelsuma
Just "Triturus" -> myWorkspacesTriturus
_ -> myWorkspaces
and that does not give me an error, but it seems to ignore the actual hostname and uses the "default" one (the one with workspaces 1 to 7). So I think I am using "Just" incorrectly and possibly also misunderstanding how "let" works in main.
Any suggestions?
Thanks,
--
Ramon Diaz-Uriarte
Department of Biochemistry, Lab B-31
Facultad de Medicina
Universidad Autónoma de Madrid
Arzobispo Morcillo, 4
28029 Madrid
Spain
Phone: +34-91-497-2412
Email: rdiaz02(a)gmail.com
r.diaz(a)uam.es
https://ligarto.org/rdiaz
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
XMONAD AND XMONAD-CONTRIB 0.17.1 ARE AVAILABLE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
New versions of xmonad and xmonad-contrib have been released. Check out
our [download page] for instructions on where to get them.
About 10 months after the big release of 0.17.0, we—as promised—picked
up the pace a bit and are back with a new minor version; don't let that
fool you though, this one still packs a punch! Plus, we now sport a
brand-new [logo], courtesy of [Hans Heintze].
As this is a minor release, we tried to keep the breaking changes to a
minimum (xmonad core does not have a single one!) However, some were
unavoidable for `xmonad-contrib', so be sure to at least glance at the
[release notes]!
For help getting started—or more info—see [our website] and [talk to
us]! If you like what we do, you can support us on [Open Collective] or
via [GitHub Sponsors]. Thanks!
[GitHub Sponsors] <https://github.com/sponsors/xmonad>
[Hans Heintze] <https://github.com/literallyunplayable>
[Open Collective] <https://opencollective.com/xmonad>
[download page] <https://xmonad.org/download.html>
[logo] <https://xmonad.org/images/logo.svg>
[our website] <https://xmonad.org/>
[release notes] See section 2
[talk to us] <https://xmonad.org/community.html>
1 xmonad 0.17.1
═══════════════
This release includes 32 non-merge commits by 6 contributors! For a
full summary of all the changes, see [xmonad's CHANGES.md] file.
[xmonad's CHANGES.md] <https://github.com/xmonad/xmonad/blob/v0.17.1/CHANGES.md>
1.1 Enhancements
────────────────
• Added custom cursor shapes for resizing and moving windows.
1.2 Bug Fixes
─────────────
• Change the main loop to try to avoid [GHC bug 21708] on systems
running GHC 9.2 up to version 9.2.3. The issue has been fixed in
[GHC 9.2.4] and all later releases.
• Fixed border color of windows with alpha channel. Now all windows
have the same opaque border color.
[GHC bug 21708] <https://gitlab.haskell.org/ghc/ghc/-/issues/21708>
[GHC 9.2.4] <https://discourse.haskell.org/t/ghc-9-2-4-released/4851>
2 xmonad-contrib 0.17.1
═══════════════════════
This release includes 212 non-merge commits by 32 contributors! For a
full summary of all the changes, see [xmonad-contrib's CHANGES.md]
file.
[xmonad-contrib's CHANGES.md] <https://github.com/xmonad/xmonad-contrib/blob/v0.17.1/CHANGES.md>
2.1 Breaking Changes
────────────────────
• `XMonad.Config.{Arossato,Dmwit,Droundy,Monad,Prime,Saegesser,Sjanssen}':
deprecated all of these modules. The user-specific configuration
modules may still be found [on the website].
• `XMonad.Util.NamedScratchpad': scratchpads are now only based on the
argument given to `namedScratchpadManageHook'; all other scratchpad
arguments are, while still present, ignored. Users passing all of
their scratchpads to functions like `namedScratchpadAction' (as is
shown in the module's documentation) should /not/ notice any
difference in behaviour.
• `XMonad.Util.DynamicScratchpads': deprecated the module; use the new
dynamic scratchpad functionality of `XMonad.Util.NamedScratchpad'
instead.
• `XMonad.Hooks.UrgencyHook': deprecated `urgencyConfig'; use `def'
from the new `Default' instance of `UrgencyConfig' instead.
[on the website] <https://xmonad.org/configurations.html>
2.2 New Modules
───────────────
• `XMonad.Hooks.Modal': a module implementing modal keybindings for
XMonad.
• `XMonad.Layout.SideBorderDecoration': this module allows for having
a configurable border position around windows; i.e., it can move the
border to either cardinal direction.
• `XMonad.Actions.PerLayoutKeys': a new module for customising
keybindings on a per-layout basis.
• `XMonad.Actions.RepeatAction': a module for adding a keybinding to
repeat the last action, similar to Vim's `.' or Emacs's `dot-mode'.
2.3 Bug Fixes and Minor Changes
───────────────────────────────
• `XMonad.Prompt' and `XMonad.Actions.TreeSelect': added xft-based
font fallback support. This may be used by appending other fonts to
the given string: `xft:iosevka-11,FontAwesome-9'. Note that this
requires `xmonad-contrib' to be compiled with `X11-xft' version
0.3.4 or higher.
• `XMonad.Util.Run': added an EDSL—particularly geared towards
programs like terminals or Emacs—to spawn processes from XMonad in a
compositional way.
• `XMonad.Util.Hacks': added `trayerPaddingXmobarEventHook' (plus
generic variants for other trays/panels) to communicate trayer
resize events to xmobar so that padding space may be reserved on
xmobar for the tray. Requires `xmobar' version 0.40 or higher.
• `XMonad.Prompt.OrgMode': added the ability to specify alphabetic
(`#A', `#B', and `#C') [priorities] at the end of the input note.
• `XMonad.Actions.Submap': added `visualSubmap' to visualise the
available keys and their actions when inside a submap.
• `XMonad.Util.NamedScratchpad': added support for dynamic scratchpads
in the form of `dynamicNSPAction' and `toggleDynamicNSP'.
• `XMonad.Hooks.WindowSwallowing': fixed windows getting lost when
used in conjunction with `smartBorders' and a single window.
[priorities] <https://orgmode.org/manual/Priorities.html>
--
Tony Zorman | https://tony-zorman.com/