ubuntu22.04 x11窗口环境手势控制

ubuntu22.04 x11窗口环境手势控制

ubuntu x11窗口环境的手势控制并不优秀,我们可以使用touchegg去代替
这个配置过程非常简单,并且可以很容易在一定范围内达到你想到的效果,类比mac的手势控制

关于安装

首先添加源,并安装

sudo add-apt-repository ppa:touchegg/stable
sudo apt update
sudo apt install touchegg

安装完成后使用touchegg命令启动应用,重启电脑后touchegg会自动启动。
创建默认配置文件

 mkdir -p ~/.config/touchegg && cp -n /usr/share/touchegg/touchegg.conf ~/.config/touchegg/touchegg.conf

关于配置

然后你可以编辑这个配置文件,他的位置在~/.config/touchegg, 你可以使用vim或gedit去编辑这个文本
在这里插入图片描述下面我提供了我的conf文件,你可以直接替换
他有那些作用
1、三指左右滑动可切换工作区
2、三指上滑可以显示概览窗口,即活动窗口,再次上滑可取消概览窗口
3、三指下滑可最小化当前窗口
4、三指内缩可关闭窗口,这是个持续动作,内缩回收可撤回(不止聚焦的窗口可用,只要在屏幕上显示的窗口都可以使用)
5、三指点击表示鼠标中键
6、四指上滑可显示全部菜单,再次上滑可回到概览窗口
7、四指左、右滑动,可将当前窗口移动至左、右工作区
8、四指外阔显示桌面
9、单指,双指保持正常逻辑

<touchégg>
  <settings>
    <property name="animation_delay">150</property>
    <property name="action_execute_threshold">20</property>
    <property name="color">auto</property>
    <property name="borderColor">auto</property>
  </settings>
  <application name="All">
    <gesture type="SWIPE" fingers="3" direction="UP">
      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Super_L</modifiers>
        <keys>S</keys>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="4" direction="UP">
      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Super_L</modifiers>
        <keys>A</keys>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="3" direction="DOWN">
      <action type="MINIMIZE_WINDOW">
        <animate>true</animate>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="4" direction="DOWN">
      <action type="CHANGE_DESKTOP">
        <direction>auto</direction>
        <animate>true</animate>
        <animationPosition>auto</animationPosition>
      </action>
    </gesture>
	<gesture type="SWIPE" fingers="4" direction="LEFT">
	  <action type="SEND_KEYS">
	    <repeat>true</repeat>
	    <modifiers>Super_L</modifiers>
	    <keys>Shift_L+Left</keys>
	  </action>
	</gesture>

	<gesture type="SWIPE" fingers="4" direction="RIGHT">
	  <action type="SEND_KEYS">
	    <repeat>true</repeat>
	    <modifiers>Super_L</modifiers>
	    <keys>Shift_L+Right</keys>
	  </action>
	</gesture>
    <gesture type="PINCH" fingers="4" direction="OUT">
      <action type="SHOW_DESKTOP">
        <animate>true</animate>
      </action>
    </gesture>
    <gesture type="TAP" fingers="2" direction="UNKNOWN">
      <action type="MOUSE_CLICK">
        <button>3</button>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="TAP" fingers="3" direction="UNKNOWN">
      <action type="MOUSE_CLICK">
        <button>2</button>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="3" direction="IN">
      <action type="CLOSE_WINDOW"></action>
    </gesture>
    <!--
	    <gesture type="SWIPE" fingers="3" direction="LEFT">
	      <action type="CHANGE_DESKTOP"></action>
	    </gesture>
	    <gesture type="SWIPE" fingers="3" direction="RIGHT">
	      <action type="CHANGE_DESKTOP"></action>
	    </gesture>
    -->
    <gesture type="SWIPE" fingers="3" direction="LEFT">
  	<action type="CHANGE_DESKTOP">
    	<direction>next</direction>
    	<animate>true</animate>
    	<animationPosition>right</animationPosition>
    	<color>3E9FED</color>
    	<borderColor>3E9FED</borderColor>
  	</action>
    </gesture>

	<gesture type="SWIPE" fingers="3" direction="RIGHT">
	  <action type="CHANGE_DESKTOP">
	    <direction>previous</direction>
	    <animate>true</animate>
	    <animationPosition>left</animationPosition>
	    <color>3E9FED</color>
	    <borderColor>3E9FED</borderColor>
	  </action>
	</gesture>
	
  </application>
  <application name="chromium-browser">
    <gesture type="PINCH" fingers="2" direction="IN">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Subtract</keys>
        <decreaseKeys>KP_Add</decreaseKeys>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="2" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Add</keys>
        <decreaseKeys>KP_Subtract</decreaseKeys>
      </action>
    </gesture>
  </application>
  <application name="firefox">
    <gesture type="PINCH" fingers="2" direction="IN">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Subtract</keys>
        <decreaseKeys>KP_Add</decreaseKeys>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="2" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Add</keys>
        <decreaseKeys>KP_Subtract</decreaseKeys>
      </action>
    </gesture>
  </application>
  <application name="google-chrome">
    <gesture type="PINCH" fingers="2" direction="IN">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Subtract</keys>
        <decreaseKeys>KP_Add</decreaseKeys>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="2" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Add</keys>
        <decreaseKeys>KP_Subtract</decreaseKeys>
      </action>
    </gesture>
  </application>
