Leave this to the themes

This commit is contained in:
David Heinemeier Hansson
2026-05-19 21:01:51 +02:00
parent abf0a68b54
commit 0f4490c9fc
10 changed files with 18 additions and 90 deletions
-20
View File
@@ -1,20 +0,0 @@
#!/bin/bash
# omarchy:summary=Set Hyprland corners to sharp or round (the shell mirrors Hyprland)
# omarchy:args=<sharp|round>
# omarchy:examples=omarchy style corners round | omarchy style corners sharp
if [[ $1 != "sharp" && $1 != "round" ]]; then
echo "Usage: omarchy-style-corners <sharp|round>"
exit 1
fi
# The shell tracks Hyprland's `decoration:rounding` directly via
# Quickshell's qs.Commons.Style singleton; no separate shell state file is
# written.
omarchy-style-corners-hyprland "$1"
case $1 in
sharp) omarchy-notification-send "Sharp corners enabled" -g 󰝣 ;;
round) omarchy-notification-send "Round corners enabled" -g 󰘇 ;;
esac
-17
View File
@@ -1,17 +0,0 @@
#!/bin/bash
# omarchy:summary=Set or toggle shape of Hyprland window corners
# omarchy:args=[toggle|sharp|round]
# omarchy:examples=omarchy style corners hyprland toggle | omarchy style corners hyprland round | omarchy style corners hyprland sharp
case "${1:-toggle}" in
round) set -- on ;;
sharp) set -- off ;;
toggle) ;;
*)
echo "Usage: omarchy-style-corners-hyprland [toggle|sharp|round]"
exit 1
;;
esac
omarchy-hyprland-toggle rounded-corners "$1"
-19
View File
@@ -1,19 +0,0 @@
#!/bin/bash
# omarchy:summary=No-op shim; the shell now mirrors Hyprland's decoration:rounding directly
# omarchy:args=[toggle|sharp|round]
# omarchy:examples=omarchy style corners quickshell toggle | omarchy style corners quickshell round | omarchy style corners quickshell sharp
# qs.Commons.Style reads decoration:rounding from hyprctl. Theme changes
# refresh it through shell IPC, while user corner toggles still trigger their
# own refresh. There is no separate quickshell-menu.json to write anymore.
# This shim stays around so anyone still calling the old subcommand (or the
# dispatcher in omarchy-style-corners) doesn't error out.
case "${1:-toggle}" in
round|sharp|toggle) exit 0 ;;
*)
echo "Usage: omarchy-style-corners-quickshell [toggle|sharp|round]" >&2
exit 1
;;
esac
-7
View File
@@ -1,7 +0,0 @@
-- Use rounded window corners.
hl.config({
decoration = {
rounding = 6,
rounding_power = 3,
},
})
-3
View File
@@ -90,7 +90,6 @@
"style.font": {"icon":"","label":"Font","keywords":"typeface","provider":"fonts"}, "style.font": {"icon":"","label":"Font","keywords":"typeface","provider":"fonts"},
"style.background": {"icon":"","label":"Background","aliases":["background","wallpaper"],"action":"background=$(omarchy-theme-bg-switcher); [[ -n $background ]] && omarchy-theme-bg-set \"$background\""}, "style.background": {"icon":"","label":"Background","aliases":["background","wallpaper"],"action":"background=$(omarchy-theme-bg-switcher); [[ -n $background ]] && omarchy-theme-bg-set \"$background\""},
"style.bar": {"icon":"󰍜","label":"Bar","keywords":"quickshell top bottom left right settings"}, "style.bar": {"icon":"󰍜","label":"Bar","keywords":"quickshell top bottom left right settings"},
"style.corners": {"icon":"󰘇","label":"Corners","keywords":"sharp round rounded"},
"style.hyprland": {"icon":"","label":"Hyprland","keywords":"look feel","action":"omarchy-launch-config-editor \"$HOME/.config/hypr/looknfeel.lua\""}, "style.hyprland": {"icon":"","label":"Hyprland","keywords":"look feel","action":"omarchy-launch-config-editor \"$HOME/.config/hypr/looknfeel.lua\""},
"style.screensaver": {"icon":"󱄄","label":"Screensaver","keywords":"branding"}, "style.screensaver": {"icon":"󱄄","label":"Screensaver","keywords":"branding"},
"style.about": {"icon":"","label":"About","keywords":"branding"}, "style.about": {"icon":"","label":"About","keywords":"branding"},
@@ -99,8 +98,6 @@
"style.bar.bottom": {"icon":"󰁅","label":"Bottom","keywords":"position","action":"omarchy-style-bar-position bottom"}, "style.bar.bottom": {"icon":"󰁅","label":"Bottom","keywords":"position","action":"omarchy-style-bar-position bottom"},
"style.bar.left": {"icon":"󰁍","label":"Left","keywords":"position","action":"omarchy-style-bar-position left"}, "style.bar.left": {"icon":"󰁍","label":"Left","keywords":"position","action":"omarchy-style-bar-position left"},
"style.bar.right": {"icon":"󰁔","label":"Right","keywords":"position","action":"omarchy-style-bar-position right"}, "style.bar.right": {"icon":"󰁔","label":"Right","keywords":"position","action":"omarchy-style-bar-position right"},
"style.corners.sharp": {"icon":"󰝣","label":"Sharp","keywords":"square","action":"omarchy-style-corners sharp"},
"style.corners.round": {"icon":"󰘇","label":"Round","keywords":"rounded","action":"omarchy-style-corners round"},
"style.about.text": {"icon":"","label":"Edit Text","keywords":"branding","action":"omarchy-branding-about text"}, "style.about.text": {"icon":"","label":"Edit Text","keywords":"branding","action":"omarchy-branding-about text"},
"style.about.image": {"icon":"","label":"Set From Image","keywords":"branding","action":"omarchy-branding-about image"}, "style.about.image": {"icon":"","label":"Set From Image","keywords":"branding","action":"omarchy-branding-about image"},
"style.about.default": {"icon":"","label":"Restore Default","keywords":"branding","action":"omarchy-branding-about reset"}, "style.about.default": {"icon":"","label":"Restore Default","keywords":"branding","action":"omarchy-branding-about reset"},
+7
View File
@@ -0,0 +1,7 @@
echo "Remove retired rounded-corners Hyprland toggle"
rm -f "$HOME/.local/state/omarchy/toggles/hypr/rounded-corners.lua"
if omarchy-cmd-present hyprctl; then
hyprctl reload >/dev/null 2>&1 || true
fi
+6 -18
View File
@@ -9,12 +9,9 @@ import Quickshell.Io
// dimensions — so panels and qs.Ui components have a single source of // dimensions — so panels and qs.Ui components have a single source of
// truth. // truth.
// //
// `cornerRadius` mirrors Hyprland's `decoration:rounding`. Themes ship // `cornerRadius` mirrors Hyprland's `decoration:rounding`. Themes and user
// their own rounding via theme/hyprland.lua; the user toggle via // Hyprland config own that value; the shell picks it up by re-running
// `omarchy style corners <round|sharp>` flips Hyprland's flag file // `hyprctl getoption` on startup and after theme IPC applies a theme.
// and Hyprland's auto-reload pushes the new value out. The shell picks
// up the change here by re-running `hyprctl getoption` when theme IPC
// manually reloads the theme and whenever user toggle files change.
// //
// Typography, spacing, and bar size come from `theme/shell.toml`. // Typography, spacing, and bar size come from `theme/shell.toml`.
// `[font] base-size` is the rem root; every `Style.font.<token>` derives // `[font] base-size` is the rem root; every `Style.font.<token>` derives
@@ -490,18 +487,9 @@ QtObject {
onTriggered: root.refresh() onTriggered: root.refresh()
} }
// `omarchy style corners <round|sharp>` and `omarchy toggle window-gaps` // `omarchy toggle window-gaps` creates/removes this flag file. Hyprland
// create/remove these flag files. Hyprland reloads its config when sourced // reloads its config when sourced files change, then hyprctl reflects the
// files change, then hyprctl reflects the new effective values. // new effective value.
property FileView roundedCornersToggle: FileView {
path: Quickshell.env("HOME") + "/.local/state/omarchy/toggles/hypr/rounded-corners.lua"
watchChanges: true
printErrors: false
onFileChanged: refreshTimer.restart()
onLoaded: refreshTimer.restart()
onLoadFailed: refreshTimer.restart()
}
property FileView windowNoGapsToggle: FileView { property FileView windowNoGapsToggle: FileView {
path: Quickshell.env("HOME") + "/.local/state/omarchy/toggles/hypr/window-no-gaps.lua" path: Quickshell.env("HOME") + "/.local/state/omarchy/toggles/hypr/window-no-gaps.lua"
watchChanges: true watchChanges: true
+1 -1
View File
@@ -85,7 +85,7 @@ Session-lock surface using Quickshell's native `WlSessionLock` and two
separate PAM services: `omarchy-lock-password` for password auth and, separate PAM services: `omarchy-lock-password` for password auth and,
only when fingerprints are enrolled, `omarchy-lock-fingerprint` for only when fingerprints are enrolled, `omarchy-lock-fingerprint` for
fingerprint auth. It mirrors the previous lock screen field dimensions, fingerprint auth. It mirrors the previous lock screen field dimensions,
colors, blurred wallpaper, placeholder, and corner toggle. colors, blurred wallpaper, placeholder, and Hyprland-driven corners.
## Polkit agent ## Polkit agent
+2 -3
View File
@@ -30,9 +30,8 @@ Item {
// ~/.cache where regeneratable artifacts belong. // ~/.cache where regeneratable artifacts belong.
readonly property string cacheDir: home + "/.cache/omarchy/" readonly property string cacheDir: home + "/.cache/omarchy/"
readonly property string imageCacheDir: cacheDir + "notification-images/" readonly property string imageCacheDir: cacheDir + "notification-images/"
// Corner radius is shared with omarchy-shell menu and bar settings panel // Corner radius is shared with omarchy-shell menu and bar settings panel.
// `omarchy style corners <sharp|round>` writes this file once and every // It mirrors Hyprland's current decoration:rounding value.
// surface reads it. Default 0 for sharp corners.
readonly property int cornerRadius: Style.cornerRadius readonly property int cornerRadius: Style.cornerRadius
// Surfaces anchor relative to the omarchy bar so popups and history land // Surfaces anchor relative to the omarchy bar so popups and history land
// alongside the other shell panels rather than on top of the bar itself. // alongside the other shell panels rather than on top of the bar itself.
+2 -2
View File
@@ -47,8 +47,8 @@ Item {
property color urgent: Color.urgent property color urgent: Color.urgent
property string fontFamily: "monospace" property string fontFamily: "monospace"
// Structural style tokens live on the shared Style singleton so toggling // Structural style tokens live on the shared Style singleton so theme swaps
// `omarchy style corners` and theme swaps update every consumer at once. // and Hyprland-derived values update every consumer at once.
// Aliasing them as readonly properties keeps the existing inline component // Aliasing them as readonly properties keeps the existing inline component
// bindings (`root.cornerRadius`, `root.focusBorderColor`, ...) working // bindings (`root.cornerRadius`, `root.focusBorderColor`, ...) working
// without sprinkling Style.* across the file. // without sprinkling Style.* across the file.