Tutorials/Using Other Window Managers with Plasma: Difference between revisions

From KDE Wiki Sandbox
m (remove in construction notice)
(Marked this version for translation)
Line 68: Line 68:
This has several advantages: the alternate session is available to all users of the system, and changing back to '''KWin''' is as simple as logging out and back in.
This has several advantages: the alternate session is available to all users of the system, and changing back to '''KWin''' is as simple as logging out and back in.


<!--T:42-->
{{Note|The XSession file location varies between distributions, but is most of the time found in {{Path|/usr/share/xsessions}}. }}
{{Note|The XSession file location varies between distributions, but is most of the time found in {{Path|/usr/share/xsessions}}. }}


Line 132: Line 133:
* A single Plasma panel, in most cases, is detected properly and bspwm will not place windows in its space. If the panel ends up presenting a problem, or when using multiple panels, the following may be added to '''.bspwmrc'''{{Input|1=<nowiki>bspc config top_padding size</nowiki>}}where '''size''' is the size of the panel in pixels. Also valid are bottom_padding, left_padding, and right_padding. As many of these directives may be used as necessary for multiple panels.
* A single Plasma panel, in most cases, is detected properly and bspwm will not place windows in its space. If the panel ends up presenting a problem, or when using multiple panels, the following may be added to '''.bspwmrc'''{{Input|1=<nowiki>bspc config top_padding size</nowiki>}}where '''size''' is the size of the panel in pixels. Also valid are bottom_padding, left_padding, and right_padding. As many of these directives may be used as necessary for multiple panels.


==Hints and Tips==
==Hints and Tips== <!--T:43-->


===Dbus===
===Dbus=== <!--T:44-->


<!--T:45-->
You can open some Plasma components with DBus commands. So you can map keybinding to this Dbus commands. To find a specific dbus command, you can look at QDbusViewer.  
You can open some Plasma components with DBus commands. So you can map keybinding to this Dbus commands. To find a specific dbus command, you can look at QDbusViewer.  


<!--T:46-->
Some examples:
Some examples:


<!--T:47-->
* Open Krunner {{Input|1=<nowiki>qdbus org.kde.kglobalaccel /component/krunner org.kde.kglobalaccel.Component.invokeShortcut 'run command'</nowiki>}}
* Open Krunner {{Input|1=<nowiki>qdbus org.kde.kglobalaccel /component/krunner org.kde.kglobalaccel.Component.invokeShortcut 'run command'</nowiki>}}
* Open logout confirmation screen {{Input|1=<nowiki>qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1</nowiki>}}
* Open logout confirmation screen {{Input|1=<nowiki>qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1</nowiki>}}


<!--T:48-->
For i3, you can map a keybinding with the bindsym command. Example:
For i3, you can map a keybinding with the bindsym command. Example:


<!--T:49-->
{{Input|1=<nowiki>bindsym $mod+Shift+e exec <command></nowiki>}}
{{Input|1=<nowiki>bindsym $mod+Shift+e exec <command></nowiki>}}


<!--T:50-->
For Bspwn, you need to use the <code>bspc</code> programm. See [https://wiki.archlinux.org/index.php/Bspwm#Keyboard Arch Linux wiki] for more information.
For Bspwn, you need to use the <code>bspc</code> programm. See [https://wiki.archlinux.org/index.php/Bspwm#Keyboard Arch Linux wiki] for more information.


==More Information==
==More Information== <!--T:51-->


<!--T:52-->
* [https://en.wikipedia.org/wiki/X_window_manager Window managers] (Wikipedia)  
* [https://en.wikipedia.org/wiki/X_window_manager Window managers] (Wikipedia)  
* [https://wiki.archlinux.org/index.php/Window_managers Window managers] (Arch Linux wiki)
* [https://wiki.archlinux.org/index.php/Window_managers Window managers] (Arch Linux wiki)
Line 156: Line 164:
* [https://wiki.archlinux.org/index.php/Desktop_environment Desktop environment] (Arch Linux wiki)
* [https://wiki.archlinux.org/index.php/Desktop_environment Desktop environment] (Arch Linux wiki)


==References==
==References== <!--T:53-->


<!--T:39-->
<!--T:39-->

Revision as of 17:00, 7 April 2019

Introduction

KWin is the default window manager (WM) in Plasma and has lot of features, but it only supports floating windows. Plasma lets you use another window manager, such as i3, bspwm or any other tilling window manager.

Warning
Other window managers are only available when using X.org. These changes cannot be made for Wayland sessions yet. With Wayland maturing and Wayland extensions being standarised, this feature could be implemented in Wayland[1]


Most window managers require few, if any, changes to their configuration files.

Some considerations to be aware of when using another window manager:

  • Tiling window managers may have problems with components like panels. For some configurations, certain options will help alleviate issues
  • Most window managers do not have their own compositors, and therefore lack features like animations and transparency. If such effects are desired, a compositor such as compton is required

Using Another Window Manager with Plasma

Single User: Using System Settings

This is the simplest method, but only affects the user for which it is added.

  • Create a shell script (kde-i3.sh as an example), containing the following
    #!/bin/sh
    export KDEWM=/usr/bin/i3
    

Replace /usr/bin/i3 with the path to the window manager desired.

  • Start System Settings
  • Select Startup and Shutdown
  • Select Autostart
  • Click the Add script button below the list
  • Enter the location of the script created earlier, or use the folder icon to use a dialog to find it. Click OK, the script will be added to the list
  • In the Run On column, select Before Session Startup from the drop down list
  • The chosen window manager will be used the next time you log in

System Wide: Adding an XSession

If superuser (root) access is available, a new session file for X.org can be created.

This has several advantages: the alternate session is available to all users of the system, and changing back to KWin is as simple as logging out and back in.

Note
The XSession file location varies between distributions, but is most of the time found in /usr/share/xsessions.


To add a session for an alternate window manager as superuser:

  • Copy the existing Plasma session file
    cp plasma.desktop plasma-i3.desktop
  • Using a text editor, open the file and change the Exec line, and optionally the Description
    [Desktop Entry]
    Type=XSession
    Exec=env KDEWM=/usr/bin/i3
    DesktopNames=KDE
    Name=Plasma (i3)
    Comment=Plasma by KDE w/i3
    X-KDE-PluginInfo-Version=5.14.4
    
  • The display manager must be restarted, most easily by rebooting
Warning
Ensure the correct path and name of the window manager application are used when modifying the Exec directive. If KDE is unable to start the window manager, the session will fail and the user will be returned to the login screen.


I3 configuration

Installation

Before starting the configuration, you should make sure i3 or i3-gaps are installed on your system. If they are not, use your package manager or Discover to install one of these two packages. You should also install a compositor such as "compton", since unlike KWin, i3 doesn't ship with an integrated compositor.

Create a default i3 configuration

Note
If you already have an i3 configuration file (usually at .i3/config or .config/i3/config), you can skip this step.


Open a console and type i3-config-wizard. This command opens a small window that will help you create a configuration file.

Some i3 window rules help you to have notifications and some other plasma windows as floating windows:

for_window [title="Desktop — Plasma"] kill; floating enable; border none
for_window [class="plasmashell"] floating enable;
for_window [class="Plasma"] floating enable; border none
for_window [title="plasma-desktop"] floating enable; border none
for_window [title="win7"] floating enable; border none
for_window [class="krunner"] floating enable; border none
for_window [class="Kmix"] floating enable; border none
for_window [class="Klipper"] floating enable; border none
for_window [class="Plasmoidviewer"] floating enable; border none
for_window [class="(?i)*nextcloud*"] floating disable

Bspwm configuration

For the most part, bspwm requires little additional configuration.

  • A single Plasma panel, in most cases, is detected properly and bspwm will not place windows in its space. If the panel ends up presenting a problem, or when using multiple panels, the following may be added to .bspwmrc
    bspc config top_padding size
    where size is the size of the panel in pixels. Also valid are bottom_padding, left_padding, and right_padding. As many of these directives may be used as necessary for multiple panels.

Hints and Tips

Dbus

You can open some Plasma components with DBus commands. So you can map keybinding to this Dbus commands. To find a specific dbus command, you can look at QDbusViewer.

Some examples:

  • Open Krunner
    qdbus org.kde.kglobalaccel /component/krunner org.kde.kglobalaccel.Component.invokeShortcut 'run command'
  • Open logout confirmation screen
    qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1

For i3, you can map a keybinding with the bindsym command. Example:

bindsym $mod+Shift+e exec <command>

For Bspwn, you need to use the bspc programm. See Arch Linux wiki for more information.

More Information

References