From: | "Joe Sapp (nixphoeni)" <nixphoeni@g.o> |
---|---|
To: | gentoo-commits@l.g.o |
Subject: | [gentoo-commits] gentoo-x86 commit in gnome-extra/gdesklets-core/files: gdesklets.desktop gdesklets-core-0.36.1-bash-completion |
Date: | Mon, 01 Jun 2009 12:03:17 |
Message-Id: | E1MB6EV-0002Y3-11@stork.gentoo.org |
1 | nixphoeni 09/06/01 12:03:15 |
2 | |
3 | Added: gdesklets.desktop |
4 | gdesklets-core-0.36.1-bash-completion |
5 | Log: |
6 | Added bash completion and an autostart .desktop file from upstream's bzr repo |
7 | (Portage version: 2.1.6.13/cvs/Linux x86_64) |
8 | |
9 | Revision Changes Path |
10 | 1.1 gnome-extra/gdesklets-core/files/gdesklets.desktop |
11 | |
12 | file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-extra/gdesklets-core/files/gdesklets.desktop?rev=1.1&view=markup |
13 | plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-extra/gdesklets-core/files/gdesklets.desktop?rev=1.1&content-type=text/plain |
14 | |
15 | Index: gdesklets.desktop |
16 | =================================================================== |
17 | [Desktop Entry] |
18 | Name=gDesklets |
19 | Type=Application |
20 | Encoding=UTF-8 |
21 | Version=1.0 |
22 | Categories=Utility; |
23 | X-GNOME-Autostart-enabled=true |
24 | Exec=gdesklets start |
25 | Icon=gdesklets |
26 | GenericName=Desktop Widgets |
27 | Comment=Eye candy for your desktop |
28 | GenericName[es]=Widgets para Escritorio |
29 | |
30 | |
31 | |
32 | 1.1 gnome-extra/gdesklets-core/files/gdesklets-core-0.36.1-bash-completion |
33 | |
34 | file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-extra/gdesklets-core/files/gdesklets-core-0.36.1-bash-completion?rev=1.1&view=markup |
35 | plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-extra/gdesklets-core/files/gdesklets-core-0.36.1-bash-completion?rev=1.1&content-type=text/plain |
36 | |
37 | Index: gdesklets-core-0.36.1-bash-completion |
38 | =================================================================== |
39 | # $Id: gdesklets-core-0.36.1-bash-completion,v 1.1 2009/06/01 12:03:14 nixphoeni Exp $ |
40 | # See http://devmanual.gentoo.org/tasks-reference/completion/index.html |
41 | # Author: Joe Sapp |
42 | |
43 | _gdesklets() |
44 | { |
45 | local cur prev opts |
46 | |
47 | COMPREPLY=() |
48 | |
49 | cur="${COMP_WORDS[COMP_CWORD]}" |
50 | prev="${COMP_WORDS[COMP_CWORD-1]}" |
51 | opts="open start stop list restart profile shell status about |
52 | version configure help check" |
53 | running_opts="slay" |
54 | not_running_opts="" |
55 | |
56 | # Do these take an additional paramater? |
57 | case "${prev}" in |
58 | open) |
59 | # First, look for .display files in the current directory |
60 | COMPREPLY=$(compgen -f -o filenames -X '!*.display' ${cur}) |
61 | |
62 | # If no filename completions are found, try for directory |
63 | # completions |
64 | # This, with the '-o filenames' argument on the 'complete' |
65 | # line below allows entering a directory name with the intent |
66 | # of finishing with a .display file |
67 | COMPREPLY=( ${COMPREPLY:-$(compgen -d ${cur})} ) |
68 | return 0 |
69 | ;; |
70 | profile) |
71 | local prof_output=$(gdesklets profile | grep "Available" | sed -e 's/.*: //' -e 's/,//') |
72 | COMPREPLY=( $(compgen -W "${prof_output}" -- ${cur}) ) |
73 | return 0 |
74 | ;; |
75 | esac |
76 | |
77 | if [[ ${COMP_CWORD} -eq 1 ]] ; then |
78 | local status="$(gdesklets status)" |
79 | if [[ "${status}" == *not* ]] ; then |
80 | opts="${opts} ${not_running_opts}" |
81 | else |
82 | opts="${opts} ${running_opts}" |
83 | fi |
84 | COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) |
85 | return 0 |
86 | fi |
87 | } |
88 | complete -F _gdesklets -o filenames gdesklets |