#i3 #libinput #x11 #gestures #touchpad #gesture

app lillinput-cli

将 libinput 手势连接到 i3 和其他应用程序的应用

1 个不稳定版本

0.3.0 2022 年 11 月 4 日

GUI 中排名 #1084

BSD-3-Clause

97KB
1.5K SLoC

lillinput-cli

crates.io

lillinput logo

lillinput-cli 是连接 libinput 手势到

  • i3 瓦片窗口管理器的 IPC 接口的命令行应用程序
  • shell 命令

用法

当调用时,lillinput-cli 将监听 libinput 事件,直到停止。默认情况下,将启用 i3 操作,将 "三指右滑" 触发配置为 "工作区下一个",将 "三指左滑" 触发配置为 "工作区上一个"。

可以通过以下方式检索完整的选项列表

$ lillinput-cli --help
...
USAGE:
    lillinput-cli [OPTIONS]

OPTIONS:
    -c, --config-file <CONFIG_FILE>
            Configuration file

    -e, --enabled-action-types <ENABLED_ACTION_TYPES>
            enabled action types [possible values: i3, command]

        --four-finger-swipe-down <FOUR_FINGER_SWIPE_DOWN>
            actions for the "four-finger swipe down" event

        --four-finger-swipe-left <FOUR_FINGER_SWIPE_LEFT>
            actions for the "four-finger swipe left" event

        --four-finger-swipe-left-down <FOUR_FINGER_SWIPE_LEFT_DOWN>
            actions for the "four-finger swipe left-down" event

        --four-finger-swipe-left-up <FOUR_FINGER_SWIPE_LEFT_UP>
            actions for the "four-finger swipe left-up" event

        --four-finger-swipe-right <FOUR_FINGER_SWIPE_RIGHT>
            actions for the "four-finger swipe right" event

        --four-finger-swipe-right-down <FOUR_FINGER_SWIPE_RIGHT_DOWN>
            actions for the "four-finger swipe right-down" event

        --four-finger-swipe-right-up <FOUR_FINGER_SWIPE_RIGHT_UP>
            actions for the "four-finger swipe right-up" event

        --four-finger-swipe-up <FOUR_FINGER_SWIPE_UP>
            actions for the "four-finger swipe up" event

    -h, --help
            Print help information

        --invert-x <INVERT_X>
            invert the X axis (considering positive displacement as "left")

        --invert-y <INVERT_Y>
            invert the Y axis (considering positive displacement as "up")

    -q, --quiet
            Less output per occurrence

    -s, --seat <SEAT>
            libinput seat

    -t, --threshold <THRESHOLD>
            minimum threshold for displacement changes

        --three-finger-swipe-down <THREE_FINGER_SWIPE_DOWN>
            actions for the "three-finger swipe down" event

        --three-finger-swipe-left <THREE_FINGER_SWIPE_LEFT>
            actions for the "three-finger swipe left" event

        --three-finger-swipe-left-down <THREE_FINGER_SWIPE_LEFT_DOWN>
            actions for the "three-finger swipe left-down" event

        --three-finger-swipe-left-up <THREE_FINGER_SWIPE_LEFT_UP>
            actions for the "three-finger swipe left-up" event

        --three-finger-swipe-right <THREE_FINGER_SWIPE_RIGHT>
            actions for the "three-finger swipe right" event

        --three-finger-swipe-right-down <THREE_FINGER_SWIPE_RIGHT_DOWN>
            actions for the "three-finger swipe right-down" event

        --three-finger-swipe-right-up <THREE_FINGER_SWIPE_RIGHT_UP>
            actions for the "three-finger swipe right-up" event

        --three-finger-swipe-up <THREE_FINGER_SWIPE_UP>
            actions for the "three-finger swipe up" event

    -v, --verbose
            More output per occurrence

    -V, --version
            Print version information

配置滑动操作

每个 --{number}-finger-swipe-{direction} 参数接受一个或多个 "操作",其形式为 {type}:{command}。例如,以下调用指定了 "三指上滑" 触发两个操作:将 i3 移动到下一个工作区,并创建一个文件。

$ lillinput -e i3 -e command --three-finger-swipe-up "i3:workspace next" --three-finger-swipe-up "command:touch /tmp/myfile"

目前,可用的操作类型是 i3command

使用配置文件

可以从配置文件中读取应用程序的配置。默认情况下,将按以下顺序读取以下来源

  1. /etc/lillinput.toml
  2. ${XDG_HOME}/lillinput/lillinput.toml
  3. ${CWD}/lillinput.toml

或者,可以通过--config-file参数指定不同的文件。配置文件可以是部分文件(例如只声明特定的选项而不是全部选项),每个选项都可以由后面的配置文件或命令行参数单独覆盖,如果没有提供,则回退到默认值。

配置文件的格式可以在示例配置文件中找到。

verbose = "INFO"
seat = "seat01"
threshold = 20.0
enabled_action_types = ["i3"]

[actions]
three-finger-swipe-right = ["i3:workspace next"]
three-finger-swipe-left = ["i3:workspace prev"]
three-finger-swipe-up = []
three-finger-swipe-down = []
four-finger-swipe-right = []
four-finger-swipe-left = []
four-finger-swipe-up = []
four-finger-swipe-down = []

许可证

本项目采用BSD-3-Clause许可证。

依赖

~8–16MB
~192K SLoC