Martchus / syncthingtray

Tray application and Dolphin/Plasma integration for Syncthing
https://martchus.github.io/syncthingtray/
Other
1.6k stars 43 forks source link

Allow "sending" files via Dolphin context menu integration #159

Closed Natetronn closed 1 year ago

Natetronn commented 1 year ago

Relevant components

Environment and versions

Bug description In Dolphin, I get the following error:

Unable to parse Syncthing status: illegal value (at offset 1)

Steps to reproduce

  1. Right click on a file.
  2. Select Syncthing. It asks you to set a config file.
  3. Browse to config files in ~/.config/syncthing/
  4. Choose config.xml, nothing happens thereafter (start over and try one and two again)
  5. This time you notice there is another config.xml file with .v0 appended to it, try that one.
  6. Number 1 above now produces error or any attempts at opening context menu does at well.

Expected behavior I expected the first config to work, if not the correct config, I expected the second one to work. Not actually knowing which config to use, I expect some sort of popup describing where to find the config or better/more information in the documentation explaining where the config is, currently there is no information found here. I now realize I shouldn't just blindly select config files, but without guidance, that's what it seemed I was left with and here we are.

How do I unset this bad syncthingtray config file in Dolphin, this so I can get my context menu back? I'm no longer able to unset the bad config file using the context menu, as my context menu isn't working as expected and only errors.

Also, where is the config file for this?

Natetronn commented 1 year ago

To fix the error, one can edit or remove the value from syncthingConfigPath within ~/.config/syncthingfileitemaction.ini

[General]
syncthingApiKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
syncthingConfigPath=~/.config/syncthing/the-proper-config-file.xml

Still not sure if ~/.config/syncthing/config.xml is the proper config file, as it does nothing when I set it, but it sure appears to be correct, as it includes <folder> with paths, labels and what not, all pointing to my syncthing directories.

Natetronn commented 1 year ago

Okay, I see that the context menu does in fact work, but it only works from within a directory that's been set up to work with Syncthing and it appears to only show stats/info for the sync directory. So not what I was imagining it was used for. Since I wasn't in a sync directory, every time I set the config, nothing happened.

I thought it was so I could copy a file into one of my Syncthing directories. For example, say I'm on my desktop and I want to send an image to my phone from some random directory, I would right click the image and select one of the would be listed syncthing directories/syncs and have the option to move or copy the image to said sync directory, this so it could then be synced up with my phone (or other sync etc.) Of course, I'm all set now, but please consider this a features request.

Martchus commented 1 year ago

I cannot reproduce this problem.

Unable to parse Syncthing status: illegal value (at offset 1)

Is there a more detailed error message logged on stderr? Maybe it would also be useful to enable logging (https://github.com/Martchus/syncthingtray#logging).

Still not sure if ~/.config/syncthing/config.xml is the proper config file

It should be. Normally the config should be picked up from that path automatically. Not sure why that is not working in your case.

Martchus commented 1 year ago

Okay, I see that the context menu does in fact work, but it only works from within a directory that's been set up to work with Syncthing and it appears to only show stats/info for the sync directory. So not what I was imagining it was used for. Since I wasn't in a sync directory, every time I set the config, nothing happened.

That's normal. And yes, it doesn't do that much at this point. The Dolphin menu was just a result of me playing around and see what I can do easily.

I thought it was so I could copy a file into one of my Syncthing directories. For example, say I'm on my desktop and I want to send an image to my phone from some random directory, I would right click the image and select one of the would be listed syncthing directories/syncs and have the option to move or copy the image to said sync directory, this so it could then be synced up with my phone (or other sync etc.) Of course, I'm all set now, but please consider this a features request.

Interesting idea. Maybe one can implement it at some point.

Natetronn commented 1 year ago

@Martchus thanks for the reply.

Another suggestion, if I may:

If I'm in a non-syncthing directory, perhaps show a message saying as such and or graying out the option to select the config. That could eliminate this from ever happening again. If the context menu feature is going to be context based, maybe it should adjust itself as such.

Martchus commented 1 year ago

I've adding such a message and also extended the documentation. I'll convert this to a feature request as the behavior you actually want simply hasn't been implemented yet.

Natetronn commented 1 year ago

Thank you @Martchus!

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Natetronn commented 1 year ago

Stale bot, I'd still like to see this feature request implemented one day, but I'm waiting patiently :-D

Martchus commented 1 year ago

To have that kind of confirmation the bot is for :-)

If you really like to have this feature anytime soon, I suggest you try implementing it yourself, though. (This project has no regularly active developer besides me and for me this isn't a priority.)

Natetronn commented 1 year ago

Okay, thanks!

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.