-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxman.lib
executable file
·59 lines (54 loc) · 1.53 KB
/
xman.lib
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
51
52
53
54
55
56
57
58
59
#!/usr/bin/env bash
#
# ############################################################################
# Project: scripts (none)
# File...: xman.lib
# Created: Sunday, 2023/08/13 - 08:03:29
# Author.: @fbnmtz, ([email protected])
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Last Modified: Sunday, 2023/10/01 - 03:43:25
# Modified By..: @fbnmtz, ([email protected])
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Version: 0.1.2.16
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Description:
# >
# ############################################################################
# HISTORY:
#
_xLIB_XMAN_=true
rofi_cmd="rofi -no-config -columns 1 -lines 10 -i -dmenu -p "
mList(){
binary=$(find "$APP_HOME/" | \
rev | \
cut -d '/' -f1 |
rev |
cut -d '.' -f1 |
sort -u | \
$rofi_cmd "Man Found"
)
mDefault
}
mBinary(){
if [ -z "$binary" ]; then
binary=$( find /usr/bin/ /bin/ /sbin/ -type f | \
sed 's/\/usr\/bin\///g' | \
sed 's/\/bin\///g' | \
sed 's/\/sbin\///g' | \
awk '{print $1}' | \
sort -u | \
$rofi_cmd "Man Search"
)
fi
mDefault
}
mDefault(){
# save man content and open
if [ -n "$binary" ]; then
filename="$APP_HOME/$binary.ps"
if [ ! -f "$filename" ]; then
man -t "$binary" > "$filename"
fi
llppac -t ps "$filename"
fi
}