Package: elpa-discomfort
Severity: wishlist
Tags: patch

Hi,

I found it difficult to distinguish between the locked and unlocked
state of an encrypted device, so have implemented configurable lock
state strings that default to the same glyphs that discomfort was
already using, thus the default behaviour doesn't change.

Please forward this patch upstream.

Thanks.

>From 5ada39c6562dd75235fcc6648dde6691d0f076a3 Mon Sep 17 00:00:00 2001
From: Teemu Hukkanen <[email protected]>
Date: Wed, 5 Aug 2026 14:18:41 +0300
Subject: [PATCH] Implement configurable lock state strings

Setting discomfort-locked-string and discomfort-unlocked-string
changes how the lock state of an encrypted device is displayed.
---
 discomfort.el | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/discomfort.el b/discomfort.el
index d830992..4f63545 100644
--- a/discomfort.el
+++ b/discomfort.el
@@ -50,6 +50,16 @@
   "Face for the mount directory."
   :group 'discomfort)
 
+(defcustom discomfort-locked-string "🔒"
+  "String used to represent locked state."
+  :group 'discomfort
+  :type 'string)
+
+(defcustom discomfort-unlocked-string "🔓"
+  "String used to represent unlocked state."
+  :group 'discomfort
+  :type 'string)
+
 (defconst discomfort-service "org.freedesktop.UDisks2")
 (defconst discomfort-path "/org/freedesktop/UDisks2/Manager")
 (defconst discomfort-interface (concat discomfort-service ".Manager"))
@@ -164,7 +174,8 @@
    ((discomfort--filesystem? obj) (caadr (assoc "IdType" (discomfort--block? obj))))
    ((discomfort--swapspace? obj) "swap")
    ((discomfort--encrypted? obj)
-    (format "%s encrypted" (if (discomfort--unlocked? obj) "🔓" "🔒")))
+    (format "encrypted %s" (if (discomfort--unlocked? obj)
+                               discomfort-unlocked-string discomfort-locked-string)))
    ((discomfort--partition-table? obj) "label")
    ((discomfort--partition? obj) "partition")
    ((discomfort--loop? obj) "loop")
-- 
2.55.0

Reply via email to