aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSamuel Fadel <samuel@nihil.ws>2023-02-13 10:45:57 +0100
committerSamuel Fadel <samuel@nihil.ws>2023-02-13 10:45:57 +0100
commit5f3200afd34b1b0ac0a809f3270e1117659957e5 (patch)
tree68b792fd397ec6ac3a039994f35dbdc73289f90e /bin
parente9cc14d5be2090a4272edc45f4c77c84dceb29d8 (diff)
Split functionality of menu-contacts into separate script for CLI0.3
Diffstat (limited to 'bin')
-rwxr-xr-xbin/list-contacts7
-rwxr-xr-xbin/menu-contacts8
2 files changed, 8 insertions, 7 deletions
diff --git a/bin/list-contacts b/bin/list-contacts
new file mode 100755
index 0000000..1492773
--- /dev/null
+++ b/bin/list-contacts
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# Search in contact list built by khard, outputs the search results as
+# NAME <ADDRESS>
+khard email --remove-first-line --parsable $@ \
+ | cut -f 1,2 \
+ | awk -F "\t" '{printf "%s <%s>\n", $2, $1}'
diff --git a/bin/menu-contacts b/bin/menu-contacts
index f2f3454..e16b0c3 100755
--- a/bin/menu-contacts
+++ b/bin/menu-contacts
@@ -1,9 +1,3 @@
#!/bin/sh
-# Search in contact list built by khard using bemenu, outputs the selected
-# option as FirstName LastName <address>
-
-khard email --remove-first-line --parsable \
- | cut -f 1,2 \
- | bemenu -i -s -c -l 20 -W 0.5 -p '@' \
- | awk -F "\t" '{printf "%s <%s>\n", $2, $1}'
+list-contacts | bemenu -i -s -c -l 20 -W 0.5 -p '@'