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

Feature request: To be able to align the text at the corners strictly without any empty space. #1344

Open
alibasel opened this issue Apr 23, 2024 · 9 comments

Comments

@alibasel
Copy link

alibasel commented Apr 23, 2024

It would be really very beneficial if dunst can put the OSD text (-r N) strictly aligned at the corner without using the box.

I am trying to use dunst as an OSD gui information presenter for media playing under Sway and I need to use the screen as effective as much possible.

@bynect
Copy link
Member

bynect commented Apr 23, 2024

I am not sure I understand what do you mean. You can set the padding to zero to let the text be right next to the borders

@bynect
Copy link
Member

bynect commented Apr 23, 2024

If you want to use the whole screen with the notification you could do something like

[global]
	width = 2560
	height = 1440
	origin = top-left
	offset = 0x0
	padding = 0
	frame_width = 0
	scale = 1

I tested it with
notify-send ciao2 "$(yes "HelloWorld" | head -n 120)" -r 1

@alibasel
Copy link
Author

I checked it again. The left and right alignment works well (ps: it is required to use alignment = right/left in the config also).
But when I use origin = top-left or origin = top-right, there is a little empty space on the text, it seems it is present for line spaceing.
And similarly when I use origin = bottom-right, there is again a empt space under the text.
As a work around I had to give negative offset values in the y direction to remove this space: offset = 0x-30
When bigger font sizes are used like 102, the empty space also gets bigger proportionally.
In my usage scenario, I want to show the clock at the bottom-right with a bigger font size constantly, and I need it strictly aligned.
Meanwhile I am going to use other notifications at the same time at left side starting from top (maybe others at other locations).
It seems that I need to use these global text positionning keywords in each of messages.
I tried hints with -h string:origin:bottom-right and pango with span but none of them worked.

@bynect
Copy link
Member

bynect commented Apr 24, 2024

I checked it again. The left and right alignment works well (ps: it is required to use alignment = right/left in the config also). But when I use origin = top-left or origin = top-right, there is a little empty space on the text, it seems it is present for line spaceing. And similarly when I use origin = bottom-right, there is again a empt space under the text. As a work around I had to give negative offset values in the y direction to remove this space: offset = 0x-30 When bigger font sizes are used like 102, the empty space also gets bigger proportionally. In my usage scenario,

Are you using wayland? On xorg an offset of 0x0 should correspond with the screen corner, so it seems like a bug. On wayland if there are status bar or similar we can't go over them.

I want to show the clock at the bottom-right with a bigger font size constantly, and I need it strictly aligned. Meanwhile I am going to use other notifications at the same time at left side starting from top (maybe others at other locations). It seems that I need to use these global text positionning keywords in each of messages. I tried hints with -h string:origin:bottom-right and pango with span but none of them worked.

This is unfortunately not possible right now. At the moment dunst can use only one origin. This issue is tracked by #1018

@alibasel
Copy link
Author

My dunst config's global section:

cat dunstrc | sed -e 's/^[ \t]*//' | grep ^[^#]
[global]
monitor = 0
follow = none
width = 4000
height = 3000
origin = bottom-right
offset = 0x0
scale = 1
notification_limit = 20
progress_bar = false
progress_bar_height = 0
progress_bar_frame_width = 0
progress_bar_min_width = 0
progress_bar_max_width = 0
progress_bar_corner_radius = 0
icon_corner_radius = 0
indicate_hidden = no
transparency = 0
separator_height = 0
padding = 0
horizontal_padding = 0
text_icon_padding = 0
frame_width = 0
frame_color = "#aaaaaa"
gap_size = 0
separator_color = auto
sort = yes
font = "Serif 34"
foreground = "#ff7500"
line_height = 0
markup = full
format = "%b"
alignment = right
vertical_alignment = bottom
show_age_threshold = -1
ellipsize = end
ignore_newline = no
stack_duplicates = true
hide_duplicate_count = false
show_indicators = yes
enable_recursive_icon_lookup = true
icon_theme = "Adwaita"
icon_position = left
min_icon_size = 32
max_icon_size = 128
sticky_history = yes
history_length = 20
dmenu = /usr/bin/dmenu -p dunst:
browser = /usr/bin/xdg-open
always_run_script = true
title = Dunst
class = Dunst
corner_radius = 0
ignore_dbusclose = false
force_xwayland = false
force_xinerama = false
mouse_left_click = none
mouse_middle_click = none
mouse_right_click = none

@alibasel
Copy link
Author

I checked it again. The left and right alignment works well (ps: it is required to use alignment = right/left in the config also). But when I use origin = top-left or origin = top-right, there is a little empty space on the text, it seems it is present for line spaceing. And similarly when I use origin = bottom-right, there is again a empt space under the text. As a work around I had to give negative offset values in the y direction to remove this space: offset = 0x-30 When bigger font sizes are used like 102, the empty space also gets bigger proportionally. In my usage scenario,

Are you using wayland? On xorg an offset of 0x0 should correspond with the screen corner, so it seems like a bug. On wayland if there are status bar or similar we can't go over them.

Yes I use wayland, but it is completely empty screen, without status bar, menu, etc.

I want to show the clock at the bottom-right with a bigger font size constantly, and I need it strictly aligned. Meanwhile I am going to use other notifications at the same time at left side starting from top (maybe others at other locations). It seems that I need to use these global text positionning keywords in each of messages. I tried hints with -h string:origin:bottom-right and pango with span but none of them worked.

This is unfortunately not possible right now. At the moment dunst can use only one origin. This issue is tracked by #1018

@alibasel
Copy link
Author

My sway configuration:

cat config | sed -e 's/^[ \t]*//' | grep ^[^#]
include /etc/sway/definitions
exec swaybg  --color "#000000"
exec /usr/bin/dunst
include /etc/sway/inputs/*
include /etc/sway/outputs/*
include /etc/sway/modes/*

@bynect
Copy link
Member

bynect commented May 1, 2024

On wayland if there are status bar or similar we can't go over them.

is this the case?

@alibasel
Copy link
Author

alibasel commented May 1, 2024

I thought had answered this above; No, this is not the case. I use wayland and it is completely empty screen, without status bar, menu, etc.
And my sway config also is above.

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

2 participants