micheleg / dash-to-dock

A dock for the Gnome Shell. This extension moves the dash out of the overview transforming it in a dock for an easier launching of applications and a faster switching between windows and desktops.
https://micheleg.github.io/dash-to-dock/
GNU General Public License v2.0
3.85k stars 461 forks source link

dash to dock multi monitor #37

Open jaccoh opened 11 years ago

jaccoh commented 11 years ago

Is it possible to make dash on dock appear separately on multiple monitors? So for example, 2 docks, one on each monitor?

micheleg commented 11 years ago

Hi,

Do you mean multiple dock, one on each monitor with only the applications running on that monitor?

jaccoh commented 11 years ago

Yes.

On 22 nov. 2012, at 19:27, Michele notifications@github.com wrote:

Hi,

Do you mean multiple dock, one on each monitor with only the applications running on that monitor? — Reply to this email directly or view it on GitHub.

micheleg commented 11 years ago

I don't think I'm going to implement something like this in the near future, for two main reasons:

1.) It would require quite a lot of work and I'm not sure I have time to do it now. Moreover not having a multiple monitor configuration slows down a lot the development and testing of such feature and stops me from starting to experiment with it in my spare time. 2.) I think it's not the way multiple monitors are meant in gnome-shell but I'm not sure about this. If I remember correctly the secondary monitor is usually just a static workspace. I've tried to be as consistent as possible with the default gnome-shell behaviour, and so for instance I decided to keep thinking of the dock as a part of the overview.

Anyhow I'm not dropping the idea completely.

ticpu commented 9 years ago

I really like the multi-dock that Ubuntu offers, it really helps reducing mouse movement and allows to locate windows at a glance since clicking twice on an icon show all the applications on the screen. In a triple monitor setup I have 2 active monitor and a static one. On a single monitor, however, I use workspaces.

fakirinho commented 9 years ago

+1 to this idea. I'd like to see this coming somewhere in near future :)

micheleg commented 8 years ago

@ticpu: I'm too lazy to try to install ubuntu... how does ubuntu handle the multimonitor thing: is the dock the same on all monitors or are them multiple docks restricted to the apps of each specific screen?

luisfpg commented 8 years ago

@micheleg In Ubuntu, the dock is (by default) visible on all monitors. The icons are the same in all docks, but there is a distinct indicator (a triangle) indicating the application is running on another monitor. So, on the monitor the app is running, you have a circle. On the others, a triangle. AFAIK there is no way to configure it to only show the icons of the current monitor, because anyway the pinned applications always appear, I don't think it makes much sense. I don't run Unity since a long time, but that is how it works.

micheleg commented 8 years ago

Thanks for the information.

bishiboosh commented 8 years ago

I'd very much like to have this feature too, that's pretty much the only thing I regret from Unity

aeno commented 8 years ago

+1 for this. It would really boost productivity with multi monitor setups.

jessebye commented 8 years ago

+1

maxammann commented 8 years ago

+1

fulljackz commented 8 years ago

:+1:

CyanBlob commented 8 years ago

I'd love this to be implemented as well. I don't care for only showing the windows open for each window, I'd rather just have the dock duplicated on each monitor. But either way, it would be very great

ItamarShDev commented 8 years ago

I'd be happy to contribute if I'll get some guidance on how to start implementing it. I never worked on gnome extensions so I don't have the right knowledge.

micheleg commented 8 years ago

@ItamarShDev : thanks for your interest in helping the development of dash-to-dock. A already said, there is no real blocking thing for having duplicated docks. Indeed, I can run two independent docks by simply duplicating the extension with a different name with very minor issues.

screenshot from 2016-07-08 22 31 18

With independent settings it's then easy to move one of the dock in the secondary monitor.

So it's mainly a matter of organizing the code in order to allow the instantiations of two dash objects.

