Add the waybar config and autostart file the hyprcosmic profile needs

The profile disables cosmic-panel, so without these a HyprCosmic session is a
compositor with no bar, no clock and no tray. Waybar's shipped default is not
a substitute: /etc/xdg/waybar/config.jsonc is built entirely from sway/*
modules and renders nothing under cosmic-comp.

Module choices are pinned to what cosmic-comp actually advertises on the
Wayland registry, checked against a live session rather than assumed:

  ext/workspaces  ext_workspace_manager_v1, present in stock cosmic-comp.
  wlr/taskbar     zwlr_foreign_toplevel_management_v1, absent from stock
                  cosmic-comp and supplied by this fork's Patch A. Under a
                  stock compositor the module stays empty and the bar
                  otherwise works, so the config is not fork-only.
  tray            cosmic-panel normally hosts the StatusNotifierWatcher via
                  cosmic-applet-status-area; with the panel disabled waybar
                  hosts it instead.

The stylesheet keeps every colour behind an @define-color so that a HyDE
theme's waybar.theme -- which is only a list of such declarations, the bespoke
CSS being HyDE's own rather than any theme's -- can recolour the bar by being
sourced ahead of it.

Configs install to /usr/share/hyprcosmic/waybar so the autostart file needs no
per-user paths, which matters because the profile parser is deliberately not a
shell and cannot expand ~ or $HOME.

Verified: config.jsonc parses as JSONC and every compositor module placed on
the bar has a matching config block.
This commit is contained in:
2026-08-10 08:36:11 +07:00
parent 8d21c0d084
commit 214a77ea18
3 changed files with 168 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
# Programs the HyprCosmic session starts after COSMIC's own components.
#
# Installed to ~/.config/hyprcosmic/autostart and read by cosmic-session's
# profile module. One command per line. Arguments and quoting work, but this is
# NOT a shell: no $VAR, no ~, no globs, no $(...). Paths must be absolute.
#
# `#` starts a comment where a word would start, so `--color=#1a1b26` is fine
# but `--color #1a1b26` is not; quote it as '#1a1b26' if you need the latter.
# The bar. Configs live under /usr/share/hyprcosmic so this file needs no
# per-user paths; copy them into ~/.config/hyprcosmic/waybar and point here to
# customise.
waybar -c /usr/share/hyprcosmic/waybar/config.jsonc -s /usr/share/hyprcosmic/waybar/style.css
# rofi is not a daemon. It is launched on demand by a keybinding, which COSMIC
# stores in com.system76.CosmicSettings.Shortcuts rather than here. Until that
# binding is set, run `rofi -show drun` from a terminal.
# HyDE drives wallpaper through swww, which is not packaged for Fedora. Once
# it is available, uncomment:
# swww-daemon
+73
View File
@@ -0,0 +1,73 @@
// Waybar configuration for a HyprCosmic session.
//
// Waybar's shipped default (/etc/xdg/waybar/config.jsonc) is built entirely
// around sway/* modules and shows nothing at all under cosmic-comp, so this
// exists rather than a handful of overrides.
//
// Module choices are constrained by what cosmic-comp actually advertises on the
// Wayland registry, which was checked against a live session:
//
// ext/workspaces ext_workspace_manager_v1 -- advertised by stock cosmic-comp.
// wlr/taskbar zwlr_foreign_toplevel_management_v1 -- NOT in stock
// cosmic-comp; provided by the HyprCosmic fork's Patch A.
// Under a stock compositor this module stays empty and the
// rest of the bar still works.
// tray Needs a StatusNotifierWatcher. cosmic-panel normally
// supplies one via cosmic-applet-status-area, and the
// hyprcosmic profile disables the panel, so waybar hosts the
// watcher itself here.
{
"layer": "top",
"position": "top",
"height": 34,
"spacing": 6,
"modules-left": ["ext/workspaces", "wlr/taskbar"],
"modules-center": ["clock"],
"modules-right": ["pulseaudio", "network", "cpu", "memory", "battery", "tray"],
"ext/workspaces": {
"format": "{name}",
"on-click": "activate"
},
"wlr/taskbar": {
"format": "{icon}",
"icon-size": 18,
"tooltip-format": "{title}",
"on-click": "activate",
"on-click-middle": "close"
},
"clock": {
"format": "{:%a %d %b %H:%M}",
"tooltip-format": "<tt><small>{calendar}</small></tt>"
},
"pulseaudio": {
"format": "{icon} {volume}%",
"format-muted": "muted",
"format-icons": { "default": ["", "", ""] },
"on-click": "pavucontrol"
},
"network": {
"format-wifi": " {signalStrength}%",
"format-ethernet": " wired",
"format-disconnected": " offline",
"tooltip-format": "{ifname}: {ipaddr}"
},
"cpu": { "format": " {usage}%", "interval": 5 },
"memory": { "format": " {percentage}%", "interval": 5 },
"battery": {
"states": { "warning": 30, "critical": 15 },
"format": "{icon} {capacity}%",
"format-charging": " {capacity}%",
"format-plugged": " {capacity}%",
"format-icons": ["", "", "", "", ""]
},
"tray": { "icon-size": 18, "spacing": 8 }
}
+74
View File
@@ -0,0 +1,74 @@
/* Waybar styling for a HyprCosmic session.
*
* Deliberately plain. HyDE's own bar styling is bespoke CSS belonging to HyDE
* rather than to any theme: a HyDE theme's waybar.theme file is only a short
* list of @define-color declarations. So the palette below is what a theme
* import can eventually overwrite, and the geometry is what stays put.
*
* Keep every colour reference pointing at one of these names, so that dropping
* a theme's waybar.theme in ahead of this file is enough to re-colour the bar.
*/
@define-color bar-bg rgba(26, 27, 38, 0.85);
@define-color bar-fg #c0caf5;
@define-color accent #7aa2f7;
@define-color warning #e0af68;
@define-color critical #f7768e;
@define-color muted #565f89;
* {
font-family: "FontAwesome 6 Free", "Noto Sans", sans-serif;
font-size: 13px;
border: none;
border-radius: 0;
min-height: 0;
}
window#waybar {
background: @bar-bg;
color: @bar-fg;
}
#workspaces button {
padding: 0 8px;
color: @muted;
background: transparent;
}
#workspaces button.active {
color: @bar-fg;
box-shadow: inset 0 -2px @accent;
}
#workspaces button:hover {
color: @bar-fg;
background: rgba(122, 162, 247, 0.15);
}
#taskbar button {
padding: 0 6px;
background: transparent;
}
#taskbar button.active {
box-shadow: inset 0 -2px @accent;
}
#clock,
#pulseaudio,
#network,
#cpu,
#memory,
#battery,
#tray {
padding: 0 10px;
}
#clock {
font-weight: bold;
}
#battery.warning { color: @warning; }
#battery.critical { color: @critical; }
#network.disconnected { color: @critical; }
#pulseaudio.muted { color: @muted; }