diff options
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/icons.ts | 70 | ||||
| -rw-r--r-- | src/utils/system.ts | 12 |
2 files changed, 48 insertions, 34 deletions
diff --git a/src/utils/icons.ts b/src/utils/icons.ts index 847ca0f..b309d7b 100644 --- a/src/utils/icons.ts +++ b/src/utils/icons.ts @@ -2,33 +2,49 @@ import { Apps } from "@/services/apps"; import { Gio } from "astal"; import type AstalApps from "gi://AstalApps"; -// Code points from https://www.github.com/lukas-w/font-logos -export const osIcons: Record<string, number> = { - almalinux: 0xf31d, - alpine: 0xf300, - arch: 0xf303, - arcolinux: 0xf346, - centos: 0x304, - debian: 0xf306, - elementary: 0xf309, - endeavouros: 0xf322, - fedora: 0xf30a, - gentoo: 0xf30d, - kali: 0xf327, - linuxmint: 0xf30e, - mageia: 0xf310, - manjaro: 0xf312, - nixos: 0xf313, - opensuse: 0xf314, - suse: 0xf314, - sles: 0xf314, - sles_sap: 0xf314, - pop: 0xf32a, - raspbian: 0xf315, - rhel: 0xf316, - rocky: 0xf32b, - slackware: 0xf318, - ubuntu: 0xf31b, +export const osIcons: Record<string, string> = { + almalinux: "", + alpine: "", + arch: "", + archcraft: "", + arcolinux: "", + artix: "", + centos: "", + debian: "", + devuan: "", + elementary: "", + endeavouros: "", + fedora: "", + freebsd: "", + garuda: "", + gentoo: "", + hyperbola: "", + kali: "", + linuxmint: "", + mageia: "", + openmandriva: "", + manjaro: "", + neon: "", + nixos: "", + opensuse: "", + suse: "", + sles: "", + sles_sap: "", + "opensuse-tumbleweed": "", + parrot: "", + pop: "", + raspbian: "", + rhel: "", + rocky: "", + slackware: "", + solus: "", + steamos: "", + tails: "", + trisquel: "", + ubuntu: "", + vanilla: "", + void: "", + zorin: "", }; export const desktopEntrySubs: Record<string, string> = { diff --git a/src/utils/system.ts b/src/utils/system.ts index 31e9cfd..8180e48 100644 --- a/src/utils/system.ts +++ b/src/utils/system.ts @@ -56,13 +56,11 @@ export const notify = (props: { export const osId = GLib.get_os_info("ID") ?? "unknown"; export const osIdLike = GLib.get_os_info("ID_LIKE"); -export const osIcon = String.fromCodePoint( - (() => { - if (osIcons.hasOwnProperty(osId)) return osIcons[osId]; - if (osIdLike) for (const id of osIdLike.split(" ")) if (osIcons.hasOwnProperty(id)) return osIcons[id]; - return 0xf31a; - })() -); +export const osIcon = (() => { + if (osIcons.hasOwnProperty(osId)) return osIcons[osId]; + if (osIdLike) for (const id of osIdLike.split(" ")) if (osIcons.hasOwnProperty(id)) return osIcons[id]; + return ""; +})(); export const currentTime = Variable(GLib.DateTime.new_now_local()).poll(1000, () => GLib.DateTime.new_now_local()); export const bindCurrentTime = (format: string, fallback?: (time: GLib.DateTime) => string) => |