LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-21-2017, 01:14 PM   #16
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619

I know this thread has been closed for a long time, so maybe this will help no one. But anyway, if you want to remove everything listed under "Games" in the menu without removing the rest of KDE, I have a script that can be used to map such things to their respective packages and create a list. I will post it later when I am not at work.
 
Old 09-21-2017, 02:03 PM   #17
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,048

Rep: Reputation: Disabled
If you just want to remove all KDE games from the menu, just list their .desktop files:
Code:
kdegames=$(grep Game /usr/share/applications/kde4/*|grep Categories|sed "s/:.*//")
Then, use a sed script to insert a line with a NoDisplay=true key in each file, either in place for all users, or in a copy in /home/$(whoami)/.local/share/applications for a specific user.

Alternatively, to show them only in the KDE menu include the key OnlyShowIn=KDE;

Cf. the Desktop Entry Specification.

Last edited by Didier Spaier; 09-21-2017 at 03:23 PM.
 
Old 09-21-2017, 03:10 PM   #18
usr345
Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 204
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by Alien Bob View Post
No thanks for the completely useless post, and that 3.5 years after the topic was closed. Way to go!
The OP said he did not install KDE. What you mention are all KDE games.
It is not completely useless. I tried to uninstall KDE games. But did it manually in a slow fashion. Tried to share my experience.

Quote:
Originally Posted by Didier Spaier View Post
If you just want to remove all KDE games from the menu, just list their .desktop files:
...
Yeah, it will hide them from the menu. Is it possible to learn the names of the packages to uninstall them completely.

Last edited by usr345; 09-21-2017 at 03:12 PM.
 
Old 09-21-2017, 04:00 PM   #19
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
Quote:
Originally Posted by usr345 View Post
It is not completely useless. I tried to uninstall KDE games. But did it manually in a slow fashion. Tried to share my experience.



Yeah, it will hide them from the menu. Is it possible to learn the names of the packages to uninstall them completely.
This script will find the package names corresponding to all *.desktop files in /usr/share/applications and subdirectories that contain the string "Game." I do not recommend blindly removing them without reviewing the list generated first. The script could be improved to only include files where "Game" is in the Categories line. I'll leave that exercise to you if you want.

Code:
#!/bin/bash

FILELIST=$(find /usr/share/applications -name "*.desktop")
PKGLIST=""
for FILE in $FILELIST
do
  # Check if file contains "Game" string
  CHECK=$(grep Game $FILE)
  if [ -z "$CHECK" ]; then
    continue
  fi

  # Find package that installed the .desktop file
  INSTALLEDFILE=${FILE:1}
  INSTALLEDPKG=$(grep $INSTALLEDFILE /var/log/packages/* | cut -d":" -f1)

  # Add to the list if is unique
  FOUND=0
  for PKG in $PKGLIST
  do
    if [ "$PKG" == "$INSTALLEDPKG" ]; then
      FOUND=1
      break
    fi
  done
  if [ $FOUND -eq 0 ]; then
    PKGLIST="$INSTALLEDPKG $PKGLIST"
  fi
done

# Echo the list
for PKG in $PKGLIST
do
  echo $PKG
done

Last edited by montagdude; 09-21-2017 at 04:01 PM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
HOWTO - Install Slackware14 in 32MB memory with no CD or netboot OldHolborn Slackware 7 03-24-2014 08:31 PM
[SOLVED] Manual partitioning for FreeBSD10 install on existing slackware14 installation Habitual Slackware 6 01-22-2014 09:48 AM
VMWare Tools download/install error on Slackware14 64bit ExternalUse Slackware 3 09-26-2013 10:35 PM
[SOLVED] Remove/uninstall Calligra* in slackware14 x86_64 Habitual Slackware 19 07-26-2013 09:02 AM
[SOLVED] Remove Games kidsin Debian 4 08-16-2011 06:59 AM

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

All times are GMT -5. The time now is 01:42 PM.

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