ghostty: keep warm daemon alive with no windows

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-07-29 22:45:02 +01:00
parent 734d18791c
commit 1b59058b91
2 changed files with 20 additions and 12 deletions

View file

@ -44,6 +44,8 @@ in
confirm-close-surface = false;
gtk-titlebar = false;
gtk-single-instance = true;
# keeps the warm instance alive with zero windows
quit-after-last-window-closed = false;
cursor-style = "bar";
cursor-style-blink = true;
};

View file

@ -1997,11 +1997,12 @@ in
property int vol: sink && sink.audio ? Math.round(sink.audio.volume * 100) : 0
property bool muted: sink && sink.audio ? sink.audio.muted : false
property string volIcon: muted ? "volume_off"
: vol > 66 ? "volume_up"
: vol > 33 ? "volume_down"
: vol > 0 ? "volume_mute"
: "volume_off"
// caelestia's getVolumeIcon: one threshold at 50%, and
// "no_sound" (not volume_off) for the muted state.
property string volIcon: muted ? "no_sound"
: vol >= 50 ? "volume_up"
: vol > 0 ? "volume_down"
: "volume_mute"
function openVolDropdown() {
bar.toggleDropdown(volDropdown, function() {
@ -2253,13 +2254,18 @@ in
PowerProfiles.profile === PowerProfile.PowerSaver ? "power-saver"
: PowerProfiles.profile === PowerProfile.Performance ? "performance"
: "balanced"
property string batteryIcon: charging ? "battery_charging_full"
: batteryLevel >= 90 ? "battery_full"
: batteryLevel >= 70 ? "battery_6_bar"
: batteryLevel >= 50 ? "battery_5_bar"
: batteryLevel >= 30 ? "battery_3_bar"
: batteryLevel >= 15 ? "battery_2_bar"
: "battery_alert"
// caelestia's getBatteryIcon: a 7-step bar scale rather
// than one flat charging glyph. The level-- skips the
// charging variants Material Symbols doesn't ship (40,
// 70). Low-battery warning is carried by colour below.
function battIconFor(pct, chg) {
if (pct === 1) return chg ? "battery_charging_full" : "battery_full";
let level = Math.floor(pct * 7);
if (chg && (level === 4 || level === 1)) level--;
return chg ? "battery_charging_" + ((level + 3) * 10)
: "battery_" + level + "_bar";
}
property string batteryIcon: battIconFor(batteryLevel / 100, charging)
// Stacked: icon over percentage. Side by side no longer
// fits, but the level is worth keeping on a laptop.