updated on Sat Jan 21 16:18:39 UTC 2012
[aur-mirror.git] / zenity_pacgui / pacyaourt
blob85103f55fbf878997aa0d8e361d33f78b26b192a
1 #!/bin/bash
3 TEXTEDITOR=$(cat ~/.pacmangui/texteditor)
4 MIRRORFILE=$(cat ~/.pacmangui/mirrorlistfile)
5 TERMINAL=$(cat ~/.pacmangui/terminal)
8 case "$TERMINAL" in
9 Gnome-terminal)
10 USETERM="gnome-terminal -x"
12 Konsole)
13 USETERM="konsole -e"
15 Xfce-terminal)
16 USETERM="xfce4-terminal -x"
18 Xterm)
19 USETERM="xterm -e"
21 esac
23 ########################
27 function refresh {
28 $USETERM sudo yaourt -Sy
30 sleep 0.5
31 until [ ! $(pidof sudo) ]; do
32 sleep 0.5
33 done
34 while [ -e /var/lib/pacman/db.lck ]; do
35 sleep 0.5
36 done
38 notify-send -i /usr/share/icons/gnome/32x32/apps/system-software-update.png -t 7500 "PacGUI - Finished." "Yaourt database refreshed."
39 mainyaourt
42 ###################
45 function upgrade {
46 $USETERM sudo yaourt -Su --aur
48 sleep 0.5
49 until [ ! $(pidof sudo) ]; do
50 sleep 0.5
51 done
52 while [ -e /var/lib/pacman/db.lck ]; do
53 sleep 0.5
54 done
57 notify-send -i /usr/share/icons/gnome/32x32/apps/system-software-update.png -t 7500 "PacGUI - Finished." "AUR packages upgraded."
59 tail -n 50 /var/log/pacman.log | tac | zenity --text-info --height=600 --width=600
60 mainyaourt
63 ######################
65 function search {
66 BUSCA=$(zenity --entry --title="Yaourt search" --width=350 --text="Type in as many keywords as you want to search for") || mainyaourt
67 echo "ColorMod TextOnly" > ~/.yaourtrc
68 RES_BUSCA=$(yaourt -Ss $BUSCA)
69 rm ~/.yaourtrc
70 RES_BUSCA_SORT=$(echo $RES_BUSCA | grep / | tr -s [:blank:] "\n" | grep /)
71 echo "$RES_BUSCA" | zenity --text-info --width=500 --height=500 --title="Results for "\"$BUSCA""\" &
72 sleep 0.1
73 INFO=$(zenity --list --title="Select package" --text="Select package to\nshow detailed info about it" --width=350 --height=500 --column=Paquete $RES_BUSCA_SORT) || search
74 INFO_SORT=$(echo $INFO | tr "|" " ")
75 echo "ColorMod TextOnly" > ~/.yaourtrc
76 zenity --info --title="Info for "\"$INFO""\" --text="$(echo "$(yaourt -Si $INFO_SORT)" | grep -v Packager)"
77 rm ~/.yaourtrc
78 mainyaourt
81 ######################
83 function install {
85 INST=$(zenity --entry --title="Install AUR package." --width=350 --text="Type in the package name you wish to install") || mainyaourt
86 $USETERM sudo yaourt -S $INST
88 sleep 0.5
89 until [ ! $(pidof sudo) ]; do
90 sleep 0.5
91 done
92 while [ -e /var/lib/pacman/db.lck ]; do
93 sleep 0.5
94 done
95 notify-send -i /usr/share/icons/gnome/32x32/apps/system-software-update.png -t 7500 "PacGUI - Finished" "You may look up the log file anytime from the application menu or /var/log/pacman.log"
96 tail -n 50 /var/log/pacman.log | tac | zenity --text-info --height=600 --width=600
97 mainyaourt
100 #####################
102 function search_install {
104 BUSCA_I=$(zenity --entry --title="Repository search." --width=350 --text="Type in as many keywords as you want to search for.") || mainyaourt
105 echo "ColorMod TextOnly" > ~/.yaourtrc
106 RES_BUSCA_I=$(yaourt -Ss $BUSCA_I)
107 rm ~/.yaourtrc
108 RES_BUSCA_I_SORT=$(echo $RES_BUSCA_I | grep / | tr -s [:blank:] "\n" | grep / | tr -s "/" " ")
110 echo "$RES_BUSCA_I" | zenity --text-info --width=500 --height=500 --title="Packages in AUR found for "\"$BUSCA_I""\" &
111 sleep 0.1
112 CHECK=$(zenity --list --radiolist --title="Package installation." --text="Select package to be installed" --width=350 --height=500 --column=Instalar --column=Paquete $RES_BUSCA_I_SORT) || busca_inst
115 CHECK_INST=$(echo $CHECK | tr "|" " ")
116 $USETERM sudo yaourt -S $CHECK_INST
118 sleep 0.5
119 until [ ! $(pidof sudo) ]; do
120 sleep 0.5
121 done
122 while [ -e /var/lib/pacman/db.lck ]; do
123 sleep 0.5
124 done
126 notify-send -i /usr/share/icons/gnome/32x32/apps/system-software-update.png -t 7500 "PacGUI - Finished." "You may look up the log file anytime from the application menu or /var/log/pacman.log"
127 tail -n 50 /var/log/pacman.log | tac | zenity --text-info --height=600 --width=600
128 mainyaourt
135 #####################
139 function mainyaourt {
141 ACCION=$(zenity --list --title="Yaourt operations" --text="Select your desired option" --height=250 --width=350 --column="" --column="Sections" "1" "Refresh database" "2" "Upgrade AUR packages" "3" "Package search" "4" "Install" "5" "Search and install" ) || exit
144 case "$ACCION" in
146 refresh #yeah
149 upgrade #yeah
152 search #yeah
155 install #yeah
158 search_install #yeah
160 esac
163 mainyaourt