Skip to content

Commit e58569b

Browse files
authored
Merge pull request #2862 from basecamp/dev
Omarchy 3.1.4
2 parents 14f8038 + 6243c82 commit e58569b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+336
-225
lines changed

applications/nvim.desktop

Lines changed: 0 additions & 12 deletions
This file was deleted.

bin/omarchy-hyprland-workspace-toggle-gaps

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ workspace_id=$(hyprctl activeworkspace -j | jq -r .id)
44
gaps=$(hyprctl workspacerules -j | jq -r ".[] | select(.workspaceString==\"$workspace_id\") | .gapsOut[0] // 0")
55

66
if [[ $gaps == "0" ]]; then
7-
hyprctl keyword "workspace $workspace_id, gapsout:10, gapsin:5, border:true"
7+
hyprctl keyword "workspace $workspace_id, gapsout:10, gapsin:5, bordersize:2"
88
else \
9-
hyprctl keyword "workspace $workspace_id, gapsout:0, gapsin:0, border:false"
9+
hyprctl keyword "workspace $workspace_id, gapsout:0, gapsin:0, bordersize:0"
1010
fi

bin/omarchy-menu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,10 @@ show_install_ai_menu() {
287287
echo ollama
288288
)
289289

290-
case $(menu "Install" "󱚤 Claude Code\n󱚤 Cursor CLI [AUR]\n󱚤 Gemini [AUR]\n󱚤 OpenAI Codex [AUR]\n󱚤 LM Studio\n󱚤 Ollama\n󱚤 Crush\n󱚤 opencode") in
290+
case $(menu "Install" "󱚤 Claude Code\n󱚤 Cursor CLI [AUR]\n󱚤 Gemini [AUR]\n󱚤 OpenAI Codex\n󱚤 LM Studio\n󱚤 Ollama\n󱚤 Crush\n󱚤 opencode") in
291291
*Claude*) install "Claude Code" "claude-code" ;;
292292
*Cursor*) aur_install "Cursor CLI" "cursor-cli" ;;
293-
*OpenAI*) aur_install "OpenAI Codex" "openai-codex-bin" ;;
293+
*OpenAI*) install "OpenAI Codex" "openai-codex-bin" ;;
294294
*Gemini*) aur_install "Gemini" "gemini-cli" ;;
295295
*Studio*) install "LM Studio" "lmstudio" ;;
296296
*Ollama*) install "Ollama" $ollama_pkg ;;
@@ -395,7 +395,7 @@ show_update_menu() {
395395
*Hardware*) show_update_hardware_menu ;;
396396
*Firmware*) present_terminal omarchy-update-firmware ;;
397397
*Timezone*) present_terminal omarchy-tz-select ;;
398-
*Time*) present_terminal omarchy-reset-time ;;
398+
*Time*) present_terminal omarchy-update-time ;;
399399
*Password*) show_update_password_menu ;;
400400
*) show_main_menu ;;
401401
esac

bin/omarchy-menu-keybindings

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ parse_keycodes() {
4949
code="${BASH_REMATCH[1]}"
5050
symbol=$(lookup_keycode_cached "$code" "$XKB_KEYMAP_CACHE")
5151
echo "${line/code:${code}/$symbol}"
52+
elif [[ "$line" =~ mouse:([0-9]+) ]]; then
53+
code="${BASH_REMATCH[1]}"
54+
55+
case "$code" in
56+
272) symbol="LEFT MOUSE BUTTON" ;;
57+
273) symbol="RIGHT MOUSE BUTTON" ;;
58+
274) symbol="MIDDLE MOUSE BUTTON" ;;
59+
*) symbol="mouse:${code}" ;;
60+
esac
61+
62+
echo "${line/mouse:${code}/$symbol}"
5263
else
5364
echo "$line"
5465
fi
@@ -101,6 +112,11 @@ dynamic_bindings() {
101112
-e 's/^77,/SUPER SHIFT CTRL ALT,/'
102113
}
103114

115+
# Hardcoded bindings, like the copy-url extension and such
116+
static_bindings() {
117+
echo "SHIFT ALT,L,Copy URL from Web App,extension,copy-url"
118+
}
119+
104120
# Parse and format keybindings
105121
#
106122
# `awk` does the heavy lifting:
@@ -147,13 +163,67 @@ parse_bindings() {
147163
}'
148164
}
149165

166+
prioritize_entries() {
167+
awk '
168+
{
169+
line = $0
170+
prio = 50
171+
if (match(line, /Terminal/)) prio = 0
172+
if (match(line, /Browser/) && !match(line, /Browser[[:space:]]*\(/)) prio = 1
173+
if (match(line, /File manager/)) prio = 2
174+
if (match(line, /Launch apps/)) prio = 3
175+
if (match(line, /Omarchy menu/)) prio = 4
176+
if (match(line, /System menu/)) prio = 5
177+
if (match(line, /Theme menu/)) prio = 6
178+
if (match(line, /Full screen/)) prio = 7
179+
if (match(line, /Close window/)) prio = 8
180+
if (match(line, /Toggle window floating/)) prio = 9
181+
if (match(line, /Toggle window split/)) prio = 10
182+
if (match(line, /Universal/)) prio = 11
183+
if (match(line, /Clipboard/)) prio = 12
184+
if (match(line, /Emoji picker/)) prio = 13
185+
if (match(line, /Color picker/)) prio = 14
186+
if (match(line, /Screenshot/)) prio = 15
187+
if (match(line, /Screenrecording/)) prio = 16
188+
if (match(line, /(Switch|Next|Former|Previous).*workspace/)) prio = 17
189+
if (match(line, /Move window to workspace/)) prio = 18
190+
if (match(line, /Swap window/)) prio = 19
191+
if (match(line, /Move window focus/)) prio = 20
192+
if (match(line, /Move window$/)) prio = 21
193+
if (match(line, /Resize window/)) prio = 22
194+
if (match(line, /Expand window/)) prio = 23
195+
if (match(line, /Shrink window/)) prio = 24
196+
if (match(line, /scratchpad/)) prio = 25
197+
if (match(line, /notification/)) prio = 26
198+
if (match(line, /Toggle window transparency/)) prio = 27
199+
if (match(line, /Toggle workspace gaps/)) prio = 28
200+
if (match(line, /Toggle nightlight/)) prio = 29
201+
if (match(line, /group/)) prio = 94
202+
if (match(line, /Scroll active workspace/)) prio = 95
203+
if (match(line, /Cycle to/)) prio = 96
204+
if (match(line, /Reveal active/)) prio = 97
205+
if (match(line, /Apple Display/)) prio = 98
206+
if (match(line, /XF86/)) prio = 99
207+
208+
# print "priority<TAB>line"
209+
printf "%d\t%s\n", prio, line
210+
}' |
211+
sort -k1,1n -k2,2 |
212+
cut -f2-
213+
}
214+
150215
monitor_height=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .height')
151216
menu_height=$((monitor_height * 40 / 100))
152217

153218
build_keymap_cache
154219

155-
dynamic_bindings |
220+
{
221+
dynamic_bindings
222+
static_bindings
223+
} |
156224
sort -u |
157225
parse_keycodes |
158226
parse_bindings |
227+
prioritize_entries |
159228
walker --dmenu -p 'Keybindings' --width 800 --height "$menu_height"
229+

bin/omarchy-restart-walker

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ if [[ $EUID -eq 0 ]]; then
1717
"
1818
else
1919
setsid uwsm-app -- elephant &
20+
wait 2
2021
setsid uwsm-app -- walker --gapplication-service &
2122
fi

bin/omarchy-theme-set-obsidian

Lines changed: 65 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,35 @@ calculate_brightness() {
8787
echo $(((r * 299 + g * 587 + b * 114) / 1000))
8888
}
8989

90+
# Calculate approximate contrast ratio between two colors
91+
# Returns ratio scaled by 100 (e.g., 450 = 4.5:1 ratio)
92+
# (this is due to bash not supporting decimal math)
93+
calculate_contrast_ratio() {
94+
local hex1="$1" hex2="$2"
95+
local br1=$(calculate_brightness "$hex1") # 0-255 range
96+
local br2=$(calculate_brightness "$hex2") # 0-255 range
97+
98+
# Ensure br1 is the lighter color (higher brightness)
99+
if [ $br1 -lt $br2 ]; then
100+
local temp=$br1
101+
br1=$br2
102+
br2=$temp
103+
fi
104+
105+
# Approximate contrast ratio scaled by 100
106+
# Add offset to avoid division by zero and approximate WCAG +0.05 behavior
107+
echo $(((br1 + 13) * 100 / (br2 + 13)))
108+
}
109+
110+
# Check if two colors meet minimum contrast threshold
111+
# Usage: meets_contrast_threshold <ratio> <threshold>
112+
# Both ratio and threshold should be scaled by 100 (e.g., 300 = 3:1)
113+
meets_contrast_threshold() {
114+
local ratio="$1" # Ratio scaled by 100 (from calculate_contrast_ratio)
115+
local threshold="$2" # Threshold scaled by 100 (300=3:1, 450=4.5:1, 700=7:1)
116+
[ $ratio -ge $threshold ]
117+
}
118+
90119
# Calculate color distance (euclidean in RGB space)
91120
color_distance() {
92121
local hex1="$1"
@@ -229,38 +258,30 @@ extract_theme_data() {
229258
fi
230259
done
231260

232-
# Sort by distance and get the closest color for code background
233-
local -a closest_to_bg
234-
readarray -t closest_to_bg < <(printf '%s\n' "${bg_distances[@]}" | sort -n | head -1 | cut -d: -f2)
235-
236261
# All background variations use the same as primary background
237262
local bg_primary_alt="$bg_color"
238263
local bg_secondary="$bg_color"
239264
local bg_secondary_alt="$bg_color"
240265

241-
# Code block background uses the closest different color
242-
local code_bg="${closest_to_bg[0]}"
243-
244-
# If no different color available, create a subtle variant for code blocks
245-
if [ -z "$code_bg" ]; then
246-
read -r r g b <<<"$(hex_to_rgb "$bg_color")"
247-
if [ $bg_brightness -gt 127 ]; then
248-
r=$((r - 10))
249-
g=$((g - 10))
250-
b=$((b - 10))
251-
else
252-
r=$((r + 15))
253-
g=$((g + 15))
254-
b=$((b + 15))
255-
fi
256-
[ $r -lt 0 ] && r=0
257-
[ $r -gt 255 ] && r=255
258-
[ $g -lt 0 ] && g=0
259-
[ $g -gt 255 ] && g=255
260-
[ $b -lt 0 ] && b=0
261-
[ $b -gt 255 ] && b=255
262-
code_bg=$(printf "#%02x%02x%02x" "$r" "$g" "$b")
266+
# Generate code background color that will contrast with foreground text
267+
read -r r g b <<<"$(hex_to_rgb "$bg_color")"
268+
if [ $bg_brightness -gt 127 ]; then
269+
r=$((r - 10))
270+
g=$((g - 10))
271+
b=$((b - 10))
272+
else
273+
r=$((r + 15))
274+
g=$((g + 15))
275+
b=$((b + 15))
263276
fi
277+
[ $r -lt 0 ] && r=0
278+
[ $r -gt 255 ] && r=255
279+
[ $g -lt 0 ] && g=0
280+
[ $g -gt 255 ] && g=255
281+
[ $b -lt 0 ] && b=0
282+
[ $b -gt 255 ] && b=255
283+
code_bg=$(printf "#%02x%02x%02x" "$r" "$g" "$b")
284+
264285

265286
# Find closest color to foreground for code block text
266287
local code_fg=""
@@ -345,6 +366,22 @@ extract_theme_data() {
345366
border_color=$(printf "#%02x%02x%02x" "$r" "$g" "$b")
346367
fi
347368

369+
# Set text colors for muted/faint based on contrast
370+
local text_muted_color="$border_color"
371+
local text_faint_color="$border_color"
372+
373+
# Validate border color contrast against background
374+
375+
# Represents a 3:1 WCAG contrast ratio
376+
local ideal_contrast_ratio=300
377+
378+
local border_contrast=$(calculate_contrast_ratio "$border_color" "$bg_color")
379+
if ! meets_contrast_threshold "$border_contrast" "$ideal_contrast_ratio"; then
380+
# Override text colors for readability, keep border color for visibility
381+
text_muted_color="$fg_color"
382+
text_faint_color="$fg_color"
383+
fi
384+
348385
# Get unique colors array (without bg/fg) sorted by frequency
349386
local -a unique_colors
350387
readarray -t unique_colors < <(echo "$filtered_data" | sort_colors_by_frequency)
@@ -409,8 +446,8 @@ extract_theme_data() {
409446
--text-mark: ${color_slots[7]};
410447
--interactive-accent: ${color_slots[8]};
411448
--blockquote-border: ${color_slots[9]};
412-
--text-muted: $border_color; /* Use border color for muted text */
413-
--text-faint: $border_color; /* Use border color for faint text */
449+
--text-muted: $text_muted_color; /* Use text-specific color for muted text */
450+
--text-faint: $text_faint_color; /* Use text-specific color for faint text */
414451

415452
/* Additional mappings */
416453
--text-accent: var(--interactive-accent);

bin/omarchy-update

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ set -e
44

55
trap 'echo ""; echo -e "\033[0;31mSomething went wrong during the update!\n\nPlease review the output above carefully, correct the error, and retry the update.\n\nIf you need assistance, get help from the community at https://omarchy.org/discord\033[0m"' ERR
66

7+
gum style --border normal --border-foreground 6 --padding "1 2" --margin "1 0" \
8+
"Ready to update Omarchy?" \
9+
"" \
10+
"• You cannot stop the update once you start!" \
11+
"• Make sure you're not on battery power or have sufficient charge"
12+
13+
if ! gum confirm --default=false "Continue with update?"; then
14+
echo "Update cancelled"
15+
exit 0
16+
fi
17+
718
omarchy-snapshot create || [ $? -eq 127 ]
819
omarchy-update-git
920
omarchy-update-perform

bin/omarchy-update-keyring

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
# Ensure we have the omarchy-keyring and it's populated
4+
if omarchy-pkg-missing omarchy-keyring || ! sudo pacman-key --list-keys 40DFB630FF42BCFFB047046CF0134EE680CAC571 &>/dev/null; then
5+
sudo pacman-key --recv-keys 40DFB630FF42BCFFB047046CF0134EE680CAC571 --keyserver keys.openpgp.org
6+
sudo pacman-key --lsign-key 40DFB630FF42BCFFB047046CF0134EE680CAC571
7+
8+
sudo pacman -Sy
9+
omarchy-pkg-add omarchy-keyring
10+
11+
sudo pacman-key --list-keys 40DFB630FF42BCFFB047046CF0134EE680CAC571
12+
fi

bin/omarchy-update-perform

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -e
44

5+
omarchy-update-time
6+
omarchy-update-keyring
57
omarchy-update-available-reset
68
omarchy-update-system-pkgs
79
omarchy-migrate
File renamed without changes.

0 commit comments

Comments
 (0)