Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

CrunchBang Linux 恢復 Openbox 預設選單配置:一鍵修復 menu.xml

編輯:關於 Linux

CrunchBang (#!) 採用 Openbox 視窗管理器,選單由 ~/.config/openbox/menu.xml 控制。若不慎損毀或誤刪導致選單空白,可從系統骨架目錄 /etc/skel/.config/openbox/ 還原預設配置。

快速修復指令

# 1. 備份現有 (若有)
cp ~/.config/openbox/menu.xml ~/.config/openbox/menu.xml.bak.$(date +%s)

# 2. 從 skeleton 還原預設
cp /etc/skel/.config/openbox/menu.xml ~/.config/openbox/menu.xml

# 3. 重載 Openbox 使生效
openbox --restart

原理解析

  • /etc/skel/ 存放新用戶建立時會複製的預設配置檔 (skeleton)。
  • Openbox 讀取 ~/.config/openbox/menu.xml,openbox --restart 會重新解析該檔而不登出。
  • 同理可還原 rc.xml (鍵盤綁定)、autostart (自動啟動) 等檔案。

進階:自訂選單結構

還原後可編輯 menu.xml 加入常用應用程式:


  
    terminator
  
  
    thunar
  
  
  
    
  

修改後同樣執行 openbox --reconfigure 或 --restart 生效。

備份習慣建議

# 將 ~/.config/openbox/ 納入 Git 版控
cd ~/.config/openbox
git init && git add . && git commit -m "Initial Openbox config"
# 之後每次修改 commit,隨時可回滾

一行指令即可從系統骨架還原 Openbox 預設選單,讓 CrunchBang 桌面瞬間恢復整潔。

Copyright © Windows教程網 All Rights Reserved