Skip to content

Open DeepL with 3 fingers drag while holding down Ctrl and Shift

Kohei Yamada edited this page Nov 7, 2021 · 6 revisions
  • Drag with three fingers to select a string.
  • Hold down the Control key and Shift key while dragging to open Google-Chrome and translate on DeepL.

require fusuma-plugin-keypress xsel

swipe:
  3:
    begin:
      command: xdotool mousedown 1
    update:
      command: xdotool mousemove_relative -- $move_x, $move_y
      interval: 0.01
      accel: 2
    end:
      command: xdotool mouseup 1
      keypress:
        LEFTSHIFT+LEFTCTRL: &deepl
          command: |
            xdotool mouseup 1
            text=$(xsel -p | ruby -r 'erb' -ne 'puts ERB::Util.url_encode $_')
            google-chrome  --incognito --app=deepl.com "https://www.deepl.com/translator#en/ja/$text"

        LEFTCTRL+LEFTSHIFT:
          <<: *deepl