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

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


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


Line 16: Line 17:


* 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.
* 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.


<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">
==Configuration de I3==
</div>


[[Image:kde-i3-integration.png]]
To make a non-standard WM work well with Plasma, some additional configuration may be required.


*Créer un script shell  (kde-i3.sh par exemple), contenant ceci {{Input/fr|1=<nowiki>
===i3===
#!/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'''
<span id="Installation"></span>
<div class="mw-translate-fuzzy">
===Installation===
</div>


* Selectionner '''Démarrage et fermeture'''
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.


* Selectionner '''Autodémarrage'''
<span id="Configure_i3"></span>
<div class="mw-translate-fuzzy">
=== Configurer i3 ===
</div>


* Cliquer sur le bouton '''Ajouter un script''' en-dessous de la liste
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>.


* 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
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.


* In the '''Run On''' column, select '''Before Session Startup''' from the drop down list


* Le gestionnaire de fenêtres choisi sera utilisé la prochaine fois que vous vous connecterez
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>}}


=== Système étendu: ajouter une session X ===
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>.
 
Au lieu d'ajouter
{{Input|1=<nowiki>for_window [title="Desktop — Plasma"] kill; floating enable; border none
</nowiki>}}


Si l'accès super-utilisateur (root) est disponible, un nouveau fichier de session pour X.org peut être créé.
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
</nowiki>}}


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.
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>}}


{{Note/fr|L"emplacement du fichier XSession varie suivant la distribution, mais en général il se trouve dans {{Path|/usr/share/xsessions}}. }}
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>}}


Pour ajouter une session concernant un gestionnaire de fenêtres supplémentaire en tant que super-utilisateur :
<span id="Configure_Plasma"></span>
<div class="mw-translate-fuzzy">
=== Configurer Plasma ===
</div>


* Copier le fichier de session Plasma existant {{Input/fr|1=<nowiki>cp plasma.desktop plasma-i3.desktop</nowiki>}}
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.


* En utilisant un éditeur de texte, ouvrez le fichier et modifiez la ligne Exec , et éventuellement la Description{{Input/fr|1=<nowiki>[Desktop Entry]
To get the Plasma provided pager display desktops as i3bar, set '''Pager Settings''' > '''General''' > '''Text display''' to "Desktop name"
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
</nowiki>}}


* Le gestionnaire d'écran doit être redamarré, le plus facilement en redémarrant la machine.
<span id="Bspwm"></span>
<div class="mw-translate-fuzzy">
== Configuration de bspwm ==
</div>


{{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.}}
Dans la plupart des cas, bspwm demande quelques petites déclarations supplémentaires.


==Configuration de I3==
* 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.


===Installation===
===awesomewm===


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. You should also install a compositor such as "compton", since unlike KWin, i3 doesn't ship with an integrated compositor.
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
    },


===Creation d'une configuration de default de i3===
},
{ -- 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


{{Note/fr|si vous avez déjà un fichier de configuration i3 (souvent dans <code>.i3/config</code> ou <code>.config/i3/config</code>), vous pouvez sauter cette étape.}}
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


[[Special:myLanguage/Tutorials/Open a console|Ouvrez un terminal]] et entrez <code>i3-config-wizard</code>. Cette commande ouvre une petite fenêtre qui vous aidera à créer un fichier de configuration.  
-- Show titlebars only if enabled.
if c.titlebars then
    awful.titlebar.show(c)
else
    awful.titlebar.hide(c)
end


[[File:i3-wizard.png|500px]]
-- 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>}}


Some i3 window rules help you to have notifications and some other plasma windows as floating windows:
You may match Plasma Desktop using the following rule:
{{Input|1=<nowiki>for_window [title="Desktop — Plasma"] kill; floating enable; border none
{{Input|1=<nowiki>
for_window [class="plasmashell"] floating enable;
rule_any = {
for_window [class="Plasma"] floating enable; border none
    name = {
for_window [title="plasma-desktop"] floating enable; border none
      "Desktop.*Plasma",
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
</nowiki>}}
</nowiki>}}


==Bspwm configuration==
<span id="Hints_and_Tips"></span>
== Conseils et astuces ==
 
<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.
 
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.


Dans la plupart des cas, bspwm demande quelques petites déclarations supplémentaires.
D'autres informations sur la gestion des méta clés :


* 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.
* [https://www.reddit.com/r/kde/comments/6wn5lk/bind_meta_key_alone_to_do_something/ Billet Reddit décrivant la relation ''Meta key - KWin'']


==Hints and Tips==
* [https://zren.github.io/2019/03/04/activate-any-widget-with-meta-key Billet de blog décrivant la relation ''DBus - Component'' ]


===DBus===


You can open some Plasma components with DBus commands. So you can map keybinding to these DBus commands. To find a specific DBus command, you can look at QDbusViewer.
Quelques exemples :


Some examples:
* Ouvrir Krunner {{Input/fr|1=<nowiki>qdbus org.kde.kglobalaccel /component/krunner org.kde.kglobalaccel.Component.invokeShortcut 'run command'</nowiki>}}
* Ouvrir l'écran de confirmation de déconnexion {{Input/fr|1=<nowiki>qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1</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:
Pour i3, vous pouvez définir un raccourci clavier avec  la commande  bindsym. Exemple :
 
{{Input/fr|1=<nowiki>bindsym $mod+Shift+e exec <command></nowiki>}}
 
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>.


{{Input|1=<nowiki>bindsym $mod+Shift+e exec <command></nowiki>}}
Exemple pour la Meta key:
{{Input|1=<nowiki>bindcode 133 --release exec --no-startup-id <command></nowiki>}}


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.
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.


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


* [https://en.wikipedia.org/wiki/X_window_manager Window managers] (Wikipedia)  
* [https://en.wikipedia.org/wiki/X_window_manager Gestionnaires de fenêtres] (Wikipedia)  
* [https://wiki.archlinux.org/index.php/Window_managers Window managers] (Arch Linux wiki)
* [https://wiki.archlinux.org/index.php/Window_managers Gestionnaires de fenêtres] (Arch Linux wiki)
* [https://en.wikipedia.org/wiki/Desktop_environment Desktop environment] (Wikipedia)
* [https://en.wikipedia.org/wiki/Desktop_environment Environment du bureau] (Wikipedia)
* [https://wiki.archlinux.org/index.php/Desktop_environment Desktop environment] (Arch Linux wiki)
* [https://wiki.archlinux.org/index.php/Desktop_environment Environment du bureau] (Arch Linux wiki)


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


[[Category:Tutorials]]
[[Category:Tutorials]]

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