Files
omarchy/plugins/omaplug/panel/Presentation.js
T
asepharyana 1cdb82a76f Sync config from arch
- hypr/apps.lua
- hypr/autostart.lua
- hypr/envs.lua
- hypr/hyprland.lua
- hypr/hyprsunset.conf
- hypr/input.lua
- hypr/looknfeel.lua
- hypr/omasettings.lua
- hypr/xdph.conf
- omarchy/branding/about.txt
- omarchy/branding/screensaver.txt
- omarchy/extensions/omarchy-menu.jsonc
- omarchy/hooks/battery-low.d/play-warning-sound.sample
- omarchy/hooks/font-set.d/show-font-notification.sample
- omarchy/hooks/post-boot.d/weather.sample
- omarchy/hooks/post-update.d/install-voxtype.hook
- omarchy/hooks/post-update.d/setup-agent.hook
- omarchy/hooks/post-update.d/setup-fingerprint.hook
- omarchy/hooks/post-update.d/show-update-notification.sample
- omarchy/hooks/pre-refresh-pacman.d/add-custom-repo.sample
- omarchy/hooks/theme-set.d/show-theme-notification.sample
- omarchy/shell.json
- omarchy/shell.toml
- omarchy/theme.name
- omarchy/themes/azure-glow/README.md
- omarchy/themes/azure-glow/alacritty.toml
- omarchy/themes/azure-glow/btop.theme
- omarchy/themes/azure-glow/hyprland.conf
- omarchy/themes/azure-glow/hyprlock.conf
- omarchy/themes/azure-glow/icons.theme
- … 269 more
2026-09-23 15:19:12 +07:00

71 lines
2.0 KiB
JavaScript

.pragma library
function marketplaceUrl(pluginId) {
return "https://plugins.omarchy.org/plugin.html?id=" + encodeURIComponent(String(pluginId))
}
function listingChecksUrl(pluginId) {
return marketplaceUrl(pluginId) + "#verification"
}
function shortSha(sha) {
var value = String(sha || "")
return value.length > 7 ? value.substring(0, 7) : value
}
function normalizedGitHubUrl(repoUrl) {
var url = String(repoUrl || "")
if (!/^https:\/\/github\.com\//.test(url)) return ""
return url.replace(/\.git\/?$/, "").replace(/\/+$/, "")
}
function commitUrl(repoUrl, sha) {
var url = normalizedGitHubUrl(repoUrl)
var commit = String(sha || "")
return url !== "" && commit !== "" ? url + "/commit/" + commit : ""
}
function authorUrl(repoUrl) {
var match = normalizedGitHubUrl(repoUrl).match(/^https:\/\/github\.com\/([^\/]+)/)
return match ? "https://github.com/" + match[1] : ""
}
function compareUrl(repoUrl, fromSha, toSha) {
var url = normalizedGitHubUrl(repoUrl)
var from = String(fromSha || "")
var to = String(toSha || "")
if (url === "" || from === "" || to === "" || from === to) return ""
return url + "/compare/" + from + "..." + to
}
function kindLabel(kinds, knownKinds) {
if (!kinds) return ""
var parts = String(kinds).split(",")
var labels = []
for (var i = 0; i < parts.length; i++) {
var kind = parts[i].trim()
if (kind === "") continue
var label = kind
for (var j = 0; j < knownKinds.length; j++) {
if (knownKinds[j].value === kind) {
label = knownKinds[j].label
break
}
}
labels.push(label)
}
return labels.join(", ").toUpperCase()
}
function iconColor(name) {
var value = String(name || "")
var hash = 0
for (var i = 0; i < value.length; i++) hash = (hash * 31 + value.charCodeAt(i)) | 0
var palette = [
"#c0392b", "#2980b9", "#27ae60", "#d35400", "#8e44ad",
"#16a085", "#e67e22", "#2c3e50", "#c0272f", "#21618c",
"#1e8449", "#b9770e", "#7d3c98", "#117a65", "#ca6f1e"
]
return palette[Math.abs(hash) % palette.length]
}