Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't figure out how to use these addons? #1

Open
sesameman opened this issue Nov 4, 2022 · 19 comments
Open

I can't figure out how to use these addons? #1

sesameman opened this issue Nov 4, 2022 · 19 comments

Comments

@sesameman
Copy link

sesameman commented Nov 4, 2022

Can I get a document?

@sesameman sesameman changed the title I can't figure out how to use this addon I can't figure out how to use these addons? Nov 4, 2022
@ahrm
Copy link
Owner

ahrm commented Nov 4, 2022

There is some documentation in the readme. You need to first install it using pip:

python -m pip install sioyek

and then add the configuration corresponding to the addon you want to use to your prefs_user.config. For example if you want to use paper_downloader, add this:

new_command _download_paper python -m sioyek.paper_downloader download "%{sioyek_path}" "%{paper_name}"
control_click_command _download_paper

To your config file.

@sesameman
Copy link
Author

There is some documentation in the readme. You need to first install it using pip:

python -m pip install sioyek

and then add the configuration corresponding to the addon you want to use to your prefs_user.config. For example if you want to use paper_downloader, add this:

new_command _download_paper python -m sioyek.paper_downloader download "%{sioyek_path}" "%{paper_name}"
control_click_command _download_paper

To your config file.

Thank you for your reply.
I follow the steps, but it doesn't work.
Maybe it is because of my OS.

And can you add your keyboard shortcut in your video? i don't know what you did.

@ahrm
Copy link
Owner

ahrm commented Nov 5, 2022

What OS are you using. You can always try to run these commands from command line, for example:

python -m sioyek.paper_downloader download "%{sioyek_path}" "%{paper_name}"

(after replacing %{sioyek_path} and %{paper_name} with the correct values). And see if there are any errors. You can bind them to shortcuts the same way you bind normal keys. For example something like this in your keys_user.config:

_download_paper <C-d>

@sesameman
Copy link
Author

My system is MacOS 13.0 (22A380).

python -m sioyek.dual_panelify "%{sioyek_path}" "%{file_path}" "%{command_text}"
python -m sioyek.dual_panelify "sioyek" "%{paper_name}" "%{command_text}"
python -m sioyek.dual_panelify "/Applications/sioyek.app" "%{paper_name}" "%{command_text}"
python -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "%{paper_name}" "%{command_text}"
python -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "/Users/xxx/Desktop/main.pdf" "%{command_text}"
python -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "/Users/xxx/Desktop/main.pdf" "%{command_text}"

I tried all these command and nothing happened. Is there anything I need to modify here?

@ahrm
Copy link
Owner

ahrm commented Nov 6, 2022

When you run this manually in command line:

python -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "/Users/xxx/Desktop/main.pdf" ""

do you get an error?

@sesameman
Copy link
Author

When you run this manually in command line:

python -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "/Users/xxx/Desktop/main.pdf" ""

do you get an error?

Sorry i got it wrong earlier what you meant by the command line. I opened Sioyek and pressed :, typed python command into it.

And It may get something wrong with python@3.10(brew version) or armMac or dependencies. I have to back to python@3.9 to reinstall pip-sioyek. It doesn't work yesterday on my pc, but it works today. I think maybe some packages were fixed. (PS: these pkgs wew got wrong: numpy swig? metadata wheel pypdf? ,etc. )

Thank you so much for helping me!

@sesameman
Copy link
Author

Closed to early.

It doesn't work in Sioyek.

# comand line
python3 -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "/Users/x/Desktop/main.pdf" ""
# it works

But in Sioyek , I input _dual_panelify2 & _dual_panelify .nothing happened.

# put in pref_user.config
new_command _dual_panelify python3 -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "%{file_path}" "%{command_text}"
new_command _dual_panelify2 python3 -m sioyek.dual_panelify "/Applications/sioyek.app/Contents/MacOS/sioyek" "/Users/kangjiayin/Desktop/main.pdf" ""


@sesameman sesameman reopened this Nov 8, 2022
@ahrm
Copy link
Owner

ahrm commented Nov 9, 2022

I borrowed one of my friends' mac machine and I have found that if you open sioyek using this command:

open /Applications/sioyek.app

it works but when you open it using the GUI it doesn't work.

I am not very familiar with MacOS and how it works so I am not entirely sure what the issue is.

@chapter09
Copy link

I borrowed one of my friends' mac machine and I have found that if you open sioyek using this command:

open /Applications/sioyek.app

it works but when you open it using the GUI it doesn't work.

I am not very familiar with MacOS and how it works so I am not entirely sure what the issue is.

I have the same issue here. Only using the command line open /Applications/sioyek.app can enable the extension.

Meanwhile, I found when I embed_annotations, I have the following issue---some highlights show up---which I did not applied.

image

@ahrm
Copy link
Owner

ahrm commented Dec 5, 2022

Meanwhile, I found when I embed_annotations, I have the following issue---some highlights show up---which I did not applied.

Should be fixed in the latest version of sioyek python package.

@justcyl
Copy link

justcyl commented Jan 24, 2023

I met the same problem in windows10, I can run the command python -m sioyek.translate "%{sioyek_path}" "%{selected_text}" on windows terminal and got the expect result, but it got nothing by using execute in sioyek. My version is python37 and sioyek Release v2.0.0. I open it by clicking "sioyek.exe".
By the way, I test the execute funtion in sioyek. It's ok in my pc, but can't run the above command. I guess there might be something wrong in python module ".sioyek"

@ahrm
Copy link
Owner

ahrm commented Jan 24, 2023

What exactly is your configuration?

@justcyl
Copy link

justcyl commented Jan 25, 2023

What exactly is your configuration?

which configuration? the python script or sioyek config?

@ahrm
Copy link
Owner

ahrm commented Jan 25, 2023

Both.

@justcyl
Copy link

justcyl commented Jan 25, 2023

I try again.
I found two problems:

  1. If I use python -m sioyek.translate , I fail. But if I use python C:\the path\translate.py , it works in execute in sioyek. Both command can run successfully in windows terminal.
  2. If I import some modules like import translators.server as tss, it will fail. But I can run it successfully in windows terminal.
    The "fail" I mean is that I run the command in execute in sioyek, but got nothing.
    I didn't change the sioyek config, and the version is 2.0.0(not protable)
    the python script is:
import sys
import os
# from googletrans import Translator # I don't want to use it
import translators.server as tss #https://github.com/UlionTse/translators
from .sioyek import Sioyek
if __name__ == '__main__':
    sioyek_path = 'D:\\Downloads\\sioyek-release-windows\\sioyek.exe'
    text = sys.argv[2]
    sioyek = Sioyek(sioyek_path)
    sioyek.set_status_string(tss.baidu(text, to_language='zh'))

@ahrm
Copy link
Owner

ahrm commented Jan 25, 2023

Do you have multiple python versions?

@justcyl
Copy link

justcyl commented Jan 25, 2023

yes, I have python3.7,python3.9 and pypy3.9, but the default is python3.7 (I type python -V in windows terminal) , and I am sure about that the module was installed at python37.

@ahrm
Copy link
Owner

ahrm commented Jan 25, 2023

Maybe sioyek is using another python version? You could specify the exact path to your python executable in prefs_user.config instead of just using python.

@justcyl
Copy link

justcyl commented Jan 26, 2023

Thanks for you replys, now I use "C:\ProgramFiles\Python37\python.exe" and the problems are solven.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants