Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving Notification pop-up on Cinnamon desktop #4892

Closed
dirent1 opened this issue Nov 29, 2015 · 46 comments
Closed

Moving Notification pop-up on Cinnamon desktop #4892

dirent1 opened this issue Nov 29, 2015 · 46 comments

Comments

@dirent1
Copy link

dirent1 commented Nov 29, 2015

Hello,
Greetings from Turkey.
As I know, users can change notifications pop-up position in MATE but we can't in Cinnamon.
It always shows at the top-right corner but I would like to see at right-bottom area, over on clock, sound applets for example. Many of users want to change the place too.
In previously versions of Cinnamon's, users can change this situation via to modify Cinnamon.css but in 17.2 we can't even modify.
If you give some permissions to modify Cinnamon.css it would be great for us.
If you add an option to user interface of Notification Settings can change it like in MATE, it would be greater than.

Thanks in advance.
Best Regards,
dirent

@kelebek333
Copy link

+1

@geckolinux
Copy link

+1

@JosephMcc
Copy link
Contributor

You guys do realize that people who follow github get an email for every reply? Please stop with all the +1's if you have nothing useful to add.

@ademcal
Copy link

ademcal commented Nov 30, 2015

greating idea 👍

@dirent1
Copy link
Author

dirent1 commented Nov 30, 2015

@JosephMcc
Hi,
The guys who've wrote "+1" as a comment, just want to support this request and also want to call somebody's attention.
Helping to the guys to describe this issue, it should be better if you add two buttons with counters (such as "Like" and "Dislike" or "Me too" or "No need" buttons) on top of or bottom of Feature Requests.
Because I think the users want to be attend and manifest themselves when they see a needed request.

Thanks and regards,
dirent

@ManIVIctorious
Copy link

@dirent1 the missing of like buttons is obviously a github issue.

@JosephMcc i know it is quite annoying, but i personally use the plus ones to keep track of the issues i am interested in in cases everything has already been said

@JosephMcc
Copy link
Contributor

My comment was mostly made because someone was jumping around adding +1's to feature requests. This is something users obviously like the idea of so I'm not sure anyone needs to get multiple emails a day to let them know ;)

@dirent1
Copy link
Author

dirent1 commented Nov 30, 2015

@JosephMcc
I see the Unsubscribe button right side on the page. If the user doesn't want to inform about the topic anymore, can click that button easily.
Anyway
Again, we want can change the notification pop-up's area in Cinnamon 👍

@crobarcro
Copy link

I just want to add I would like to see this too. By default popups cover window controls and other important parts of the screen. An option to choose a window corner would be nice. Personally I just wish they were bottom left or right corner.

@piotrekkr
Copy link

If you want to move notification pop-up vertically, temporary solution would be changing /usr/share/cinnamon/js/ui/messageTray.js like in my comment #5130 . It will work until next cinnamon update.

@geckolinux
Copy link

Thanks very much @piotrekkr for the useful workaround. The notification covering my window controls and Firefox tabs was driving me crazy.

@two-dogs
Copy link

Thanks very much @piotrekkr, worked for me too, kudos

@JosephMcc JosephMcc changed the title [Feature Request] Moving Notification pop-up on Cinnamon desktop Moving Notification pop-up on Cinnamon desktop Mar 23, 2016
@argamanza
Copy link

It's a must have feature i think, hope it will be implemented ASAP.

@geckolinux
Copy link

@piotrekkr Hmm, the hack doesn't seem to work anymore on Cinnamon 3.0.

@piotrekkr
Copy link

@geckolinux I'm waiting for Linux Mint 18, there should be cinnamon 3.0 included, I think. Meanwhile I'll find some live cd with cinnamon 3.0 and try to move notification there. I'll let you know if I succeed.

@geckolinux
Copy link

@piotrekkr Thanks, much appreciated! I'll have a live CD of openSUSE with Cinnamon 3.0 out in the next few days. I'll give you the link ASAP.

