Refonte complete du rice. Palette 100% originale (Mitsuri Kanroji inspired), zero emprunt Dracula/Catppuccin. 50 fichiers, 3200+ lignes. Palette v2: - palette.sh source de verite unique (dark + light) - 5 accents (magenta, lilac, mitsuri, lavande, champagne) - 4 semantiques derivees, 4 niveaux texte, 6 fonds - Gradient signature: magenta → lilac → lavande → mitsuri - Variante Light: fonds lavande, accents assombris WCAG Terminal: - kitty (remplace COSMIC Term comme principal) - Maple Mono NF (cursive italics, ligatures) - Cursor trail magenta, splits/layouts tiling, undercurl - Vi-mode zsh avec cursor shape adaptatif Shell: - starship 3 lignes (palette nommee, brain_name, battery, sudo) - zshrc v2 (nouveaux outils, fzf pimp, shell functions, vi-mode) - Commandes custom: proj, glog, fkill, colors, hotkeys, weather, y Desktop: - AGS config (bar 3-pills, OSD gradient, launcher, notifications) - COSMIC Dark + Light v2 (7 fichiers RON chacun) - COSMIC Term v2 (color schemes dark/light, Maple Mono NF) - GTK3/GTK4 dark + light css - Vivaldi theme v2 Outils: - +kitty +dust +procs +tokei +sd +hyperfine +gping +Maple Mono NF - Propagation palette sur: bat, btop, cava, yazi, lazygit, rofi, delta, fastfetch, atuin, ls-colors, vivaldi - Claude Code statusline brain-aware Docs: - README v2 complet (palette, structure, raccourcis, commandes) - help.md v2 (reference exhaustive)
96 lines
3.3 KiB
JavaScript
96 lines
3.3 KiB
JavaScript
// ── violet-chaton v2 — OSD widget ───────────────────────────────────────────
|
|
// Overlay volume / brightness avec gradient Mitsuri
|
|
|
|
const audio = await Service.import("audio");
|
|
|
|
// ── OSD reveal timer ────────────────────────────────────────────────────────
|
|
|
|
let osdTimeout = null;
|
|
|
|
const showOSD = (window) => {
|
|
window.visible = true;
|
|
if (osdTimeout) clearTimeout(osdTimeout);
|
|
osdTimeout = setTimeout(() => {
|
|
window.visible = false;
|
|
}, 1500);
|
|
};
|
|
|
|
// ── Volume OSD ──────────────────────────────────────────────────────────────
|
|
|
|
const VolumeOSD = () => {
|
|
const icon = Widget.Label({ className: "icon" });
|
|
const progress = Widget.ProgressBar();
|
|
const label = Widget.Label({ className: "label" });
|
|
|
|
const box = Widget.Box({
|
|
className: "osd",
|
|
children: [icon, progress, label],
|
|
connections: [[audio, (self) => {
|
|
const vol = audio.speaker?.volume || 0;
|
|
const muted = audio.speaker?.isMuted;
|
|
icon.label = muted ? "" : vol > 0.66 ? "" : vol > 0.33 ? "" : "";
|
|
progress.value = vol;
|
|
label.label = `${Math.round(vol * 100)}%`;
|
|
}, "speaker-changed"]],
|
|
});
|
|
|
|
return box;
|
|
};
|
|
|
|
// ── Brightness OSD ──────────────────────────────────────────────────────────
|
|
|
|
const BrightnessOSD = () => {
|
|
const icon = Widget.Label({ className: "icon", label: "" });
|
|
const progress = Widget.ProgressBar();
|
|
const label = Widget.Label({ className: "label" });
|
|
|
|
const getBrightness = () => {
|
|
try {
|
|
const max = Number(Utils.exec("brightnessctl max"));
|
|
const cur = Number(Utils.exec("brightnessctl get"));
|
|
return max > 0 ? cur / max : 0;
|
|
} catch {
|
|
return 0;
|
|
}
|
|
};
|
|
|
|
const box = Widget.Box({
|
|
className: "osd",
|
|
children: [icon, progress, label],
|
|
connections: [[500, (self) => {
|
|
const val = getBrightness();
|
|
progress.value = val;
|
|
label.label = `${Math.round(val * 100)}%`;
|
|
}]],
|
|
});
|
|
|
|
return box;
|
|
};
|
|
|
|
// ── OSD windows ─────────────────────────────────────────────────────────────
|
|
|
|
export const OSD = (monitor) => {
|
|
const volumeWin = Widget.Window({
|
|
name: `osd-volume-${monitor}`,
|
|
monitor,
|
|
anchor: ["bottom"],
|
|
layer: "overlay",
|
|
visible: false,
|
|
child: VolumeOSD(),
|
|
});
|
|
|
|
const brightnessWin = Widget.Window({
|
|
name: `osd-brightness-${monitor}`,
|
|
monitor,
|
|
anchor: ["bottom"],
|
|
layer: "overlay",
|
|
visible: false,
|
|
child: BrightnessOSD(),
|
|
});
|
|
|
|
// Auto-show on volume change
|
|
Utils.merge([audio.speaker?.bind("volume")], () => showOSD(volumeWin));
|
|
|
|
return [volumeWin, brightnessWin];
|
|
};
|