-
Notifications
You must be signed in to change notification settings - Fork 342
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
Dunst cannot be configured through command line arguments #940
Comments
What's your use case? |
I just saw this issue and I'd like to express the same feelings towards the new release. Most of the things seems to be changed: my old config is not working as expected anymore and I guess I have to do things like "startup notification" and "shortcuts" manually now. It *almost* feels like a |
I have a script to get the colors from xresources and use them to configure dunst. |
Also removing [shortcuts] is retarded as hell, I agree. |
I also noticed [shortcuts] is not working as intended. Is there any way to keybind |
Why would you want startup notifications except for debugging? Anyways, you can keep using it with
Luckily this problem is already solved by https://github.com/dunst-project/dunst/blob/master/contrib/dunst_xr_theme_changer.sh. Just run the script and change your config location to ~/.config/dusnt/dunstrc_xr_colors. As always, every time you change the config, you need to restart dunst. |
Why not just bring these options back instead 🤯 🤯 🤯 |
Please bring back shortcuts and command line arguments |
For clarity, these settings weren't exactly removed, instead they weren't re-implemented after the settings refactor (#803). This was because these things weren't deemed important enough, since they have other similar alternatives. As for the shortcuts section, I haven't heard good reasons to bring it back. There are lots of ways to add shortcuts and we don't need yet another one. On top of that, it's not possible for programs in wayland to add global shortcuts themselves, making it a X11 only feature. Just use your WM's way of defining shortcuts or use something like As for the command line arguments, the deprecation notice has existed for a long time (#328), at least regarding section-specific command line arguments. Unfortunately, due to bad timing by me, the best proposed alternative hasn't been merged yet, but is on it's way. This will come in the form of drop-in config files (#933). This will allow you to generate a simple dunst drop-in file that contains only the x resources colours, while keeping the rest of your config non-generated. I hope this alternative is sufficient, but otherwise let me know why it's not. |
@fwsmit would be good to mention this in the README, don't you think? I can make a PR. |
True. A PR would be appreciated :) |
For clarity, I'm considering re-adding the command line options in a slightly different from. They would be with double dashes ( |
For the record, this is a script I was using to change dunst colors based on the pywal theme. This isn't working anymore: #!/bin/sh
# source wal colors.
source ~/.cache/wal/colors.sh
pkill --exact dunst
dunst \
-config=~/.config/dunst/dunstrc \
-frame_width 1 \
-lb $color0 \
-lf $color7 \
-lfr $color3 \
-cb $color0 \
-cf $color7 \
-cfr $color3 \
-nb $color0 \
-nf $color7 \
-nfr $color3 & |
Would like to know what is a workaround for this, since it stopped working. |
@aleksfadini my understanding is that there is no workaround. @fwsmit your feedback on this would be appreciated. I've created a script to manually change contents of the #!/bin/sh
# source wal colors.
source ~/.cache/wal/colors.sh
DUNST_FILE=~/.config/dunst/dunstrc
# update dunst based on pywal colors.
sed -i '/background = /s/.*/background = "'$color0'"/' $DUNST_FILE
sed -i '/foreground = /s/.*/foreground = "'$color7'"/' $DUNST_FILE
sed -i '/frame_color = /s/.*/frame_color = "'$color3'"/' $DUNST_FILE Is there a way to do this in a more elegant way? The above feels like a dirty hack. |
You're almost at the workaround I think is best. Instead of overwriting the existing dunstrc, you should generate one based on a template. Then you should start Dunst with the generated config. |
@marcelofern thank you for posting that. could you reply (or edit/add to the post) with a link to your dunstrc for clarity? For some reason I'm having trouble with colors since command line options were removed. |
It seems a hell of a downgrade to rely on an external script for a functionality that was already implemented on dunst itself. Using a close-looking hack way as well for now, two commands actually:
[global]
font = ${font}
width = ${width}
height = ${height}
offset = ${x}x${y}
separator_height = ${separator_height}
padding = ${padding}
horizontal_padding = ${horizontal_padding}
frame_width = ${frame_width}
max_icon_size = ${max_icon_size}
[urgency_low]
background = "${low_background}"
foreground = "${low_foreground}"
frame_color = "${low_frame_color}"
[urgency_normal]
background = "${normal_background}"
foreground = "${normal_foreground}"
frame_color = "${normal_frame_color}"
[urgency_critical]
background = "${critical_background}"
foreground = "${critical_foreground}"
frame_color = "${critical_frame_color}"
dunst.font : Noto Sans CJK JP 10
dunst.geometry.width : 300
dunst.geometry.height : 80
dunst.geometry.x : 45
dunst.geometry.y : 60
dunst.separator_height : 2
dunst.padding : 10
dunst.horizontal_padding : 10
dunst.max_icon_size : 64
dunst.frame_width : 2
dunst.critical.background : #13171aAA
dunst.critical.foreground : #fe2d3b
dunst.critical.frame_colour : #141e24
dunst.normal.background : #13171aAA
dunst.normal.foreground : #ffffff
dunst.normal.frame_colour : #000000
dunst.low.background : #000000AA
dunst.low.foreground : #A8A8A8
dunst.low.frame_colour : #111111
kill -9 $(pidof dunst)
export \
font="$(xgetres dunst.font)" \
width="$(xgetres dunst.geometry.width)" \
height="$(xgetres dunst.geometry.height)" \
x="$(xgetres dunst.geometry.x)" \
y="$(xgetres dunst.geometry.y)" \
separator_height="$(xgetres dunst.separator_height)" \
padding="$(xgetres dunst.padding)" \
horizontal_padding="$(xgetres dunst.horizontal_padding)" \
max_icon_size="$(xgetres dunst.max_icon_size)" \
frame_width="$(xgetres dunst.frame_width)" \
low_background="$(xgetres dunst.low.background)" \
low_foreground="$(xgetres dunst.low.foreground)" \
low_frame_color="$(xgetres dunst.low.frame_colour)" \
normal_background="$(xgetres dunst.normal.background)" \
normal_foreground="$(xgetres dunst.normal.foreground)" \
normal_frame_color="$(xgetres dunst.normal.frame_colour)" \
critical_background="$(xgetres dunst.critical.background)" \
critical_foreground="$(xgetres dunst.critical.foreground)" \
critical_frame_color="$(xgetres dunst.critical.frame_colour)"
envsubst < "$HOME/.config/dunst/template_dunstrc" > "$HOME/.config/dunst/dunstrc"
dunst -s -follow keyboard & disown I'll stick with this probably since it's easier to switch themes with it. |
@BeyondMagic thank you for explaining this. We still can't understand why such a function was removed. |
just throwing my hat in the ring. broke today on me and has the ugly midnight default colors. |
Drop-in files have been implemented in #997, so this should solve the underlying issue of needing to generate the entire dunstrc. The solutions mentioned above should work without any issues. I'll go ahead and close this issue. |
So there won't be a I don't want another file. As petty as it is, it's just one more thing to copy between machines if I'm setting something new up or changing something. |
There might be some time. If someone wants to submit a PR that'd be great.
I get where you're coming from. It's just not something that bothers me in my setup, as I'm using a dotfiles repo with a dotfiles manager. So it's easy to copy dotfiles around. If you have a different setup it might be easier to use command line arguments. |
Config adapted based on docs: https://github.com/dunst-project/dunst/blob/master/docs/dunst.5.pod And the somewhat controversial original issue : dunst-project/dunst#940 For now just using a hardcoded gruvbox, as making the theme adaptive is a bit cumbersome
I used to do |
You can use |
Why have you removed this, it was one of the most useful functionalities of this program????
The text was updated successfully, but these errors were encountered: