Files in Desktop folder not showing on Desktop

You can change this setting by going to ~.config/mimeapps.list and do any needed edits. Thanks Misko_2083!

I think that for some reason Mate Tweak is buggy.

While enjoying my Cohiba Cigar :slight_smile: I made a little Gtk3 app to run this command with button.

[code]#!/usr/bin/env python3

from gi import require_version
require_version('Gtk', '3.0')
require_version('Gdk', '3.0')
from gi.repository import Gtk, Gdk
import os
import sys
import shlex
import subprocess
from gi.repository.GdkPixbuf import Pixbuf

#Temporary window icon, you can change it to your liking
icon="/usr/share/icons/Ambiant-MATE/places/128/folder-blue-desktop.svg"

def execute(command):
"""function to exec"""
p = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
return p.stdout

class MateDesktopIconsWindow(Gtk.Window):

def __init__(self):
    Gtk.Window.__init__(self, title="Desktop Icons")

    self.set_default_size(-1, 150)
    self.set_border_width(10)

    self.grid = Gtk.Grid()
    self.grid.set_row_spacing(8)
    self.grid.set_column_spacing(8)
    self.add(self.grid)


    self.label = Gtk.Label()
    self.label.set_name('label')
    self.label.set_markup("Use the switch\nto show and hide desktop icons")
    self.label.set_line_wrap(True)
    self.label.set_size_request(200, -1)

    self.grid.attach(self.label, 1, 0, 2, 1)

    self.label1 = Gtk.Label("Desktop Icons", xalign=1)
   
    self.grid.attach(self.label1, 1, 1, 1, 1)

    button1 = Gtk.Switch()
    button1.connect("notify::active", self.on_switch_activated_filesystem)
    cmd = 'gsettings get org.mate.background show-desktop-icons'
    result = os.popen(cmd)
    result = result.readline().split()[0]

    if result == "false":
       button1.set_active(False)
    elif result == "true":
       button1.set_active(True)
    else:
       button1.set_active(False)

    self.grid.attach_next_to(button1, self.label1, Gtk.PositionType.RIGHT, 1, 1)

    buttonc = Gtk.Button(label="_Close", use_underline=True)
    buttonc.set_border_width(10)
    buttonc.connect("clicked", self.on_close_clicked)
    self.grid.attach(buttonc,  1, 1, 1, 2)

def on_switch_activated_filesystem(self, switch, gparam):
    if switch.get_active():
        execute('gsettings set org.mate.background show-desktop-icons true')
        state = "on"
    else:
        execute('gsettings set org.mate.background show-desktop-icons false')
        state = "off"
    return print("Desktop Icons are", state)

def on_close_clicked(self, button):
    print("Closing Tweak Desktop Icons")
    Gtk.main_quit()

def main():
window = MateDesktopIconsWindow()
window.connect("delete-event", Gtk.main_quit)
window.set_resizable(False)
window.set_position(Gtk.WindowPosition.CENTER)
window.set_icon(Pixbuf.new_from_file("{0}".format(icon)))
window.set_name('Show/Hide Desktop Icons')

window.show_all()
Gtk.main()

if name == 'main':
try:
main()
except (Exception, AttributeError, FileNotFoundError) as e:
print("Exiting due to error: {0}".format(e))
sys.exit(1)[/code]
You can create a file "desktop-icons.py" and copy the code into file and save. Make the file executable and run.

Thanks :cool:
ā €ā €ā €ā €ā €ā €ā €ā €

Seems like creating small panel applet for gtk3 isnā€™t very hard. :wink:


Iā€™m trying to figure out how to use gtk popover menu to be able to store the switch in that menu.

I donā€™t remember where I read it - I thought it was here, but I had the same problem - all you have to do is go to startup applications and enter a new app - ā€œcaja -nā€ - fixed it completely, and now my desktop is exactly like it used to be - icons of folders and shortcuts right on the desktop live

Thank you a lot!

ā€˜caja -nā€™ in startup applications solved this issue immediately on Ubuntu mate 18.04. It is rather weird issue. It would be interesting to understand the reason behind this behavior.

I know this is an old posting but I had a similar problem; I had desktop icons that didnā€™t function. They appeared, but did not do anything, nor did the file icons show the corresponding image. Nor could i put new icons on the desktop. I wonā€™t bore you with all the steps I took (using the suggestions offered here. Too dull; TL;DR). But what I ended up finding was that the permissions were mis-set. I had to ensure that permissions were set appropriately for ~/Desktop. I started a terminal session. I typed

jjweintraub@jjweintraub-Latitude-E6400:~$ sudo su

This prompts for the userā€™s password (assuming the user had admin rights) so I could be eleveated to root. Then I typed

root@jjweintraub-Latitude-E6400:/home/jjweintraub# cd /home/jjweintraub/

Next:

root@jjweintraub-Latitude-E6400:/home/jjweintraub# chmod 770 Desktop

To check that it worked, I typed:

root@jjweintraub-Latitude-E6400:/home/jjweintraub# ls Desktop -l

But you have to make sure that you do things like ensuring that the tweak-tool, whether gnome-tweak-tool or mate-tweak-tool, allows for showing icons on the desktop.

I hope this helps others dealing with this related problem. Thanks.

John Weintraub (LPIC-1/Linux+ certified)

you can use gnome extension https://extensions.gnome.org/extension/2452/desktop-icons/ .
I hope this will help you.