Skip to content

Commit

Permalink
Add Wayland zwp_input_method_v1 support (#659)
Browse files Browse the repository at this point in the history
* Rearrange code of wayland frontend

* Implement wayland input_method_v1

* Make it possible for kime to be run privileged by KDE Plasma

* Update CHANGELOG and README

* Reformat code

* Fix typo in install script

* List libxkbcommon as dependency

* Add PlasmaVirtualKeyboard check

* Use standard XDG_CURRENT_DESKTOP instead of DESKTOP_SESSION

* Format code

* Add weston config in README

* Fallback when XDG_CURRENT_DESKTOP & XDG_SESSION_TYPE is not defined
  • Loading branch information
Jhyub authored Apr 8, 2024
1 parent 01ee479 commit f82ce41
Show file tree
Hide file tree
Showing 12 changed files with 1,139 additions and 507 deletions.
35 changes: 31 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@ kime은 kime 데몬을 위한 kime.desktop 파일을 /etc/xdg/autostart에 설

혹시 `i3``sway`처럼 `시작 프로그램`을 지원하지 않는다면 해당 WM의 설정파일에서 `kime` 혹은 원하시는 서버 커맨드를 실행해주세요

### KDE Plasma Wayland

시스템 설정 > 하드웨어 > 입력 장치 > 가상 키보드에서 `kime 데몬`을 선택해야 합니다.
이후에 로그아웃을 하는 것을 권장합니다.

### Weston
`~/.config/weston.ini`에 해당 내용이 있어야 합니다.
```
[input-method]
path=/usr/bin/kime
```

### Configuration

자세한 옵션은 [CONFIGURATION.md](docs/CONFIGURATION.ko.md)를 참고하세요.
Expand All @@ -170,6 +182,7 @@ kime은 kime 데몬을 위한 kime.desktop 파일을 /etc/xdg/autostart에 설
* xcb (candidate)
* fontconfig (xim)
* freetype (xim)
* libxkbcommon (wayland)

### 빌드타임 종속성 (바이너리 실행 시엔 필요 없습니다)

Expand All @@ -190,3 +203,4 @@ kime은 kime 데몬을 위한 kime.desktop 파일을 /etc/xdg/autostart에 설
* xcb
* fontconfig
* freetype
* libxkbcommon
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,19 @@ if you use X, append above lines to file `~/.xprofile`

kime.desktop file is installed in /etc/xdg/autostart when installing kime.

### KDE Plasma Wayland

It is required to select `kime daemon` under System Settings > Hardware > Input Devices > Virtual Keyboard.
A logout is recommended afterwards.

### Weston

It is required to have the following lines in `~/.config/weston.ini`
```
[input-method]
path=/usr/bin/kime
```

### Configuration

Read [CONFIGURATION.md](docs/CONFIGURATION.md) for detail options.
Expand All @@ -169,6 +182,7 @@ These dependencies are optional depending on your environments. For example, qt6
* xcb (candidate)
* fontconfig (xim)
* freetype (xim)
* libxkbcommon (wayland)

### Build time (you don't need this on running compiled binary)

Expand All @@ -189,3 +203,4 @@ These dependencies are optional depending on your environments. For example, qt6
* xcb
* fontconfig
* freetype
* libxkbcommon
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Fix KDE autostart [#576](https://github.com/Riey/kime/issues/576)
* Add unicode prime symbols to math mode. (prime, double prime, triple prime, quadruple prime)
* Fix to work on wlroots>=0.17.1 (Sway 1.9) [#664](https://github.com/Riey/kime/issues/664)
* Add wayland zwp_input_method_v1 support **[@Jhyub]**

## 3.0.2

Expand Down
1 change: 1 addition & 0 deletions res/kime.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ X-DBUS-StartupType=Unique
X-GNOME-AutoRestart=false
X-GNOME-Autostart-Notify=false
X-KDE-StartupNotify=false
X-KDE-Wayland-VirtualKeyboard=true
Icon=kime-hangul-black
5 changes: 5 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ if [ -z "$KIME_AUTOSTART_DIR" ]; then
KIME_AUTOSTART_DIR=etc/xdg/autostart
fi

if [ -z "$KIME_DESKTOP_ENTRY_DIR" ]; then
KIME_DESKTOP_ENTRY_DIR=usr/share/applications
fi

if [ -z "$KIME_LIB_DIR" ]; then
KIME_LIB_DIR=usr/lib
fi
Expand Down Expand Up @@ -95,6 +99,7 @@ if [ "${KIME_INSTALL_DOC}" -eq "1" ]; then
fi

install -Dm644 $KIME_OUT/*.desktop -t "$PREFIX/$KIME_AUTOSTART_DIR"
install -Dm644 $KIME_OUT/*.desktop -t "$PREFIX/$KIME_DESKTOP_ENTRY_DIR"
install -Dm755 $KIME_OUT/kime-xdg-autostart -t "$PREFIX/$KIME_BIN_DIR"
install -Dm644 $KIME_OUT/icons/64x64/*.png -t "$PREFIX/$KIME_ICON_DIR/hicolor/64x64/apps"
install -Dm755 $KIME_OUT/libkime_engine.so -t "$PREFIX/$KIME_LIB_DIR"
Expand Down
1 change: 1 addition & 0 deletions src/frontends/wayland/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ kime-version = { path = "../../tools/version" }
wayland-client = "0.29"
wayland-protocols = { version = "0.29", features = ["client", "unstable_protocols"] }
zwp-virtual-keyboard = "0.2.7"
xkbcommon = { version = "0.7.0", features = ["wayland"] }

libc = "0.2.82"
log = "0.4.13"
Expand Down
Loading

0 comments on commit f82ce41

Please sign in to comment.