Skip to content

Commit 15c22d5

Browse files
authored
Merge pull request #2770 from basecamp/dev
Omarchy v3.1.2
2 parents 832ca69 + 1776981 commit 15c22d5

Some content is hidden

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

41 files changed

+336
-84
lines changed

bin/omarchy-battery-monitor

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,18 @@
44

55
BATTERY_THRESHOLD=10
66
NOTIFICATION_FLAG="/run/user/$UID/omarchy_battery_notified"
7-
8-
get_battery_percentage() {
9-
upower -i "$(upower -e | grep 'BAT')" \
10-
| awk -F: '/percentage/ {
11-
gsub(/[%[:space:]]/, "", $2);
12-
val=$2;
13-
printf("%d\n", (val+0.5))
14-
exit
15-
}'
16-
}
17-
18-
get_battery_state() {
19-
upower -i $(upower -e | grep 'BAT') | grep -E "state" | awk '{print $2}'
20-
}
7+
BATTERY_LEVEL=$(omarchy-battery-remaining)
8+
BATTERY_STATE=$(upower -i $(upower -e | grep 'BAT') | grep -E "state" | awk '{print $2}')
219

2210
send_notification() {
2311
notify-send -u critical "󱐋 Time to recharge!" "Battery is down to ${1}%" -i battery-caution -t 30000
2412
}
2513

26-
BATTERY_LEVEL=$(get_battery_percentage)
27-
BATTERY_STATE=$(get_battery_state)
28-
29-
if [[ "$BATTERY_STATE" == "discharging" && "$BATTERY_LEVEL" -le "$BATTERY_THRESHOLD" ]]; then
30-
if [[ ! -f "$NOTIFICATION_FLAG" ]]; then
31-
send_notification "$BATTERY_LEVEL"
32-
touch "$NOTIFICATION_FLAG"
14+
if [[ $BATTERY_STATE == "discharging" && $BATTERY_LEVEL -le $BATTERY_THRESHOLD ]]; then
15+
if [[ ! -f $NOTIFICATION_FLAG ]]; then
16+
send_notification $BATTERY_LEVEL
17+
touch $NOTIFICATION_FLAG
3318
fi
3419
else
35-
rm -f "$NOTIFICATION_FLAG"
20+
rm -f $NOTIFICATION_FLAG
3621
fi

bin/omarchy-battery-remaining

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# Returns the battery percentage remaining as an integer.
4+
5+
upower -i $(upower -e | grep BAT) \
6+
| awk -F: '/percentage/ {
7+
gsub(/[%[:space:]]/, "", $2);
8+
val=$2;
9+
printf("%d\n", (val+0.5))
10+
exit
11+
}'

bin/omarchy-debug

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash
2+
3+
LOG_FILE="/tmp/omarchy-debug.log"
4+
5+
cat > "$LOG_FILE" <<EOF
6+
Date: $(date)
7+
Hostname: $(hostname)
8+
Omarchy Branch: $(git -C "$OMARCHY_PATH" branch --show-current 2>/dev/null || echo "unknown")
9+
10+
=========================================
11+
SYSTEM INFORMATION
12+
=========================================
13+
$(inxi -Farz)
14+
15+
=========================================
16+
DMESG
17+
=========================================
18+
$(sudo dmesg)
19+
20+
=========================================
21+
JOURNALCTL (CURRENT BOOT, ERRORS ONLY)
22+
=========================================
23+
$(journalctl -b -p 4..1)
24+
25+
=========================================
26+
INSTALLED PACKAGES
27+
=========================================
28+
$({ expac -S '%n %v (%r)' $(pacman -Qqe) 2>/dev/null; comm -13 <(pacman -Sql | sort) <(pacman -Qqe | sort) | xargs -r expac -Q '%n %v (AUR)'; } | sort)
29+
EOF
30+
31+
OPTIONS=("View log" "Save in current directory")
32+
if ping -c 1 8.8.8.8 >/dev/null 2>&1; then
33+
OPTIONS=("Upload log" "${OPTIONS[@]}")
34+
fi
35+
36+
ACTION=$(gum choose "${OPTIONS[@]}")
37+
38+
case "$ACTION" in
39+
"Upload log")
40+
echo "Uploading debug log to 0x0.st..."
41+
URL=$(curl -sF "file=@$LOG_FILE" -Fexpires=24 https://0x0.st)
42+
if [ $? -eq 0 ] && [ -n "$URL" ]; then
43+
echo "✓ Log uploaded successfully!"
44+
echo "Share this URL:"
45+
echo ""
46+
echo " $URL"
47+
echo ""
48+
echo "This link will expire in 24 hours."
49+
else
50+
echo "Error: Failed to upload log file"
51+
exit 1
52+
fi
53+
;;
54+
"View log")
55+
less "$LOG_FILE"
56+
;;
57+
"Save in current directory")
58+
cp "$LOG_FILE" "./omarchy-debug.log"
59+
echo "✓ Log saved to $(pwd)/omarchy-debug.log"
60+
;;
61+
esac

bin/omarchy-hook

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

3+
set -e
4+
35
if [[ $# -lt 1 ]]; then
46
echo "Usage: omarchy-hook [name] [args...]"
57
exit 1
File renamed without changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
workspace_id=$(hyprctl activeworkspace -j | jq -r .id)
4+
gaps=$(hyprctl workspacerules -j | jq -r ".[] | select(.workspaceString==\"$workspace_id\") | .gapsOut[0] // 0")
5+
6+
if [[ $gaps == "0" ]]; then
7+
hyprctl keyword "workspace $workspace_id, gapsout:10, gapsin:5, border:true"
8+
else \
9+
hyprctl keyword "workspace $workspace_id, gapsout:0, gapsin:0, border:false"
10+
fi

bin/omarchy-install-vscode

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
echo "Installing VSCode..."
44
omarchy-pkg-add visual-studio-code-bin
55

6-
mkdir -p ~/.vscode
6+
mkdir -p ~/.vscode ~/.config/Code/User
77

88
cat > ~/.vscode/argv.json << 'EOF'
99
// This configuration file allows you to pass permanent command line arguments to VS Code.

bin/omarchy-launch-terminal

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
exec setsid uwsm-app -- "${TERMINAL:-alacritty}" "$@"

bin/omarchy-menu

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -387,27 +387,20 @@ show_remove_menu() {
387387
}
388388

389389
show_update_menu() {
390-
case $(menu "Update" " Omarchy\n Branch\n Config\n󰸌 Extra Themes\n Process\n󰇅 Hardware\n Firmware\n Password\n Timezone") in
390+
case $(menu "Update" " Omarchy\n Config\n󰸌 Extra Themes\n Process\n󰇅 Hardware\n Firmware\n Password\n Timezone\n Time") in
391391
*Omarchy*) present_terminal omarchy-update ;;
392-
*Branch*) show_update_branch_menu ;;
393392
*Config*) show_update_config_menu ;;
394393
*Themes*) present_terminal omarchy-theme-update ;;
395394
*Process*) show_update_process_menu ;;
396395
*Hardware*) show_update_hardware_menu ;;
397396
*Firmware*) present_terminal omarchy-update-firmware ;;
398397
*Timezone*) present_terminal omarchy-tz-select ;;
398+
*Time*) present_terminal omarchy-reset-time ;;
399399
*Password*) show_update_password_menu ;;
400400
*) show_main_menu ;;
401401
esac
402402
}
403403

404-
show_update_branch_menu() {
405-
case $(menu "Branch" "master\ndev" "" "$(omarchy-version-branch)") in
406-
*master*) present_terminal "omarchy-update-branch master" ;;
407-
*dev*) present_terminal "omarchy-update-branch dev" ;;
408-
*) show_update_menu ;;
409-
esac
410-
}
411404
show_update_process_menu() {
412405
case $(menu "Restart" " Hypridle\n Hyprsunset\n Swayosd\n󰌧 Walker\n󰍜 Waybar") in
413406
*Hypridle*) omarchy-restart-hypridle ;;

bin/omarchy-refresh-limine

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
if [[ -f /boot/EFI/linux/omarchy_linux.efi ]] && [[ -f /boot/EFI/linux/$(cat /etc/machine-id)_linux.efi ]]; then
4+
echo "Cleanup extra UKI"
5+
sudo rm -f /boot/EFI/Linux/$(cat /etc/machine-id)_linux.efi
6+
fi
7+
echo "Resetting limine config"
8+
9+
sudo mv /boot/limine.conf /boot/limine.conf.bak
10+
11+
sudo tee /boot/limine.conf <<EOF >/dev/null
12+
### Read more at config document: https://github.com/limine-bootloader/limine/blob/trunk/CONFIG.md
13+
#timeout: 3
14+
default_entry: 2
15+
interface_branding: Omarchy Bootloader
16+
interface_branding_color: 2
17+
hash_mismatch_panic: no
18+
19+
term_background: 1a1b26
20+
backdrop: 1a1b26
21+
22+
# Terminal colors (Tokyo Night palette)
23+
term_palette: 15161e;f7768e;9ece6a;e0af68;7aa2f7;bb9af7;7dcfff;a9b1d6
24+
term_palette_bright: 414868;f7768e;9ece6a;e0af68;7aa2f7;bb9af7;7dcfff;c0caf5
25+
26+
# Text colors
27+
term_foreground: c0caf5
28+
term_foreground_bright: c0caf5
29+
term_background_bright: 24283b
30+
31+
EOF
32+
33+
sudo limine-update
34+
sudo limine-snapper-sync

0 commit comments

Comments
 (0)