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

Moreoptions #1

Closed
wants to merge 2 commits into from
Closed

Moreoptions #1

wants to merge 2 commits into from

Conversation

budRich
Copy link
Contributor

@budRich budRich commented Sep 19, 2020

commandline options for foreground_color, background_color, border_color, border_pixels and font added.

-f STRING ; font
-c COLOR  ; background_color
-C COLOR  ; foreground_color
-b COLOR  ; border_color
-B INT    ; border_pixels
@budRich budRich mentioned this pull request Sep 19, 2020
@phillbush
Copy link
Owner

I don't know... I like to keep appearance configuration in ~/.Xresources rather than in command-line options.
This kind of appearance configuration is only set once and kept unchanged, rather than being something the user set at each invocation. If it was something that the user changes at each invocation then it would be a good addition for command-line option.

@phillbush phillbush closed this Sep 19, 2020
@budRich
Copy link
Contributor Author

budRich commented Sep 19, 2020

Yeah. I was thinking it could work with -o option.

say you have a default notification layout and style. And want to use -o option . Not being able to have a different geometry for the new notification will result in it being drawn in the same location as any current notifications.

In my experience it is also desirable when creating a notification that the geometry relates to the context. when i delete files in my filemanager, i show a notification that is "anchored" to the NW corner of the filemanager window, the window is also usually quite small so, i like having a smaller font in that notification.

The way I currently do this now, is using dunst. and killing the daemon, create a temporary config file (with geometry dynamically added depending on the window size), load dunst with that config. display notification. kill dunst, restart with default config.

Also, if one would skip any of the command line options added in this PR, it would default to xresources i think?

--

Maybe a compromise could be to only allow these options when -o is used?

@phillbush
Copy link
Owner

The geometry can be set at runtime with -G and -g.

So your use case is that you have a different style (color and font) for each notification context?
I think I can add a option for setting the color in the notification input, like this:

printf 'BG:#C0FFEE\tHello World\n' > /tmp/xnotify.fifo

So you could set the color for each notification individually without having to set all notifications of the same ./xnotify instance to have the same color.

What do you think?
If you prefer to set colors at invocation-time then I can reconsider my decision.

@phillbush
Copy link
Owner

Also, I can add an option to embed a notification into a window, so you can keep the global gravity and geometry (say -G NE) but draw the notification at a window's northeast, not the monitor northeast

@budRich
Copy link
Contributor Author

budRich commented Sep 19, 2020

yeah, having an option for window id (-d) would be awesome. Also BG FG also works, i would also like FONT: though.
scrot
scrot2

@phillbush
Copy link
Owner

phillbush commented Sep 19, 2020

Having dynamic fonts is harder than using dynamic colors, a FONT: would make the code harder to maintain.

@phillbush
Copy link
Owner

I've just added support for setting the color in the notification input.

Now you can run the following command. You can replace BG with FG (for foreground color) or BRD (for border color).

printf 'BG:#C0FFEE\tHello World\n' > /tmp/xnotify.fifo

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

Successfully merging this pull request may close these issues.

2 participants