summarylogtreecommitdiffstats
path: root/fakeAUR.sh
blob: 06ec29925f8a5bb94a188e96a5753d144a9a1dff (plain)
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
#!/bin/bash -i
#Developer: schrmh (schreibemirhalt@gmail.com) / derberg#7221 from Linux Gaming Discord
#Git-Repo: 
function show_help () {
    echo "fakeAUR"
    echo "You need to use the option -echo and provide AUR helper (e.g. yay) + old name package name, new package name and new description:"
    echo "fakeAUR -echo \"yay fakeAUR\" nani \"now you can speak japanese\""
    echo ""
    echo "use -btw for a btwiusearch message and -nani for that nani message."
    echo "-grep will grep the original description of the piped package"
    echo "TODO: 1). switch between core/community/aur or custom with colour. Also version, size, orphanded, etc."
    echo "2) Manipulate multiple packages at once and list them just like a package helper would"
    echo "3) Copy a screnshoot to clipboard"
    echo "4) implement piping: yay fakeAUR | fakeAUR nani \"now you can speak japanese\""
    echo "5) Fix formatted output for trizen.."
}
if [ $# -eq 0 ] 
then
    show_help
    exit 1
fi

for i in "$@"
    do 
        case $i in
            -h | --h | --help )
                show_help
                exit 1
            ;;
            -btw )
                description=$(echo -ne '\n' | eval "$2" | grep "    ")
                name=$(echo $2 | grep -Eo "[^ ]+$")
                helper=$(echo $2 | grep -o '^\S*')
                echo ${PS1@P}$helper btwiusearch
                echo -ne '\n' | eval $2 | sed -e "s/$name/btwiusearch/" | sed -e "s/$description/A very important and easy to use package to show the world that you run the best distro/"
            ;;
            -nani )
                description=$(echo -ne '\n' | eval "$2" | grep "    ")
                name=$(echo $2 | grep -Eo "[^ ]+$")
                helper=$(echo $2 | grep -o '^\S*')
                echo ${PS1@P}$helper nani
                echo -ne '\n' | eval $2 | sed -e "s/$name/nani/" | sed -e "s/$description/now you can speak japanese/"
            ;;
            -echo )
                description=$(echo -ne '\n' | eval "$2" | grep "    ")
                name=$(echo $2 | grep -Eo "[^ ]+$")
                helper=$(echo $2 | grep -o '^\S*')
                echo ${PS1@P}$helper $3
                echo -ne '\n' | eval $2 | sed -e "s/$name/$3/" | sed -e "s/$description/$4/"
            ;;
            -grep)
            description=$(echo -ne '\n' | eval "$2" | grep "    ")
            echo $description
            ;;
        esac
    done
exit 0