Published on: 2022-07-01
Hello guys, this post will allow you to use unicode in Electron apps (google-chrome, brave, discord,...) open via rofi
Written by: Krix Daniel
Reading time: 2 min read
View count:
Hello guys, this post will allow you to use unicode in Electron apps (google-chrome, brave, discord,β¦) open via rofi
If you are using i3 (X11) and ibus-bamboo you donβt have to worry about it cause the ibus-bamboo work well in electrons app.
And if you using hyprland (wayland) or any desktrop enviroment based on wayland, and have to use [fcitx] (https://fcitx-im.org/wiki/Fcitx_5) for unicode. Then this post is what you need.
--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime
~/.local/bin/rofi-electron-launch
#!/bin/bash
# List of apps that require the Wayland flags
ELECTRON_APPS=(
"discord"
"thunar"
"code"
"firefox"
"google-chrome"
"brave-browser"
"obsidian"
"chromium"
"vscode"
"brave"
# Adding more your application class name
)
# Extract the base command (before any args)
CMD="$1"
BASE_CMD=$(basename "$CMD")
FLAG="--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime"
# Check if the base command matches any Electron app
for app in "${ELECTRON_APPS[@]}"; do
if [[ "$BASE_CMD" == "$app" ]]; then
exec "$CMD" $FLAG
fi
done
# If not in the list, run as-is with arguments
exec "$@"
rofi-electron-launch
$ELECTRON_LAUNCH_SCRIPT=$HOME/.local/bin/rofi-electron-launch
-run-command
after keybinding launch rofipkill rofi || rofi -show drun -replace -i -run-command "$ELECTRON_LAUNCH_SCRIPT {cmd}"
discord --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime