Comments (12)
Tray Icon Support arrived in the latest beta release 0.2.0-b1!
Please help by testing and providing feedback.
from normcap.
Well, we don't need to run as a service during startup. But a good suggestion is if it's executed once, it can stay at tray icon. The reason is that if a user has selected text recently. There is a high chance that he will again use the tool within a few minutes.
We can consider it a design enhancement. Although as I said it will only go to tray icon when EXE file is executed manually.
(This could be my personal opinion, for now, I have found an alternative way by dragging the executable file to my taskbar and pinned it, so I don't need to go and run the program again and again)
from normcap.
I personally prefer software to not run in the background constantly, especially if I don't need it very often.
But considering the startup time, which is especially slow for the exe-release on windows, I can understand if some people prefer to run it as a service.
Therefore I'll take a look on this, but can't promise anything here, because I have no idea how difficult it is to implement this platform independently (which is one of the major goals for this project).
Thanks for your suggestion!
from normcap.
I like your suggestion! As a first step, we could:
- add a command line switch like
--keep-in-tray
to activate the tray icon - If the tray icon is active and you click on it, a simple menu will show up:
(the scribble doesn't show a system tray, I know... ;-)
What do you think?
from normcap.
Yeah looks good to me. We can use PyQt5 for that. A demonstrated example is available here
This is a cross-platform library for Windows and macOS
from normcap.
Hey @ashishpatel1992, while PyQt5 definitely could do that, I'll try to stay away from it. It's a too powerful (and bloated) framework, for such a tiny feature. For the same reason I'm currently using Tkinter as UI-Framework, which is less bloated and a default lib in Python.
However, Tkinter (as far as I can tell) doesn't support tray icons. I'm currently experimenting if pystray can do the job :-)
from normcap.
pystray conflicts with pyperclip (module for clipboard handling). I filed a simple PR which could help: asweigart/pyperclip#182
Waiting till it arrives upstream...
from normcap.
Hi @dynobo ,
I have been trying to test pystray but looks like I am stuck at this point. I have followed the documentation Creating a system tray icon.
My Sample code
from pystray import Icon as icon, Menu as menu, MenuItem as item
from PIL import Image
state = False
im = Image.new(mode = "RGB", size = (200, 200), color = (153, 153, 255))
def on_clicked(icon, item):
global state
state = not item.checked
icon('test', im, menu=menu(item('Checkable',on_clicked,checked=lambda item: state))).run()
and getting the following error
(base) ashish@pixels:~/Desktop/sa/test$ python test.py
Failed to dock icon
Traceback (most recent call last):
File "/home/ashish/anaconda3/lib/python3.7/site-packages/pystray/_xorg.py", line 162, in _update_icon
self._assert_docked()
File "/home/ashish/anaconda3/lib/python3.7/site-packages/pystray/_xorg.py", line 389, in _assert_docked
assert self._systray_manager
AssertionError
Failed to dock icon
Traceback (most recent call last):
File "/home/ashish/anaconda3/lib/python3.7/site-packages/pystray/_xorg.py", line 143, in _show
self._assert_docked()
File "/home/ashish/anaconda3/lib/python3.7/site-packages/pystray/_xorg.py", line 389, in _assert_docked
assert self._systray_manager
AssertionError
Do you have any idea about this error? I am testing it on Ubuntu 20.04.1 LTS
from normcap.
@ashishpatel1992 : Your code-example works on my machine, I see the "icon" and don't get an error. My best guess is that you are missing a dependency. You could try to install the following stuff:
sudo apt install libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-3.0
pip install PyGObject
from normcap.
Hi @dynobo ,
Well, the packages didn't help, but I noticed one thing it wasn't working on Python 3.7.6 but was working fine on python 3.8.
Also tested on windows and working fine under python 3.8
from normcap.
Hi @dynobo ,
Sure I will test this and let you know the feedback.
from normcap.
Considered as solved with #116
from normcap.
Related Issues (20)
- NormCap AppImage Failing at OCR HOT 8
- [Linux, AWM] Can't OCR From All Monitors HOT 4
- [Linux] Crash due to "Timeout when taking screenshot" HOT 5
- Cannot download other languages. AppImage version HOT 4
- [Windows] Crash immediately after launch (UnicodeDecodeError) HOT 5
- [Linux, FlatPak] provide aarch64/arm64 package HOT 3
- [Linux, FlatPak] Trying to update form Flathub. Corrupted checksum HOT 3
- Windows 10 - locked in screenshot mode HOT 5
- Failing to copy to clipboard with version 0.5.2 on X11 HOT 1
- [Linux, Wayland] Multi monitor issues - Help needed! HOT 1
- Permission denied for Screenshot via xdg-portal! HOT 6
- Crashes on MacOS (CRITICAL - normcap:152) HOT 7
- Sending result to another app HOT 2
- Enhancement Suggestion - Add Customizable Hotkeys (Keyboard Shortcuts) HOT 3
- Arabic instead of English HOT 2
- Flatpak notifications are shown as hidden
- Screenshots are saved in /home/Pictures with every OCR HOT 4
- Looking for PySide/PyQT expert to help with GUI code
- Auto language switch HOT 1
- The application crashes on startup. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from normcap.