LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 03-15-2016, 07:52 PM   #1
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Question Google Chrome works in GNOME when started from a command line, but it's not displayed in the applications menu.


First, be aware that I'm running a Fedora 25 system, so this may not be a real problem.

Anyhow, the google-chrome.desktop file in in the /usr/lib/applications/ directory, and is displayed on the menus of most of the other desktop environments (e.g., Mate, LXQT, ...).

When started from a terminal, it seems to work with no problems. (In fact, I'm typing this query using Chrome started in that way.)

I assumed that the problem was because several of the GNOME .menu files list google-chrome in the <exclude>...</exclude> sections, editing those file to remove references to "google-chrome" did not make the application appear on the menu.

I also tried remodeling the google-chrome.desktop file so it looked more like the Midori.desktop file, since the GNOME documentation talks about their "modifications" to the XDG_Desktop standard. That only resulted in the Midori application no longer being displayed. (I assume that I inadvertantly saved a messed-up copy while I was editing the Chrome .desktop file.)

So, my questions:
  1. Has anyone seen this problem on other Fedora releases?
  2. Are there other .desktop file that are not available from the "Activities" action of GNOME?
  3. If you've had a similar problem, have you solved it?

If you're interested, here's a bash script I wrote that I use to start detached commands from a terminal window. (I needed this because I find the KDE desktop much easier to use then the GNOME one, and, for some -- as yet undetermined -- reason, the KDM works, but the shell crashes when plasmashell is started. So, if I want to use KDM, I have to work mostly from terminal windows.)

Code:
$ cat ~/bin/Init
#!/bin/bash
help()
{
  local i name lc
  lc=${1,,?}
  name=$(basename ${0})
  if ( [ -z "${1}" ] || [[ "${lc}" =~ ^-+h ]] )
  then
    cat <<EOF >&1
${name}: Run a command, detached, supressing all terminal output.

Usage: ${name} command [arguments ...]

Special command values:
  -h|--help                Print this message to stderr and exit
  -s|--setup[=n[oauto]]    Run the set of predetrmined commands.
  -r|--run= n1 n2 ...      Run the pre-defined command <n> (See --list.)
  -l|--list                List pre-defined commands
  -a|--auto                List any command(s) automatically run
                           after the --setup command(s) are started.
                           unless the "noauto" optiom of "--setup" is used.

EOF
  exit 0
  fi
#elif
  if [[ "${lc}" =~ ^-+l ]]
  then
    for (( i=1; i<=${#CMD[@]}; ++i ))
    do
      echo "  $i = ${CMD[$i]}" >&1
    done
    echo "" >&1
    exit 0
  fi
#elif
  if [[ "${lc}" =~ ^-+a ]]
  then
    for (( i=1; i<=${#AUTO[@]}; ++i ))
    do
      echo "  ${AUTO[$i]}" >&1
    done
    echo "" >&1
    exit 0
  fi
#else return
}
# Function to run a command in as a detached process
dispatch()
{
  echo -n '"'${1}'"' >&1
  if ( [ -n "${*}" ] && [ -n "$(type ${1})" ] )
  then
    "$*" &>/dev/null &
    job=$!
    disown
    echo " started as process #${job}" >&1
  else
    echo " does not appear to be a valid command." >&1
  fi
}
#
# Main program
#
# Initialize CMD and AUTO
CMD=(  [1]="konsole" [2]="google-chrome" [3]="gkrellm" )
AUTO=( [1]="Update --refresh" )
# Do we have any help arguments?
help "${*}"
# Convert the first argument to lowercase
lc=${1,,?}
# Do we have the "--setup" option?
if [[ "${lc}" =~ ^-+s ]]
then
  # dispatch all the commands in the CMD array
  for (( i=1; i<=${#CMD[@]}; ++i ))
  do
    dispatch ${CMD[${i}]}
  done
  # If the "noauto" option is not used, dispatch all commands in the AUTO array
  if ![[ "${*,,}" =~ ^-+s.*=?[[:space:]]*n ]]
  then
    for (( i=1; i<= ${#AUTO[@]}; ++i ))
    do
      dispatch ${AUTO[${i}]}
    done
  fi
  exit 0
fi
#
# Not an "--setup" command. Is it a --run command?
if [[ "${lc}" =~ ^-+r ]]
then
  # Set the initial number of arguments to consume to 2
  j=2
  # The user may wik to start a subset of the available commands
  # so we need to support "--run 1 3", etc.
  while [ $# -gt 0 ]
  do
    cmd=${CMD[${!j}]}
    if [[ -z "${cmd}" ]]
    then
      echo "\"${!j}\" is not a valid command number."
      help "-l"
    fi
    # Get rid of the processed arguments
    shift $j
    # and reduce the number of arguments to 1
    j=1
    dispatch "${cmd}"
  done
  exit 0
fi
# If we get here, then assume that ${@} is a (single) command to be dispatched
dispatch ${@}
 
Old 03-21-2016, 09:00 PM   #2
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Maybe try installing alacarte and use that to add the icon to your Applications Menu. It worked for me.
<OR> see my Blog on How To Create A Desktop Entry.
 
Old 03-21-2016, 10:26 PM   #3
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
How did you install Chrome? I used the google repository on fedora 23/xfce and the install put Google Chrome in the application menu, and I could easily create a desktop launcher with a drag & drop from the menu.
 
Old 03-27-2016, 10:24 PM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Original Poster
Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Originally Posted by Doug G View Post
How did you install Chrome? I used the google repository on fedora 23/xfce and the install put Google Chrome in the application menu, and I could easily create a desktop launcher with a drag & drop from the menu.
Unsurprisingly, Chrome is not in the Rawhide repository. I installed it from the Google stable repository. (Which works fine with F-23.)
 
Old 03-27-2016, 10:27 PM   #5
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Original Poster
Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Thumbs up Solved.

Quote:
Originally Posted by Ztcoracat View Post
Maybe try installing alacarte and use that to add the icon to your Applications Menu. It worked for me.
<OR> see my Blog on How To Create A Desktop Entry.
Alacarte did the trick. Thanks.

Last edited by PTrenholme; 03-27-2016 at 10:31 PM. Reason: Add alacarte tag
 
Old 03-28-2016, 05:03 PM   #6
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by PTrenholme View Post
Alacarte did the trick. Thanks.
Cool!
Glad it worked for you-
 
Old 03-28-2016, 06:47 PM   #7
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
Yes, thanks. I'd forgotten about alacarte, and it wasn't installed on my f23 system. It is now
 
  


Reply

Tags
.desktop, alacarte, gnome, google-chrome


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
[SOLVED] Google Maps works well in Google Chrome but not in Chromium... Robert.Thompson Slackware 1 04-13-2011 02:47 AM
Trouble setting up command line wlan that works fine on gnome (ubuntu 9.10) Boffy Linux - Wireless Networking 3 11-13-2009 03:08 PM
What applications should be started from command line? glore2002 Slackware 21 08-28-2008 04:28 PM
How to change GNOME main menu icon(Applications menu) deepclutch Linux - Software 7 06-25-2007 01:31 PM
Editing GNOME menu that is displayed on a right click? coolamit78 Linux - Software 1 05-09-2004 02:44 PM

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

All times are GMT -5. The time now is 01:07 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