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

From KDE UserBase Wiki
(test)
(Updating to match new version of source page)
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages />
<languages />


<span id="Introduction"></span>
== Introduction ==
== Introduction ==


Line 18: Line 19:
** 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.
** 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.


<span id="Set-up"></span>
<div class="mw-translate-fuzzy">
== Utiliser un autre gestionnaire de fenêtre avec Plasma ==
== Utiliser un autre gestionnaire de fenêtre avec Plasma ==
</div>


=== Mono utilisateur : utiliser les paramètres système ===
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].


Ceci est la méthode la plus simple, mais elle ne concerne que l'utilisateur pour lequel elle a été ajoutée.
<span id="Configuration"></span>
 
<div class="mw-translate-fuzzy">
[[Image:kde-i3-integration.png]]
==Configuration de I3==
 
</div>
*Créer un script shell  (kde-i3.sh par exemple), contenant ceci {{Input/fr|1=<nowiki>
#!/bin/sh
export KDEWM=/usr/bin/i3
</nowiki>}}
Remplacer /usr/bin/i3 par le chemin du gestionnaire de fenêtres choisi.
 
* Démarrer la '''configuration système'''
 
* Selectionner  '''Démarrage et fermeture'''


* Selectionner '''Autodémarrage'''
To make a non-standard WM work well with Plasma, some additional configuration may be required.


* Cliquer sur le bouton '''Ajouter un script''' en-dessous de la liste
===i3===  
 
* Entrez l'emplacement du script créé plus tôt, ou uilisez l'icône de dossier pour obtenir un dialogue pour le rechercher. Cliquez '''OK''', le script sera ajouté à la liste
 
* Dans la colonne '''Démarrer sur''', sélectionnez '''Avant le démarrage de la session''' à partir de la liste déroulante
 
* Le gestionnaire de fenêtres choisi sera utilisé la prochaine fois que vous vous connecterez
 
=== Système étendu: ajouter une session X ===
 
Si l'accès super-utilisateur (root) est disponible, un nouveau fichier de session pour X.org peut être créé.
 
Cela à plusieurs avantages : la session alternative est disponible pour tous les utilisateurs, et pour réutiliser '''KWin''', il suffit de se déconnecter et de se reconnecter.
 
{{Note/fr|L"emplacement du fichier XSession varie suivant la distribution, mais en général il se trouve dans {{Path|/usr/share/xsessions}}. }}
 
Pour ajouter une session concernant un gestionnaire de fenêtres supplémentaire en tant que super-utilisateur :
 
* Copier le fichier de session Plasma existant {{Input/fr|1=<nowiki>cp plasma.desktop plasma-i3.desktop</nowiki>}}
 
* En utilisant un éditeur de texte, ouvrez le fichier et modifiez la ligne Exec , et éventuellement la Description{{Input/fr|1=<nowiki>[Desktop Entry]
Type=XSession
Exec=env KDEWM=/usr/bin/i3 /usr/bin/startplasma-x11
DesktopNames=KDE
Name=Plasma (i3)
Comment=Plasma by KDE w/i3
</nowiki>}}
{{Warning/fr|Dans les versions antérieures à Plasma 5.17, utilisez '''startkde''' à la place de  '''startplasma-x11''' dans la directive Exec ci-dessus.}}
 
* Le gestionnaire d'écran doit être redamarré, le plus facilement en redémarrant la machine.
 
{{Warning/fr|Assurez-vous que le chemin correct ainsi que le nom de l'application du gestionnaire de fenêtres sont utilisés lorsque l'on modifie la directive Exec. Si KDE ne peut pas démarrer le gestionnaire de fenêtres, la session va échouer et l'utilisateur reviendra à l'écran de connexion.}}
 
==Configuration de I3==


<span id="Installation"></span>
<div class="mw-translate-fuzzy">
===Installation===
===Installation===
</div>


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.
Avant de commencer la configuration, vous devez vous assurer que i3 ou i3-gaps sont installés sur votre système. S'ils ne le sont pas, utilisez votre gestionnaire de paquets ou  [[Special:myLanguage/Discover|Discover]] pour installer l'un de ces deux paquets.


<span id="Configure_i3"></span>
<div class="mw-translate-fuzzy">
=== Configurer i3 ===
=== Configurer i3 ===
</div>


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>.
Lorsque vous exécutez i3 pour la première fois, sa configuration globale par défaut (dans <code>/etc/i3/config</code>) va lancer i3-config-wizard, qui fournit un dialogue pour la sélection de clé Mod et génère la configuration locale de l'utilisateur dans <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.
Si vous voulez conserver la même configuration pour tous  les utilisateurs (ils pourront encore le réécraser avec leur propre configuration locale), supprimez l'appel de l'assistant du fichier de configuration global et utilisez le directement.




The following i3 window rules will help you with notifications and some other plasma windows:
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
{{Input|1=<nowiki>for_window [title="Desktop — Plasma"] kill, floating enable, border none
for_window [class="plasmashell"] floating enable;
for_window [class="plasmashell"] floating enable
for_window [class="Plasma"] floating enable; border none
for_window [class="Plasma"] floating enable, border none
for_window [title="plasma-desktop"] floating enable; border none
for_window [title="plasma-desktop"] floating enable, border none
for_window [title="win7"] floating enable; border none
for_window [title="win7"] floating enable, border none
for_window [class="krunner"] floating enable; border none
for_window [class="krunner"] floating enable, border none
for_window [class="Kmix"] floating enable; border none
for_window [class="Kmix"] floating enable, border none
for_window [class="Klipper"] floating enable; border none
for_window [class="Klipper"] floating enable, border none
for_window [class="Plasmoidviewer"] floating enable; border none
for_window [class="Plasmoidviewer"] floating enable, border none
for_window [class="(?i)*nextcloud*"] floating disable
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  
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>}}
</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>.
Si vous utilisez une installation de Plasma qui n'est pas en langue anglaise, vous devez trouver quel est le titre exact de la fenêtre du bureau. Une manière de faire cela est d'utiliser <code>wmctrl -l</code>.


Instead of adding
Au lieu d'ajouter
{{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
</nowiki>}}
</nowiki>}}


add the name of the window to the i3 config. This example uses the German Plasma installation.
ajoutez le nom de la fenêtre à la configuration i3. Cet exemple utilise l'installation Plasma en allemand.
{{Input|1=<nowiki>for_window [title="Arbeitsfläche — Plasma"] kill; floating enable; border none
{{Input|1=<nowiki>for_window [title="Arbeitsfläche — Plasma"] kill; floating enable; border none
</nowiki>}}
</nowiki>}}


===Configure Plasma===
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>}}
 
<span id="Configure_Plasma"></span>
<div class="mw-translate-fuzzy">
=== Configurer Plasma ===
</div>


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.
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.
Line 114: Line 94:
To get the Plasma provided pager display desktops as i3bar, set '''Pager Settings''' > '''General''' > '''Text display''' to "Desktop name"
To get the Plasma provided pager display desktops as i3bar, set '''Pager Settings''' > '''General''' > '''Text display''' to "Desktop name"


 
<span id="Bspwm"></span>
<div class="mw-translate-fuzzy">
== Configuration de bspwm ==
== Configuration de bspwm ==
</div>


Dans la plupart des cas, bspwm demande quelques petites déclarations supplémentaires.
Dans la plupart des cas, bspwm demande quelques petites déclarations supplémentaires.
Line 121: Line 103:
* 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.


===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>
rule_any = {
    name = {
      "Desktop.*Plasma",
    },
},
</nowiki>}}
<span id="Hints_and_Tips"></span>
== Conseils et astuces ==
== Conseils et astuces ==


===DBus===
<span id="DBus"></span>
=== DBus ===


Vous pouvez ouvrir certains composants Plasma avec les commandes DBus. Ainsi vous pouvez créer des raccourcis clavier vers ces commandes DBus. Pour trouver une commande DBus spécifique, vous pouvez utiliser QDbusViewer.
Vous pouvez ouvrir certains composants Plasma avec les commandes DBus. Ainsi vous pouvez créer des raccourcis clavier vers ces commandes DBus. Pour trouver une commande DBus spécifique, vous pouvez utiliser QDbusViewer.
Line 129: Line 186:
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.
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:
D'autres informations sur la gestion des méta clés :


* [https://www.reddit.com/r/kde/comments/6wn5lk/bind_meta_key_alone_to_do_something/ Reddit post describing the ''Meta key - KWin'' relation]
* [https://www.reddit.com/r/kde/comments/6wn5lk/bind_meta_key_alone_to_do_something/ Billet Reddit décrivant la relation ''Meta key - KWin'']


* [https://zren.github.io/2019/03/04/activate-any-widget-with-meta-key Blog post describing the ''DBus - Component'' relation]
* [https://zren.github.io/2019/03/04/activate-any-widget-with-meta-key Billet de blog décrivant la relation ''DBus - Component'' ]




Line 149: Line 206:
{{Input/fr|1=<nowiki>bindsym $mod+Shift+e exec <command></nowiki>}}
{{Input/fr|1=<nowiki>bindsym $mod+Shift+e exec <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.
Si vous voulez faire correspondre la clé du modificateur lui-même, utilisez la commande '''bindcode''' - vous devez préciser le code de clé généré par la clé, que vous pouvez obtenir via l'utilitaire  <code>xev</code>.


Example for the Meta key:
Exemple pour la Meta key:
{{Input|1=<nowiki>bindcode 133 --release exec --no-startup-id <command></nowiki>}}
{{Input|1=<nowiki>bindcode 133 --release exec --no-startup-id <command></nowiki>}}


Pour Bspwn, vous devez utiliser le programme <code>bspc</code> . Voir le [https://wiki.archlinux.org/index.php/Bspwm#Keyboard wiki de l'archive linux] pour plus d'informations.
Pour Bspwn, vous devez utiliser le programme <code>bspc</code> . Voir le [https://wiki.archlinux.org/index.php/Bspwm#Keyboard wiki de l'archive linux] pour plus d'informations.


<span id="More_Information"></span>
== Davantage d'informations ==
== Davantage d'informations ==


Line 163: Line 221:
* [https://wiki.archlinux.org/index.php/Desktop_environment Environment du bureau] (Arch Linux wiki)
* [https://wiki.archlinux.org/index.php/Desktop_environment Environment du bureau] (Arch Linux wiki)


<span id="References"></span>
== Références ==
== Références ==



Latest revision as of 01:26, 22 October 2023

Introduction

KWin est le gestionnaire de fenêtres (WM) dans Plasma et à de nombreuses fonctionnalité, mais ne supporte uniquement des fenêtres flottantes. Plasma vous laisse utiliser un autre gestionnaire de fenêtres par exemple i3, bspwm ou n'importe quelle autre gestionnaire de fenêtre par pavage.

Plasma utilisant i3 comme gestionnaire de fenêtres

Attention

D'autre gestionnaire de fenêtre sont uniquement disponible en utilisant X.org. Ces changements ne peuvent pas encore être réalisés pour les sessions Wayland. Avec un Wayland plus mature et les extensions Wayland qui commencent à se normaliser, cette fonctionalité pourrait être implémentée dans Wayland [1]


Beaucoup de gestionnaire de fenêtre nécessite peu, voire aucune, modifications de leurs fichiers de configuration.

Quelques considérations à prendre en compte lorsque vous utilisez un autre gestionnaire de fenêtres :

  • Empiler les gestionnaires de fenêtres peut générer des problèmes avec les composants tels que les panneaux. Pour certaines configurations, certaines options aideront à surmonter les problèmes
  • La plupart des gestionnaires de fenêtres ne possèdent pas leur propre compositeur, c'est pourquoi certaines fonctionalités leur sont absentes comme les animations ou a transparence. Si de tels effets sont souhaités, un compositeur tel que compton est nécessaire.
    • 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.

Utiliser un autre gestionnaire de fenêtre avec Plasma

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 de I3

To make a non-standard WM work well with Plasma, some additional configuration may be required.

i3

Installation

Avant de commencer la configuration, vous devez vous assurer que i3 ou i3-gaps sont installés sur votre système. S'ils ne le sont pas, utilisez votre gestionnaire de paquets ou Discover pour installer l'un de ces deux paquets.

Configurer i3

Lorsque vous exécutez i3 pour la première fois, sa configuration globale par défaut (dans /etc/i3/config) va lancer i3-config-wizard, qui fournit un dialogue pour la sélection de clé Mod et génère la configuration locale de l'utilisateur dans ~/.i3/config.

Si vous voulez conserver la même configuration pour tous les utilisateurs (ils pourront encore le réécraser avec leur propre configuration locale), supprimez l'appel de l'assistant du fichier de configuration global et utilisez le directement.


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"] 

Si vous utilisez une installation de Plasma qui n'est pas en langue anglaise, vous devez trouver quel est le titre exact de la fenêtre du bureau. Une manière de faire cela est d'utiliser wmctrl -l.

Au lieu d'ajouter

for_window [title="Desktop — Plasma"] kill; floating enable; border none

ajoutez le nom de la fenêtre à la configuration i3. Cet exemple utilise l'installation Plasma en allemand.

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

Configurer 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"

Configuration de bspwm

Dans la plupart des cas, bspwm demande quelques petites déclarations supplémentaires.

  • 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",
     },
 },

Conseils et astuces

DBus

Vous pouvez ouvrir certains composants Plasma avec les commandes DBus. Ainsi vous pouvez créer des raccourcis clavier vers ces commandes DBus. Pour trouver une commande DBus spécifique, vous pouvez utiliser QDbusViewer.

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.

D'autres informations sur la gestion des méta clés :


Quelques exemples :

  • Ouvrir Krunner
    qdbus org.kde.kglobalaccel /component/krunner org.kde.kglobalaccel.Component.invokeShortcut 'run command'
  • Ouvrir l'écran de confirmation de déconnexion
    qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1
  • 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

Pour i3, vous pouvez définir un raccourci clavier avec la commande bindsym. Exemple :

bindsym $mod+Shift+e exec <command>

Si vous voulez faire correspondre la clé du modificateur lui-même, utilisez la commande bindcode - vous devez préciser le code de clé généré par la clé, que vous pouvez obtenir via l'utilitaire xev.

Exemple pour la Meta key:

bindcode 133 --release exec --no-startup-id <command>

Pour Bspwn, vous devez utiliser le programme bspc . Voir le wiki de l'archive linux pour plus d'informations.

Davantage d'informations

Références