---
title: 'howto toggle (show/hide) crow-translate in swaywm'
url: 'https://willifix.net/blog/howto-toggle-showhide-crow-translate-in-swaywm'
markdown: 'https://willifix.net/blog/howto-toggle-showhide-crow-translate-in-swaywm.md'
date: '2026-07-15'
description: 'I actually use the deepl plugin for ulauncher to quickly translate texts. Unfortunately, the plugin is not really stable and I have not yet been able to find the cause. After a bit of research, I came across various tools and decided to use crow-translate. crow-translate can be controlled via so-ca…'
---

## [howto toggle (show/hide) crow-translate in swaywm](https://willifix.net/blog/howto-toggle-showhide-crow-translate-in-swaywm)

    15th Jul 2026  

I actually use the [deepl](https://github.com/Rapha149/ulauncher-deepl) plugin for [ulauncher](https://ulauncher.io) to quickly translate texts. Unfortunately, the plugin is not really stable and I have not yet been able to find the cause. After a bit of research, I came across various tools and decided to use [crow-translate](https://invent.kde.org/office/crow-translate).

`crow-translate` can be controlled via so-called dbus calls [https://invent.kde.org/office/crow-translate#d-bus-api](https://invent.kde.org/office/crow-translate#d-bus-api?target=_blank). Unfortunately, there is no **MainWindow.hide** or **MainWindow.close** in the list of possible commands. There is only the **MainWindow.quit** option. This closes the application completely and takes a correspondingly long time for each start. That is why I have built a corresponding helper script for my tiling window manager [sway](https://swaywm.org).

The helper script uses `swaymsg` to check whether a `crow-translate` window is open and then closes it using the `swaymsg kill` command. The kill command does NOT kill the application but it kills the window from my sway workplace 🙂. If no window is open, a window is opened using the dbus call from `crow-translate`.

#### autostart crow-translate

There are several ways to start `crow-translate` with the window manager. The simplest is to execute `crow-translate` in your `sway` configuration. However, the more elegant and better way is to create a systemd-user unit.

1. navigate to **~/.config/systemd/user/**
2. create a file named **crow-translate.service**

    ```bash
    [Unit]
    Description=Crow-Translate
    Documentation=https://invent.kde.org/office/crow-translate
    After=graphical-session.target
    ConditionEnvironment=WAYLAND_DISPLAY

    [Service]
    Restart=always
    RestartSec=1
    ExecStart=/usr/bin/crow

    [Install]
    WantedBy=graphical-session.target
    ```
3. reload your systemd configuration with **systemctl --user daemon-reload**
4. enable the unit with **systemctl --user enable --now crow-translate.service**

#### the script

> ./config/sway/tools/crow-toggle

```bash
#!/bin/bash
# created by ♞ Raffael.Willems
if swaymsg -t get_tree | grep -q "org.kde.CrowTranslate"; then 
    swaymsg '[app_id="org.kde.CrowTranslate"] kill'
else 
    dbus-send --type=method_call --dest=org.kde.CrowTranslate /org/kde/CrowTranslate/MainWindow org.kde.CrowTranslate.MainWindow.open
fi
```

#### sway config

in you sway configuration you can then bind the script to a key with:

```bash
bindsym mod4+t exec $tools/crow-toggle
```

After this you can toggle the crow-translate window by pressing win+t.

 [ Previous Post](https://willifix.net/blog/uprade-immich-to-v3) [Next Post ](https://willifix.net/blog/spotiplay-withouth-nodered)

---

## Navigation

- Parent: [Blog](https://willifix.net/blog.md)
- Previous: [grav2 spotify playing plugin without needing Node-RED](https://willifix.net/blog/spotiplay-withouth-nodered.md)
- Next: [uprade immich to version 3](https://willifix.net/blog/uprade-immich-to-v3.md)
