Closed2

Sway(Wayland)でもスワイプで行ったり来たりしたい

りおーりおー

はじめに

Swayをタッチパッドな環境で操作しています。
ブラウザはVivaldiを使っていますが、履歴を行ったり来たりするのにショートカットを使っていました。
せっかくのタッチパッドなのでスワイプ操作で動かしたいなと思いました。(こなみかん)

環境

  • Sway(I use Arch btw)
    • Waylandで動作してほしい(X非依存)
    • Fujitsu FMV Mobile keyboard
      これまではxremapRightCtrlAltに変換していました

選定

導入記事が豊富なのはlibinput-gesutures

https://github.com/bulletmark/libinput-gestures

GUIで設定可能なtouchegg

https://github.com/JoseExposito/touchegg

ただし上記はいずれもXへの依存が多少なりともあるようです😅
X.orgはあんまり使いたくない

今回導入したのはwzmach

https://github.com/d86leader/wzmach

導入

AURにもまだ登録されていないのでソースからbuildした。

ghq get d86leader/wzmach
cd /path/to/builddir/
cargo build --release
cargo install

PATHを通して起動
設定に関しては~/.config/wzmach/config.ron

global_triggers: [
     // Move to the right tab in most apps (natural scroll direction)
     (
            trigger: Swipe (
               fingers: 3,
               direction: Left,
               repeated: false,
            ),
            action: UinputAction (
               modifiers: ["RightAlt"],
               sequence: ["Right"],
              )
            ),
  // Move to the left tab in most apps (natural scroll direction)
           (
               trigger: Swipe (
                   fingers: 3,
                   direction: Right,
                   repeated: false,
              ),
               action: UinputAction (
                   modifiers: ["RightAlt"],
                   sequence: ["Left"],
               )
           ),
       ],

基本的にはlibinputの拡張らしいです

快適です😀


余談

Firefoxなら標準でできます😯
chromiumなら--enable-features=TouchpadOverscrollHistoryNavigationでも動く?
https://wiki.archlinux.jp/index.php/Chromium#.E3.83.95.E3.83.A9.E3.82.B0.E3.82.92.E6.B0.B8.E7.B6.9A.E5.8C.96.E3.81.99.E3.82.8B
→Vivaldiではできませんでした(Archlinux特有のvivaldi-*.confに記載)

Swayにも1.8くらいからbindgestureというコマンドが使えるようになっているのでydotoolなどを使えば再現できるかも?

このスクラップは4ヶ月前にクローズされました