IceWM 是一個專為 X Window System 設計的視窗管理員, 由 Marko Maček 於 1997 年開始開發。 IceWM 是個十分輕量的視窗管理員,通常一些設定需要自行修改文字設定檔才行。 要考量的是 IceWM 只是一個視窗管理員,而不是一個桌面環境, 因此缺少檔案管理員 (File Manager) 等內建程式, 需要安裝某個桌面環境提供的程式或者是外部的應用程式。應該也有為了能夠在老舊硬體也能夠執行良好, 使用 IceWM 作為核心,組合其它的應用程式加上自己的設定以後的 Linux Distribution。 因為 Gnome 與 KDE 都相繼轉向 Wayland-only 的環境,但是我仍然需要一個 X Window System 的環境, 所以開始嘗試使用 IceWM。
在安裝完成之後,建立 ~/.config/icewm 目錄(openSUSE 可以使用此目錄進行設定), 再複製下列的設定檔:
cp -a /usr/share/icewm/{prefoverride,toolbar,menu} ~/.config/icewm/
檔案 prefoverride 可以作為主設定檔(包含 theme 設定的項目可以在這裡再設定一次覆蓋掉); 工具列設定在 toolbar;主選單在 menu。
IceWM 支援 theme,在 ~/.config/icewm 下建立 theme 檔案, OpenSUSE 內建的 theme 在 /usr/share/icewm/themes,設定的方式如下:
Theme="win95/default.theme"
下面是我工具列 toolbar 的設定:
prog "xterm" utilities-terminal xterm
prog "Firefox" firefox firefox file:///home/danilo/public_html/index.html
prog PCManFM-Qt pcmanfm-qt pcmanfm-qt
(在 prog 後面的項目是:程式名稱 程式圖示 程式執行路徑與參數,menu 與 toolbar prog 的設定語法相同)
下面是我主選單 menu 的設定:
prog XTerm utilities-terminal xterm
prog Firefox firefox firefox
prog Thunderbird thunderbird thunderbird
prog LibreOffice libreoffice-main libreoffice
prog "SciTE Editor" Sci48M SciTE
prog QPdfView qpdfview qpdfview
prog Nomacs org.nomacs.ImageLounge nomacs
prog DeaDBeeF deadbeef deadbeef
prog "VLC Player" vlc vlc
prog "Volume Control" multimedia-volume-control pavucontrol-qt
includeprog icewm-menu-fdo --seps -d1400 -D1650 -S --limit-max-len=42
#menufile Programs folder programs
menufile Tool_bar folder toolbar
menuprog SUSE folder xdg_menu --format icewm
icewm-menu-fdo 指令可以從系統資料自動產生選單與子選單。 IceWM 有個很有趣的功能, 可以使用 icesh 這個命令列工具組合選取條件、過濾器與動作來控制視窗屬性或 IceWM 本身。 因此我們可以使用 icesh restart 重新啟動 IceWM, 觀察是否有正確修改 theme 或者是選單。
我修改的主要設定檔 prefoverride 設定項目為:
# Command to lock display/screensaver.
LockCommand="xautolock -locknow"
# Opaque window move.
OpaqueMove=0 # 0/1
# Opaque window resize.
OpaqueResize=0 # 0/1
# Favour Xft fonts over core X11 fonts where possible.
PreferFreetypeFonts=1 # 0/1
# Enable Alt+Tab window switching.
QuickSwitch=1 # 0/1
# Show mailbox status on task bar.
TaskBarShowMailboxStatus=0 # 0/1
# Show 'show desktop' button on taskbar (value of 2 to put after the clock)
TaskBarShowShowDesktopButton=2 # [0-2]
# Desktop background color(s), comma separated.
DesktopBackgroundColor=""
# Desktop background image(s), comma separated.
# DesktopBackgroundImage=""
DesktopBackgroundImage="/home/danilo/Pictures/orange-cat.jpg"
在 prefoverride 設定完桌面的背景桌布以後,可以使用 icewmbg -r 重新載入觀察結果。
PulseAudio and PipeWire
二者我都有用過,都工作的很好。
PipeWire 是目前 openSUSE Tumbleweed 的預設值 (在 20220708 之後,不過如果是從 openSUSE Leap 升上來的,如果使用者沒有手動變更,便用的仍然是 PulseAudio)。 PulseAudio 的問題在於其設計者腦子裡並沒有考慮軟體相容性, 在當時已經有延屬較低而且被不少專業音訊軟體採用的 JACK 存在, 但是其設計者卻完全不考慮軟體相容性並且與 JACK 並不相容,而 Redhat 也不管軟體相容問題直接力推 PulseAudio, 造成一些軟體相容性的問題。 就我來說,建議使用 PipeWire,PipeWire 優越的地方就是提供了 PulseAudio 與 JACK 相容的軟體介面,但是延遲比 PulseAudio 較低且通常使用的資源比較少。
下面是安裝 PipeWire 的指令:
sudo zypper in pipewire-pulseaudio pipewire-alsa
要注意 PipeWire 與 PulseAudio 無法共存,所以要選擇 deinstallation PulseAudio 的套件。
因為 IceWM 本身不包含音訊管理功能,需要在啟動時設定自動執行 PipeWire 服務。 不過好像不設定也可以,在我設定之前,音訊功能似乎也可以正常工作。 IceWM 的自動啟動檔案為 ~/.config/icewm/startup (記得使用 chmod +x startup 設定檔案屬性為可執行)。 使用 systemd 的系統,startup 檔案內容如下:
#!/bin/bash
# For PipeWire
systemctl --user start pipewire pipewire-pulse wireplumber
如果使用非 systemd 系統,則改為如下:
#!/bin/bash
pipewire &
pipewire-pulse &
wireplumber &
檢查是否設定成功:
pactl info
如果輸出結果中的 Server Name 顯示為 PulseAudio (on PipeWire x.y.z), 就代表設定成功。
如果想要設定音量,可以安裝 pavucontrol-qt (適合 PulseAudio 以及有安裝 PulseAudio 相容軟體層的 PipeWire 使用)。
NetworkManager
接下來加入網路設定的部份。如果使用 NetworkManager 設定網路,可以安裝 NetworkManager-applet 來更方便的設定網路。 修改 startup 檔案:
#!/bin/bash
# start network manager
sleep 1 && nm-applet &
# allow notifications
/usr/libexec/notification-daemon &
# For PipeWire
systemctl --user start pipewire pipewire-pulse wireplumber
Lock screen
接下來設定螢幕鎖定功能。 這裡使用 xautolock 與 xscreensaver 結合使用的方式,因此需要二個套件都有安裝。
修改主要設定檔 prefoverride,設定 LockCommand:
# Command to lock display/screensaver.
LockCommand="xautolock -locknow"
修改 startup 檔案:
#!/bin/bash
# pcmanfm-qt desktop icon manager
#pcmanfm-qt --desktop &
# start network manager
sleep 1 && nm-applet &
# enable screensaver
xscreensaver -nosplash &
# allow notifications
/usr/libexec/notification-daemon &
# For PireWire
systemctl --user start pipewire pipewire-pulse wireplumber
# enable lockscreen
xautolock -detectsleep -time 10 -locker "xscreensaver-command -lock" &
xautolock 的 -time 用來設定時間,這裡的 10 就是 10 分鐘; -locker 用來呼叫執行螢幕鎖定功能的程式。 在使用 xautolock 控制 xscreensaver 時,需要調整 xscreensaver 本身的設定, 避免二個套件在螢幕鎖定時間的衝突, 執行 xscreensaver-demo(xscreensaver 的設定界面),取消勾選 Lock Screen After。
Theme (Gtk/Qt)
下面嘗試設定 Gtk 以及 Qt 的 theme 設定,讓使用 Gtk 以及 Qt 撰寫的程式看起來比較美觀; 以及 LibreOffice 的相關設定。設定方式為在 ~/.config/icewm/env 這個檔案設定環境變數:
GTK_THEME="Adwaita"
#GTK_THEME="Adwaita:dark"
QT_QPA_PLATFORMTHEME="qt6ct"
SAL_USE_VCLPLUGIN="qt6"
原本我 QT_QPA_PLATFORMTHEME 嘗試使用 platform theme 並且設為 gtk3, 但是在使用中發現這並不是正確的設法,還是需要使用 qt6ct 處理 Qt6 在非 Qt 開發的環境下的視覺設定, 不過也一樣需要設定 QT_QPA_PLATFORMTHEME 為正確的值 (qt6ct) 才行。
xdg-desktop-portal
我發現 xdg-desktop-portal service 並沒有正確啟動(有安裝 xdg-desktop-portal-gtk 但是沒有啟動成功), 而原因是 graphical-session.target 沒有正確啟動服務。 嘗試採用 workaround 避開這個問題, 修改 /usr/lib/systemd/user/xdg-desktop-portal.service:
[Unit]
Description=Portal service
#PartOf=graphical-session.target
#Requisite=graphical-session.target
#After=graphical-session.target
[Service]
Type=dbus
BusName=org.freedesktop.portal.Desktop
ExecStart=/usr/libexec/xdg-desktop-portal
Slice=session.slice
使用下列的指令檢查目前的服務狀態:
systemctl --user status xdg-desktop-portal.service
PCManFM-Qt
PCManFM-Qt 是一個輕量的檔案管理以及桌面管理程式。 檔案管理方面有二個地方要設定,Edit > Preference > Advanced, 選擇要使用的 Terminal emulator 以及 Archiver integration(如果沒有安裝其它桌面環境的 archive manager, 可以安裝同樣是 LXQt 桌面環境組件的 lxqt-archiver 並且設定使用)。
IceWM 使用 icewmbg 處理桌面上的桌布。如果要讓 pcmanfm-qt 處理, 那麼要在 prefoverride 將 DesktopBackgroundImage 與 DesktopBackgroundColor 都設為空白, 並且在 startup 設定啟動 pcmanfm-qt desktop manager。加入下面的設定內容:
#!/bin/bash
# pcmanfm-qt desktop icon manager
pcmanfm-qt --desktop &
在 pcmanfm-qt 管理桌面以後,按右鍵選擇 Desktop Preferences 就可以設定桌面選項 (我使用的版本行為是這樣)。 但是有個麻煩的地方是 desktop icon 不管什麼桌面環境都會放在家目錄下的 Desktop 目錄, 所以彼此可能會發生衝突。在考慮以後,我決定使用 IceWM 原來的 icewmbg 管理桌布, 而不使用 pcmanfm-qt(在 startup 關於 pcmanfm-qt 的設定需要移除或者是註解掉)。
XTerm
X Window 內建的終端模擬器為 XTerm,其設定檔可以使用家目錄下的 .Xresources。
! Set font and anti-aliasing
xterm*faceName: Monospace
XTerm*faceSize: 16
! Enable a scrollbar on the right side
XTerm*scrollBar: true
XTerm*rightScrollBar: true
! Configuring the maximized window size
XTerm*maximized: true
! Set color scheme (Black background, white text)
XTerm*vt100.background: black
XTerm*vt100.foreground: white
! Display Scrollbar
XTerm.vt100.scrollBar: true
XTerm.vt100.scrollbar.width: 8
! Increase history scrollback buffer
XTerm*saveLines: 4096
! Selections are available via the standard clipboard
XTerm*selectToClipboard: false
! Fix backspace behavior
XTerm*vt100.backarrowKey: false
! Custom Key Bindings for copy and paste
XTerm*vt100*translations: #override \n\
Shift <Key>Insert: insert-selection(CLIPBOARD) \n\
Ctrl <Key>Insert: copy-selection(CLIPBOARD) \n\
Ctrl Shift <Key>C: copy-selection(CLIPBOARD) \n\
Ctrl Shift <Key>V: insert-selection(CLIPBOARD)
(原本我將 XTerm*selectToClipboard 設為 true,這樣只要選取文字就會自動複製到 clipboard。 不過後來我決定採取更手動的方式,所以使用 custom key bindings 的方式,設定 Ctrl+Insert 用來複製文字; 並且加入 Shfit+Ctrl+C 與 Shfit+Ctrl+V 這組按鍵。)
如果要立即生效,使用下列的指令:
xrdb -merge ~/.Xresources
XTerm 讀取環境變數 SHELL 作為執行命令時的命令列介面程式,如果需要使用指定的 SHELL, 可以設定環境變數 SHELL 以後再執行 xterm:
SHELL=/usr/bin/tcsh xterm
Mozilla Firefox
Firefox 支援佈景主題 (Themes) 與內建 PDF.js。下面是我目前有在使用的套件:
- uBlock Origin: 高效率的廣告攔截工具
- Decentraleyes: 用於保護使用者免遭集中的內容交付網路(CDN)的跟蹤
- Privacy Badger: 用於阻止那些不遵守 DNT 協定的廣告商跟蹤行為
- Flagfox: 以旗幟圖示顯示出目前網頁伺服器實際位置的擴充套件
- Livemarks: Get auto-updated RSS feed bookmark folders
Thunderbird
下面是 gmail 的設定資料,Thunderbird 本身已經有設定資料,只是用來檢查設定是否正確。
內送郵件伺服器 (IMAP)
- 伺服器名稱 (Host):imap.gmail.com
- 通訊埠 (Port):993
- 安全性加密類型:SSL 或 TLS
- 使用者名稱 (Username):Gmail 電子郵件地址
- 密碼 (Password):Gmail 密碼或應用程式密碼(若已開啟兩步驟驗證)
外寄郵件伺服器 (SMTP)
- 伺服器名稱 (Host):smtp.gmail.com
- 通訊埠 (Port):465(搭配 SSL)
- 安全性加密類型:TLS 或 SSL
- 需要驗證:勾選「我的外寄伺服器 (SMTP) 需要驗證」(設定與內送相同)
從 2025 年開始,Google 帳戶已全面不支援僅用「使用者名稱與密碼」登入的低安全性第三方應用程式, 第三方郵件端需改用 OAuth 2.0 或「應用程式密碼」來進行身分驗證。
下面是 Account Settings 要注意的部份。
在 Server Settings 中,不要勾選 Clean up ("Expunge") Inbox on Exit 與 Empty Trash on Exit。
在 Copies & Folders 中,不要勾選 Place a copy in 選項,
在 Drafts and Templates 的 Keep message drafts in: 選項中,選擇 Other, Drafts on [Your Gmail address]。
在 Spam Settings,不要勾選 Enable adaptive junk mail controls for this account。
下面是 hotmail 的設定資料,Thunderbird 本身已經有設定資料,只是用來檢查設定是否正確。
內送郵件伺服器 (IMAP)
- 伺服器名稱 (Host):outlook.office365.com
- 通訊埠 (Port):993
- 加密方法:SSL / TLS
- 使用者名稱 (Username):Hotmail 電子郵件地址
- 密碼 (Password):Hotmail 密碼或應用程式密碼(若已開啟兩步驟驗證)
外寄郵件伺服器 (SMTP)
- 伺服器名稱 (Host):smtp-mail.outlook.com
- 通訊埠 (Port):587
- 加密方法:STARTTLS
- 驗證方式:OAuth2
注意需要啟用 IMAP 功能:登入 Outlook 網頁版,前往 設定 > 郵件 > 轉寄和 IMAP,確認已勾選 開啟 IMAP 並儲存。
下面是 Account Settings 要注意的部份。
在 Copies & Folders 中,在 Place a copy in 選項 選擇 Other 選項。
SciTE
選單 Options > Open User Options File, 然後加入要設定的選項(可以先複製 global options 的內容到此處再設定)。 User Option file 檔案為家目錄下的 .SciTEUser.properties。 下面只是目前修改的結果,主要修改使用者介面、code page 以及字型設定。
# Window sizes and visibility
position.maximize=1
#position.tile=1
#full.screen.hides.menu=1
#minimize.to.tray=1
#icon.busy=1
split.vertical=0
#split.wide=1
#output.horizontal.size=200
#output.vertical.size=60
#output.initial.hide=1
#horizontal.scrollbar=0
#horizontal.scroll.width=10000
#horizontal.scroll.width.tracking=0
#output.horizontal.scrollbar=0
#output.horizontal.scroll.width=10000
#output.horizontal.scroll.width.tracking=0
#output.scroll=0
#error.select.line=1
#end.at.last.line=0
tabbar.visible=1
#tabbar.hide.one=1
#tabbar.hide.index=1
#tabbar.multiline=1
toolbar.visible=1
#toolbar.usestockicons=1
#toolbar.large=1
#menubar.detachable=1
#undo.redo.lazy=1
undo.selection.history=1
statusbar.visible=1
# Sizes and visibility in edit pane
line.margin.visible=1
line.margin.width=2+
view.whitespace=1
check.if.already.open=1
#temp.files.sync.load=1
default.file.ext=.txt
#source.default.extensions=.h|.cxx|.bat
title.full.path=1
open.dialog.in.file.directory=1
save.check.modified.time=1
# Indentation
tabsize=4
indent.size=4
use.tabs=1
# Wrapping of long lines
wrap=1
wrap.style=2
# Behaviour
#eol.mode=LF
eol.auto=1
clear.before.execute=1
# Unicode
code.page=65001
output.code.page=65001
# Give symbolic names to the set of fonts used in the standard styles.
font.base=$(font.monospace)
font.small=font:Noto Sans Mono CJK TC, size:10
font.comment=$(font.monospace)
font.code.comment.box=$(font.monospace)
font.code.comment.line=$(font.monospace)
font.code.comment.doc=$(font.monospace)
font.code.comment.nested=$(font.monospace)
font.text=$(font.monospace)
font.text.comment=$(font.monospace)
font.embedded.base=$(font.monospace)
font.embedded.comment=$(font.monospace)
font.monospace=font:Noto Sans Mono CJK TC, size:12
font.monospace.small=font:Noto Sans Mono CJK TC, size:10
font.vbs=$(font.monospace)
Tips
Clear the GTK/FreeDesktop History File
使用下列的指令:
rm -f ~/.local/share/recently-used.xbel
touch ~/.local/share/recently-used.xbel