Cinnamon开始菜单-CSDN博客
设置模块都是做好的,比GNOME简单得多!
在 applet.js 里增加
const Settings = imports.ui.settings;
this.settings = new Settings.AppletSettings(this, 'HTYMenu@sonichy', instance_id);
this.settings.bind('menu-icon', 'menuIcon', this.updateIcon);
updateIcon() {
this.set_applet_icon_name(this.menuIcon);
}
settings-schema.json
{
"menu-icon" : {
"type" : "iconfilechooser",
"default" : "cinnamon-symbolic",
"description" : "Icon",
"tooltip" : "Select an icon to show in the panel.",
"default_icon" : "cinnamon-symbolic"
}
}
自动生成 设置界面

自动生成 图标选择控件(iconfilechooser)
有点卡,选好自动触发绑定的函数。









![[10-3]软件I2C读写MPU6050 江协科技学习笔记(16个知识点)](https://i-blog.csdnimg.cn/direct/4d4c7839d80d427f8e7c008410ac0a2d.png)