If you have a look at the code, in extension.js the docking.DockedDash object (https://github.com/micheleg/dash-to-dock/blob/master/docking.js#L184) is created. A dirty approach would be to duplicate it at this level, creating another one and somehow force its settings to show the dock on the secondary monitor. This would be basically as duplicating the whole extension, duplicating also the code dealing with intellihide and the various shell tweaks which should instead be kept in common. You don't need a particular understanding of Gnome Shell innards, but only of Javascript, to get the idea of how rework the code. I see two options:

  1. The DockedDash class instantiates multiple dash objects and deal with them.
  2. The DockedDash class is split into a component dealing with the single dock placement and logic, and one dealing with settings, overview tweaking, etc.

Are you willing to look into this? If so I can provide guidance once you get an overview of the code.

ItamarShDev commented 8 years ago

@micheleg sure i am willing I have already looked at the code, will be happy to help. will give it another look this evening or tomorrow's Will be happy to more guidance if needed Thanks for the info

michaelarnauts commented 8 years ago

I went with the "easy approach" and renamed the extension to a new one with different settings.

rm -rf ~/.local/share/gnome-shell/extensions/dash-to-multiple@micxgx.gmail.com
cp -R ~/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com ~/.local/share/gnome-shell/extensions/dash-to-multiple@micxgx.gmail.com
mv ~/.local/share/gnome-shell/extensions/dash-to-multiple@micxgx.gmail.com/schemas/org.gnome.shell.extensions.dash-to-dock.gschema.xml ~/.local/share/gnome-shell/extensions/dash-to-multiple@micxgx.gmail.com/schemas/org.gnome.shell.extensions.dash-to-multiple.gschema.xml
sed -i 's/Dash to Dock/Dash to Multiple/g' ~/.local/share/gnome-shell/extensions/dash-to-multiple@micxgx.gmail.com/metadata.json
sed -i 's/dash-to-dock/dash-to-multiple/g' ~/.local/share/gnome-shell/extensions/dash-to-multiple@micxgx.gmail.com/metadata.json ~/.local/share/gnome-shell/extensions/dash-to-multiple@micxgx.gmail.com/*.js ~/.local/share/gnome-shell/extensions/dash-to-multiple@micxgx.gmail.com/schemas/org.gnome.shell.extensions.dash-to-multiple.gschema.xml
rm ~/.local/share/gnome-shell/extensions/dash-to-multiple@micxgx.gmail.com/schemas/gschemas.compiled
glib-compile-schemas ~/.local/share/gnome-shell/extensions/dash-to-multiple@micxgx.gmail.com/schemas/

Then, hit alt+f2 and execute r to reload gnome-shell. You can now activate and configure your independent copy with the tweak tool.

franglais125 commented 8 years ago

Hi, I'm not planning on working on this in the near future, but if someone wants to look at it, I created a branch with minimal (and hacky) support for 2 monitors. https://github.com/franglais125/dash-to-dock/tree/multi_monitor

I'm essentially duplicating the DockedDash object, but I'm forcing two of them on 2 monitors, so you need at least 2 monitors to run it properly!

Todo:

Just to make it clear, this is not a correct implementation; the single patch that matters [4abfb6e92ecfc3b60202b420866819aab1c4cd97] shows what object to duplicate, and basic monitor handling.

I tested it on 2 monitors and it "works", not sure if it will crash eventually, so be careful if you install it :).

Cheers

franglais125 commented 8 years ago

Well, I ended up working on it, as it wasn't as much work as I thought, at least to get it to work minimally. The 3rd point still need to be checked:

I just updated the tree [https://github.com/franglais125/dash-to-dock/tree/multi_monitor]. If anyone wants to give it a try, it seems to work reasonably well on Gnome 3.20. I won't be doing a PR until some other PRs are resolved though.

franglais125 commented 8 years ago

Hi all: I rebased the tree I was working on [[https://github.com/franglais125/dash-to-dock/tree/multi_monitor] to update it against @micheleg's master.

As far as I can tell, the code works quite well (tested on Gnome 3.20):

What I would really need is some testing, as I can't cover all use-cases and combination of features. I have sent some pull requests, but this one is a bit bigger and more intrusive. I'd feel more comfortable if somebody could test this branch and send me feedback.

ticpu commented 8 years ago

I'm currently testing the extension on Gnome 3.18 on Ubuntu Xenial, no problem whatsoever. Currently set options are extend dock and isolate workspace.

ticpu commented 8 years ago

I think I encountered a crash while unlocking my screen. This is the first crash I had with gnome-shell in quite a while. I still have the process open in gdb if needed.

https://gist.github.com/ticpu/686b1d4cd8c3caf4b42b02e84a95f2cc

franglais125 commented 7 years ago

@ticpu any new problems to report? Or did the fix I included work well so far? And thanks for your feedback so far.

To all: I updated the multi-monitor branch (https://github.com/franglais125/dash-to-dock/tree/multi_monitor) after the release of v54. So if anyone else is willing to test it, please let me know how it goes!

bishiboosh commented 7 years ago

I'll try to use it tomorrow and I'll tell you how it went

ticpu commented 7 years ago

I've been using it daily ever since the last release without any updates. No crash yet.

franglais125 commented 7 years ago

@ticpu thanks!

@bishiboosh I forgot to mention that the multi-monitor tree only works for Gnome Shell 3.18, 3.20 and 3.22

akurpanek commented 7 years ago

It works.

franglais125 commented 7 years ago

@micheleg Is it a good time to start a PR for this?

Perhaps there are other issues/PRs you want to handle first!

micheleg commented 7 years ago

I'd like to merge the hotkeys branch first. As usual I'm a bit scared of introducing big changes until I become confident about it. I need to find the time to review it. How much do you like your current implementation?

franglais125 commented 7 years ago

Well, I'm scared of introducing too many changes too! I'm asking now as there seems to be at least a few people using it (without bad reports).

Super summary: essentially the way it works is that there is a "dockManager" that creates and deletes docks whenever the monitors change.

This is what I have to say (briefly) about the 7 commits:

I can wait for you to review/accept/reject the hotkeys implementation, and then bother again with this when you are done. Or I can send you this now/soon (with a better description), and just wait for you to find the time to review it. As you prefer!

thejacer87 commented 7 years ago

+1 for this feature

iraklisg commented 7 years ago

+1 for this feature

franglais125 commented 7 years ago

For anyone interested, I rebased the multi-monitor branch (https://github.com/franglais125/dash-to-dock/tree/multi_monitor), so that a merge is still easily feasible.

micheleg commented 7 years ago

@franglais125 do you have this feature implemented for 3.14? I have a single monitor only at home but I'd like to run it at work where I have two screens.

franglais125 commented 7 years ago

@micheleg I just prepared a branch for 3.14. I simply had to cherry-pick a few commits from my gnome-3.14-custom branch.

Here it is: https://github.com/franglais125/dash-to-dock/commits/gnome-3.14-multi_monitor

By the way, it contains the hotkeys as well (first 2 commits).

Here is a comparison: https://github.com/micheleg/dash-to-dock/compare/gnome-3.14...franglais125:gnome-3.14-multi_monitor?expand=1

micheleg commented 7 years ago

Thanks,

I'll give it a try next week.

franglais125 commented 7 years ago

@micheleg did you get a chance to test it? :)

pkoutsovasilis commented 7 years ago

@franglais125 I installed the multi monitor branch from here. Up until now everything feels as it should, the only thing i noticed is that when i press application button of dock on the second monitor it actually opens it on the "primary". Nice effort :)

ItamarShDev commented 7 years ago

@pkoutsovasilis this is gnome related imho as the apps and overview always display in the main monitor. I am using two monitors for awhile on gnome and i dont recall any extension that manipulates this behavior.

but, maybe im mistaken

ItamarShDev commented 7 years ago

@micheleg sorry i wasn't here, i caught up in my work (new work, new programming language) and weren't able to find me some time to work on it to the fullest :(

franglais125 commented 7 years ago

@pkoutsovasilis thanks for the feedback! I noticed this too, but I am not sure that adding the option to open the overview on the secondary monitor makes a lot of sense... Perhaps it would be better to simply remove the Apps button from the dash on secondary monitors.

In any case, I think I would rather wait for @micheleg to review the changes and give some feedback on how it is implemented. We can then look at improving the remaining bits.

micheleg commented 7 years ago

Unfortunately I haven't had the opportunity to look into this yet. I will try to do it soon.

jonnjonzzn commented 7 years ago

@franglais125 thank you for working on this! However, I'm perhaps slightly confused.

How do you get the dash to show on all you monitors? I was expecting in the "Show the dock on" pull-down there would be a new option for "All Monitors" or similar?

Again, thank you to all involved. I think if we can get this branch merged and the windows previews to be activated via hover it will be perfect ;-)

Thank you all!

Mike

franglais125 commented 7 years ago

@jonnjonzzn

You simply need to check the "Show on all monitors." check box :)

screenshot from 2016-11-30 12 32 53

jonnjonzzn commented 7 years ago

Yeah, that was my fault. You have to be smart enough to grab the correct branch ;-)

So far works well. As @luisfpg mentioned above some of Ubuntu's per-monitor Unity magic would be icing on the cake.

Regardless, thank you. Great work.

Mike

jonnjonzzn commented 7 years ago

A few days on continuous use at work (3 monitors) and no problems I've noticed.

+1

Merge it.

franglais125 commented 7 years ago

@jonnjonzzn thanks for the feedback!

I guess the "icing on the cake" you are referring to is to have some kind of indicator to know on which monitor the app is running? I don't think I'll implement something like this in the short term, but once (and if) this is merged, I can have a look at it.

MarcoPeraza commented 7 years ago

I'm testing @franglais125's modifications on Fedora 25 and it's working beautifully. It works after disconnecting and reconnecting the external display. I'm using intelligent autohide and they both behave independently as you'd expect. Looks good!

jonnjonzzn commented 7 years ago

@franglais125 I was potentially thinking the dot(s) below or background of running applications could be a different color for apps running on the current monitor. Certainly not very important and perhaps not even a good idea with the overhead to the code. Just a thought.

Again, thank you for all your work on this. It is very much appreciated.