Run at startup¶
Goal: WuWeiDict answers at localhost:6888 from the moment you log in, without you starting it.
All this is optional and is just convenience to have wudict running as service even after you reboot,
so that you don't need to start it manually every time you need it.
LaunchAgent¶
macOS starts a LaunchAgent when you log in. The Makefile in a source clone generates and manages it.
| Command | What it does |
|---|---|
make mac-agent-install |
generate the plist and register the agent |
make mac-agent-start |
start it now |
make mac-agent-stop |
stop it |
make mac-agent-restart |
rebuild the binary, then restart |
make mac-agent-status |
show its state, including the process id |
make mac-agent-uninstall |
stop it and delete the plist |
Verify¶
Then open localhost:6888.
Or use the app instead¶
wuDict.app does the same job on demand. It shows a menu-bar icon that reports whether the server runs, opens it, rescans dictionaries and quits it. The LaunchAgent shows nothing.
Choose the agent to have WuWeiDict always there. Choose the app to start and stop it yourself.
systemd user unit¶
The service runs as your user. Only the binary needs sudo, because it
goes to /usr/local/bin.
| Command | What it does |
|---|---|
make linux-service-install |
install the binary with sudo, then create the user unit |
make linux-service-start |
enable and start it now |
make linux-service-stop |
disable and stop it |
make linux-service-restart |
rebuild, reinstall, restart |
make linux-service-status |
show the unit's state |
make linux-service-uninstall |
remove the unit and keep the binary |
The unit expects the binary at /usr/local/bin/wudict.
To install only the binary, run make linux-install. Set
PREFIX=/opt/foo to put it elsewhere.
Keep it running after you log out¶
Verify¶
The installer does it¶
The setup wizard has a start at sign-in option. Switch it on during
installation and it places the launcher in your Startup folder, with
--no-browser already set. See
the Windows installer.
By hand¶
- Put
wudict.exein a folder of your choice, for exampleC:\tools\wudict\. - Press Win+R and enter
shell:startup. - Put a shortcut to
wudict.exein the folder that opens.
Add --no-browser to the shortcut's command line if you do not want a
browser tab at every sign-in.
What you get¶
Started by Windows or from Explorer, wudict.exe shows a tray icon in
the notification area instead of a console window with log messages. It logs to
%LOCALAPPDATA%\wudict\wudict.log.
Verify¶
Sign out and back in, then open localhost:6888.
Useful settings for a background server¶
| Setting | Why |
|---|---|
NO_BROWSER |
do not open a browser tab at every start |
TRAY |
force the tray or menu-bar icon on or off |
VERBOSE |
log requests and dictionary opens while you diagnose |