简体   繁体   English

在Linux中更改默认系统文件复印机

[英]Change default system file copier in Linux

I have coded a python app to manage file copies on linux, I want to know how can I get it to process copy/paste calls, like those launched by pressing ctrl + c/ ctrl + v or right click / Copy..., or drag and drop, instead of using system copier. 我已经编写了一个python应用程序来管理linux上的文件副本,我想知道如何获取它来处理复制/粘贴调用,例如通过按ctrl + c / ctrl + v或右键单击/ Copy ...启动的调用,或拖放,而不使用系统复印机。

Can I do this for all deb based linux dist. 我可以为所有基于deb的linux dist执行此操作吗? or its on different ways for Ubuntu, Mint, Debian, and so on???? 还是对Ubuntu,Mint,Debian等使用不同的方式???

Forgive my English and thanks in advance! 请原谅我的英语,并预先感谢!

Short answer: no, you can't. 简短的回答:不,你不能。

Long answer: the component that does "copy&paste" is not alone defined by the distribution. 长答案:进行复制和粘贴的组件并不是由发行版单独定义的。 This is a function of the desktop system / window manager. 这是桌面系统/窗口管理器的功能。 In other words: there is no such thing as the "default system file" copier for "Linux". 换句话说:没有用于“ Linux”的“默认系统文件”复印机。

There are file mangers like dolphin for KDE; 有一些文件管理器,例如KDE的dolphin; or nautilus on gnome that all come with their own implementation of file copy. 或gnome上的nautilus都带有自己的文件复制实现。 Some good, some not so much (try copying a whole directory with thousands of files with nautilus). 有些不错,有些则不是很多(尝试使用nautilus复制包含数千个文件的整个目录)。

But the real question here: why do you want to do that? 但是这里真正的问题是:为什么要这么做? What makes you think that your file-copy implementation that requires an interpreter to run ... is suited to replace the defaults that come with Linux? 是什么让您认为需要运行解释器的文件复制实现适合替换Linux随附的默认设置? Why do you think that your re-invention of an existing wheel will be better at doing anything?! 您为什么认为对现有车轮的重新发明在做任何事情上会更好?

Edit: if your reason to "manage" system copy is some attempt to prevent the user from doing certain things ... you should better look into file permissions and such ideas. 编辑:如果您要“管理”系统副本的原因是为了防止用户执行某些操作而进行的某些尝试……您应该更好地研究文件许可权和此类想法。 Within a Linux environment, you simply can't manage what the user is doing in the first place by manipulating some tools. 在Linux环境中,您根本无法通过操纵某些工具来首先管理用户的操作。 Instead: understand the management capabilities that the OS offers to you, and use those! 相反:了解操作系统为您提供的管理功能,然后使用它们!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM