LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-02-2009, 05:40 PM   #1
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Rep: Reputation: 139Reputation: 139
Writing my first Slackbuild and cannot add an entry to KDE games menu


I believe that I have all the necessary bits and pieces, the Slackbuild works, but I can't get it to add a KDE menu item for the program.

I have a program.desktop file and it has been added to /usr/share/applications. I have a program.png added to /usr/share/pixmaps, I have a doinst.sh but I have no idea if it is running or not.

These are all the files

Code:
/build.sh
/doinst.sh
/README
/slack-desc
/xscrabble-2.12.tar.bz2
/xscrabble.desktop
/xscrabble.info
/xscrabble.png
/xscrabble.Slackbuild/xscrabble.SlackBuild
/xscrabble_en.tar.bz2
The doinst.sh
Code:
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
The xscrabble.desktop
Code:
[Desktop Entry]
Name=xscrabble
Comment=xscrabble - A Scrabble like game
Exec=/usr/X11/bin/xscrabble
Icon=/usr/share/pixmaps/xscrabble.png
Terminal=false
Type=Application
Categories=Game;
The xscrabble.Slackbuild
Code:
#!/bin/sh

# SlackBuild script for Xscrabble
# Written by Steven A. McIntosh (samac) (mcintosh@cotterochan.co.uk)
#
# This game has it's own install script and this script uses it and
# creates a Slackware package.
#
PRGNAM=xscrabble
VERSION=2.12
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

rm -fr $TMP/$PRGNAM $PKG $TMP/$PRGNAM-$VERSION
mkdir -p $TMP $PKG $OUTPUT
cd $TMP || exit 1
tar xvjf $CWD/${PRGNAM}-$VERSION.tar.bz2 || exit 1

# Don't trust the ownership/permissions...
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
chmod 755 $PRGNAM-$VERSION

# Make the directories that are needed by Xscrabble's build script
mkdir -p $PKG/usr/share/pixmaps \
	 $PKG/usr/share/applications 

# Replace the build script with a SBo friendly one and move language files
cp $CWD/build $TMP/$PRGNAM-$VERSION
cp $CWD/xscrabble_en.tar.bz2 $TMP
cd $TMP/$PRGNAM-$VERSION

# Call the Xscrabble build script
./build bin &&
./build install &&
./build lang en &&
./build clean

# OK, put everything where it goes in a proper Slack package...
mkdir -p $PKG/usr/X11/bin \
	 $PKG/install
#
mv $PKG/usr/games/xscrabble $PKG/usr/X11/bin
mv $PKG/usr/games/xscrab $PKG/usr/X11/bin
rmdir $PKG/usr/games

cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
Please keep any suggestions KISS as I am not brilliant at bash scripting.

Thanks

samac
 
Old 02-03-2009, 03:32 AM   #2
gegechris99
Senior Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 15.0 64bit
Posts: 1,161
Blog Entries: 5

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
Hello Samac,

Try to change line "Categories" in the .desktop file to:

Code:
Categories=Qt;KDE;Game;
This is how "Categories" looks like in kdegames .desktop files.

Last edited by gegechris99; 02-03-2009 at 03:34 AM. Reason: Explain why I put this suggestion
 
Old 02-03-2009, 04:51 AM   #3
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Original Poster
Rep: Reputation: 139Reputation: 139
Thanks gegechris99, but that did not work, neither did Categories=Application;Game;

I thought that the doinst.sh would update the menu, is there something else that I should be doing?

samac
 
Old 02-03-2009, 04:59 AM   #4
gegechris99
Senior Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 15.0 64bit
Posts: 1,161
Blog Entries: 5

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
Hello,

Just to make sure, did you try to manually run as root:

Code:
/usr/bin/update-desktop-database -q /usr/share/applications
 
Old 02-03-2009, 05:19 AM   #5
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Original Poster
Rep: Reputation: 139Reputation: 139
OK, interesting. The doinst.sh is running and the xscrabble.desktop works fine with just Categories=Game;

I logged in as root and there was xscrabble in the games menu, but it is not there when I log in as samac. Could it be because I have modified the menu with KDE's menu editor and it is now looking for a different configuration file.

I modified the slackbuild, .desktop and doinst.sh from a package that managed to add itself to my menu, so I am not sure what the problem is, could it be permissions?

samac
 
Old 02-03-2009, 05:47 AM   #6
gegechris99
Senior Member
 
Registered: Oct 2005
Location: France
Distribution: Slackware 15.0 64bit
Posts: 1,161
Blog Entries: 5

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
Hello Samac,

The following how-to will be of interest to you as you modified your KDE Menu:

http://humanreadable.nfshost.com/howtos/kde-menus.htm

I've read it superficially but it addresses how/where modified menus are located.

So yes, your package is working fine but user 'samac' can not see the xscrabble menu entry because you created your own local menu.

Last edited by gegechris99; 02-03-2009 at 05:53 AM.
 
Old 02-03-2009, 06:08 AM   #7
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Original Poster
Rep: Reputation: 139Reputation: 139
I will have a think on this. Thanks for the link.

samac
 
Old 02-03-2009, 04:49 PM   #8
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Quote:
I logged in as root and there was xscrabble in the games menu, but it is not there when I log in as samac.
First thing to do is verify the xscrabble.desktop file has 644 and root:root permissions.

Quote:
Could it be because I have modified the menu with KDE's menu editor and it is now looking for a different configuration file.
A local user menu will override the KDE defaults. The user menu is stored at ~/.config/menus/applications-kmenuedit.menu. You can temporarily move that file to see whether something in the configuration is overriding the KDE defaults. Be sure to not be in X/KDE or at least not logged in as that user when you temporarily rename the file.

All of the menu configuration files are basically a list of Include and Exclude directives. Your samac config file might have some kind of Exclude directive for the Games menu.
 
Old 02-04-2009, 04:43 AM   #9
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Original Poster
Rep: Reputation: 139Reputation: 139
Hi Woodsman

xscrabble.desktop file has 644 and root:root permissions.

Changing the name of ~/.config/menus/applications-kmenuedit.menu did not work, though the original did have an exclude for xscrabble.desktop, which I subsequently edited out. That did not work either.

I then created a new user, vanilla, and both they and root have xscrabble in their menus.

samac
 
Old 02-04-2009, 02:20 PM   #10
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Renaming the user menu should have been sufficient.

Were the directory permissions of ~/.config and ~/.config/menu 755 and samac:samac? Were the permissions of ~/.config/menu//applications-kmenuedit.menu 644 samac:samac?

There is a second directory affecting the user menu. That location is ~/.local/share. In ~/.local/share you will find two directories: applications and desktop-directories. You'll find the Trash directory there too.

Quote:
though the original did have an exclude for xscrabble.desktop, which I subsequently edited out.
Perhaps there remained some remnant in the config file. The Include and Exclude directives are not always easy to follow. Been there done that. Perhaps try using the graphical menu editor to edit the file.
 
Old 02-04-2009, 02:56 PM   #11
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Original Poster
Rep: Reputation: 139Reputation: 139
My directories are 700 and files 644 and all are samac:users this looks perfect to me.

I missed a </exclude> when editing, but I still didn't get a menu entry, but it did give me back my lost+found menu entry, and xscrabble is in it.

Why does KDE's menu system have to be sooooooo complicated?

samac
 
Old 02-04-2009, 05:04 PM   #12
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Quote:
I missed a </exclude> when editing, but I still didn't get a menu entry, but it did give me back my lost+found menu entry, and xscrabble is in it.
Yup, I have missed entries like that too.

Quote:
Why does KDE's menu system have to be sooooooo complicated?
Good question. I don't know. I wish the menu editor supported global menus. Perhaps 4.x will be better.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add e menu entry to KDE start menu over CLI browny_amiga Linux - General 7 02-08-2009 03:05 PM
Unable to Add new Menu Entry crash_override_me Debian 3 05-19-2008 12:43 PM
How Do I Add An Entry To Drop Down Menu rrrssssss Linspire/Freespire 0 09-05-2007 05:07 AM
KDE menu entry cannot be deleted! gkiagia Linux - Software 2 10-04-2005 09:57 AM
Add KDE menu in Gnome start menu melinda_sayang Slackware 2 03-06-2004 05:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration