Choose style:

Author Topic: Desktop "Computer" icon unknown file type[Solved]  (Read 249 times)

0 Members and 1 Guest are viewing this topic.

Offline reme

  • nOOb
  • *
  • Posts: 9
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 7
Desktop "Computer" icon unknown file type[Solved]
« on: May 09, 2017, 07:37:32 pm »
I was messing around in the xdg-open file, trying to get magnet links to work in Chrome. I fixed that issue,  but in the process, created another. Since I changed it, when I try opening "Computer" from my desktop, I get an unknown application error, would I like to choose an application, etc. I'm pretty sure all I did was change this:

Spoiler (click here to view / hide)
# Checks for known desktop environments
# set variable DE to the desktop environments name, lowercase

detectDE()
{
    # see https://bugs.freedesktop.org/show_bug.cgi?id=34164
    unset GREP_OPTIONS

    if [ -n "${XDG_CURRENT_DESKTOP}" ]; then
      case "${XDG_CURRENT_DESKTOP}" in
         # only recently added to menu-spec, pre-spec X- still in use
         Cinnamon|X-Cinnamon)
           DE=cinnamon;
           ;;
         ENLIGHTENMENT)
           DE=enlightenment;
           ;;
         # GNOME, GNOME-Classic:GNOME, or GNOME-Flashback:GNOME
         GNOME*)
           DE=gnome;
           ;;
         KDE)
           DE=kde;
           ;;
         LXDE)
           DE=lxde;
           ;;
         MATE)
           DE=mate;
           ;;
         XFCE)
           DE=xfce
           ;;
         X-Generic)
           DE=generic
           ;;
      esac
    fi

    if [ x"$DE" = x"" ]; then
      # classic fallbacks
      if [ x"$KDE_FULL_SESSION" != x"" ]; then DE=kde;
      elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
      elif [ x"$MATE_DESKTOP_SESSION_ID" != x"" ]; then DE=mate;
      elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org
[close]

to this:

Spoiler (click here to view / hide)
# Checks for known desktop environments
# set variable DE to the desktop environments name, lowercase

detectDE()
{
    # see https://bugs.freedesktop.org/show_bug.cgi?id=34164
    unset GREP_OPTIONS

    if [ -n "${XDG_CURRENT_DESKTOP}" ]; then
      case "${XDG_CURRENT_DESKTOP}" in
         # only recently added to menu-spec, pre-spec X- still in use
         Cinnamon|X-Cinnamon)
           DE=cinnamon;
           ;;
         ENLIGHTENMENT)
           DE=enlightenment;
           ;;
         # GNOME, GNOME-Classic:GNOME, or GNOME-Flashback:GNOME
         GNOME*)
           DE=gnome;
           ;;
         KDE)
           DE=kde;
           ;;
         LXDE)
           DE=lxde;
           ;;
         MATE)
           DE=mate;
           ;;
         XFCE)
           DE=xfce
           ;;
         X-Generic)
           DE=xfce
           ;;
      esac
    fi

    if [ x"$DE" = x"" ]; then
      # classic fallbacks
      if [ x"$KDE_FULL_SESSION" != x"" ]; then DE=kde;
      elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
      elif [ x"$MATE_DESKTOP_SESSION_ID" != x"" ]; then DE=mate;
      elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org
[close]

But changing it back only breaks magnet links, doesn't fix the Computer issue. Thanks.
« Last Edit: May 11, 2017, 08:10:42 pm by reme »

Online PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 15590
  • Karma: 1844
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 7 Respin (64bit)
Re: Desktop "Computer" icon unknown file type
« Reply #1 on: May 09, 2017, 08:28:37 pm »
There's little point to a "Computer" icon on the desktop .. but if you really want one I have no idea why you're messing with xdg-open ???

You can easily add one from dconf-editor

Install dconf-editor
Code: [Select]
sudo apt-get install dconf-editor
then fire it up

the navigate to
org > nemo > desktop

and put a tick in "computer-icon-visible"
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
Linux in the UK

Offline reme

  • nOOb
  • *
  • Posts: 9
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 7
Re: Desktop "Computer" icon unknown file type
« Reply #2 on: May 09, 2017, 09:16:03 pm »
Maybe I didn't explain my issue clear enough, so I'll try again. I wasn't using xdg-open to try to add the computer icon to my desktop, it was already there, and functional before I edited xdg-open. I was only changing xdg-open to fix magnet links in Chrome. Using gconf editor was how I put the computer icon there in the first place. It just stopped working (giving unknown file type error) after editing xdg-open, and reverting my change didn't fix it. I tried turning it off and back on again in gconf editor, and that didn't fix it either. I know it isn't the most important issue, I just like having a shortcut to a place that shows all my drives in the main Nemo window.

Online PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 15590
  • Karma: 1844
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 7 Respin (64bit)
Re: Desktop "Computer" icon unknown file type
« Reply #3 on: May 09, 2017, 09:21:22 pm »
So what did you do to xdg-open ?

and does running
Code: [Select]
nemo computer:///
still work ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
Linux in the UK

Offline reme

  • nOOb
  • *
  • Posts: 9
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 7
Re: Desktop "Computer" icon unknown file type
« Reply #4 on: May 09, 2017, 09:27:09 pm »
Running "nemo computer:///" does work. I showed the change I made to xdg-open in the first post.


Online PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 15590
  • Karma: 1844
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 7 Respin (64bit)
Re: Desktop "Computer" icon unknown file type
« Reply #5 on: May 09, 2017, 10:22:37 pm »
I'm kinda baffled why you'd need to edit xdg-open to get magnet links to work in the first place .. they should work just fine in Peppermint 7 as we've already tweaked xdg-open to work with chromium/chrome and magnet links ?

the only line you should need to change is line 916 (very close to the end)

So you're changing:-
Code: [Select]
    lxde)
    open_lxde "$url"
    ;;
to:-
Code: [Select]
    lxde)
    open_gnome3 "$url"
    ;;
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
Linux in the UK

Offline reme

  • nOOb
  • *
  • Posts: 9
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 7
Re: Desktop "Computer" icon unknown file type
« Reply #6 on: May 10, 2017, 09:25:16 am »
Magnet links worked fine with firefox and transmission, then I switched my browser to Chrome, and they still worked with Transmission, then I switched from Transmission to Tixati, and the first time I used one it worked, but the second time Chrome gave me a dialog box asking how I wanted to handle magnet links, and I clicked the wrong thing and they stopped working. I tried several solutions from googling around, and editing the xdg-open and switching
Code: [Select]
X-Generic)
           DE=generic
to
Code: [Select]
X-Generic)
           DE=xfce
did finally fix it, but then I encountered my current issue, which googling hasn't provided a solution to.

My line 916 in xdg-open already is
Code: [Select]
lxde)
    open_gnome3 "$url"
    ;;
I searched and I don't have a line that shows
Code: [Select]
 lxde)
    open_lxde "$url"
    ;;

Online PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 15590
  • Karma: 1844
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 7 Respin (64bit)
Re: Desktop "Computer" icon unknown file type
« Reply #7 on: May 10, 2017, 11:30:57 am »
Try this:
Code: [Select]
pluma ~/.local/share/applications/mimeapps.list
add this line at the bottom
Code: [Select]
x-scheme-handler/magnet=tixati.desktop
makes sure it doesn't contain any other line that starts with
Code: [Select]
x-scheme-handler/magnet=
SAVE the file.

Now see if Chrome/Chromium opens magnet links.

But you should NOT need to edit xdg-open.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
Linux in the UK

Offline reme

  • nOOb
  • *
  • Posts: 9
  • Karma: 1
  • New Forum User
    • View Profile
  • Peppermint version(s): 7
Re: Desktop "Computer" icon unknown file type
« Reply #8 on: May 11, 2017, 09:36:06 am »
I restored xdg-open from a backup, and used your instructions for fixing magnet links. Both Computer and magnet links are working now. Thanks!

Online PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 15590
  • Karma: 1844
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 7 Respin (64bit)
Re: Desktop "Computer" icon unknown file type
« Reply #9 on: May 11, 2017, 11:06:48 am »
Great news, and you're welcome :)

If you're happy this is now (SOLVED), can you please remember to edit the FIRST posting in this topic and change:-

Subject: Desktop "Computer" icon unknown file type (SOLVED)

Thanks in advance :)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
Linux in the UK