@piotrekkr
Copy link

@geckolinux I tried installing cinnamon 3.0 in when using Ubuntu 16.04 live cd but failed due to unresolved dependencies. Now I'm trying arch linux variant named Antergos. I read somewhere that there is cinnamon installed already. Maybe it will work.

I just viewed cinnamon code on github and it seems that messageTray.js file hasn't changed since January 9. Can you change line 1829 to this:

let newY = monitor.y + height + 50; // additional 50 px from top

restart cinnamon and check if it is working? Basically do same thing like in #5130 (comment)

@geckolinux
Copy link

geckolinux commented May 10, 2016

change line 1829 to this:
let newY = monitor.y + height + 50; // additional 50 px from top

Thanks very much! That did the trick.

@goetzc
Copy link

goetzc commented Jul 28, 2016

As I don't have a top panel, only on the bottom, this trick doesn't work for me, but with a small tweak it does. In the same file messageTray.js and same function _onNotificationExpanded, change:

false to true in let panel = Main.panelManager.getPanel(0, false)
so that the bottom panel size is considered, and

let newY = monitor.y + height;
to
let newY = monitor.y + 768 - 60 - height;

replacing 768 with you vertical resolution.[1] You may have to adjust the 60 value, it work great for me. Then restart Cinnamon, in Run dialog type r, or Ctrl+Alt+Esc.

[1] You can find it under Settings -> Display or xrandr | grep '*' | awk '{print $1}'


The downside of editing those files, is that the will be overwritten on the next update. I don't know if an extension could be made to solve this, maybe the Cinnamon JS API already enables this.

Having the possibility to move the notification bubble in an more user-friendly way would be very useful in those cases where it hides some window elements or if the panel is on the bottom, as it seems to be better down there.

@piotrekkr
Copy link

piotrekkr commented Jul 28, 2016

@goetzc I don't quite get why you did calculate like that. I have also only bottom panel and adding 50 to newY works just fine. Notification popup does not cover my window controlls. Im using cinnamon 3.0 at the moment.
notifications

@goetzc
Copy link

goetzc commented Jul 28, 2016

@piotrekkr because I want the notification on the bottom :)

Now I realize that I forgot to mention that I also changed false to true in:
let panel = Main.panelManager.getPanel(0, false)
So the bottom panel size is also included in the new notification position calculation.

@piotrekkr
Copy link

piotrekkr commented Jul 28, 2016

Yeah but there can be a problem when there is multi line notification since it will probably be over bottom panel.

Try this in console:

notify-send "test" "test\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest"

To overcome this you can do something simplier. You need to get screen height, notification height and substract them. Also substract some more pixels to make some margin between bottom panel and notification:

let newY = monitor.height - this._notificationBin.height - 50; 

Try it, it worked for me:

notification
notification

@goetzc
Copy link

goetzc commented Jul 28, 2016

@piotrekkr oh you are right, and this is much better now!

EDIT:
With themes that change the panels height (and if the settings allow it), including the panel's height might help (also changing the getPanel() false to true).
let newY = monitor.height - this._notificationBin.height - height - 15;

And what about monitor.y, in my setup it is 0, why is if used for?

@Odyseus
Copy link
Contributor

Odyseus commented Sep 10, 2016

Hello, everybody.

I already added my thumbs up to this feature request with the hope to see the notifications popup position be allowed to be changed from Cinnamon settings.

In the meantime, and thanks to the exchange between @goetzc and @piotrekkr on this issue, I managed to position the notifications popup at the bottom right of the screen. Next I will describe the exact changes that I made.

I opened as root the file /usr/share/cinnamon/js/ui/messageTray.js, located the _onNotificationExpanded method and edited it as follows:

Disclaimer!!!
Do the maths. The messageTray.js file is a system file that has to be edited as root. If you are not aware of the risks, stay away from this file.
These changes will be overwritten every time Cinnamon updates.

Cinnamon 3.0.7 stable specific

Change this line...

let panel = Main.panelManager.getPanel(0, false);

...like this...

let panel = Main.panelManager.getPanel(0, true);

Cinnamon 3.0.7 nightly specific (installed from this repository)

Change this line...

let panel = Main.panelManager.getPanel(0, 0);

...like this...

let panel = Main.panelManager.getPanel(0, 1);

Cinnamon stable and nightly alike

Change this line...

let newY = monitor.y + height;

...like this...

let newY = monitor.height - this._notificationBin.height - height - 10;

At this point, if the file is saved and Cinnamon is restarted, notifications will start to show up at the bottom right of the screen but with a little drawback. The notification will still be animated from the top of the screen to its final position at the bottom. And will travel all the way back from the bottom of the screen to the top when the notification is hidden.

The only way that I found to avoid all this dancing around of the notification popup is as follows:
Change this line (for Cinnamon stable and nightly alike), near the beginning of the file...

const ANIMATION_TIME = .2;

...like this...

const ANIMATION_TIME = .001;

This change will make the notification popup to show up without animation. Do not try to set it to 0 (zero) because it will break the notifications.

@kelebek333
Copy link

You can easily change Cinnamon's notification position with following Cinnamon Tweaks extention.

https://cinnamon-spices.linuxmint.com/extensions/view/41

@geckolinux
Copy link

@kelebek333 Hey, nice find! Thanks very much, works great.

@two-dogs
Copy link

i would suggest the instructions indicate positioning described relative to location on display regardless of panel location, i keep the panel (any desktop) on top, so distance from panel may not be distance from display 'top' or 'botton' :)

@piotrekkr
Copy link

@kelebek333 Is this extension available in System Settings => Applets? I have Mint 18 and just refreshed applet list but can't find it there.

@piotrekkr
Copy link

piotrekkr commented Oct 10, 2016

Ok at last I found how to install it manually. Download it and decompress it in ~/.local/share/cinnamon/applets.

//EDIT

Was this really tested because I have big red ! beside this applet and after clicking "Add to panel" I get errors from glass.log:

info t=2016-10-10T06:18:31.933Z Cinnamon.AppSystem.get_default() started in 132 ms
info t=2016-10-10T06:18:31.936Z loading user theme: /usr/share/themes/Mint-Y-Dark/cinnamon/cinnamon.css
info t=2016-10-10T06:18:31.948Z added icon directory: /usr/share/themes/Mint-Y-Dark/cinnamon
info t=2016-10-10T06:18:31.992Z PlacesManager: Updating devices
info t=2016-10-10T06:18:32.003Z loaded at Mon Oct 10 2016 08:18:32 GMT+0200 (CEST)
info t=2016-10-10T06:18:32.008Z Loaded applet show-desktop@cinnamon.org in 3 ms
info t=2016-10-10T06:18:32.052Z Role locked: panellauncher
info t=2016-10-10T06:18:32.052Z Loaded applet panel-launchers@cinnamon.org in 43 ms
info t=2016-10-10T06:18:32.058Z Loaded applet window-list@cinnamon.org in 5 ms
info t=2016-10-10T06:18:32.302Z Loaded applet menu@cinnamon.org in 243 ms
info t=2016-10-10T06:18:32.307Z Role locked: notifications
info t=2016-10-10T06:18:32.309Z Loaded applet notifications@cinnamon.org in 6 ms
info t=2016-10-10T06:18:32.314Z Loaded applet systray@cinnamon.org in 4 ms
info t=2016-10-10T06:18:32.319Z Loaded applet removable-drives@cinnamon.org in 4 ms
info t=2016-10-10T06:18:32.344Z Loaded applet keyboard@cinnamon.org in 24 ms
info t=2016-10-10T06:18:32.359Z Loaded applet user@cinnamon.org in 14 ms
info t=2016-10-10T06:18:32.397Z Loaded applet network@cinnamon.org in 37 ms
info t=2016-10-10T06:18:32.427Z Loaded applet sound@cinnamon.org in 29 ms
info t=2016-10-10T06:18:32.437Z Loaded applet calendar@cinnamon.org in 9 ms
info t=2016-10-10T06:18:32.442Z Loaded applet windows-quick-list@cinnamon.org in 4 ms
info t=2016-10-10T06:18:32.442Z AppletManager.init() started in 438 ms
info t=2016-10-10T06:18:32.444Z Cinnamon took 657 ms to start
info t=2016-10-10T06:18:32.828Z Hiding systray: network
info t=2016-10-10T06:19:32.668Z Adding systray: mintupdate.py (24x24px)
info t=2016-10-10T06:19:49.719Z Adding systray: kadu (24x24px)
error t=2016-10-10T06:42:25.332Z [Applet "0dyseus@CinnamonTweaks"]: File not found: /home/piotrek/.local/share/cinnamon/applets/0dyseus@CinnamonTweaks/applet.js
error t=2016-10-10T06:42:25.333Z Could not load applet 0dyseus@CinnamonTweaks
info t=2016-10-10T06:42:25.336Z Adding systray: kadu (24x24px)
info t=2016-10-10T06:42:25.336Z Hiding systray: network
info t=2016-10-10T06:42:25.337Z Adding systray: mintupdate.py (24x24px)
info t=2016-10-10T06:42:25.353Z Adding systray: kadu (24x24px)
info t=2016-10-10T06:42:25.354Z Hiding systray: network
info t=2016-10-10T06:42:25.356Z Adding systray: mintupdate.py (24x24px)
error t=2016-10-10T06:44:45.053Z [Applet "0dyseus@CinnamonTweaks"]: File not found: /home/piotrek/.local/share/cinnamon/applets/0dyseus@CinnamonTweaks/applet.js
error t=2016-10-10T06:44:45.053Z Could not load applet 0dyseus@CinnamonTweaks
info t=2016-10-10T06:44:45.062Z Adding systray: kadu (24x24px)
info t=2016-10-10T06:44:45.063Z Hiding systray: network
info t=2016-10-10T06:44:45.064Z Adding systray: mintupdate.py (24x24px)
info t=2016-10-10T06:44:45.067Z Adding systray: kadu (24x24px)
info t=2016-10-10T06:44:45.067Z Hiding systray: network
info t=2016-10-10T06:44:45.068Z Adding systray: mintupdate.py (24x24px)

Seems like applet.js is missing. I have cinnamon 3.0.7.

@JosephMcc
Copy link
Contributor

JosephMcc commented Oct 10, 2016

Was this really tested because I have big red ! beside this applet and after clicking "Add to panel" I get errors from glass.log:

@piotrekkr You need to read more carefully. This is your fault and not the fault of the developer. It isn't an applet. It's an extension. You can download it and install it from Cinnamon Settings->Extensions. Remove the one you copied to the applets folder.

@piotrekkr
Copy link

@JosephMcc Ok, I thought that extension is same as applet just different name, my fault.

@JosephMcc
Copy link
Contributor

JosephMcc commented Oct 10, 2016

There are 3 different types of xlets in Cinnamon (4 if you count themes). Applets, desklets, and extensions. Each has their own page in Cinnamon settings. Of the 3, extensions are the most likely to break when a new version of Cinnamon is released. Unlike an applet or desklet, an extension actually patches new code into Cinnamon's javascript code. Because of that extensions are capable of doing more than an applet or desklet but are much more susceptible to breakage if the code around them changes between versions.

@MegaV0lt
Copy link

MegaV0lt commented May 9, 2017

Thanks for the hint with cinnamon tweaks. Finally was easy to move the notification to the bottom.

Would be nice to have that as an option without having install extra software.

@Slater91
Copy link

The tweaks presented here seem to no longer be effective. Cinnamon Tweaks has also been removed for unknown reasons, so there currently seems no way to move notifications - a fact that, together with the lack of a "close" button and a few other quirks, is making me think of moving away from this desktop environment which is rapidly falling behind in usability.

@ghost
Copy link

ghost commented Sep 21, 2017

@JosephMcc this feature seems like something to be added into cinnamon's core to prevent such issues. The settings for this feature can be easily added to the Notifications section in cinnamon settings, and a simple algorithm to take into consideration the total size of each notification, on the fly to prevent multiline ones cutting through panels or screen edges, could be implemented without too much resource usage. Right now, firefox is unusable if I'm in a lively chat because the constant notifications block the tabs on the right side, with my panel at the top of the screen

@panaak
Copy link

panaak commented Nov 12, 2017

i tried to move the notification down a bit in messageTray.js, but it didn't work until i removed this condion:

        // let newY = monitor.y + height;
        let newY = monitor.y + height + 50;


        // if (this._notificationBin.y < expandedY)
        //     this._notificationBin.y = expandedY;
        // else if (this._notification.actor.y != expandedY)
        //     this._tween(this._notificationBin, '_notificationState', State.SHOWN,
        //                 { y: newY,
        //                   time: ANIMATION_TIME,
        //                   transition: 'easeOutQuad'
        //                 });


        this._tween(this._notificationBin, '_notificationState', State.SHOWN,
                    { y: newY,
                      time: ANIMATION_TIME,
                      transition: 'easeOutQuad'
                    });

https://github.com/panaak/Cinnamon/blob/ce234ad226669af3fb66e10ef5b4e794ca95a493/js/ui/messageTray.js#L1861

i don't quite understand why.. didn't dig into the code that much..
i guess there would be some side effects after this change, i will have to wait and see..

@MegaV0lt
Copy link

MegaV0lt commented Nov 12, 2017

After two years a still no feature in cinnamon. Even the cinnamon tweaks is deleted. What a shame

@nikhilw
Copy link

nikhilw commented Nov 29, 2017

Still nothing?
And what happened to CinnamonTweaks @Odyseus ? After upgrade to 18.3 it just stopped working, so I checked and seems it is gone!

@MegaV0lt
Copy link

Same here. After upgarde to 18.3 cinnmon tweaks does not work anymore

@linuxmint linuxmint locked and limited conversation to collaborators Nov 29, 2017
@linuxmint linuxmint unlocked this conversation Nov 29, 2017
@Slater91
Copy link

@nikhilw it's only been two years for such a basic feature. Don't be so hasty!
Meanwhile I switched over to KDE and I finally find myself at home. I think Cinnamon will lose users if it does fix some of its most basic and/or serious issues.

@chrispoket99
Copy link

Hi, for version 18.3:

sudo vim /usr/share/cinnamon/js/ui/messageTray.js

function: _showNotification, forward of the line:1674

change: let topGap = 5;
to: let topGap = 300;

and tweak topGap value to your preferences

reset cinnamon with alt+F2 and enter r

@panaak
Copy link

panaak commented Dec 7, 2017

@chrispoket99 solution works for me.

@Z-42PO
Copy link

Z-42PO commented Dec 13, 2017

@chrispoket99 I recommand to start from the bottom, like this :
line:1698
change: this._notificationBin.y = monitor.y + topGap * 2;
to: this._notificationBin.y = monitor.height - this._notification._table.height - topGap * 2;

in one command to edit the file :
sudo sed -i 's/this\._notificationBin\.y = monitor\.y + topGap \* 2;/this\._notificationBin\.y = monitor\.height - this\._notification\._table\.height - topGap \* 2;/g' /usr/share/cinnamon/js/ui/messageTray.js

@chilliger
Copy link

chilliger commented Dec 16, 2017

@Z-42PO cuts the notifications for me, does not consider the bottom panel

@MegaV0lt
Copy link

How can i activate cinnamion 3.8 branch? It the commit working?
#7111

@Qqwy
Copy link

Qqwy commented Feb 25, 2018

While the PR is not live yet, you can already use it by following the instructions outlined by @jaszhix here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests