![]() Make_thumbnail(factory, os.path.join(dirpath, filename))įactory = GnomeDesktop.DesktopThumbnailFactory()Ĭopy and paste the code section above into a new file, choose a fitting name for it (e.g. Update_name_and_meta(thumb_path, filename, mtime, mime_type, size)įor dirpath, dirnames, filenames in os.walk(folder): Thumbnail = factory.generate_thumbnail(uri, mime_type)įactory.save_thumbnail(thumbnail, uri, mtime) If not factory.can_thumbnail(uri, mime_type, mtime): If factory.lookup(uri, mtime) is not None: # Use Gio to determine the URI and mime type # uncomment this to remove GNOME thumbnails: Im.save(kde_thumb_path, "png", pnginfo=meta) Meta.add_text("Thumb::Mimetype", mime_type) Meta.add_text("Thumb::MTime", str(int(mtime))) Meta.add_itxt("Software", KDE_THUMBNAILER) Kde_thumb_path = os.path.join(thumb_dir, kde_md5 + ".png") # with the URI RFC2396 which is listed in the freedesktop specs, Print("Making thumb compatible with KDE.") KDE_THUMBNAILER = "KDE Thumbnail Generator"ĭef update_name_and_meta(thumb_path, filename, mtime, mime_type, size): # regardless of MIME type might not always work # FIXME: Hardcoding the Thumbnailer to a generic name Gi.require_version('GnomeDesktop', '3.0')įrom gi.repository import Gio, GnomeDesktop Generated through GNOME's thumbnail factory and then made compatible with KDE. You will also need to have the corresponding thumbnailers installed (e.g.Įvince-thumbnailer). Pillow can be installed with `pip install pillow` Is meant as a workaround to that issue, generating thumbnails that followĭependencies: python3 gir1.2-gnomedesktop-3.0 python-pillow Towards how to follow the XDG specs for saving thumbnails. Unfortunately there seems to be some disagreement between GNOME and KDE Largely based on a script by James Henstridge Here is the aforementioned script in its current revision: #!/usr/bin/python3 The main change I implemented is a function that updates the generated thumbnails to be recognized by KDE (by renaming them and updating the PNG metadata chunk). In order to work around this incompatibility, I ended up modifying the Python script that James Henstridge posted in the Q&A linked to above. Thumbnailer script to bridge the KDE/GNOME gap I've filed a bug report with KDE that will hopefully get this addressed eventually, but for now thumbnails generated by KDE and GNOME are sadly incompatible with each other. This is quite unfortunate since issues like these were supposed to be eliminated with the work of the Free Standards Group. Once the Plasma shell is restarted, you should notice the issue you were having resolved.So it turns out that KDE and GNOME now follow slightly different thumbnail naming and metadata conventions. So, that was how you can restart the KDE plasma desktop without rebooting your machine. kstart allows you to launch applications as independent services so they won’t close as soon as you close the Terminal. You’ll notice Firefox closes automatically since it was running on the Terminal as a dependent service. Now close the Terminal but not the Firefox. This will launch Firefox if you have it installed. For instance, type firefox in a terminal and hit enter. Clearly, we haven’t done anything like that so why use the kstart command? For the uninitiated, you can also launch apps via the Terminal by simply using their names. There are a number of different parameters you can assign. You can specify the location of the app window, the size, or whether it should appear on all desktops or just one, etc. kstart – the kstart command is used to launch applications with special properties.You can use the kquitapp5 -h command in a terminal to know more about it. So you can use kquitapp5 to stop the application itself, thus killing the desktop out of your system’s memory. The Plasma desktop is run by an application named plasmashell. kquitapp5 – This command takes the name of the application you want to stop.This will call all the running instances of the chrome process. Using killall to kill plasma desktop makes sure that no other instances of it are running but the one you will be starting using the kstart command. For instance, if you have 5 instances of Chrome running simultaneously you can use killall chrome. killall – This command kills all of the processes associated with the name of the process you give it.In that spirit, before using the commands let’s see what the commands actually do. Now you don’t really need to know this, but if you’re using Linux you’re probably enjoying the learning experience. Kstart5 plasmashell What do these commands mean? Here’s how you can do this using the kquitapp5 command: kquitapp5 plasmashell
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |