-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfu
executable file
·75 lines (61 loc) · 1.75 KB
/
fu
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
72
73
74
75
#! /bin/bash
# Licence: GPL v.3
# Version: Alpha 6
# Developer: tele
RC='\e[0;31m' # Red Color
NC='\e[0m' # No Color
ERRORS="0"
DEP=""
BROKEN1()
{
echo -e "${RC} Error: $1 ${NC}" ; ERRORS=$((ERRORS+1))
}
BROKEN2()
{
# zenity --error --text "$1" ; exit 1
BROKEN1 "Missing $1 , please install."
DEP="$DEP"$'\n'"$1"
}
WINDOW_ERROR()
{
yad --image=dialog-warning \
--text="<b><span color='red'>$1</span></b>" \
--button="<b><span color='blue'>OK</span></b>" \
--title="Error:"
}
# Check Dependecies
[[ $(echo $SHELL) == "/bin/bash" ]] || BROKEN1 "Check \$SHELL=/bin/bash , change SHELL to bash."
[[ -z $(which yad) ]] && BROKEN1 " FUUUUUUUUU yad. \n Please install yad."
[[ -z $(which awk) ]] && BROKEN2 "awk"
[[ -z $(which gtkdialog) ]] && BROKEN2 "gtkdialog"
[[ -z $(which curl) ]] && BROKEN2 "curl"
[[ -z $(which xdg-open) ]] && BROKEN2 "xdg-open"
[[ -z $(which notify-send) ]] && BROKEN2 "notify-send"
# KILL SCRIPT IF EXIST ANY ERROR
echo "Errors = $ERRORS"
#echo "Dep = $DEP"
[ -z "$DEP" ] || WINDOW_ERROR "Please install dependencies: $DEP"
[ "$ERRORS" -ne "0" ] && { echo Exiting ; exit 1; }
TIP()
{
echo -e "-Where are the river without water? \n-On the maps."
}
# Menu in tray icon
echo "-----------------------------"
yad --title="Test_window" --notification --listen \
--menu="Check News!data/check_news
Manager!data/manager
Refresh Markers!data/manager --refresh_markers
Logs!data/open_log
Exit !data/kill_yd "Test_window"" \
--separator="\\n" \
--command='echo "-Where are the river without water? -On the maps."' \
--image=data/icons/cool-smilies.png \
--button="gtk-close:1"
echo "-----------------------------"
# yad icon is small after Debian update or Mate
## other options
#CD open!eject
#CD close!eject -t
#Gedit !gedit
#VLC Player !vlc