bar: use nf icons for os icon
This commit is contained in:
parent
21e9d1fcb5
commit
82e31b6d8d
2 changed files with 48 additions and 34 deletions
|
|
@ -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> = {
|
||||
|
|
|
|||
|
|
@ -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) =>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue