Como usar o i3 como gerenciador de janelas no KDE plasma
Dica publicada em Linux / Configuração
Como usar o i3 como gerenciador de janelas no KDE plasma
O primeiro passo é criar uma "Sessão de Login" com o Plasma+i3:
sudo nano /usr/bin/i3-kde-session
Adicione o conteúdo abaixo:
Agora, crie um Launcher para a Sessão KDE/i3 no Xsessions:
sudo nano /usr/share/xsessions/i3-kde.desktop
Adicione o seguinte conteúdo:
Por fim, faça alguns ajustes no arquivo de configuração do i3 para deixá-lo melhor integrado ao KDE plasma:
nano ~/.config/i3/config
Adicione os códigos abaixo em complementação ao i3-config:
sudo apt-get install git gcc make libx11-dev libxtst-dev pkg-config
git clone https://github.com/hanschen/ksuperkey.git
cd ksuperkey
make
sudo make
E adicione "exec --no-startup-id ksuperkey" ao arquivo de configuração do i3.
Pronto, agora basta iniciar sua nova Sessão "KDE/i3" pelo SDDM e se divertir com o i3, sem ter que abrir mão de usar todos os recursos de um Ambiente Gráfico (DE) completo.
Obs.: esta dica foi testada no Kubuntu e Solus, funciona tanto para o i3-WM como o i3-Gaps. Não se esqueça de configurar os atalhos de teclado do i3, de modo a não conflitar com os atalhos do KDE plasma.
sudo nano /usr/bin/i3-kde-session
Adicione o conteúdo abaixo:
#!/bin/sh
if test -n "$1"; then
echo "Syntax: i3-kde-session"
exit
fi
# Set the prefix for the menu layout to use
export XDG_MENU_PREFIX="kde-4-"
# Clean up after SDDM
xprop -root -remove _NET_NUMBER_OF_DESKTOPS \
-remove _NET_DESKTOP_NAMES \
-remove _NET_CURRENT_DESKTOP 2> /dev/null
# Run KDE with i3 as its window manager
export KDEWM="/usr/bin/i3"
exec startkde "$@"
Agora, crie um Launcher para a Sessão KDE/i3 no Xsessions:
sudo nano /usr/share/xsessions/i3-kde.desktop
Adicione o seguinte conteúdo:
[Desktop Entry]
Name=KDE/i3
Comment=Use the i3 window manager inside of the K Desktop Environment
Exec=/usr/bin/i3-kde-session
TryExec=startkde
Icon=
Type=Application
Name=KDE/i3
Comment=Use the i3 window manager inside of the K Desktop Environment
Exec=/usr/bin/i3-kde-session
TryExec=startkde
Icon=
Type=Application
Por fim, faça alguns ajustes no arquivo de configuração do i3 para deixá-lo melhor integrado ao KDE plasma:
nano ~/.config/i3/config
Adicione os códigos abaixo em complementação ao i3-config:
## Esconder barra do i3 (opcional)
bar {
#status_command i3status
tray_output none
mode invisible
}
## Atalho para Hide/unhide a barra do i3
bindsym $mod+m bar mode toggle
## KDE plasma integration
for_window [title="Desktop Plasma"] kill
for_window [title="Área de Trabalho Plasma"] kill
for_window [title="plasma-desktop"] floating enable, border none
for_window [title="win7"] floating enable, border none
for_window [class="plasmashell"] floating enable
for_window [class="Klipper"] floating enable, border none
for_window [class="Kmix"] floating enable, border none
for_window [class="Plasmoidviewer"] floating enable, border none
for_window [class="bovo"] floating enable
for_window [class="kcalc"] floating enable
for_window [class="kcolorchooser"] floating enable
for_window [class="klines"] floating enable
for_window [class="Knights"] floating enable
for_window [class="kruler"] floating enable
for_window [class="krunner"] floating enable, border none
for_window [class="ksysguard"] floating enable
for_window [class="yakuake"] floating enable
#
for_window [window_role="About"] floating enable
for_window [window_role="Preferences"] floating enable
for_window [window_role="bubble"] floating enable
for_window [window_role="pop-up"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [window_type="dialog"] floating enable
for_window [window_type="menu"] floating enable
#
no_focus [class=plasmashell]
no_focus [window_role="pop-up"]
no_focus [window_type="notification"]
## Logout/Desligar
bindsym $mod+Shift+e exec qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1
## krunner
bindsym $mod+d exec qdbus org.kde.kglobalaccel /component/krunner org.kde.kglobalaccel.Component.invokeShortcut 'run command'
## Compositor (Compton)
exec --no-startup-id compton --backend glx --vsync opengl-swc
bar {
#status_command i3status
tray_output none
mode invisible
}
## Atalho para Hide/unhide a barra do i3
bindsym $mod+m bar mode toggle
## KDE plasma integration
for_window [title="Desktop Plasma"] kill
for_window [title="Área de Trabalho Plasma"] kill
for_window [title="plasma-desktop"] floating enable, border none
for_window [title="win7"] floating enable, border none
for_window [class="plasmashell"] floating enable
for_window [class="Klipper"] floating enable, border none
for_window [class="Kmix"] floating enable, border none
for_window [class="Plasmoidviewer"] floating enable, border none
for_window [class="bovo"] floating enable
for_window [class="kcalc"] floating enable
for_window [class="kcolorchooser"] floating enable
for_window [class="klines"] floating enable
for_window [class="Knights"] floating enable
for_window [class="kruler"] floating enable
for_window [class="krunner"] floating enable, border none
for_window [class="ksysguard"] floating enable
for_window [class="yakuake"] floating enable
#
for_window [window_role="About"] floating enable
for_window [window_role="Preferences"] floating enable
for_window [window_role="bubble"] floating enable
for_window [window_role="pop-up"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [window_type="dialog"] floating enable
for_window [window_type="menu"] floating enable
#
no_focus [class=plasmashell]
no_focus [window_role="pop-up"]
no_focus [window_type="notification"]
## Logout/Desligar
bindsym $mod+Shift+e exec qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout -1 -1 -1
## krunner
bindsym $mod+d exec qdbus org.kde.kglobalaccel /component/krunner org.kde.kglobalaccel.Component.invokeShortcut 'run command'
## Compositor (Compton)
exec --no-startup-id compton --backend glx --vsync opengl-swc
Dica extra
Com a substituição do kwin pelo i3, perde-se o atalho de abrir o menu com a tecla Super (Windows). Para ter de volta essa funcionalidade, instale o aplicativo ksuperkey:sudo apt-get install git gcc make libx11-dev libxtst-dev pkg-config
git clone https://github.com/hanschen/ksuperkey.git
cd ksuperkey
make
sudo make
E adicione "exec --no-startup-id ksuperkey" ao arquivo de configuração do i3.
Pronto, agora basta iniciar sua nova Sessão "KDE/i3" pelo SDDM e se divertir com o i3, sem ter que abrir mão de usar todos os recursos de um Ambiente Gráfico (DE) completo.
Obs.: esta dica foi testada no Kubuntu e Solus, funciona tanto para o i3-WM como o i3-Gaps. Não se esqueça de configurar os atalhos de teclado do i3, de modo a não conflitar com os atalhos do KDE plasma.