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

From KDE UserBase Wiki
(add some i3 config improvement and add categories)
(Marked this version for translation)
Line 1: Line 1:
<languages />
<languages />
<translate>
<translate>
<!--T:1-->
{{Construction}}
{{Construction}}


==Introduction==
==Introduction== <!--T:2-->


<!--T:3-->
KWin is the default window manager (WM) in Plasma and has lot of features, but only support floating windows. Plasma let you use another window manager for example i3, bspwm or [https://wiki.archlinux.org/index.php/Window_managers any other tilling window manager].
KWin is the default window manager (WM) in Plasma and has lot of features, but only support floating windows. Plasma let you use another window manager for example i3, bspwm or [https://wiki.archlinux.org/index.php/Window_managers any other tilling window manager].


<!--T:4-->
{{Warning|Other window managers are only available when using X.org. These changes can not be made for Wayland sessions.}}
{{Warning|Other window managers are only available when using X.org. These changes can not be made for Wayland sessions.}}


<!--T:5-->
Most window managers require few, if any, changes to their configuration files.
Most window managers require few, if any, changes to their configuration files.


<!--T:6-->
Some considerations to be aware of when using another window manager:
Some considerations to be aware of when using another window manager:


<!--T:7-->
*Tiling window managers may have problems with components like panels. For some configuration options will help alleviate issues
*Tiling window managers may have problems with components like panels. For some configuration options will help alleviate issues


<!--T:8-->
* Most window managers do not have their own compositors, and therefore lack such features as animations and transparency. If such effects are desired, a compositor, such as '''compton''', is required
* Most window managers do not have their own compositors, and therefore lack such features as animations and transparency. If such effects are desired, a compositor, such as '''compton''', is required


==Using Another Window Manager with Plasma ==
==Using Another Window Manager with Plasma == <!--T:9-->
===Single User: Using System Settings===
===Single User: Using System Settings===


<!--T:10-->
This is the simplest method, but only affects the user for which it is added
This is the simplest method, but only affects the user for which it is added


<!--T:11-->
[[Image:kde-i3-integration.png]]
[[Image:kde-i3-integration.png]]


<!--T:12-->
*Create a shell script (kde-i3.sh as an example), containing the following{{Input|1=<nowiki>
*Create a shell script (kde-i3.sh as an example), containing the following{{Input|1=<nowiki>
#!/bin/sh
#!/bin/sh
Line 30: Line 40:
Replace /usr/bin/i3 with the path to the window manager desired.
Replace /usr/bin/i3 with the path to the window manager desired.


<!--T:13-->
* Start '''System Settings'''
* Start '''System Settings'''


<!--T:14-->
* Select '''Startup and Shutdown'''
* Select '''Startup and Shutdown'''


<!--T:15-->
* Select '''Autostart'''
* Select '''Autostart'''


<!--T:16-->
* Click the '''Add script''' button below the list
* Click the '''Add script''' button below the list


<!--T:17-->
* 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
* 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


<!--T:18-->
* In the '''Run On''' column, select '''Before Session Startup''' from the drop down list
* In the '''Run On''' column, select '''Before Session Startup''' from the drop down list


<!--T:19-->
* The chosen window manager will be used the next time you log in
* The chosen window manager will be used the next time you log in


=== System Wide: Adding an XSession===
=== System Wide: Adding an XSession=== <!--T:20-->


<!--T:21-->
If superuser (root) access is available, a new session file for X.org can be created.
If superuser (root) access is available, a new session file for X.org can be created.


<!--T:22-->
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 then 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 then back in


<!--T:23-->
To add a session for an alternate window manager, as the superuser
To add a session for an alternate window manager, as the superuser


<!--T:24-->
* Copy the existing Plasma session flie{{Input|1=<nowiki>cp plasma.desktop plasma-i3.desktop</nowiki>}}
* Copy the existing Plasma session flie{{Input|1=<nowiki>cp plasma.desktop plasma-i3.desktop</nowiki>}}


<!--T:25-->
* Using a text editor, open the file and change the Exec line, and optionally the Description{{Input|1=<nowiki>[Desktop Entry]
* Using a text editor, open the file and change the Exec line, and optionally the Description{{Input|1=<nowiki>[Desktop Entry]
Type=XSession
Type=XSession
Line 63: Line 85:
</nowiki>}}
</nowiki>}}


<!--T:26-->
* The display manager must be restarted, most easily by rebooting
* The display manager must be restarted, most easily by rebooting


==I3 configuration==
==I3 configuration== <!--T:27-->


===Installation===
===Installation=== <!--T:28-->


<!--T:29-->
Before starting the configuration, you should make sure i3 or i3-gaps are installed on your system. If not use your packet manager or [[Special:myLanguage/Discover|Discover]] to install one of this two packages. You should also install a compositor, because unlike KWin, i3 don't ship with an integrated compositor. I recommend the use of compton.  
Before starting the configuration, you should make sure i3 or i3-gaps are installed on your system. If not use your packet manager or [[Special:myLanguage/Discover|Discover]] to install one of this two packages. You should also install a compositor, because unlike KWin, i3 don't ship with an integrated compositor. I recommend the use of compton.  


===Create a default i3 configuration===
===Create a default i3 configuration=== <!--T:30-->


<!--T:31-->
{{Note|If you already have an i3 configuration file (usually at <code>.i3/config</code> or <code>.config/i3/config</code>), you can skip this step.}}
{{Note|If you already have an i3 configuration file (usually at <code>.i3/config</code> or <code>.config/i3/config</code>), you can skip this step.}}


<!--T:32-->
[[Special:myLanguage/Tutorials/Open a console|Open a console]] and type <code>i3-config-wizard</code>. This command open a small windows that will help you create a configuration file.  
[[Special:myLanguage/Tutorials/Open a console|Open a console]] and type <code>i3-config-wizard</code>. This command open a small windows that will help you create a configuration file.  


<!--T:33-->
[[File:i3-wizard.png|500px]]
[[File:i3-wizard.png|500px]]


<!--T:34-->
Some i3 keybinding can be used to provide better integration with Plasma.  
Some i3 keybinding can be used to provide better integration with Plasma.  
{{Input|1=<nowiki># Open logout confirmation screen with $mod+e
{{Input|1=<nowiki># Open logout confirmation screen with $mod+e
Line 86: Line 114:
</nowiki>}}
</nowiki>}}


<!--T:35-->
Some i3 window rules help you to have notification and some other plasma windows as floating windows:
Some i3 window rules help you to have notification and some other plasma windows as floating windows:
{{Input|1=<nowiki>for_window [title="Desktop — Plasma"] kill; floating enable; border none
{{Input|1=<nowiki>for_window [title="Desktop — Plasma"] kill; floating enable; border none
Line 99: Line 128:
</nowiki>}}
</nowiki>}}


==bspwm==
==bspwm== <!--T:36-->


<!--T:37-->
For the most part, bspwm requires little additional configuration.
For the most part, bspwm requires little additional configuration.


<!--T:38-->
* A single Plasma panel, in most cases, is detected properly and bspwm will not place windows in its space. If the panel does present 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 in pixels of the panel. Also valid are bottom_padding, left_padding, and right_padding. As many of these directive 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 does present 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 in pixels of the panel. Also valid are bottom_padding, left_padding, and right_padding. As many of these directive may be used as necessary for multiple panels.


<!--T:39-->
[[Category:Tutorials]]
[[Category:Tutorials]]
[[Category:Advanced Users]]
[[Category:Advanced Users]]

Revision as of 06:59, 29 December 2018

Under Construction

This is a new page, currently under construction!


Introduction

KWin is the default window manager (WM) in Plasma and has lot of features, but only support floating windows. Plasma let you use another window manager for example i3, bspwm or any other tilling window manager.

Warning

Other window managers are only available when using X.org. These changes can not be made for Wayland sessions.


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 configuration options will help alleviate issues
  • Most window managers do not have their own compositors, and therefore lack such features as 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 then back in

To add a session for an alternate window manager, as the superuser

  • Copy the existing Plasma session flie
    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

I3 configuration

Installation

Before starting the configuration, you should make sure i3 or i3-gaps are installed on your system. If not use your packet manager or Discover to install one of this two packages. You should also install a compositor, because unlike KWin, i3 don't ship with an integrated compositor. I recommend the use of compton.

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 open a small windows that will help you create a configuration file.

Some i3 keybinding can be used to provide better integration with Plasma.

# Open logout confirmation screen with $mod+e
bindsym $mod+Shift+e exec qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1
# Open krunner with $mod+d
bindsym $mod+d exec qdbus org.kde.kglobalaccel /component/krunner org.kde.kglobalaccel.Component.invokeShortcut 'run command'

Some i3 window rules help you to have notification 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

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 does present a problem, or when using multiple panels, the following may be added to .bspwmrc
    bspc config top_padding size
    where size is the size in pixels of the panel. Also valid are bottom_padding, left_padding, and right_padding. As many of these directive may be used as necessary for multiple panels.