Extract GPS coordinates in KDE with just a right click
Posted by
ads
on
Thursday, 2026-07-02 Posted in [Code-Snippets][Fotografie][Kde][Python][Shell][Software]
Oftentimes I need the GPS coordinates from where a picture was taken. In the past I was using exiftool (see this blog posting), but that is cumbersome: right click the image in Dolphin, click “Copy location”, open a terminal, search in the history (Ctrl*r) the last line with exiftool, jump to the end, remove the previous picture filename, paste the filename, and then select and copy the coordinates. Too many steps. There must be a better way.
KDE has a feature where one can create custom context menus, called “service menus”. Awesome. All I need is two files:
A .desktop file in the servicemenus folder
A small script which extracts the coordinates
And while I’m at it, also transform the EXIFspecializedGPSLatitude, GPSLatitudeRef, GPSLongitude and GPSLongitudeRef into a more readable Decimal Degrees format. And also copy the result directly into the clipboard, saving a couple of steps.
.desktop file
The folder for the servicemenus is: ~/.local/share/kio/servicemenus/. Create a new file in this folder, the name doesn’t really matter as long as it ends with .desktop. In my case I’m using: ~/.local/share/kio/servicemenus/extract_gps_coordinates.desktop. The content of the file: