cerebro
cerebro copied to clipboard
Redirect to opened app instead opening new one
I believe that some people prefer to always open new apps, but for those would don't this would be great.
Example: I have opened one instance of google-chrome
. When I use short-cut to initialize cerebro and type google-chrome, I would expect that previous instance would pop up instead of creating new one.
But don't you think it's the app that should decide this, not the launcher? For example the messenger I use doesn't open the second instance of itself, same for email client -- the apps themselves take care of that. The app developers can better tell whether it makes sense to be able to run two instances simultaneously (it makes sense for two calculators or two text editors) or only one instance should be allowed.
I'm using Cerebro on a Mac and I can confirm that Chrome uses this behaviour - it switches to the already open instance instead of creating a new one. I haven't yet tried it on my Linux laptop though.
@pkajaba what operation system do you use?
Fedora 25
I think the best way to approach this feature request is by creating a completely new plugin. The current plugin is doing one job (opening new apps) and it's doing it well, let's keep it simple.
The new plugin would:
- search currently opened windows (not apps!)
- let you fuzzy-filter them
- and on Enter would bring it on top and focus it.
The main benefits are:
- it keeps code clean and separated, eliminates all funny bugs
- allows to choose which of the multiple windows you want to focus.
Examples:
Suppose you have two documents opened in LibreOffice Writer, the two windows have titles Fun - LibreOffice Writer
and Work - LibreOffice Writer
.
- Opening Cerebro and typing
writer
gives you 3 results:- Fun - LibreOffice Writer // Enter would focus on this specific document
- Work - LibreOffice Writer // Enter would focus on this specific document
- LibreOffice Writer // Enter would open a new instance of Writer
- Opening Cerebro and typing
w writer
gives you only one result, because nothing else matches:- Work - LibreOffice Writer
Hey'ya all - I'm excited at the prospect of this feature. I'm no programmer but I 'dug around' & stumbled upon some interesting info, IMO. Note this is for GNU/Linux systems as it relies on wmctrl
:
#!/bin/bash
PROGRAM=$1
WINID=$(wmctrl -lx | grep -i $PROGRAM | awk 'NR==1{print $1}')
if [ $WINID ]; then
wmctrl -ia $WINID &
# exit 0
else
$PROGRAM &
# exit 0
fi
(Source: Albert Launcher's Github, Issue 123, Switch to application if it's already running, mintystark, 2016-02-10)
xlsclients
was another Linux-specific command I saw mentioned, too.
Anyone have an idea how this could be implemented for us Linux users until an OS agnostic solution comes along?
This the the most anticipated plugin for me! Developers, please create it! Or maybe it is even better to have it inside the app as a setting that maybe changed. I switched from OS X, where Spotlight has this feature as a default behaviour when typing an app that is already opened. With such feature on OS X, I've never used Alt+Tab or Dock to switch between opened apps.
I am very excited to test this feature in the future if released. :1st_place_medal:
This is the soul reason I wanted something like cerebro!
Any news on a plugin with this functionality?
Any news on this plugin?
OK, I have decided to write this plugin myself because it was one of the main reasons why I installed cerebro in the first place
you can check it out at its repo or install it directly from cerebro by typing plugins manager
try it out and let me know what you think
PS: only tested on ubuntu 18.04 but should work on other distros too
OK, I have decided to write this plugin myself because it was one of the main reasons why I installed cerebro in the first place you can check it out at its repo or install it directly from cerebro by typing
plugins manager
try it out and let me know what you think PS: only tested on ubuntu 18.04 but should work on other distros too
Not working in debian 10
OK, I have decided to write this plugin myself because it was one of the main reasons why I installed cerebro in the first place you can check it out at its repo or install it directly from cerebro by typing
plugins manager
try it out and let me know what you think PS: only tested on ubuntu 18.04 but should work on other distros too
Unfortunately doesnt work on windows as well :c