Skip to content

Commit f21a808

Browse files
authored
Merge pull request #467 from basecamp/dev
Omarchy 1.10.0
2 parents f4b684f + 2712f26 commit f21a808

Some content is hidden

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

53 files changed

+375
-254
lines changed

bin/omarchy

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,41 +21,16 @@ main_menu() {
2121
ack_command
2222
main_menu
2323
;;
24-
Update) update_menu ;;
24+
Update)
25+
omarchy-update
26+
main_menu
27+
;;
2528
Setup) setup_menu ;;
2629
Manual) open_manual ;;
2730
Exit) clear && exit 0 ;;
2831
esac
2932
}
3033

31-
update_menu() {
32-
show_ascii_art
33-
local menu=("Omarchy" "Waybar" "Walker" "Plymouth" "SwayOSD" "Desktop apps" "Back")
34-
local commands=(
35-
"omarchy-update"
36-
"omarchy-refresh-waybar"
37-
"omarchy-refresh-walker"
38-
"omarchy-refresh-plymouth"
39-
"omarchy-refresh-swayosd"
40-
"omarchy-refresh-applications"
41-
"main_menu"
42-
)
43-
local choice
44-
choice=$(printf "%s\n" "${menu[@]}" | gum choose --header="Update") || main_menu
45-
for i in "${!menu[@]}"; do
46-
if [[ "${menu[$i]}" == "$choice" ]]; then
47-
if [[ "$choice" == "Back" ]]; then
48-
main_menu
49-
else
50-
eval "${commands[$i]}"
51-
ack_command
52-
main_menu
53-
fi
54-
break
55-
fi
56-
done
57-
}
58-
5934
theme_menu() {
6035
show_ascii_art
6136
local menu=("Pick" "Install" "Update" "Remove" "Back")

bin/omarchy-battery-monitor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ get_battery_state() {
1414
}
1515

1616
send_notification() {
17-
notify-send -u critical "Battery Low" "Time to recharge! (battery is at ${1}%)" -i battery-caution
17+
notify-send -u critical "󱐋 Time to recharge!" "Battery is down to ${1}%" -i battery-caution -t 30000
1818
}
1919

2020
BATTERY_LEVEL=$(get_battery_percentage)

bin/omarchy-cmd-screensaver

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ if command -v tte &>/dev/null; then
1010
while pgrep tte >/dev/null; do
1111
if read -n 1 -t 0.01; then
1212
pkill tte 2>/dev/null
13+
pkill -f "alacritty --class Screensaver" 2>/dev/null
1314
exit 0
1415
fi
1516
done
1617
done
1718
else
1819
gum spin --title "Can't find tte. Try: pip install terminaltexteffects" -- sleep 2
1920
fi
20-

bin/omarchy-launch-screensaver

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
#!/bin/bash
22

3-
pgrep -f "alacritty --class Screensaver" ||
4-
alacritty --class Screensaver --title Screensaver -o 'colors.primary.background="#000000"' \
5-
-o 'colors.cursor.cursor="#000000"' -e ~/.local/share/omarchy/bin/omarchy-cmd-screensaver
3+
# Exit early if screensave is already running
4+
pgrep -f "alacritty --class Screensaver" && exit 0
5+
6+
focused=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')
7+
8+
for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do
9+
hyprctl dispatch focusmonitor $m
10+
hyprctl dispatch exec -- \
11+
alacritty --class Screensaver \
12+
-o 'colors.primary.background="#000000"' \
13+
-o 'colors.cursor.cursor="#000000"' \
14+
-o 'font.size=18' \
15+
-o 'window.opacity=1' \
16+
-e ~/.local/share/omarchy/bin/omarchy-cmd-screensaver
17+
done
18+
19+
hyprctl dispatch focusmonitor $focused

bin/omarchy-menu-keybindings

Lines changed: 60 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,62 +3,84 @@
33
# A script to display Hyprland keybindings defined in your configuration
44
# using walker for an interactive search menu.
55

6-
USER_HYPRLAND_CONF="$HOME/.config/hypr/hyprland.conf"
7-
OMARCHY_BINDINGS_CONF="$HOME/.local/share/omarchy/default/hypr/bindings.conf \
8-
$HOME/.local/share/omarchy/default/hypr/bindings/tiling.conf \
9-
$HOME/.local/share/omarchy/default/hypr/bindings/utilities.conf \
10-
$HOME/.local/share/omarchy/default/hypr/bindings/media.conf"
6+
# Fetch dynamic keybindings from Hyprland
7+
#
8+
# Also do some pre-processing:
9+
# - Remove standard Omarchy bin path prefix
10+
# - Remove uwsm prefix
11+
# - Map numeric modifier key mask to a textual rendition
12+
# - Output comma-separated values that the parser can understand
13+
dynamic_bindings() {
14+
hyprctl -j binds | \
15+
jq -r '.[] | {modmask, key, keycode, description, dispatcher, arg} | "\(.modmask),\(.key)@\(.keycode),\(.description),\(.dispatcher),\(.arg)"' | \
16+
sed -r \
17+
-e 's/null//' \
18+
-e 's,~/.local/share/omarchy/bin/,,' \
19+
-e 's,uwsm app -- ,,' \
20+
-e 's/@0//' \
21+
-e 's/,@/,code:/' \
22+
-e 's/^0,/,/' \
23+
-e 's/^1,/SHIFT,/' \
24+
-e 's/^4,/CTRL,/' \
25+
-e 's/^5,/SHIFT CTRL,/' \
26+
-e 's/^8,/ALT,/' \
27+
-e 's/^9,/SHIFT ALT,/' \
28+
-e 's/^12,/CTRL ALT,/' \
29+
-e 's/^13,/SHIFT CTRL ALT,/' \
30+
-e 's/^64,/SUPER,/' \
31+
-e 's/^65,/SUPER SHIFT,/' \
32+
-e 's/^68,/SUPER CTRL,/' \
33+
-e 's/^69,/SUPER SHIFT CTRL,/' \
34+
-e 's/^72,/SUPER ALT,/'
35+
}
1136

12-
# Process the configuration file to extract and format keybindings
13-
# 1. `grep` finds all lines starting with 'bind' (allowing for leading spaces).
14-
# 2. The first `sed` removes comments (anything after a '#').
15-
# 3. `awk` does the heavy lifting of formatting the output.
16-
# - It sets the field separator to a comma ','.
17-
# - It removes the 'bind... =' part from the beginning of the line.
18-
# - It joins the key combination (e.g., "SUPER + Q").
19-
# - It joins the command that the key executes.
20-
# - It prints everything in a nicely aligned format.
21-
# 4. The final `sed` cleans up any leftover commas from the end of lines.
22-
grep -h '^[[:space:]]*bind' $USER_HYPRLAND_CONF $OMARCHY_BINDINGS_CONF |
23-
sed 's/#.*//' |
24-
sed '/^[[:space:]]*$/d' |
25-
sort -u |
37+
# Parse and format keybindings
38+
#
39+
# `awk` does the heavy lifting:
40+
# - Set the field separator to a comma ','.
41+
# - Joins the key combination (e.g., "SUPER + Q").
42+
# - Joins the command that the key executes.
43+
# - Prints everything in a nicely aligned format.
44+
parse_bindings() {
2645
awk -F, '
2746
{
28-
# Strip trailing comments
29-
sub(/#.*/, "");
30-
31-
# Remove the "bind... =" part and surrounding whitespace
32-
sub(/^[[:space:]]*bind[^=]*=(\+[[:space:]])?(exec, )?[[:space:]]*/, "", $1);
33-
3447
# Combine the modifier and key (first two fields)
3548
key_combo = $1 " + " $2;
3649
3750
# Clean up: strip leading "+" if present, trim spaces
3851
gsub(/^[ \t]*\+?[ \t]*/, "", key_combo);
3952
gsub(/[ \t]+$/, "", key_combo);
4053
41-
# Reconstruct the command from the remaining fields
42-
action = "";
43-
for (i = 3; i <= NF; i++) {
44-
action = action $i (i < NF ? "," : "");
45-
}
54+
# Use description, if set
55+
action = $3;
4656
47-
# Clean up trailing commas, remove leading "exec, ", and trim
48-
sub(/,$/, "", action);
49-
gsub(/(^|,)[[:space:]]*exec[[:space:]]*,?/, "", action);
50-
gsub(/^[ \t]+|[ \t]+$/, "", action);
51-
gsub(/[ \t]+/, " ", key_combo); # Collapse multiple spaces to one
57+
if (action == "") {
58+
# Reconstruct the command from the remaining fields
59+
for (i = 4; i <= NF; i++) {
60+
action = action $i (i < NF ? "," : "");
61+
}
62+
63+
# Clean up trailing commas, remove leading "exec, ", and trim
64+
sub(/,$/, "", action);
65+
gsub(/(^|,)[[:space:]]*exec[[:space:]]*,?/, "", action);
66+
gsub(/^[ \t]+|[ \t]+$/, "", action);
67+
gsub(/[ \t]+/, " ", key_combo); # Collapse multiple spaces to one
5268
53-
if (action != "") {
5469
# Escape XML entities
5570
gsub(/&/, "\\&amp;", action);
5671
gsub(/</, "\\&lt;", action);
5772
gsub(/>/, "\\&gt;", action);
5873
gsub(/"/, "\\&quot;", action);
5974
gsub(/'"'"'/, "\\&apos;", action);
60-
75+
}
76+
77+
if (action != "") {
6178
printf "%-35s → %s\n", key_combo, action;
6279
}
63-
}' |
80+
}'
81+
}
82+
83+
dynamic_bindings | \
84+
sort -u | \
85+
parse_bindings | \
6486
walker --dmenu --theme keybindings -p 'Keybindings'

bin/omarchy-migrate

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
11
#!/bin/bash
22

3-
# Exit immediately if a command exits with a non-zero status
43
set -e
54

6-
# Create the migrations state directory, we will store an empty file for each migration that has already been performed.
5+
# Where we store an empty file for each migration that has already been performed.
76
STATE_DIR="$HOME/.local/state/omarchy/migrations"
87
mkdir -p "$STATE_DIR"
98

109
# Run any pending migrations
11-
cd ~/.local/share/omarchy
12-
13-
for file in migrations/*.sh; do
10+
for file in ~/.local/share/omarchy/migrations/*.sh; do
1411
filename=$(basename "$file")
15-
migrate_at="${filename%.sh}"
16-
17-
# Migration already applied, to re-run it simply delete the state file and try again
18-
[ -e "${STATE_DIR}/$filename" ] && continue
1912

20-
echo -e "\e[32m\nRunning migration (${filename%.sh})\e[0m"
21-
source $file
22-
touch "${STATE_DIR}/$filename"
13+
if [[ ! -f "$STATE_DIR/$filename" ]]; then
14+
echo -e "\e[32m\nRunning migration (${filename%.sh})\e[0m"
15+
source $file
16+
touch "$STATE_DIR/$filename"
17+
fi
2318
done
24-
25-
# Back to where we came from
26-
cd - >/dev/null

bin/omarchy-refresh-hypridle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#!/bin/bash
22

33
omarchy-refresh-config hypr/hypridle.conf
4-
pkill -x hypridle
5-
uwsm app -- hypridle >/dev/null 2>&1 &
6-
4+
omarchy-restart-hypridle

bin/omarchy-refresh-hyprlock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22

3-
# Overwrite local Hyprlock settings with the latest in Omarchy
4-
omarchy-refresh-config hypr/hyprlock.conf
3+
omarchy-refresh-config hypr/hyprlock.conf
4+

bin/omarchy-refresh-hyprsunset

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
omarchy-refresh-config hypr/hyprsunset.conf
4+
omarchy-restart-hyprsunset

bin/omarchy-refresh-swayosd

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22

33
omarchy-refresh-config swayosd/config.toml
44
omarchy-refresh-config swayosd/style.css
5-
6-
pkill swayosd-server
7-
setsid uwsm app -- swayosd-server &>/dev/null &
5+
omarchy-restart-swayosd

0 commit comments

Comments
 (0)