Click to See Complete Forum and Search --> : Creating an app menu launcher for a Python app in Gnome?
FrozenFire
09-22-2004, 03:02 PM
Greetings all! First post @ JL!
I'm brand new to Linux (about 1 month) and have been trying out different distros (testing Ubuntu Warty now) and reading and fiddling like crazy! :)
I cannot figure out how to add a app menu launcher icon in Gnome 2.8 that will launch a little Python app I want to use (http://awesum.sourceforge.net/). I've read the Gnome User Guide and have successfully added icons to the app menu for some other programs that didn't do it automatically, but these were installed via Synaptic. I can run Awesum from the terminal just fine.
I've tried using commands such as "python awesum.py", "python [FULL PATH TO AWESUM SCRIPT HERE]" in the launcher properties command line when trying to create the launcher icon. The launcher is created but it doesn't launch Awesum. I've searched JL and G4L and haven't found anything that helps me.
This seems like it should be dead simple to do. I'm missing something obvious, but I can't see it. I'd appreciate any suggestions or if someone could point me in the right direction.
Thanks in advance!
Bob
JohnT
09-22-2004, 05:40 PM
Try absolute path..."/home/somebody/awesum". You might additionally check "run in terminal" if it's appropriate.
FrozenFire
09-22-2004, 06:10 PM
Thanks for the suggestion JohnT! I'll try what you suggest when I get home and will report back.
Bob
FrozenFire
09-23-2004, 09:04 AM
Well, no luck with the absolute path, either with "run in terminal" checked or unchecked.
Dag Wieers has an RPM package built for Awesum. I installed it on my main box that is presently running FC2. This package installed and did create a launcher in the Red Hat menu. This launcher triggers Awesum to run without any problems.
Looking at the launchers properties, I didn't see anything odd. In the command line the text was simply "awesum." I then looked at the spec file thinking that might give me a clue, but I can't really make much sense from it. Maybe someone else can:
# $Id: awesum.spec 1846 2004-08-04 11:33:26Z dries $
# Authority: dag
# Upstream: Darren L. LaChausse <the_trapper$users,sourceforge,net>
%{?dist: %{expand: %%define %dist 1}}
%{?rh7:%define _without_freedesktop 1}
%{?el2:%define _without_freedesktop 1}
Summary: Graphical checksum verifier
Name: awesum
Version: 0.6.0
Release: 1
License: BSD
Group: Applications/File
URL: http://awesum.sf.net/
Packager: Dag Wieers <dag@wieers.com>
Vendor: Dag Apt Repository, http://dag.wieers.com/apt/
Source: http://dl.sf.net/awesum/awesum-%{version}-src.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch: noarch
BuildRequires: python, pygtk2
Requires: python, pygtk2
%{!?_without_freedesktop:BuildRequires: desktop-file-utils}
%description
Awesum is a graphical checksum verification utility. Awesum is very easy to
use and includes support for both MD5 and SHA checksum algorithms. Unlike
many checksum verification utilities, Awesum features a progress bar which
makes working with large files (such as CD-ROM ISO images) much more bearable.
%prep
%setup -n %{name}
%{__cat} <<EOF >awesum.desktop
[Desktop Entry]
Name=Checksum Verifier
Comment=Verify the checksum of files
Icon=redhat-accessories.png
Exec=awesum
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;Application;Utility;
EOF
%build
%install
%{__rm} -rf %{buildroot}
./install.sh
%{__install} -d -m0755 %{buildroot}%{_datadir}/applications/
desktop-file-install --vendor gnome \
--add-category X-Red-Hat-Base \
--dir %{buildroot}%{_datadir}/applications \
awesum.desktop
### Clean up buildroot
%{__rm} -rf %{buildroot}%{_datadir}/awesum/*.txt
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-, root, root, 0755)
%doc *.txt doc/html/
%{_bindir}/awesum
%{_datadir}/applications/*.desktop
%{_datadir}/awesum/
%exclude %{_docdir}/awesum/
%changelog
* Tue May 04 2004 Dag Wieers <dag@wieers.com> - 0.6.0-1
- Initial package. (using DAR)
It looks to me that this package creates a awesum.desktop file. When I browse to usr/share there is an awesum folder that seems related. In the folder is 2 files: awesum.glade and awesum.py.
Does this info give any clues? I just gotta believe it isn't as hard as I'm making it to run this Python script from a lancher rather than from the terminal.
Thanks!
Bob
mrBen
09-23-2004, 10:33 AM
Try this:
1. Find the awesum.py file
2. Check that the file begins with the line #!/usr/bin/python
3. Ensure that the file is executable (chmod a+x awesum.py)
4. Add a direct link to the file (/home/bob/myscripts/awesum.py) in your launcher.
FrozenFire
09-23-2004, 03:17 PM
Thanks for the reply mrBen! I'll take a look tonight when I get home and report back the results. Appreciate it!
Bob