Tutorials/Using Other Window Managers with Plasma/en: Difference between revisions
(Importing a new version from external source) |
(Updating to match new version of source page) |
||
(8 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
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 [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 it only supports floating windows. Plasma lets you use another window manager, such as i3, bspwm or [https://wiki.archlinux.org/index.php/Window_managers any other tilling window manager]. | ||
[[File:Plasma_i3.png|500px|thumb|center|Plasma using i3 as window | [[File:Plasma_i3.png|500px|thumb|center|Plasma using i3 as 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 standardized, this feature could be implemented in Wayland<ref>https://drewdevault.com/2018/04/28/KDE-Sprint-retrospective.html</ref> }} | {{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 standardized, this feature could be implemented in Wayland<ref>https://drewdevault.com/2018/04/28/KDE-Sprint-retrospective.html</ref> }} | ||
Line 15: | Line 15: | ||
* Tiling window managers may have problems with components like panels. For some configurations, certain options will help alleviate issues | * 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 | * Most window managers do not have their own compositors, and therefore lack features like animations and transparency. If such effects are desired, a compositor is required - refer to [https://wiki.archlinux.org/index.php/Xorg#Composite Arch Wiki] for options. | ||
** Compositors can also help with screen tearing, however check first if you can resolve it with your video drivers, as this will be a more performant solution in most cases. | |||
== | ==Set-up == | ||
To use a different window manager with Plasma, replace the systemd service for KWin with a new user unit for your preferred WM. A tutorial can be found in the [https://wiki.archlinux.org/title/KDE#Use_a_different_window_manager ArchWiki]. | |||
==Configuration== | |||
To make a non-standard WM work well with Plasma, some additional configuration may be required. | |||
===i3=== | |||
====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 [[Special:myLanguage/Discover|Discover]] to install one of these two packages. | |||
====Configure i3==== | |||
When you first start i3, its default global configuration (at <code>/etc/i3/config</code>) will start i3-config-wizard, which will provide a dialog for Mod key selection and generate the user local configuration at <code>~/.i3/config</code>. | |||
If you wish to maintain the same configuration across users (they can still override it with their own local config), remove the wizard invocation from the global configuration file and use it directly. | |||
The following i3 window rules will help you with notifications and some other plasma windows: | |||
{{Input|1=<nowiki>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 | |||
for_window [class="plasmashell" window_type="notification"] floating enable, border none, move right 700px, move down 450px | |||
no_focus [class="plasmashell" window_type="notification"] | |||
</nowiki>}} | |||
If you are using a non-English installation of Plasma, you need to find out what the exact window title of the Desktop is. One way is to do this is with <code>wmctrl -l</code>. | |||
Instead of adding | |||
{{Input|1=<nowiki>for_window [title="Desktop — Plasma"] kill; floating enable; border none | |||
</nowiki>}} | |||
add the name of the window to the i3 config. This example uses the German Plasma installation. | |||
{{Input|1=<nowiki>for_window [title="Arbeitsfläche — Plasma"] kill; floating enable; border none | |||
</nowiki>}} | |||
Notification positioning can be tricky, since not all notifications have the same size depending on their content. You can also use coordinates positioning, knowing your screen resolution. For example, for a 1920x1080 screen and notifications in the top-right corner we can use:{{Input|1=<nowiki> | |||
for_window [class="plasmashell" window_type="notification"] floating enable, border none, move position 1450px 20px | |||
</nowiki>}} | |||
If you want to unlock KWallet automatically on login, configure PAM and then add the following line to your i3 configuration file: | |||
{{Input|1=<nowiki>exec --no-startup-id /usr/lib/pam_kwallet_init | |||
</nowiki>}} | |||
====Configure Plasma==== | |||
You may get into issues related with the "Activities" feature - activating it via keyboard shortcuts (some of which are also used by i3, like "Meta + Q") seems to make i3 unresponsive. Removing Activity related global shortcuts seems to resolve this. | |||
To get the Plasma provided pager display desktops as i3bar, set '''Pager Settings''' > '''General''' > '''Text display''' to "Desktop name" | |||
===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 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. | ||
=== | ===awesomewm=== | ||
Following rules help Plasma to work as intended. | |||
Add these entries into <code>awful.rules.rules</code> table | |||
{{Input|1=<nowiki> | |||
{ -- General plasma rules | |||
rule_any = { | |||
class = { | |||
"plasmashell", | |||
"ksmserver-logout-greeter", | |||
}, | |||
}, | |||
properties = { | |||
floating = true, | |||
border_width = 0, | |||
titlebars = false, -- custom property to control titlebars | |||
}, | |||
=== | }, | ||
{ -- KDE apps | |||
rule_any = { | |||
class = { | |||
"spectacle", | |||
"krunner" | |||
} | |||
}, | |||
properties = { | |||
floating = true, | |||
} | |||
}, | |||
</nowiki>}} | |||
Plasma widgets hide when they become unfocused. We do not want Desktop and Panel to be focusable, but want other <code>plasmashell</code> windows to remain focusable. A way to achieve this is with "manage" signal handler. An example handler: | |||
{{Input|1=<nowiki> | |||
client.connect_signal("manage", function(c) | |||
--... your config | |||
if c.type == "dock" -- Plasma Panel | |||
or c.type == "desktop" then -- Plasma Desktop | |||
c.focusable = false | |||
c:tags(c.screen.tags) -- show on all tags from this screen. | |||
end | |||
-- Show titlebars only if enabled. | |||
if c.titlebars then | |||
awful.titlebar.show(c) | |||
else | |||
awful.titlebar.hide(c) | |||
end | |||
-- Place floating windows. Plasma widgets provide this info | |||
if c.floating then | |||
if c.size_hints.user_position then | |||
c.x = c.size_hints.user_position.x | |||
c.y = c.size_hints.user_position.y | |||
end | |||
if c.size_hints.user_size then | |||
c.width = c.size_hints.user_size.width | |||
c.height = c.size_hints.user_size.height | |||
end | |||
end | |||
.. | |||
end) | |||
</nowiki>}} | |||
You may match Plasma Desktop using the following rule: | |||
{{Input|1=<nowiki> | {{Input|1=<nowiki> | ||
rule_any = { | |||
name = { | |||
"Desktop.*Plasma", | |||
}, | |||
}, | |||
</nowiki>}} | </nowiki>}} | ||
== | ==Hints and Tips== | ||
===DBus=== | |||
Since Meta key handling is in part performed by KWin, you will have to handle these shortcuts manually when you switch to a different window manager. | |||
You can open some Plasma components with DBus commands. You can use this to map corresponding keybindings to DBus commands. To find a specific DBus command, you can look at <code>dbus-monitor</code> or <code>qdbusviewer</code> while you invoke the component in a standard Plasma set-up. | |||
More info on meta key handling: | |||
* [https://www.reddit.com/r/kde/comments/6wn5lk/bind_meta_key_alone_to_do_something/ Reddit post describing the ''Meta key - KWin'' relation] | |||
* [https://zren.github.io/2019/03/04/activate-any-widget-with-meta-key Blog post describing the ''DBus - Component'' relation] | |||
Some examples: | Some examples: | ||
* Open Application Launcher {{Input|1=<nowiki>qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.activateLauncherMenu</nowiki>}} | |||
* 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>}} | ||
For i3, you can map a keybinding with the bindsym command. Example: | For i3, you can map a keybinding with the '''bindsym''' command. Use <code>--no-startup-id</code> to prevent the command from generating "i3" entries in the task manager. | ||
Example: | |||
{{Input|1=<nowiki>bindsym $mod+Shift+e exec --no-startup-id <command></nowiki>}} | |||
If you want to map the modifier key itself, use the '''bindcode''' command - you have to specify the keycode generated by the key, which you can get via the <code>xev</code> utility. | |||
{{Input|1=<nowiki> | Example for the Meta key: | ||
{{Input|1=<nowiki>bindcode 133 --release exec --no-startup-id <command></nowiki>}} | |||
For Bspwn, you need to use the <code>bspc</code> | For Bspwn, you need to use the <code>bspc</code> program. See [https://wiki.archlinux.org/index.php/Bspwm#Keyboard Arch Linux wiki] for more information. | ||
==More Information== | ==More Information== |
Latest revision as of 01:28, 22 October 2023
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.
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 is required - refer to Arch Wiki for options.
- Compositors can also help with screen tearing, however check first if you can resolve it with your video drivers, as this will be a more performant solution in most cases.
Set-up
To use a different window manager with Plasma, replace the systemd service for KWin with a new user unit for your preferred WM. A tutorial can be found in the ArchWiki.
Configuration
To make a non-standard WM work well with Plasma, some additional configuration may be required.
i3
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.
Configure i3
When you first start i3, its default global configuration (at /etc/i3/config
) will start i3-config-wizard, which will provide a dialog for Mod key selection and generate the user local configuration at ~/.i3/config
.
If you wish to maintain the same configuration across users (they can still override it with their own local config), remove the wizard invocation from the global configuration file and use it directly.
The following i3 window rules will help you with notifications and some other plasma 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 for_window [class="plasmashell" window_type="notification"] floating enable, border none, move right 700px, move down 450px no_focus [class="plasmashell" window_type="notification"]
If you are using a non-English installation of Plasma, you need to find out what the exact window title of the Desktop is. One way is to do this is with wmctrl -l
.
Instead of adding
for_window [title="Desktop — Plasma"] kill; floating enable; border none
add the name of the window to the i3 config. This example uses the German Plasma installation.
for_window [title="Arbeitsfläche — Plasma"] kill; floating enable; border none
Notification positioning can be tricky, since not all notifications have the same size depending on their content. You can also use coordinates positioning, knowing your screen resolution. For example, for a 1920x1080 screen and notifications in the top-right corner we can use:
for_window [class="plasmashell" window_type="notification"] floating enable, border none, move position 1450px 20px
If you want to unlock KWallet automatically on login, configure PAM and then add the following line to your i3 configuration file:
exec --no-startup-id /usr/lib/pam_kwallet_init
Configure Plasma
You may get into issues related with the "Activities" feature - activating it via keyboard shortcuts (some of which are also used by i3, like "Meta + Q") seems to make i3 unresponsive. Removing Activity related global shortcuts seems to resolve this.
To get the Plasma provided pager display desktops as i3bar, set Pager Settings > General > Text display to "Desktop name"
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 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.
awesomewm
Following rules help Plasma to work as intended.
Add these entries into awful.rules.rules
table
{ -- General plasma rules rule_any = { class = { "plasmashell", "ksmserver-logout-greeter", }, }, properties = { floating = true, border_width = 0, titlebars = false, -- custom property to control titlebars }, }, { -- KDE apps rule_any = { class = { "spectacle", "krunner" } }, properties = { floating = true, } },
Plasma widgets hide when they become unfocused. We do not want Desktop and Panel to be focusable, but want other plasmashell
windows to remain focusable. A way to achieve this is with "manage" signal handler. An example handler:
client.connect_signal("manage", function(c) --... your config if c.type == "dock" -- Plasma Panel or c.type == "desktop" then -- Plasma Desktop c.focusable = false c:tags(c.screen.tags) -- show on all tags from this screen. end -- Show titlebars only if enabled. if c.titlebars then awful.titlebar.show(c) else awful.titlebar.hide(c) end -- Place floating windows. Plasma widgets provide this info if c.floating then if c.size_hints.user_position then c.x = c.size_hints.user_position.x c.y = c.size_hints.user_position.y end if c.size_hints.user_size then c.width = c.size_hints.user_size.width c.height = c.size_hints.user_size.height end end .. end)
You may match Plasma Desktop using the following rule:
rule_any = { name = { "Desktop.*Plasma", }, },
Hints and Tips
DBus
Since Meta key handling is in part performed by KWin, you will have to handle these shortcuts manually when you switch to a different window manager.
You can open some Plasma components with DBus commands. You can use this to map corresponding keybindings to DBus commands. To find a specific DBus command, you can look at dbus-monitor
or qdbusviewer
while you invoke the component in a standard Plasma set-up.
More info on meta key handling:
Some examples:
- Open Application Launcher
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.activateLauncherMenu
- 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. Use --no-startup-id
to prevent the command from generating "i3" entries in the task manager.
Example:
bindsym $mod+Shift+e exec --no-startup-id <command>
If you want to map the modifier key itself, use the bindcode command - you have to specify the keycode generated by the key, which you can get via the xev
utility.
Example for the Meta key:
bindcode 133 --release exec --no-startup-id <command>
For Bspwn, you need to use the bspc
program. See Arch Linux wiki for more information.
More Information
- Window managers (Wikipedia)
- Window managers (Arch Linux wiki)
- Desktop environment (Wikipedia)
- Desktop environment (Arch Linux wiki)