awesome icon indicating copy to clipboard operation
awesome copied to clipboard

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

Open lyh970817 opened this issue 1 year ago • 5 comments

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.

lyh970817 avatar Mar 13 '23 16:03 lyh970817

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

raven2cz avatar Mar 17 '23 11:03 raven2cz

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"

lyh970817 avatar Mar 17 '23 19:03 lyh970817

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

raven2cz avatar Mar 17 '23 19:03 raven2cz

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.

lyh970817 avatar Mar 20 '23 17:03 lyh970817

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

raven2cz avatar Apr 04 '23 05:04 raven2cz