Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bin/frog.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ import locale

VERSION = '@VERSION@'
pkgdatadir = '@pkgdatadir@'
pythondir = '@pythondir@'
localedir = '@localedir@'
project_name = '@projectname@'

sys.path.insert(1, pkgdatadir)
sys.path.insert(1, pythondir)
signal.signal(signal.SIGINT, signal.SIG_DFL)

# L10n
Expand Down
14 changes: 14 additions & 0 deletions frog/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ def __init__(self, version=None):
None
)

self.add_main_option(
'server',
ord('s'),
GLib.OptionFlags.NONE,
GLib.OptionArg.NONE,
_("Run in server mode without GUI."),
None
)

# Initialize tesseract data files storage.
language_manager.init_tessdata()

Expand Down Expand Up @@ -124,6 +133,11 @@ def do_command_line(self, command_line):
options = command_line.get_options_dict()
options = options.end().unpack()

if "server" in options:
logger.info("Server mode activated. Backend is running.")
self.hold()
return 0

if "extract_to_clipboard" in options:
self.backend.capture(self.settings.get_string("active-language"), True)
return 1
Expand Down