Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request. Recent projects or documents in context menu #2283

Open
AlexZCP opened this issue Sep 12, 2024 · 1 comment
Open

Feature request. Recent projects or documents in context menu #2283

AlexZCP opened this issue Sep 12, 2024 · 1 comment

Comments

@AlexZCP
Copy link

AlexZCP commented Sep 12, 2024

Hi, everybody!

Dash to dock is brilliant extension, thank you much for that.
But one thing is missing due to Windows and Mac.
In context menu of docked app is very useful to have an recent docs or paths list, based on app mime-types or etc.

This functionality was already covered by such extensions:
https://extensions.gnome.org/extension/33/jump-lists/
https://extensions.gnome.org/extension/1747/quicklists/

But ones are no more supported in modern Gnome-shell.
If smb can point me to existing solution, I will appreciate.

However, it'd be great to support such feature inside dash-to-dock extension built-in.

@ppvan
Copy link

ppvan commented Dec 21, 2024

I can't found the source code for
https://extensions.gnome.org/extension/33/jump-lists/
but for
https://extensions.gnome.org/extension/1747/quicklists/
the solution seem be:

  1. Get recent access files and directories from Gtk.RecentManager
  2. Filter by app mime types

Since Gtk.RecentManager is supported in GTK 4, it's should be possible in modern GNOME (correct me if not)
I did some test with this simple script and compare it with vscode's internal (~/.config/Code/User/globalStorage/state.vscdb. Not an exact match, but good enough:
Screenshot From 2024-12-22 00-32-14

import gi
gi.require_version('Gtk', '4.0')
from gi.repository import Gtk, Gio

class RecentFilesApp(Gtk.Application):
    def __init__(self):
        super().__init__(application_id="com.example.recentfiles",
                        flags=Gio.ApplicationFlags.FLAGS_NONE)

    def do_activate(self):
        recent_manager = Gtk.RecentManager.get_default()
        items = list(recent_manager.get_items())
        
        for item in items:
            if item.last_application() == "code":
                print(item.get_display_name(), item.get_uri_display())
        
        # Exit after printing
        self.quit()

app = RecentFilesApp()
app.run(None)

However, I'm not familar with extension development or dash to dock, so I'm not sure if it can be implemented easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants