dunst-project / dunst

Lightweight and customizable notification daemon
https://dunst-project.org
Other
4.64k stars 343 forks source link

[Q] invoke dmenu revers order #1375

Closed biopsin closed 1 week ago

biopsin commented 2 months ago

2024-08-27-195254_3840x2160_scrot

Issue description

Hi, i need to revers the order dmenu outputs open notifications, the order in picture is "dmenu top" = "bottom notification" I would like to align it equal top to bottom?

Installation info

Minimal dunstrc ```ini dmenu = /usr/local/bin/dmenu #####dmenu bin /usr/bin/dmenu -i -l 9 -x 1560 -w 720 -fn "Dejavu Sans:style=Book:pixelsize=16" \ -nb "#FDF6E3" -nf "#555555" -sb "#657B83" -sf "#FFFFFF" ```
bynect commented 2 months ago

could it be that dmenu automatically orders entry by alphabetical order?

biopsin commented 2 months ago

no the dmenu entries are ordered but in reverse order, however I will test with different priority tho. Maybe your right its alphabetical but bottom to top in dmenu. Yes dmenu_output is ordered alphabetical but thats fine as are the notifications (at least locally), so they both align, but one is in a revers order. The first dmenu_line should trigger first/top notification and so on as its intuitive at least to me to match a selected line with a spesific notification, if it makes sense?

bynect commented 2 months ago

I'm looking at this. could it be that you are using a particular notification ordering? or are you using the default one (last arrived at the top)?

also what did you do to open that notification menu? exact command

biopsin commented 2 months ago

Yes default; last is top. Default binary location as in dunstrc but its a symlink to local/bin with extra dmenu config settings, nothing that would order on a custom level. I guess it would also make sense to order/group in a mixed action nonaction condition all action notifications are stacked first/above all nonaction notifications.

bynect commented 2 months ago

what did you do to pop up that menu exactly?

biopsin commented 2 months ago

bind-key 4M-space - "dunstctl context" or is there something else you are thinking of?

bynect commented 2 months ago

just wanted to be sure. I think the problem lies in this function here https://github.com/dunst-project/dunst/blob/d2faa87081329a31726082837d5197199be53f50/src/menu.c#L296

I will try to fix the order in some time

bynect commented 2 weeks ago

Hello, I successfully reproduced this problem and it turns out it was just a linked list being reversed.

biopsin commented 2 weeks ago

@bynect Hi, thank you for looking into it, will test the patch later today both for vertical and horisontal dmenu context.