File: make.sh

package info (click to toggle)
gnome-shell-timer 0.0.20120615%2Bgitbde3fd2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 188 kB
  • sloc: python: 198; xml: 57; sh: 50; makefile: 17
file content (63 lines) | stat: -rwxr-xr-x 2,430 bytes parent folder | download
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
#!/bin/bash

install() {
    sudo mkdir -p "/usr/share/gnome-shell/extensions"
    sudo cp -R "timer@olebowle.gmx.com" "/usr/share/gnome-shell/extensions/"

    sudo mkdir -p "/usr/share/glib-2.0/schemas"
    sudo cp "org.gnome.shell.extensions.timer.gschema.xml" "/usr/share/glib-2.0/schemas/"
    sudo glib-compile-schemas "/usr/share/glib-2.0/schemas"

    sudo mkdir -p "/usr/share/icons/hicolor/scalable/apps"
    sudo cp "utilities-timer-symbolic.svg" "/usr/share/icons/hicolor/scalable/apps/"
    sudo cp "gnome-shell-timer-config.svg" "/usr/share/icons/hicolor/scalable/apps/"
    sudo gtk-update-icon-cache -q -t -f "/usr/share/icons/hicolor"

    sudo mkdir -p "/usr/bin"
    sudo cp "gnome-shell-timer-config.py" "/usr/bin/gnome-shell-timer-config"
    sudo mkdir -p "/usr/share/applications"
    sudo cp "gnome-shell-timer-config.desktop" "/usr/share/applications/"

    for lang in `locale -a | grep '^[[:alpha:]]\+_[[:alpha:]]\+$'`; do
        if [ -d "po/$lang" ]; then
            sudo mkdir -p "/usr/share/locale/$lang/LC_MESSAGES"
            sudo msgfmt -cv -o "/usr/share/locale/$lang/LC_MESSAGES/gnome-shell-timer.mo" "po/$lang/gnome-shell-timer.po"
        fi
    done
    echo "timer-extension successfully installed"
    echo "Press Alt+F2 and type 'r' to refresh"
}

uninstall() {
    sudo rm -R "/usr/share/gnome-shell/extensions/timer@olebowle.gmx.com"
    sudo rm "/usr/share/glib-2.0/schemas/org.gnome.shell.extensions.timer.gschema.xml"
    sudo glib-compile-schemas "/usr/share/glib-2.0/schemas"
    dconf reset -f /org/gnome/shell/extensions/timer/

    sudo rm "/usr/share/icons/hicolor/scalable/apps/utilities-timer-symbolic.svg"
    sudo rm "/usr/share/icons/hicolor/scalable/apps/gnome-shell-timer-config.svg"
    sudo gtk-update-icon-cache -q -t -f "/usr/share/icons/hicolor"

    sudo rm "/usr/bin/gnome-shell-timer-config"
    sudo rm "/usr/share/applications/gnome-shell-timer-config.desktop"

    sudo find "/usr/share/locale/" -type f -name "gnome-shell-timer.mo" -exec rm {} \;
    echo "timer-extension successfully uninstalled"
    echo "Press Alt+F2 and type 'r' to refresh"
}

if [ $# -ne "1" ] || [ $1 = "help" ]; then
    echo "Usage:"
    echo " $0 install - Install timer-extension"
    echo " $0 uninstall - Uninstall timer-extension"
    echo " $0 help - Show this help"
    exit 0
fi

if [ $1 = "install" ]; then
    install
fi

if [ $1 = "uninstall" ]; then
    uninstall
fi