Skip to content

_add_text extension is not working #26

Open
@apalermo01

Description

@apalermo01

When I run add_text, no text appears in the selected rectangle.

Here's my config:

startup_commands toggle_custom_color
new_command _embed_annotations_in_file python /home/alex/scripts/embed_annotations_in_file.py %{sioyek_path} %{local_database} %{shared_database} %{file_path}

new_command _add_text python -m sioyek.add_text %{sioyek_path} %{local_database} %{shared_database} %{file_path} %{selected_rect} %{command_text}

I found that putting the parameters in quotes like in the readme throws an error:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib/python3.13/site-packages/sioyek/add_text.py", line 55, in <module>
    selected_page, selected_rect = parse_rect(rect_string)
                                   ~~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/sioyek/add_text.py", line 7, in parse_rect
    page = int(parts[0])
ValueError: invalid literal for int() with base 10: '"0'

This is the full terminal output when I open up sioyek and just try to run select_rect then _add_text (I added a few print statements to add_text.py to make sure the arguments are getting parsed correctly):

➤ sioyek statistical_rethinking_text.pdf
default_config_path: /etc/sioyek/prefs.config
default_keys_path: /etc/sioyek/keys.config
user_config_path: [ 0 ] /etc/xdg/sioyek/prefs_user.config
user_config_path: [ 1 ] /home/alex/.config/sioyek/prefs_user.config
user_keys_path: [ 0 ] /etc/xdg/sioyek/keys_user.config
user_keys_path: [ 1 ] /home/alex/.config/sioyek/keys_user.config
database_file_path: /home/alex/.local/share/sioyek/test.db
local_database_file_path: /home/alex/.local/share/sioyek/local.db
global_database_file_path: /home/alex/.local/share/sioyek/shared.db
tutorial_path: /usr/share/sioyek/tutorial.pdf
last_opened_file_address_path: /home/alex/.local/share/sioyek/last_document_path.txt
shader_path: /usr/share/sioyek/shaders
Creating shared memory block...
Shared memory created: this is the primary application.
Starting IPC server...
IPC server started.
QString::arg: Argument missing: python -m sioyek.add_text %{sioyek_path} %{local_database} %{shared_database} %{file_path} %{selected_rect} %{command_text}, /home/alex/Documents/library/statistical_rethinking_text.pdf
Sioyek path =  /usr/bin/sioyek
local database path =  /home/alex/.local/share/sioyek/local.db
shared database path =  /home/alex/.local/share/sioyek/shared.db
file path =  /home/alex/Documents/library/statistical_rethinking_text.pdf
rect string =  0,16.4408,148.774,93.5231,254.426
added text =  TEST
params =  {}

Here's my system information:

  • Sioyek version: 2.0.0
  • OS: EndeavourOS
  • Kernel: Linux 6.12.10-arch1-1
  • Shell: Fish 3.7.1

I orignallly installed sioyek using the package in the AUR, however I also run into this issue when I installed sioyek in a virtual environmet.

I also attached a video of the issue.

sioyek_bug_20250125.mp4

Please let me know if I'm doing something dumb or if this is an actual bug. If it is a bug, I'm open to attempting a fix myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions