mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[scripts] add a script for marking files as recently used
This commit is contained in:
parent
cf9f46a90e
commit
1e9f4c7618
1 changed files with 14 additions and 0 deletions
14
scripts/mark-as-recently-used
Executable file
14
scripts/mark-as-recently-used
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
# Taken from <https://unix.stackexchange.com/a/509417/411555>
|
||||||
|
|
||||||
|
import gi
|
||||||
|
import sys
|
||||||
|
|
||||||
|
gi.require_version("Gtk", "3.0")
|
||||||
|
from gi.repository import Gtk, Gio, GLib # noqa E402
|
||||||
|
|
||||||
|
rec_mgr = Gtk.RecentManager.get_default()
|
||||||
|
for arg in sys.argv[1:]:
|
||||||
|
rec_mgr.add_item(Gio.File.new_for_path(arg).get_uri())
|
||||||
|
GLib.idle_add(Gtk.main_quit)
|
||||||
|
Gtk.main()
|
Loading…
Reference in a new issue