在 Lubuntu 中使用滚轮禁用桌面切换?

Ste*_*ven 13 mouse lubuntu 11.04 lxde multiple-desktops

我仍然想保留我的多个桌面,我想禁用用鼠标切换桌面。

tan*_*ius 13

从 Lubuntu 14.04 或更早版本开始,配置文件格式和解决方案与@SWrobel's answer略有不同。然后在 Ubuntu 17.10(或更早版本)中,事情再次发生变化。

以下说明适用于当前情况(Ubuntu 17.10 及更高版本)。

  1. 删除以下行~/.config/openbox/lubuntu-rc.xml以禁用窗口中的任何滚轮桌面切换,带和不带修饰键。(<context …> … </context>尽管保留外部元素。)

    <context name="Frame">
      […]
      <mousebind button="A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="C-A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="C-A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="A-S-Up" action="Click">
        <action name="SendToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="A-S-Down" action="Click">
        <action name="SendToDesktop">
          <to>next</to>
        </action>
      </mousebind>
    </context>
    
    Run Code Online (Sandbox Code Playgroud)
  2. 同时删除以下几行以禁用桌面背景上的任何滚轮桌面切换:

    <context name="Desktop">
      <mousebind button="A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="C-A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="C-A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="Left" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="Focus"/>
        <action name="Raise"/>
      </mousebind>
    </context>
    
    Run Code Online (Sandbox Code Playgroud)
  3. 还要删除以下行以在移动窗口时禁用任何滚轮桌面切换:

    <context name="MoveResize">
      <mousebind button="Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
      <mousebind button="A-Up" action="Click">
        <action name="GoToDesktop">
          <to>previous</to>
        </action>
      </mousebind>
      <mousebind button="A-Down" action="Click">
        <action name="GoToDesktop">
          <to>next</to>
        </action>
      </mousebind>
    </context>
    
    Run Code Online (Sandbox Code Playgroud)
  4. 执行这个让设置立即生效(来源):

    openbox --reconfigure
    
    Run Code Online (Sandbox Code Playgroud)


swr*_*bel 9

cd ~/.config/openbox
cp lubuntu-rc.xml lubuntu-rc.xml.bak
Run Code Online (Sandbox Code Playgroud)

(这会生成一个备份文件,以便当您认为自己搞砸了时可以将其还原。)

leafpad lubuntu-rc.xml
Run Code Online (Sandbox Code Playgroud)

并删除说的行;

<mousebind button="UP" action="click">
 <action name="DesktopPrevious" />
<mousebind button="Down" action="click">
 <action name="DesktopNext" />
Run Code Online (Sandbox Code Playgroud)

注销并重新登录以查看更改!

如果你把它搞砸了,想把它恢复原状;

cp lubuntu-rc.xml.bak lubuntu-rc.xml
Run Code Online (Sandbox Code Playgroud)

Lubuntu 文档引用的答案