Skip to content

Commit

Permalink
Merge pull request #188 from Freed-Wu/auto-use-gnome
Browse files Browse the repository at this point in the history
Use gnome-screenshot automatically
  • Loading branch information
lukas-blecher committed Sep 20, 2022
2 parents 51c86f5 + 6a94ab1 commit f479a12
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ There are three ways to get a prediction from an image.

2. Thanks to [@katie-lim](https://github.com/katie-lim), you can use a nice user interface as a quick way to get the model prediction. Just call the GUI with `latexocr`. From here you can take a screenshot and the predicted latex code is rendered using [MathJax](https://www.mathjax.org/) and copied to your clipboard.

Under linux, it is possible to use the GUI with `gnome-screenshot` which comes with multiple monitor support. You just need to run `latexocr --gnome` (**Note:** you should install `gnome-screenshot` beforehand).
Under linux, it is possible to use the GUI with `gnome-screenshot` which comes with multiple monitor support if `gnome-screenshot` was installed beforehand.

![demo](https://user-images.githubusercontent.com/55287601/117812740-77b7b780-b262-11eb-81f6-fc19766ae2ae.gif)

Expand Down
1 change: 0 additions & 1 deletion pix2tex/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def main():
parser.add_argument('-k', '--katex', action='store_true', help='Render the latex code in the browser (cli only)')

parser.add_argument('--gui', action='store_true', help='Use GUI (gui only)')
parser.add_argument('--gnome', action='store_true', help='Use gnome-screenshot to capture screenshot (gui only)')

arguments = parser.parse_args()

Expand Down
3 changes: 2 additions & 1 deletion pix2tex/gui.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from shutil import which
import sys
import os
import tempfile
Expand Down Expand Up @@ -105,7 +106,7 @@ def toggleProcessing(self, value=None):
@pyqtSlot()
def onClick(self):
self.close()
if self.args.gnome:
if which('gnome-screenshot'):
self.snip_using_gnome_screenshot()
else:
self.snipWidget.snip()
Expand Down

0 comments on commit f479a12

Please sign in to comment.