~rrt/wicd/tray-icon

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
#!/bin/sh
# check_firstrun()
if [ ! -d "$HOME/.wicd" ]; then
    mkdir -p "$HOME/.wicd"
fi
# Make sure the user knows WHEREAREMYFILES ;-)
if [ -e "%VARLIB%WHEREAREMYFILES" ] && [ ! -L "$HOME/.wicd/WHEREAREMYFILES" ]; then
    ln -s "%VARLIB%WHEREAREMYFILES" "$HOME/.wicd/WHEREAREMYFILES"
fi
if [ "$DISPLAY" = "" ]; then
    BOLD=$(tput bold)
    BLUE=$(tput setaf 4)
    NC=$(tput sgr0)
    if [ -x "%BIN%wicd-curses" ]; then
        if [ ! -f "$HOME/.wicd/CLIENT_CURSES_WARNING" ]; then
            printf "NOTICE: You do not have an X server active on this console, \n"
            printf "so ${BOLD}${BLUE}wicd-curses${NC} will be started instead. \n"
            printf "Please see the wicd-client and/or wicd-curses manual pages \n"
            printf "for more information about this error and resulting message. \n"
            printf "\n" 
            printf "This message will not be displayed again. \n"
            printf "Press enter to continue... \n"

            read _junk
            cat >> "$HOME/.wicd/CLIENT_CURSES_WARNING" << EOF 
The wicd-client script checks for the existence of this file to determine
whether it should warn the user before launching wicd-curses instead, in 
the event of the gui client being launched outside of the X Window environment.

If you delete this file, then wicd-client will print the warning if it is 
launched outside of X (and then recreate this file again).
EOF
        fi
        exec %BIN%wicd-curses $@
    
    else
        printf "NOTICE: You do not have an X server active on this console, \n"
        printf "but you do not appear to have ${BOLD}${BLUE}wicd-curses${NC}\n"
        printf "installed on this system.  We'd normally be running it here.\n"
        printf "Please see the wicd-client manual page for more information.\n"

    fi
else
    exec %BIN%wicd-gtk $@
fi