- Prompt.tsx: GLib.get_user_name() au lieu de hardcode "tetardtek" - ghost-shell.desktop: $HOME au lieu de chemin absolu - SystemStats.tsx: lecture /proc/stat + /proc/meminfo (zero fork, économie batterie) - Battery.tsx: createDerivedBinding percentage+charging — réactif sur branchement
19 lines
450 B
TypeScript
19 lines
450 B
TypeScript
import GLib from "gi://GLib"
|
|
import { createPoll } from "ags/time"
|
|
|
|
export default function Prompt() {
|
|
const username = GLib.get_user_name() || "user"
|
|
|
|
const cursor = createPoll("_", 600, () => {
|
|
// alternate between _ and empty to create blink
|
|
return Date.now() % 1200 < 600 ? "_" : " "
|
|
})
|
|
|
|
return (
|
|
<box>
|
|
<label class="prompt-name" label={username} />
|
|
<label class="prompt-cursor" label={cursor} />
|
|
</box>
|
|
)
|
|
}
|