</touchégg>

关于你可以怎么简单配置

注意的是,这里的<action type="SEND_KEYS">的手势,都是基于你的自定义快捷键
在这里插入图片描述
如此处我将shift+super+右设置为将窗口右移一个工作区,那么我可以进行如下配置

<gesture type="SWIPE" fingers="4" direction="LEFT">
  <action type="SEND_KEYS">
    <repeat>true</repeat>
    <modifiers>Super_L</modifiers>
    <keys>Shift_L+Left</keys>
  </action>
</gesture>

<gesture type="SWIPE" fingers="4" direction="RIGHT">
  <action type="SEND_KEYS">
    <repeat>true</repeat>
    <modifiers>Super_L</modifiers>
    <keys>Shift_L+Right</keys>
  </action>
</gesture>

感谢您的翻阅

<think>好的,用户想要了解基于Wayland的窗口管理器和桌面环境推荐。首先,我需要确认用户对Wayland的了解程度,但根据问题,他们可能已经知道Wayland是X11的替代,所以直接进入推荐部分。 接下来,我需要分清楚窗口管理器和桌面环境的区别,确保用户不会混淆。Wayland下的桌面环境通常集成自己的窗口管理器,而独立的窗口管理器可能需要更多配置。 对于桌面环境,常见的如GNOME、KDE Plasma、Sway(虽然Sway更偏向于窗口管理器)都是支持Wayland的。需要列出每个的特点,比如GNOME对Wayland支持最好,KDE Plasma的成熟度,以及Sway的平铺式管理。同时,可能要考虑中文支持、易用性、社区活跃度等因素。 窗口管理器方面,除了Sway,还有Wayfire、Labwc等。需要说明它们的类型,比如Wayfire是动态的,Labwc模仿Openbox,适合轻量级用户。此外,Hyprland最近比较流行,但可能稳定性稍差,适合愿意尝试的用户。 还要考虑用户的使用场景,是普通桌面使用还是需要高效工作流。比如,Sway适合程序员,而GNOME适合一般用户。同时,硬件兼容性,比如Nvidia显卡用户可能在Wayland下遇到问题,需要提醒。 另外,需要检查推荐的每个项目是否确实支持Wayland,并且是否有活跃的开发和社区支持。比如,Xfce和Cinnamon虽然有计划支持,但可能还不完善,所以暂时不推荐。 最后,总结建议,根据用户需求推荐不同的选项,并提醒可能的注意事项,比如驱动问题或配置复杂度。确保回答结构清晰,分点列出,帮助用户逐步了解各个选项的优缺点。</think>以下是为您整理的基于Wayland的窗口管理器及桌面环境推荐指南,按使用场景分类: 一、完整桌面环境(开箱即用) 1. GNOME - 特点:对Wayland支持最成熟 - 优势:手势操作完善,HiDPI支持优秀 - 适用:普通用户/开发者,追求稳定体验 - 注意:资源占用较高 2. KDE Plasma - 特点:Wayland支持快速进步 - 优势:高度可定制,功能丰富 - 适用:习惯Windows操作的用户 - 版本:推荐5.27+版本 3. Sway(平铺式) - 特点:i3wm的Wayland移植版 - 优势:键盘驱动,高效工作流 - 适用:程序员/极客用户 - 要求:需熟悉配置文件 二、独立窗口管理器 1. Hyprland(动态平铺) - 特点:炫酷动画效果 - 优势:高度可定制界面 - 注意:仍处于活跃开发阶段 2. Wayfire(混合式) - 特点:支持3D特效 - 优势:类似Compiz的插件系统 - 适用:视觉系用户 3. Labwc(轻量级) - 特点:Openbox风格 - 优势:低资源占用 - 适用:老旧硬件设备 三、选择建议 1. 新手用户 - 推荐:GNOME或KDE Plasma - 理由:自动处理显示协议切换 2. 进阶用户 - 推荐:Sway + Waybar - 配置示例: ``` # ~/.config/sway/config input "type:keyboard" { xkb_layout "cn" } ``` 3. 实验性尝试 - 推荐:Hyprland - 注意:需定期更新版本 四、注意事项 1. 硬件兼容性 - Nvidia显卡:需使用545+驱动版本 - 多显示器:建议使用5.15+内核 2. 软件适配 - 已原生支持:Firefox、Chrome、LibreOffice - 仍需XWayland:部分老旧应用 建议先通过发行版LiveCD测试硬件兼容性,推荐使用Fedora Workstation或Ubuntu 22.04+进行初步体验。Wayland生态正在快速发展,建议每半年关注一次关键组件的更新进展。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值