当前位置: 首页>>技术教程>>正文


有什么方法可以完全禁用工作区并从Unity-2D面板中删除图标?

, ,

问题描述

我的系统是围绕我71岁的父亲(他是一个最近的Linux用户,现在非常支持)构建的。

他不需要多个桌面,而且我发现面板上有太多东西可能会让他感到困惑。

有什么方法可以完全禁用工作空间/以及从面板中删除图标?

最佳方案

  1. 禁用多个工作区:

    • 使用GConf Editor/apps/metacity/general/num_workspaces的值更改为1

  2. 从启动器中删除工作区切换器:删除并重新排列因此,要进行此更改,您需要编辑一个文件。首先要安全备份:

(对于11.04和11.10)

sudo cp /usr/share/unity-2d/launcher/Launcher.qml /usr/share/unity-2d/launcher/Launcher.qml-backup 

when you screw up something just:

sudo cp /usr/share/unity-2d/launcher/Launcher.qml-backup /usr/share/unity-2d/launcher/Launcher.qml 

(对于12.04)

sudo cp /usr/share/unity-2d/shell/launcher/Launcher.qml /usr/share/unity-2d/shell/launcher/Launcher.qml-backup 

when you screw up something just:

sudo cp /usr/share/unity-2d/launcher/Launcher.qml-backup /usr/share/unity-2d/launcher/Launcher.qml 

Now for removing items from the Launcher:

(对于11.04 /11.10):

gksu gedit /usr/share/unity-2d/launcher/Launcher.qml 

scroll down to line 104, there you will see:

(对于12.04)

gksu gedit /usr/share/unity-2d/shell/launcher/Launcher.qml 

scroll down to line 104, there you will see:

Component.onCompleted: {     items.appendModel(applications);     items.appendModel(workspaces);     items.appendModel(visiblePlaces);     items.appendModel(devices);     shelfItems.appendModel(trashes); 

items.appendModel(applications); = applications in launcher
items.appendModel(workspaces); = Workspace Switcher
items.appendModel(visiblePlaces); = Files & Folders and application button.items.appendModel(devices); = mounted drives (NTFS) + flash drives etc.
shelfitems.appendModel(trashes); = Trash

You can remove these items by deleting their lines or you can rearrange items by moving lines up or down.

Source

应当注意,第二步是编辑实际代码,而不是配置文件,因此,下一次安装unity-2d更新时,所有更改都将被覆盖。

次佳方案

顺便说一句,上面的好答案。谢谢。为了简化一点,您可以通过以下方法减少终端的工作空间:

    gconftool-2 -s /apps/metacity/general/num_workspaces --type int 1

并更改配置(通过以下方式从启动器中删除工作区启动器:)

    sudo cp /usr/share/unity-2d/launcher/Launcher.qml{,.bck}
    sudo sed -i '/items.appendModel(workspaces)/d' /usr/share/unity-2d/launcher/Launcher.qml

是的,只要软件包unity-2d-launcher得到更新,它将被重置。

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/10546.html,未经允许,请勿转载。