Skip to content

Commit f4b684f

Browse files
authored
Merge pull request #434 from basecamp/dev
Omarchy v1.9.0
2 parents 07d88a4 + 631b629 commit f4b684f

37 files changed

+226
-83
lines changed

bin/omarchy-cmd-screensaver

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

3-
trap "exit" SIGINT
3+
if command -v tte &>/dev/null; then
4+
while true; do
5+
effect=$(tte 2>&1 | grep -oP '{\K[^}]+' | tr ',' ' ' | tr ' ' '\n' | sed -n '/^beams$/,$p' | sort -u | shuf -n1)
6+
tte -i ~/.local/share/omarchy/logo.txt \
7+
--frame-rate 240 --canvas-width 0 --canvas-height $(($(tput lines) - 2)) --anchor-canvas c --anchor-text c \
8+
"$effect" &
9+
10+
while pgrep tte >/dev/null; do
11+
if read -n 1 -t 0.01; then
12+
pkill tte 2>/dev/null
13+
exit 0
14+
fi
15+
done
16+
done
17+
else
18+
gum spin --title "Can't find tte. Try: pip install terminaltexteffects" -- sleep 2
19+
fi
420

5-
while true; do
6-
effect=$(tte 2>&1 | grep -oP '{\K[^}]+' | tr ',' ' ' | tr ' ' '\n' | sed -n '/^beams$/,$p' | sort -u | shuf -n1)
7-
tte -i ~/.local/share/omarchy/logo.txt \
8-
--frame-rate 240 --canvas-width 0 --canvas-height 0 --anchor-canvas c --anchor-text c \
9-
"$effect"
10-
done

bin/omarchy-launch-screensaver

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

3-
pkill -f "alacritty --class Screensaver" ||
3+
pgrep -f "alacritty --class Screensaver" ||
44
alacritty --class Screensaver --title Screensaver -o 'colors.primary.background="#000000"' \
5-
-e ~/.local/share/omarchy/bin/omarchy-cmd-screensaver
5+
-o 'colors.cursor.cursor="#000000"' -e ~/.local/share/omarchy/bin/omarchy-cmd-screensaver

bin/omarchy-menu-power

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
show_power_menu() {
44
# The first characters are invisible sort keys.
5-
local menu_options="\u200B Lock
6-
\u200C󰤄 Suspend
7-
\u200D Relaunch
8-
\u2060󰜉 Restart
9-
\u2063󰐥 Shutdown"
5+
local menu_options=" Lock
6+
󱄄 Save
7+
󰤄 Suspend
8+
 Relaunch
9+
󰜉 Restart
10+
󰐥 Shutdown"
1011
local selection=$(echo -e "$menu_options" | walker --dmenu --theme dmenu_150)
1112

1213
case "$selection" in
1314
*Lock*) hyprlock ;;
15+
*Save*) ~/.local/share/omarchy/bin/omarchy-launch-screensaver ;;
1416
*Suspend*) systemctl suspend ;;
1517
*Relaunch*) uwsm stop ;;
1618
*Restart*) systemctl reboot ;;

bin/omarchy-migrate

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# Exit immediately if a command exits with a non-zero status
4+
set -e
5+
6+
# Create the migrations state directory, we will store an empty file for each migration that has already been performed.
7+
STATE_DIR="$HOME/.local/state/omarchy/migrations"
8+
mkdir -p "$STATE_DIR"
9+
10+
# Run any pending migrations
11+
cd ~/.local/share/omarchy
12+
13+
for file in migrations/*.sh; do
14+
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
19+
20+
echo -e "\e[32m\nRunning migration (${filename%.sh})\e[0m"
21+
source $file
22+
touch "${STATE_DIR}/$filename"
23+
done
24+
25+
# Back to where we came from
26+
cd - >/dev/null

bin/omarchy-refresh-config

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
config_file=$1
55

66
if [[ -z "$config_file" ]]; then
7-
cat << USAGE
7+
cat <<USAGE
88
Usage: $0 [config_file]
99
1010
Must provide a file path from the .config directory to be refreshed.
@@ -16,15 +16,20 @@ USAGE
1616
fi
1717

1818
# Backup the destination file (with timestamp) to avoid clobbering (Ex: hyprlock.conf.bak.1753817951)
19-
backup_file="${HOME}/.config/${config_file}.bak.$(date +%s)"
20-
cp -f "${HOME}/.config/${config_file}" "$backup_file" 2>/dev/null
19+
user_config_file="${HOME}/.config/$config_file"
20+
default_config_file="${HOME}/.local/share/omarchy/config/$config_file"
21+
backup_config_file="$user_config_file.bak.$(date +%s)"
2122

22-
# Deploy the source file
23-
cp -f "${HOME}/.local/share/omarchy/config/${config_file}" "${HOME}/.config/${config_file}" 2>/dev/null
23+
# Create preliminary backup
24+
cp -f "$user_config_file" "$backup_config_file" 2>/dev/null
25+
26+
# Replace config with new default
27+
cp -f "$default_config_file" "$user_config_file" 2>/dev/null
2428

2529
# Compare and delete/inform accordingly
26-
if cmp -s "${HOME}/.config/${config_file}" "$backup_file"; then
27-
rm $backup_file
30+
if cmp -s "$user_config_file" "$backup_config_file"; then
31+
rm "$backup_config_file"
2832
else
29-
echo -e "\e[31mExisting "${HOME}/.config/${config_file}" replaced with new Omarchy default, but ${backup_file} file was made.\e[0m"
33+
echo -e "\e[31mReplaced $user_config_file with new Omarchy default.\nSaved backup as ${backup_config_file}.\n\n\e[32mChanges:\e[0m"
34+
diff "$user_config_file" "$backup_config_file"
3035
fi

bin/omarchy-refresh-hypridle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
omarchy-refresh-config hypr/hypridle.conf
4+
pkill -x hypridle
5+
uwsm app -- hypridle >/dev/null 2>&1 &
6+

bin/omarchy-refresh-waybar

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ omarchy-refresh-config waybar/config.jsonc
44
omarchy-refresh-config waybar/style.css
55

66
# Restart waybar
7-
pkill -SIGUSR2 waybar
7+
omarchy-restart-waybar

bin/omarchy-restart-waybar

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
killall waybar || true
4+
setsid uwsm app -- waybar &>/dev/null &

bin/omarchy-theme-set

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,19 @@ else
3232
gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark"
3333
fi
3434

35+
# Change gnome icon theme color
36+
if [[ -f ~/.config/omarchy/current/theme/icons.theme ]]; then
37+
gsettings set org.gnome.desktop.interface icon-theme "$(<~/.config/omarchy/current/theme/icons.theme)"
38+
else
39+
gsettings set org.gnome.desktop.interface icon-theme "Yaru-blue"
40+
fi
41+
3542
# Trigger alacritty config reload
3643
touch "$HOME/.config/alacritty/alacritty.toml"
3744

3845
# Restart components to apply new theme
3946
pkill -SIGUSR2 btop
40-
pkill -SIGUSR2 waybar
47+
"$HOME/.local/share/omarchy/bin/omarchy-restart-waybar"
4148
pkill swayosd-server
4249
setsid uwsm app -- swayosd-server &>/dev/null &
4350
makoctl reload

bin/omarchy-update

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,23 @@
33
# Exit immediately if a command exits with a non-zero status
44
set -e
55

6-
STATE_DIR="$HOME/.local/state/omarchy/migrations"
7-
8-
cd ~/.local/share/omarchy
9-
10-
# Create the migrations state directory, we will store an empty file for each migration that has already been performed.
11-
mkdir -p "$STATE_DIR"
6+
# Show logo
7+
clear
8+
cat <~/.local/share/omarchy/logo.txt
129

1310
# Get the latest while trying to preserve any modifications
14-
git pull --autostash
15-
git diff --check || git reset --merge
16-
17-
# Run any pending migrations
18-
for file in migrations/*.sh; do
19-
filename=$(basename "$file")
20-
migrate_at="${filename%.sh}"
11+
omarchy_path=~/.local/share/omarchy
12+
git -C $omarchy_path pull --autostash
13+
git -C $omarchy_path diff --check || git -C $omarchy_path reset --merge
2114

22-
# Migration already applied, to re-run it simply delete the state file and try again
23-
[ -e "${STATE_DIR}/$filename" ] && continue
24-
25-
echo -e "\e[32m\nRunning migration (${filename%.sh})\e[0m"
26-
source $file
27-
touch "${STATE_DIR}/$filename"
28-
done
15+
# Run migrations
16+
"$HOME/.local/share/omarchy/bin/omarchy-migrate"
2917

3018
# Update system packages
3119
echo -e "\e[32m\nUpdate system packages\e[0m"
3220
yay -Syu --noconfirm
3321

34-
# Back to where we came from
35-
cd - >/dev/null
36-
22+
# Offer to reboot if the kernel has been changed
23+
if [ "$(uname -r | sed 's/-arch/\.arch/')" != "$(pacman -Q linux | awk '{print $2}')" ]; then
24+
gum confirm "Linux kernel has been updated. Reboot?" && sudo reboot now
25+
fi

0 commit comments

Comments
 (0)