Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions bin/omarchy-dock
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ USAGE
# A shell.json without pins of its own uses the default pins, so pinning or
# unpinning starts from those rather than from an empty dock.
PINNED='(.dock.pinned // $defaults[0].dock.pinned // [])'
PIN_CONFIG='(if type == "object" then . else {} end) | .version = 1'

cmd_position() {
if (( $# == 0 )); then
Expand Down Expand Up @@ -93,7 +94,7 @@ cmd_pinned() {
for id in "$@"; do
ids+=("$(desktop_id "$id")")
done
commit "$NORMALIZE | .dock.pinned = (\$ids | reduce .[] as \$id ([]; if index([\$id]) then . else . + [\$id] end))" \
commit "$PIN_CONFIG | .dock.pinned = (\$ids | reduce .[] as \$id ([]; if index([\$id]) then . else . + [\$id] end))" \
--argjson ids "$(printf '%s\n' "${ids[@]}" | jq -R . | jq -s .)"
echo "Set the apps pinned to the dock"
}
Expand All @@ -108,15 +109,15 @@ desktop_id() {
cmd_pin() {
local id
id=$(desktop_id "$@")
commit "$NORMALIZE | .dock.pinned = ($PINNED | if index([\$id]) then . else . + [\$id] end)" \
commit "$PIN_CONFIG | .dock.pinned = ($PINNED | if index([\$id]) then . else . + [\$id] end)" \
--arg id "$id" --slurpfile defaults "$DEFAULTS_FILE"
echo "Pinned $id to the dock"
}

cmd_unpin() {
local id
id=$(desktop_id "$@")
commit "$NORMALIZE | .dock.pinned = ($PINNED | map(select(. != \$id)))" \
commit "$PIN_CONFIG | .dock.pinned = ($PINNED | map(select(. != \$id)))" \
--arg id "$id" --slurpfile defaults "$DEFAULTS_FILE"
echo "Unpinned $id from the dock"
}
Expand Down
20 changes: 15 additions & 5 deletions bin/omarchy-monitor-state
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@

# Hyprland reports `mirrorOf` as the mirrored monitor's id, so name it here
# for everything below and for the panel.
monitors_json=$(hyprctl monitors all -j | jq '
(map({key: (.id | tostring), value: .name}) | from_entries) as $names
monitors_json=$(hyprctl monitors all -j) || exit 1
monitors_json=$(printf '%s\n' "$monitors_json" | jq -e '
if type != "array" then error("not a monitor list") else . end
| (map({key: (.id | tostring), value: .name}) | from_entries) as $names
| map(.mirrorOf = (if (.mirrorOf // "none") == "none" then "none" else ($names[.mirrorOf | tostring] // .mirrorOf) end))
')
') || exit 1
focused_monitor=$(printf '%s\n' "$monitors_json" | jq -r '[.[] | select(.focused == true)][0].name // ""')

# Read every enabled display's brightness at once: a DDC read takes a moment
# per monitor, so one after another they'd add up.
brightness_dir=$(mktemp -d)
trap 'rm -rf "$brightness_dir"' EXIT
state_file=$(mktemp)
trap 'rm -rf "$brightness_dir" "$state_file"' EXIT

# The panel reads this output by line index, so hold it back until every line
# is written: a failure part way through prints nothing instead of a short read.
exec 3>&1 >"$state_file" || exit 1
while read -r name; do
[[ $name =~ ^[A-Za-z0-9._-]+$ ]] || continue
{ omarchy-brightness-display --monitor "$name" 2>/dev/null; echo; } | head -n 1 >"$brightness_dir/$name" &
Expand Down Expand Up @@ -43,11 +50,14 @@ brightness_json=$(for file in "$brightness_dir"/*; do
done | jq -R -n '[inputs | split("\t") | select(.[1] | test("^[0-9]+$")) | {(.[0]): (.[1] | tonumber)}] | add // {}')

printf '%s\n' "$monitors_json" | jq -c --argjson brightness "$brightness_json" \
'[.[] | {name, make, model, enabled:(.disabled != true), focused:(.focused == true), width, height, physicalWidth, physicalHeight, refreshRate, scale, x, y, transform, mirrorOf, availableModes:(.availableModes // []), brightness:($brightness[.name] // null)}]'
'[.[] | {name, make, model, enabled:(.disabled != true), focused:(.focused == true), width, height, physicalWidth, physicalHeight, refreshRate, scale, x, y, transform, mirrorOf, availableModes:(.availableModes // []), brightness:($brightness[.name] // null)}]' || exit 1

# Whether the mirror is Omarchy's own, which the panel can turn back off.
if omarchy-hyprland-toggle-enabled internal-monitor-mirror; then
echo on
else
echo
fi

exec >&3 3>&-
cat "$state_file"
1 change: 1 addition & 0 deletions bin/omarchy-toggle-suspend
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ if omarchy-sleep-disabled; then
fi

omarchy-toggle suspend-off
omarchy-shell -q lock refreshSuspend

if omarchy-toggle-enabled suspend-off; then
omarchy-notification-send -g 󰒲 "$(omarchy-i18n suspend.removedFromMenu)"
Expand Down
16 changes: 16 additions & 0 deletions default/i18n/en/shell.json
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,18 @@
"lock.checking": "Checking…",
"lock.enterPassword": "Enter Password",
"lock.fingerprintUnavailable": "Fingerprint reader unavailable",
"lock.reboot": "Reboot",
"lock.rebootConfirm": "Reboot?",
"lock.rebootFailed": "Reboot failed",
"lock.rebooting": "Rebooting…",
"lock.shutdown": "Shutdown",
"lock.shutdownConfirm": "Shutdown?",
"lock.shutdownFailed": "Shutdown failed",
"lock.shuttingDown": "Shutting down…",
"lock.suspend": "Suspend",
"lock.suspendConfirm": "Suspend?",
"lock.suspendFailed": "Suspend failed",
"lock.suspending": "Suspending…",
"media.mediaSource": "Media source",
"media.next": "Next",
"media.nothingPlaying": "Nothing playing",
Expand All @@ -433,6 +445,7 @@
"monitor.brightness": "BRIGHTNESS",
"monitor.builtInDisplay": "Built-in Display",
"monitor.display": "Display",
"monitor.displays": "DISPLAYS",
"monitor.extend": "Extend",
"monitor.layout": "LAYOUT",
"monitor.layoutHint": "ctrl+arrows or drag to arrange · r to rotate",
Expand All @@ -445,7 +458,10 @@
"monitor.rotateHint": "r or right-click to rotate",
"monitor.rotateNormal": "Normal",
"monitor.scale": "SCALE",
"monitor.stateStale": "Display state unavailable; showing last known state",
"monitor.stateUnavailable": "Display state unavailable",
"monitor.textSize": "TEXT SIZE",
"monitor.unavailable": "Display information unavailable",
"mv7plus.compressorDesc": "Evens out the gap between quiet and loud speech",
"mv7plus.compressorHeavy": "Heavy",
"mv7plus.compressorLabel": "Compressor",
Expand Down
2 changes: 2 additions & 0 deletions manual/13-toggles-idle-screensaver.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,5 @@ The logo it draws is yours to change, under _Appearance > Branding > Screensaver
`Super + Ctrl + L` locks the machine. That runs the lock screen from the Omarchy shell, blanks the display, resets your keyboard layout to the first one so you're not typing your password in the wrong alphabet, and — if you have it running — locks 1Password on the way out.

The lock screen takes a password, and it'll take a fingerprint too once you've set one up. That, and the other ways to authenticate, are covered in [hardware authentication](37-hardware-authentication.md).

Suspend, Reboot and Shutdown sit in the bottom-right corner, so you can put the machine to sleep or turn it off without unlocking it. Click one and it asks; click it again and it goes. Clicking anywhere else, or typing, calls it off. Suspend only shows where Omarchy offers it in the menu, so it's missing on a machine where sleep is turned off.
Loading