-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetMail.lib
More file actions
executable file
·50 lines (42 loc) · 1.4 KB
/
getMail.lib
File metadata and controls
executable file
·50 lines (42 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
#
# ############################################################################
# Project: scripts (none)
# File...: getMail.lib
# Created: Tuesday, 2023/04/25 - 20:14:21
# Author.: @fbnmtz, (fabiano.matoz@gmail.com)
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Last Modified: Friday, 2023/05/19 - 00:18:24
# Modified By..: @fbnmtz, (fabiano.matoz@gmail.com)
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Version: 0.0.5.126
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Description:
# >
# ############################################################################
# HISTORY:
#
use utils io
_xLIB_GETMAIL_=true
# create default data directory
xsetHome
# app data file
MAILSTORE="$APP_HOME/mails"
[ ! -f "$MAILSTORE" ] && touch "$MAILSTORE"
# app config file
MAILCONF=$APP_HOME/$APP.cfg
_EDITOR=$(rconfig editor "$MAILCONF")
# get an editor
[ -z "$_EDITOR" ] && _EDITOR=$(getPath vim nano code gedit micro code sublime)
xNew(){
if grep "$1" "$MAILSTORE"; then
echo "mail $1 already saved"; exit
else
echo "mail $1 saved"
echo "$1" >> "$MAILSTORE"
fi
}
xMenu(){
mail=$(eval xsys.menu 'Select a mail' < "$MAILSTORE")
[ -n "$mail" ] && echo "$mail" | xsys.clipboard
}