From 84f6cb36c0cb5d2389cd666237559d6562e02a75 Mon Sep 17 00:00:00 2001 From: Marcel Robitaille Date: Tue, 6 Apr 2021 10:45:47 -0400 Subject: [PATCH] [dunst] Fix contact filenames Slugify special characters --- config.yaml | 2 ++ dotdrop_filters.py | 5 +++++ dunst/dunstrc | 6 +++--- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 dotdrop_filters.py diff --git a/config.yaml b/config.yaml index 74a7838..073cd80 100644 --- a/config.yaml +++ b/config.yaml @@ -13,6 +13,8 @@ config: minversion: 0.29.4 instignore: - '*/__pycache__/*' + filter_file: + - ./dotdrop_filters.py actions: pre: diff --git a/dotdrop_filters.py b/dotdrop_filters.py new file mode 100644 index 0000000..d4b1752 --- /dev/null +++ b/dotdrop_filters.py @@ -0,0 +1,5 @@ +import re + + +def slufigy(s): + return re.sub(r'[^a-zA-Z\.]', '', s) diff --git a/dunst/dunstrc b/dunst/dunstrc index e7504c4..230236f 100644 --- a/dunst/dunstrc +++ b/dunst/dunstrc @@ -232,11 +232,11 @@ {%@@ for contact in contacts.split('\n') @@%} [{{@@ contact @@}}] summary="{{@@ contact @@}}" - new_icon="{{@@ contact @@}}" + new_icon="{{@@ contact | slufigy @@}}" [{{@@ contact @@}}-video-call] summary="WhatsApp video call from {{@@ contact @@}}" - new_icon="{{@@ contact @@}}" + new_icon="{{@@ contact | slufigy @@}}" [{{@@ contact @@}}-voice-call] summary="WhatsApp video call from {{@@ contact @@}}" - new_icon="{{@@ contact @@}}" + new_icon="{{@@ contact | slufigy @@}}" {%@@ endfor @@%}