Doing YourWindowManager --replace means xfwm4 has already started upon login and you are now stopping it to start a new window manager...that's working but there's a quicker and cleaner way as this guy explains taking kwin as his example.
XFCE starts the window manager specified in /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml or, under xubuntu, in /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
In this file look for the Client0_Command property and edit its value: <value type="string" value="xfwm4"/> to <value type="string" value="kwin"/> (obviously, replace "kwin" with your window manager of choice) You would need to go root. You could also copy and only edit that file in /home/user/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml if you want the changes to only affect your userspace.
Because in XFCE it is common for us to save our session while logging out, don't forget to clean your session: Settings Manager->Session and Startup->Session tab->Clear saved sessions
Download your desired window manager if you don't already have it
Run it with --replace, so for the XFCE default manager xfwm4 --replace
Log out, but ensure that you have checked the 'Save session for future logins' option. The logout dialog, if otherwise unavailable, can be invoked from a command line xfce4-session-logout
The easiest way I found to permanently change the default window manager is:
Download your desired WM.
Then go: system tools > preferences > startup applications.
Then click "add".
If you wanted, for example, to change your default WM to metacity, at "name" put "metacity" and at "command" put "metacity --replace". Click "add".
Log out > log in.
Doing
YourWindowManager --replace
means xfwm4 has already started upon login and you are now stopping it to start a new window manager...that's working but there's a quicker and cleaner way as this guy explains taking kwin as his example.XFCE starts the window manager specified in
/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
or, under xubuntu, in/etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
In this file look for the
Client0_Command
property and edit its value:<value type="string" value="xfwm4"/>
to<value type="string" value="kwin"/>
(obviously, replace "kwin" with your window manager of choice) You would need to go root. You could also copy and only edit that file in/home/user/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
if you want the changes to only affect your userspace.Because in XFCE it is common for us to save our session while logging out, don't forget to clean your session: Settings Manager->Session and Startup->Session tab->Clear saved sessions
Now you can logout and back in.
In general...
xfwm4 --replace
xfce4-session-logout
To change it to xfwm4, the following command should work. This would change it back to the setting Xfce has by default out of the box.
xfconf-query --channel xfce4-session --property /sessions/Failsafe/Client0_Command --type string --set 'xfwm4' --type string --set '--replace'
If you prefer a GUI solution, go to:
Settings >> Desktop Settings. In the Desktop Settings dialog, change the Window Manager to the manager of your choice.
Desktop Settings, Window Manager
This works in Linux Mint 20.2