This repository has been archived by the owner on Nov 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbashware
executable file
·71 lines (65 loc) · 1.59 KB
/
bashware
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
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
# some vars
cps1="\n$(tput setaf 1)|---ubuntu-$(tput setaf 6)xfce $(tput setaf 4)\t \d\n$(tput setaf 1)|--$(tput setaf 3)${debian_chroot:+($debian_chroot)}\u@\h:$(tput setaf 5)\w\$$(tput setaf 1)\n|-$(tput sgr0)"
bashutilfo="$(tput setaf 1)baSHWaRE $(tput setaf 2)final beta$(tput sgr0)"
# bashwareutils
if [[ $# == 0 ]]; then
echo "
Please use bashware --help for help."
elif [[ $1 == "--help" ]] || [[ $1 == "-h" ]]; then
if [[ $2 == "ps1" ]]; then
echo "
PS1 Options:
bashware ps1 reset - resets PS1 to default
bashware ps1 custom - sets PS1 to bashware's own custom PS1"
elif [[ -z $2 ]]; then
echo "
${bashutilfo}
--version - Display the bashware version
ps1 - Customise your PS1
launch - launches a baSHWaRE APPlEt
ls - custom ls, pretty useless"
else
echo "Invalid Option"
fi
elif [[ $1 == "--version" ]] || [[ $1 == "-v" ]]; then
echo "
${bashutilfo}"
elif [[ $1 == "ps1" ]]; then
if [[ $2 == "reset" ]]; then
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
elif [[ $2 == "custom" ]]; then
PS1=$cps1
elif [[ -z $2 ]]; then
echo "
PS1 Options:
bashware ps1 reset - resets PS1 to default
bashware ps1 custom - sets PS1 to bashware's own custom PS1"
else
echo "Invalid Option"
fi
elif [[ $1 == "ls" ]]; then
i=0
sedded=""
if [[ -z $2 ]]; then
for i in *; do
echo -n "$i "
done
else
for i in $2/*; do
echo -n "$i "
done
fi
elif [[ $1 == "launch" ]]; then
if [[ -z $2 ]]; then
afile=0
echo "Available bashware apps:"
for afile in /root/.bashware/apps/*; do
echo "$afile "
done
else
~/.bashware/apps/$2 $3
fi
else
echo "Invalid Option"
fi