Xfce: Difference between revisions
imported>Mucaho Describe xmonad usage with xfce4 desktop enabled |
A subsection on how to exclude packages in xfce. Tags: Mobile edit Mobile web edit |
||
| (12 intermediate revisions by 9 users not shown) | |||
| Line 1: | Line 1: | ||
[http://www.xfce.org Xfce] is a lightweight desktop environment based on GTK+. It includes a window manager, a file manager, desktop and panel. | [http://www.xfce.org Xfce] is a lightweight desktop environment based on GTK+. It includes a window manager, a file manager, desktop and panel. | ||
This article is an extension of the documentation in the [https://nixos.org/manual/nixos/stable/#sec-xfce NixOS manual]. | |||
== Enabling == | == Enabling == | ||
To use xfce set <code> | To use xfce set <code>services.xserver.desktopManager.xfce.enable</code> to <code>true</code>. For example: | ||
{{file|/etc/nixos/configuration.nix|nix| | {{file|/etc/nixos/configuration.nix|nix| | ||
<nowiki> | <nowiki> | ||
| Line 13: | Line 15: | ||
enable = true; | enable = true; | ||
desktopManager = { | desktopManager = { | ||
xterm.enable = false; | xterm.enable = false; | ||
xfce.enable = true; | xfce.enable = true; | ||
}; | }; | ||
}; | }; | ||
services.displayManager.defaultSession = "xfce"; | |||
... | ... | ||
} | } | ||
| Line 23: | Line 25: | ||
}} | }} | ||
{{Evaluate}} | {{Evaluate}} | ||
=== Excluding xfce applications === | |||
Xfce does not include as many applications by default as some other desktop environments. Still, those can be excluded as demonstrated in the example below. Place this before the <code>services.xserver</code> snippet from above. | |||
{{file|/etc/nixos/configuration.nix|nix| | |||
<nowiki> | |||
{ | |||
environment.xfce.excludePackages = with pkgs.xfce; [ | |||
mousepad | |||
parole | |||
# ristretto | |||
xfce4-appfinder | |||
# xfce4-notifyd | |||
xfce4-screenshooter | |||
# xfce4-session | |||
# xfce4-settings | |||
# xfce4-taskmanager | |||
# xfce4-terminal | |||
]; | |||
} | |||
</nowiki> | |||
}} | |||
=== Using as a desktop manager and not a window manager === | === Using as a desktop manager and not a window manager === | ||
| Line 35: | Line 58: | ||
enable = true; | enable = true; | ||
desktopManager = { | desktopManager = { | ||
xterm.enable = false; | xterm.enable = false; | ||
xfce = { | xfce = { | ||
| Line 45: | Line 67: | ||
windowManager.i3.enable = true; | windowManager.i3.enable = true; | ||
}; | }; | ||
services.displayManager.defaultSession = "xfce"; | |||
... | ... | ||
} | } | ||
| Line 72: | Line 95: | ||
enable = true; | enable = true; | ||
desktopManager = { | desktopManager = { | ||
xterm.enable = false; | xterm.enable = false; | ||
xfce = { | xfce = { | ||
| Line 81: | Line 103: | ||
}; | }; | ||
windowManager = { | windowManager = { | ||
xmonad = { | xmonad = { | ||
enable = true; | enable = true; | ||
| Line 93: | Line 114: | ||
}; | }; | ||
}; | }; | ||
services.displayManager.defaultSession = "xfce+xmonad"; | |||
... | ... | ||
} | } | ||
| Line 112: | Line 134: | ||
{{Evaluate}} | {{Evaluate}} | ||
After choosing the <code>xfce+ | After choosing the <code>xfce+xmonad</code> session in your display manager, you will be taken to a clean screen, where you can open a terminal with <code>MOD+Shift+Enter</code> or launch an application with <code>MOD(+SHIFT)+p</code>. | ||
===== With xfce desktop ===== | ===== With xfce desktop ===== | ||
| Line 121: | Line 143: | ||
After logging in you will be greeted by xfce's desktop which interferes with xmonad. To solve this issue you have to remove the <code>xfdesktop</code> process from being started in the session. | After logging in you will be greeted by xfce's desktop which interferes with xmonad. To solve this issue you have to remove the <code>xfdesktop</code> process from being started in the session. | ||
Open the session manager in the application launcher with <code>MOD(+SHIFT)+p</code> and then typing in "Session and Startup". Go to tab "Session" and set the restart style of <code>xfdesktop</code> to "Never". Kill the process with "Quit program", then "Save session." After this, xfce4 and xmonad work together nicely. | Open the session manager in the application launcher with <code>MOD(+SHIFT)+p</code> and then typing in "Session and Startup". Go to tab "Session" and set the restart style of <code>xfdesktop</code> to "Never". Kill the process with "Quit program", then "Save session." After this, xfce4 and xmonad will work together nicely. | ||
===== Java-based GUI applications ===== | |||
Java-based applications may not work properly with xmonad. The applications main window may stay blank or gray on startup. This is a known issue with some versions of Java, where xmonad is not recognized as a "non-reparenting" window manager. There are multiple solutions to this problem as described on xmonad's FAQ page. | |||
One alternative is to fake xmonad's window manager name, after running the EMWH initialization. This particular approach works well when running xmonad alongside the xfce-based desktop (described above). | |||
{{file|~/.xmonad/xmonad.hs|haskell| | |||
<nowiki> | |||
import XMonad | |||
import XMonad.Config.Xfce | |||
import XMonad.Hooks.EwmhDesktops | |||
import XMonad.Hooks.SetWMName | |||
main = xmonad xfceConfig | |||
{ terminal = "xfce4-terminal" | |||
, modMask = mod4Mask -- Use Win as MOD key | |||
, startupHook = ewmhDesktopsStartup >> setWMName "LG3D" -- for some reason the double greater sign is escaped here due to wiki formatting, replace this with proper greater signs! | |||
} | |||
</nowiki> | |||
}} | |||
===== Additional resources ===== | ===== Additional resources ===== | ||
| Line 134: | Line 177: | ||
[https://wiki.haskell.org/File:Xmbindings.png Haskell Wiki: Xmonad default key bindings] | [https://wiki.haskell.org/File:Xmbindings.png Haskell Wiki: Xmonad default key bindings] | ||
[https://wiki.haskell.org/Xmonad/Frequently_asked_questions#Problems_with_Java_applications.2C_Applet_java_console Haskell Wiki FAQ: Problems with Java applications] | |||
== Troubleshooting == | == Troubleshooting == | ||
| Line 139: | Line 184: | ||
If you use pulse audio, set <code>nixpkgs.config.pulseaudio = true</code> as shown above. Otherwise, you may | If you use pulse audio, set <code>nixpkgs.config.pulseaudio = true</code> as shown above. Otherwise, you may | ||
experience glitches like being able to mute the sound card but not unmute it. | experience glitches like being able to mute the sound card but not unmute it. | ||
[[Category:Desktop environment]] | |||
[[Category:NixOS Manual]] | |||