You are not logged in.
Hi Archers,
I installed python-caja and added a new item to the context menu, but I can't figure out how to pass the caja's selected files to the script.
This is the code written so far:
import os
import urllib
import gi
gi.require_version('Caja', '2.0')
from gi.repository import Caja, GObject
class ColumnExtension(GObject.GObject, Caja.MenuProvider):
def __init__(self):
pass
def menu_activate_cb(self, menu, file):
path = "/var/log/dmesg" #Replace with caja selected files
os.system('zenity --warning --text="/usr/bin/notepadqq {}"'.format(path))
os.system('/usr/bin/notepadqq {}'.format(path))
def get_file_items(self, window, file):
item = Caja.MenuItem(name='NotepadMenuProvider::Notepad',
label='Edit with Notepadqq',
tip='',
icon='')
item.connect('activate', self.menu_activate_cb, file)
return item,can someone help me? or indicate me an exhaustive documentation?
Offline