You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to request the addition of the possibility to bring up nvpy from taskbar or tray(or background in general) to front.
Example use case: You're working in some application, let's say browser. You want to take a note of something you've seen or something you found. Assuming the application is already running (e.g. autostarts with system), I would press a key combination to bring up nvpy e.g. Alt+R, then Ctrl+N to start new note, then Ctrl+V to paste url or type something, then press escape to exit the note, and escape again to minimise nvPY.
Hi there @yuuki0xff
I was thinking about workaround for this, because lack of the global shortcut makes my life miserable. The workaround I was thinking is - I can configure custom global shortcut on my system, to launch specific command. I was thinking that I can use this feature, but it seems that nvpy command by default doesn't check if there is an instance already running. So the current behavior for me, seems to be that whenever I run the nvpy command, a new instance is launched. Is there some switch available to suppress launching of the second instance and bring up the existing one ?
Hacked my way around it. Posting here maybe someone will find it useful.
This works on linux, and assumes you have the wmctrl and pgrep package installed. I tested arch linux with gnome.
create a bash script:
#!/bin/bash
pidNo="$(pgrep -f 'python2 -m nvpy')"
echo $pidNo
if [ -z "$pidNo" ]
then
echo "Execution of a script"
python2 -m nvpy &
exit 1
else
echo "Activate the PID"
wmctrl -a nvPy
fi
Then assign shortcut to this script. When NVPY is not running, it will launch it. If it is running, it will unminimize/bring the window to foreground :)
edit: there's a small bug, if there are more windows with nvpy in the window title (e.g. browser with this git repo open in an active tab), the script will not know which window to unminimize. In my case, it unminimizes the browser.
Activity
grandfso commentedon Jan 21, 2019
Hi there @yuuki0xff
I was thinking about workaround for this, because lack of the global shortcut makes my life miserable. The workaround I was thinking is - I can configure custom global shortcut on my system, to launch specific command. I was thinking that I can use this feature, but it seems that nvpy command by default doesn't check if there is an instance already running. So the current behavior for me, seems to be that whenever I run the
nvpycommand, a new instance is launched. Is there some switch available to suppress launching of the second instance and bring up the existing one ?grandfso commentedon Jul 15, 2019
Hacked my way around it. Posting here maybe someone will find it useful.
This works on linux, and assumes you have the wmctrl and pgrep package installed. I tested arch linux with gnome.
create a bash script:
Then assign shortcut to this script. When NVPY is not running, it will launch it. If it is running, it will unminimize/bring the window to foreground :)
edit: there's a small bug, if there are more windows with nvpy in the window title (e.g. browser with this git repo open in an active tab), the script will not know which window to unminimize. In my case, it unminimizes the browser.
x3cca commentedon Nov 6, 2019
I use
alt+nas shortcut for nvpy. I have a separate autohotkey script that manages this. Place it in the same folder as the nvpy repo after compiling.Direct support would be nice but here's another work-around for Windows in the meantime.