You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何移除Sublime Text 4中Guna主题残留的时钟天气组件

移除Guna主题残留的侧边栏时钟组件

我安装了Guna主题,想保留它的配色方案,但切换回默认主题后,主题附带的时钟和天气组件仍无法移除。
Clock widget from the Guna theme, still showing in the Default theme.

尝试将时钟纹理所在图层的透明度设为0,仅实现了时钟颜色改变的效果,无法彻底隐藏。Guna主题默认设置第166行起的相关代码如下:

{
    "class": "sidebar_container",
    "layer0.texture": "Guna/assets/simple/sidebar/sidebar-bg-clock-nb.png",
    "layer0.inner_margin": [15, 55, 15, 0],
    //"layer0.inner_margin": [15, 70, 15, 0],
    //"layer0.inner_margin": [15, 92, 15, 0],
    "layer0.tint": "color(var(--background))",
    "layer0.opacity": 1,
    "content_margin": [0, 45, 0, 0],
    //"content_margin": [0, 60, 0, 0],
    //"content_margin": [0, 82, 0, 0],
}, {
    "class": "sidebar_container",
    "settings": ["gnwidgx"],
    "layer0.texture": "Guna/assets/simple/sidebar/sidebar-bg-nb.png",
    "layer0.inner_margin": [15, 55, 15, 0],
    "layer0.tint": "color(var(--background))",
    "layer0.opacity": 1,
    "content_margin": [0, 0, 0, 0]
}

参照隐藏文件图标的方法,将时钟组件的content_margin设为[0,0],代码如下:

{
    "variables": {
    },
    "rules":
    [
        {
            "class": "sidebar_container",
            "content_margin": [0,0],
            "layer0.opacity": 0
        },
        {
            "class": "sidebar_container",
            "content_margin": [0,0],
            "layer1.opacity": 0
        }
    ]
}

结果导致侧边栏所有元素(包括文件和文件夹)出现异常拖尾效果:
Result of my custom theme settings


解决方法

  • 精准定位目标组件,避免全局影响
    你的自定义规则未区分带时钟的侧边栏和普通侧边栏,导致所有元素异常。参考Guna代码,带时钟的sidebar_container没有["gnwidgx"]设置标记,可通过排除该标记单独修改:

    {
        "variables": {},
        "rules": [
            {
                "class": "sidebar_container",
                "settings": ["!gnwidgx"], // 仅匹配带时钟的侧边栏
                "layer0.texture": "", // 清空时钟纹理路径
                "content_margin": [0, 0, 0, 0], // 恢复正常边距
                "layer0.opacity": 1 // 保持背景透明度正常
            }
        ]
    }
    
  • 清除主题缓存
    若修改后仍有残留,找到主题缓存目录(如~/.config/gtk-3.0/cache),删除Guna相关缓存文件,重启应用或系统生效。

  • 强制重置侧边栏样式
    若上述方法无效,可强制将目标侧边栏属性重置为系统默认:

    {
        "variables": {},
        "rules": [
            {
                "class": "sidebar_container",
                "settings": ["!gnwidgx"],
                "layer0.texture": "@theme_bg_dark", // 使用系统默认背景
                "layer0.inner_margin": [0, 0, 0, 0],
                "content_margin": [0, 0, 0, 0],
                "layer0.tint": "",
                "layer0.opacity": 1
            }
        ]
    }
    

内容的提问来源于stack exchange,提问作者mihaelkyeah

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.11 10:20:41