awesomeWM / awesome

awesome window manager
https://awesomewm.org/
GNU General Public License v2.0
6.21k stars 593 forks source link

Can't set notification borders with `theme.notification_border_width` and `theme.notification_border_color` #3786

Open lyh970817 opened 1 year ago

lyh970817 commented 1 year ago

Output of awesome --version:

awesome v4.3-1588-gb54e50ad6 (Too long) • Compiled against Lua 5.4.4 (running with 0.9.2) • API level: 4 • D-Bus support: yes • xcb-errors support: no • execinfo support: yes • xcb-randr version: 1.6 • LGI version: /usr/share/lua/5.4/lgi/version.lua • Transparency enabled: yes • Custom search paths: no

How to reproduce the issue:

Copy the default theme.lua in /usr/share/awesome/defaults to ~/.config/awesome, and add the following lines after -- Variables set for theming notifications::

theme.notification_border_width = 6
theme.notification_border_color = "#000000"

Modify the beautiful.init(...) line in rc.lua to beautiful.init("~/.config/awesome/theme.lua").

Run notify-send "test" in terminal.

Actual result:

No border appears for the notification window.

Expected result:

The notification window would have a black border.

raven2cz commented 1 year ago

I configured these properties for notifications which works by spec:

https://github.com/awesomeWM/awesome/blob/master/lib/naughty/notification.lua#L668

Example in theme.lua.

  --------------------------
  -- NAUGHTY CONFIGURATION
  --------------------------
  naughty.config.defaults.ontop = true
  naughty.config.defaults.icon_size = dpi(32)
  naughty.config.defaults.timeout = 10
  naughty.config.defaults.hover_timeout = 300
  naughty.config.defaults.title = 'System Notification Title'
  naughty.config.defaults.margin = dpi(16)
  naughty.config.defaults.border_width = 0
  naughty.config.defaults.position = 'top_middle'
  naughty.config.defaults.shape = function(cr, w, h)
    gears.shape.rounded_rect(cr, w, h, dpi(6))
  end
lyh970817 commented 1 year ago

Thank you so much for responding! This appears to make margin work which originally also wouldn't work (but I didn't mention it), but border_width doesn't seem to work still - evident in no border seen after setting in theme.lua:

naughty.config.defaults.border_width = 5
naughty.config.defaults.border_color = "#000000"
raven2cz commented 1 year ago

I tested this settings now

  --------------------------
  -- NAUGHTY CONFIGURATION
  --------------------------
  naughty.config.defaults.ontop = true
  naughty.config.defaults.icon_size = dpi(32)
  naughty.config.defaults.timeout = 10
  naughty.config.defaults.hover_timeout = 300
  naughty.config.defaults.title = 'System Notification Title'
  naughty.config.defaults.margin = dpi(16)
  naughty.config.defaults.border_width = 20
  naughty.config.defaults.border_color = "#111eee"
  naughty.config.defaults.position = 'top_middle'
  naughty.config.defaults.shape = function(cr, w, h)
    gears.shape.rounded_rect(cr, w, h, dpi(6))
  end

and this is a result. notification-test

lyh970817 commented 1 year ago

2023-03-21-1679331965 This is what it looks like for me. It appears to have an effect of increasing the gap between the notification window and the border of my screen.

raven2cz commented 1 year ago

@lyh970817 please provide link to your full awesome dotfiles. It has to be something else in different place.