wakatime / wakatime-cli

Command line interface used by all WakaTime text editor plugins
https://wakatime.com/plugins
BSD 3-Clause "New" or "Revised" License
262 stars 40 forks source link

Unknown editor #1044

Closed noahfraiture closed 2 months ago

noahfraiture commented 2 months ago

Hello, I made an unofficial Helix wakatime plugin with a simple bash script

#!/bin/bash
echo "[$(date +%s)] wakatime send : $1" >>/home/noah/.config/helix/wakatime.log && 
wakatime-cli --entity "$1" --plugin "Helix/version Helix/version" --write 2>&1 >/dev/null &&

for i in {1..3}
do
echo "[$(date +%s)] wakatime send : $1. Iteration $i" >>/home/noah/.config/helix/wakatime.log && 
  wakatime-cli --entity "$1" --plugin "Helix/$(hx --version | cut -d' ' -f2) Helix-wakatime/$(hx --version | cut -d' ' -f2)" 2>&1 >/dev/null
  sleep 120
done

The problem is that on my dashboard the editor is unknown image How can I resolve this issue ?

alanhamlett commented 2 months ago

This line is the problem:

wakatime-cli --entity "$1" --plugin "Helix/version Helix/version" --write 2>&1 >/dev/null

Instead of sending the real version it's sending version. If you send any number instead, like 0, or the real helix version like you do below then it detects Helix correctly: --plugin "Helix/$(hx --version | cut -d' ' -f2) Helix-wakatime/$(hx --version | cut -d' ' -f2)"