2

I have been trying to find a way to rename workspaces while working. I'm currently using up to 4 workspaces at the time and I would like to assign the workspaces new names as needed.

I came across XMonad.Actions.DynamicWorkspaces, and I am able to create and remove workspaces, however not rename. I have the current binding

((modM .|. shiftMask, xK_r), renameWorkspace defaultXPConfig)

However when I enter something into the defaultXPConfig, nothing happens (and by nothing happens I mean, the name of the workspace doesn't change in my xmobar). I am able to create and delete workspaces, these changes appear in my xmobar.

The method renameWorkspaceByName works as expected, therefore I believe I am using the xpconfig wrong?

I have posted my xmonad.hs here

Stephen Rauch
  • 4,209
  • 14
  • 22
  • 32
user89423
  • 21
  • 1

1 Answers1

0

Make sure you are using the 'configuration' from xmonad-contrib https://hackage.haskell.org/package/xmonad-contrib-0.13/docs/XMonad-Config-Desktop.html.

Essentially from the minimal config you posted you need to replace xmonad $ defaultConfig { with xmonad $ desktopConfig {. Make sure you also import the required module: import XMonad.Config.Desktop.

Here is the working minimal configuration:

import XMonad
import XMonad.Config.Desktop
import XMonad.Util.EZConfig
import XMonad.Actions.DynamicWorkspaces

modM                 = mod4Mask
myWorkspaces         = ["1:Surf",  "2:Web", "3:Dev", "4:Term","5:Pdf"]
myKeys = [((modM .|. shiftMask, xK_r), renameWorkspace def)]

main = do
  xmonad $ desktopConfig {
   workspaces         = myWorkspaces
  , modMask            = modM
  }
    `additionalKeys` myKeys
Chris Stryczynski
  • 5,178
  • 5
  • 40
  • 80
  • Hi Chris, thank you for taking time to help me out. Unfortunately the edited minimal configuration you posted did not solve the issue for me, command is still not doing what it should :/ i tried with the workspace change and a shell prompt using "XMonad.Prompt.Shell" but with same result. I am starting to believe there is something wrong with my xmonad installation or my system as the xmonad config should work :/ any more ideas ? :) – user89423 Aug 20 '17 at 20:13
  • What version of xmonad is this? `xmonad --version` – Chris Stryczynski Aug 20 '17 at 20:15
  • xmonad --version: `Xmonad 0.12` – user89423 Aug 20 '17 at 20:38