From 12cb200ba8ca95d4f619a2a8696877d0c78dec2e Mon Sep 17 00:00:00 2001 From: tiyn Date: Sun, 22 Oct 2023 01:16:03 +0200 Subject: [PATCH] dunst: added dnd mode --- .config/dunst/dunstrc | 13 +++++++++++-- .config/xorg/xprofile | 2 +- .local/bin/tools/dnd_start | 7 +++++++ .local/bin/tools/dnd_stop | 10 ++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100755 .local/bin/tools/dnd_start create mode 100755 .local/bin/tools/dnd_stop diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc index f0f7d1e..e39fd4b 100644 --- a/.config/dunst/dunstrc +++ b/.config/dunst/dunstrc @@ -10,6 +10,7 @@ padding = 10 horizontal_padding = 10 frame_width = 2 + corner_radius = 5 frame_color = "#555555" separator_color = "#555555" @@ -66,10 +67,18 @@ frame_color = "#8c3d45" timeout = 0 -[normal_urgency_sound] +[sound_normal] msg_urgency = "normal" script = ~/.config/dunst/alert_normal.sh -[critical_urgency_sound] +[sound_critical] msg_urgency = "critical" script = ~/.config/dunst/alert_high.sh + +[dnd_normal] + msg_urgency = "normal" + skip_display = true + +[dnd_low] + msg_urgency = "low" + skip_display = true diff --git a/.config/xorg/xprofile b/.config/xorg/xprofile index c957276..6f1951d 100644 --- a/.config/xorg/xprofile +++ b/.config/xorg/xprofile @@ -2,7 +2,7 @@ xset r rate 300 50 & # Speed xrate up unclutter & # Remove mouse when idle -dunst & # dunst for notifications +dunst && dunstctl rule dnd_low disable && dunstctl rule dnd_normal disable & # dunst for notifications redshift & # redshift for saving your eyes $STATUSBAR & # for refreshing the statusbar xcompmgr & # compositor for transparency diff --git a/.local/bin/tools/dnd_start b/.local/bin/tools/dnd_start new file mode 100755 index 0000000..e9b218c --- /dev/null +++ b/.local/bin/tools/dnd_start @@ -0,0 +1,7 @@ +#!/bin/sh + +notify-send -u low "dunst" "Do not disturb started" +dunstctl history-clear +dunstctl rule dnd_low enable +dunstctl rule dnd_normal enable +dunstctl rule sound_normal disable diff --git a/.local/bin/tools/dnd_stop b/.local/bin/tools/dnd_stop new file mode 100755 index 0000000..e14b6b6 --- /dev/null +++ b/.local/bin/tools/dnd_stop @@ -0,0 +1,10 @@ +#!/bin/sh + +dunstctl rule dnd_low disable +dunstctl rule dnd_normal disable +dunstctl rule sound_normal enable +hist_size=$(dunstctl history | jq '.data[0] | length') +for i in `seq $hist_size`; do + dunstctl history-pop +done +notify-send -u low "dunst" "Do not disturb stopped"