aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-10-05 16:46:13 +0530
committerAkshay Nair <phenax5@gmail.com>2025-10-05 17:05:22 +0530
commit845b96c9a7f6d80f2042ef5d334fd6842d617f27 (patch)
tree5c5f95acc25adcd400c7f1a658f571d70a6c365b
parent332fed0c0936a48b5cb68ebd7b2dc4d96003008e (diff)
downloaddaffm-845b96c9a7f6d80f2042ef5d334fd6842d617f27.tar.gz
daffm-845b96c9a7f6d80f2042ef5d334fd6842d617f27.zip
Add stripping quotes for toml keys
Diffstat (limited to '')
-rw-r--r--config.toml2
-rw-r--r--lib/Daffm/Configuration.hs3
-rw-r--r--notes.org2
3 files changed, 4 insertions, 3 deletions
diff --git a/config.toml b/config.toml
index efeaf3f..2e58799 100644
--- a/config.toml
+++ b/config.toml
@@ -23,4 +23,4 @@ mf = "cmdline-set !touch "
dd = "!rm -rfi %f"
sdd = "!sudo rm -rfi %f"
-pi = "!!clear; chafa -f kitty %"
+"<space>p" = "!!clear; chafa -f kitty %"
diff --git a/lib/Daffm/Configuration.hs b/lib/Daffm/Configuration.hs
index cc4749d..afcca08 100644
--- a/lib/Daffm/Configuration.hs
+++ b/lib/Daffm/Configuration.hs
@@ -37,5 +37,6 @@ keymapCodec = Toml.dimap (const Map.empty) toKeymap . keymapRawCodec
where
keymapRawCodec = Toml.tableMap Toml._KeyText Toml.text
toKeymap = Map.fromList . map (bimap toKeys toCmd) . Map.toList
- toKeys = fromMaybe [] . parseKeySequence
+ toKeys = fromMaybe [] . parseKeySequence . stripQuotes
toCmd = fromMaybe CmdNoop . parseCommand
+ stripQuotes txt = fromMaybe txt (Text.stripPrefix "\"" txt >>= Text.stripSuffix "\"")
diff --git a/notes.org b/notes.org
index 2f529ef..cf690d1 100644
--- a/notes.org
+++ b/notes.org
@@ -17,7 +17,7 @@
- [X] Error handling
- [X] Expand ~ to home in internal commands (cd)
- [X] Show current pending keys in statusline
-- [ ] Opener configuration
+- [X] Opener configuration
- [ ] Cmdline history
- [ ] Cli arg parsing (dir arg)
** Right after