是否可以为Mac OS X编写一个监控垃圾箱的程序,并在填充罐时动态更改图标?
Yes, it's possible. Candybar does it. I expect that rather than dynamically changing the icon, they just register a new 'empty' and 'full' icon with the Dock process.
Panic的Candybar可让您自定义系统图标(包括垃圾桶),因此必须可以。
The NSDockTile class allows you to make changes to your application's icon in the dock:
The Trash is actually a hidden folder in the user's home folder called .Trash
I guess you could monitor whether or not it's empty by periodically finding the size of the folder. Or you could run ls
using NSTask, and find out whether there are any files left in it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.