如何在 KDE 5 中使用 i3 視窗管理器

如何在 KDE 5 中使用 i3 視窗管理器

如何在 KDE 5 中使用 i3 視窗管理器?

我最近在 Arch Linux 上安裝了 KDE 5.15,但無法將視窗管理器切換到 i3。

我還從 AUR 安裝了適用於 KDE 的 i3。我嘗試過類似的解決方案並依中所述在 .xinitrc 中設定環境變量這個帖子,但到目前為止還沒有運氣。

答案1

我剛剛寫了一個涵蓋該主題的部落格文章。 Melkor33 的解決方案有效,但它不是很乾淨,IMO(要恢復為普通 Plasma,您必須進入並編輯設定檔);我相信我的方法更“正確”,即使需要多做一點工作。

如果您已經安裝了 i3(我推薦i3-間隙),它基本上可以歸結為兩個步驟:1)將 i3 配置為 Plasma 友好,2)配置您的顯示管理器(登入畫面)以添加 Plasma + i3 的選項。

將 i3 配置為 Plasma 友善型

將以下行新增至~/.config/i3/config

# Don’t treat Plasma pop-ups as full-sized windows
for_window [class="plasmashell"] floating enable

# Don’t spawn an empty window for the Plasma Desktop
for_window [title="Desktop — Plasma"] kill, floating enable, border none

配置您的顯示管理器以新增 Plasma + i3 的選項

我使用 sddm(Debian 上的預設設定),因此如果您使用其他顯示管理器 ( cat /etc/X11/default-display-manager),則必須查看設定選項。

# Create a plasma + i3 launcher script
$ echo -e "#!/bin/sh\n\nKDEWM=/usr/bin/i3 startkde" > /usr/local/bin/startkde-i3
$ sudo chown root.staff /usr/local/bin/startkde-i3
$ sudo chmod 755 /usr/local/bin/startkde-i3

# Create a custom desktop sessions directory
$ sudo cp -a /usr/share/xsessions /usr/local/share/xsessions

# Create a new desktop session file for plasma + i3
$ cp /usr/local/share/xsessions/plasma.desktop /usr/local/share/xsessions/plasma-i3.desktop
$ sudo sed -i 's|/usr/bin/startkde|/usr/local/bin/startkde-i3|' /usr/share/xsessions/plasma-i3.desktop
$ sudo sed -i '/Name.*=/ s/$/-i3/' /usr/share/xsessions/plasma-i3.desktop

# Configure sddm (the login screen) to use our new desktop sessions directory
$ echo -e "\n\n[X11]\nSessionDir=/usr/local/share/xsessions" | sudo tee -a /etc/sddm.conf

答案2

如果建立以下文件,則可以設定環境變數:

~/.config/plasma-workspace/env/wm.sh

其中包含行

export KDEWM=i3wm

(得到的答案來自這個github項目如果您對 KDE + i3 感興趣,這可能值得一看)

相關內容