Skip to content

Commit 7ea4e1a

Browse files
committed
Switch hyprlock to QS
1 parent 0f50441 commit 7ea4e1a

35 files changed

Lines changed: 784 additions & 219 deletions

AGENTS.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,3 @@ New migration format:
169169
Some older migrations predate these rules. Do not copy older migrations that start with shebangs, omit the leading `echo`, or hard-code `~/.local/share/omarchy`.
170170

171171
Migrations may use raw `pacman`, `command -v`, or direct config edits when needed for historical compatibility or one-off repair work.
172-
173-
Example:
174-
```bash
175-
echo "Disable fingerprint in hyprlock if fingerprint auth is not configured"
176-
177-
if omarchy-cmd-missing fprintd-list || ! fprintd-list "$USER" 2>/dev/null | grep -q "finger"; then
178-
sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = false/' ~/.config/hypr/hyprlock.conf
179-
fi
180-
```

bin/omarchy-debug-idle

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
3+
# omarchy:summary=Show idle, screensaver, and lock diagnostics
4+
# omarchy:group=debug
5+
# omarchy:args=[log-lines]
6+
# omarchy:examples=omarchy debug idle | omarchy-debug-idle 400
7+
8+
lines=${1:-200}
9+
if [[ ! $lines =~ ^[0-9]+$ ]]; then
10+
lines=200
11+
fi
12+
13+
section() {
14+
printf '\n== %s ==\n' "$1"
15+
}
16+
17+
section "Time"
18+
date -Is
19+
20+
section "Idle IPC status"
21+
omarchy-shell idle status 2>&1 | jq . 2>/dev/null || omarchy-shell idle status 2>&1 || true
22+
23+
section "Quickshell instances"
24+
quickshell list -p "$OMARCHY_PATH/shell" --any-display 2>&1 || true
25+
26+
section "Recent idle logs"
27+
quickshell --no-color log -p "$OMARCHY_PATH/shell" --any-display --tail "$lines" --log-times -r 'quickshell.wayland.idle_notify=true' 2>&1 \
28+
| grep -Ei 'omarchy idle|idle_notify|screensaver|lock|error|warn|failed' || true
29+
30+
section "Relevant processes"
31+
ps -eo pid=,args= \
32+
| grep -E 'quickshell -n -p|dbus-monitor.*PrepareForSleep|org\.omarchy\.screensaver|omarchy-screensaver|(^|/| )tte( |$)' \
33+
| grep -v grep || true
34+
35+
section "Hyprland screensaver clients"
36+
hyprctl clients -j 2>/dev/null \
37+
| jq -r '.[] | select(.class == "org.omarchy.screensaver" or .initialClass == "org.omarchy.screensaver") | [.pid,.class,.initialClass,.title,.focusHistoryID] | @tsv' || true
38+
39+
section "Idle inhibitors"
40+
hyprctl clients -j 2>/dev/null \
41+
| jq -r '.[] | select(.inhibitingIdle == true or ((.tags // []) | index("noidle"))) | [.pid,.class,.title,((.tags // []) | join(",")),.inhibitingIdle] | @tsv' || true
42+
43+
section "Screensaver detector"
44+
if hyprctl clients -j 2>/dev/null | jq -e '.[] | select(.class == "org.omarchy.screensaver" or .initialClass == "org.omarchy.screensaver")' >/dev/null; then
45+
echo "running-window"
46+
elif pgrep -f '[o]rg.omarchy.screensaver' >/dev/null; then
47+
echo "running-process"
48+
elif omarchy-toggle-enabled screensaver-off; then
49+
echo "disabled"
50+
else
51+
echo "stopped"
52+
fi
53+
54+
section "Lock detector"
55+
omarchy-shell lock status 2>&1 | jq . 2>/dev/null || omarchy-shell lock status 2>&1 || true

bin/omarchy-font-set

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ if [[ -n $font_name ]]; then
2626
sed -i "s/^font=.*/font=$font_name:size=9/g" ~/.config/foot/foot.ini
2727
fi
2828

29-
sed -i "s/font_family = .*/font_family = $font_name/g" ~/.config/hypr/hyprlock.conf
30-
3129
# fontconfig is the canonical source of truth — the omarchy shell, Qt
3230
# apps, and anything else that resolves "monospace" all read from here.
3331
xmlstarlet ed -L \

bin/omarchy-launch-config-editor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# omarchy:summary=Open a config file in the user's editor and surface a toast
44
# omarchy:args=<path>
5-
# omarchy:examples=omarchy launch config-editor ~/.config/hypr/hyprlock.conf
5+
# omarchy:examples=omarchy launch config-editor ~/.config/hypr/hyprland.lua
66

77
path="${1-}"
88

bin/omarchy-refresh-config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ if [[ -z $config_file ]]; then
1010
Usage: $0 [config_file]
1111
1212
Must provide a file path from the .config directory to be refreshed.
13-
To copy ~/.local/share/omarchy/config/hypr/hyprlock.conf to ~/.config/hypr/hyprlock.conf
13+
To copy ~/.local/share/omarchy/config/hypr/hyprland.lua to ~/.config/hypr/hyprland.lua
1414
15-
$0 hypr/hyprlock.conf
15+
$0 hypr/hyprland.lua
1616
USAGE
1717
exit 1
1818
fi
1919

20-
# Backup the destination file (with timestamp) to avoid clobbering (Ex: hyprlock.conf.bak.1753817951)
20+
# Backup the destination file (with timestamp) to avoid clobbering (Ex: hyprland.lua.bak.1753817951)
2121
user_config_file="${HOME}/.config/$config_file"
2222
default_config_file="$OMARCHY_PATH/config/$config_file"
2323
backup_config_file="$user_config_file.bak.$(date +%s)"

bin/omarchy-refresh-hyprlock

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

bin/omarchy-remove-security-fingerprint

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,18 @@ remove_pam_config() {
2020
fi
2121
}
2222

23-
remove_hyprlock_fingerprint_icon() {
24-
echo "Removing fingerprint icon from hyprlock placeholder text..."
25-
sed -i 's/placeholder_text = .*/placeholder_text = Enter Password/' ~/.config/hypr/hyprlock.conf
26-
sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = false/' ~/.config/hypr/hyprlock.conf
23+
remove_lock_fingerprint_pam() {
24+
if [[ -f /etc/pam.d/omarchy-lock-fingerprint ]]; then
25+
echo "Removing lock screen fingerprint authentication..."
26+
sudo rm -f /etc/pam.d/omarchy-lock-fingerprint
27+
fi
2728
}
2829

30+
2931
echo -e "\e[32mRemoving fingerprint scanner from authentication.\n\e[0m"
3032

3133
remove_pam_config
32-
remove_hyprlock_fingerprint_icon
34+
remove_lock_fingerprint_pam
3335

3436
echo "Removing fingerprint packages..."
3537
omarchy-pkg-drop fprintd libfprint-git

bin/omarchy-restart-shell

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
CONFIG_DIR="$OMARCHY_PATH/shell"
77

8-
if ! quickshell reload -p "$CONFIG_DIR" >/dev/null 2>&1; then
9-
setsid quickshell -n -p "$CONFIG_DIR" >/dev/null 2>&1 &
10-
fi
8+
quickshell kill -p "$CONFIG_DIR" --any-display >/dev/null 2>&1 || true
9+
sleep 0.2
10+
setsid quickshell -n -p "$CONFIG_DIR" >/dev/null 2>&1 &

bin/omarchy-setup-lock

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash
2+
3+
# omarchy:summary=Configure Quickshell lock screen authentication
4+
# omarchy:group=setup
5+
# omarchy:name=lock
6+
# omarchy:requires-sudo=true
7+
8+
set -e
9+
10+
target_user=${SUDO_USER:-}
11+
if [[ -z $target_user && -n ${PKEXEC_UID:-} ]]; then
12+
target_user=$(getent passwd "$PKEXEC_UID" | cut -d: -f1)
13+
fi
14+
target_user=${target_user:-$USER}
15+
target_home=$(getent passwd "$target_user" | cut -d: -f6)
16+
target_group=$(id -gn "$target_user" 2>/dev/null || echo "$target_user")
17+
18+
as_root() {
19+
if (( EUID == 0 )); then
20+
"$@"
21+
else
22+
sudo "$@"
23+
fi
24+
}
25+
26+
tee_root() {
27+
local path="$1"
28+
29+
if (( EUID == 0 )); then
30+
tee "$path"
31+
else
32+
sudo tee "$path"
33+
fi
34+
}
35+
36+
echo "Configuring lock screen password authentication..."
37+
38+
tee_root /etc/pam.d/omarchy-lock-password >/dev/null <<'EOF'
39+
#%PAM-1.0
40+
auth required pam_faillock.so preauth silent deny=10 unlock_time=120
41+
-auth [success=2 default=ignore] pam_systemd_home.so
42+
auth [success=1 default=bad] pam_unix.so try_first_pass nullok
43+
auth [default=die] pam_faillock.so authfail deny=10 unlock_time=120
44+
auth optional pam_permit.so
45+
auth required pam_env.so
46+
auth required pam_faillock.so authsucc
47+
account include system-local-login
48+
EOF
49+
50+
if omarchy-cmd-present fprintd-list && fprintd-list "$target_user" 2>/dev/null | grep -qi finger; then
51+
echo "Configuring lock screen fingerprint authentication..."
52+
tee_root /etc/pam.d/omarchy-lock-fingerprint >/dev/null <<'EOF'
53+
#%PAM-1.0
54+
auth required pam_fprintd.so
55+
account include system-local-login
56+
EOF
57+
else
58+
as_root rm -f /etc/pam.d/omarchy-lock-fingerprint
59+
fi
60+
61+
62+
omarchy-shell lock status >/dev/null 2>&1 && echo "Lock screen authentication configured."

bin/omarchy-setup-security-fingerprint

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@ EOF
4242
fi
4343
}
4444

45-
add_hyprlock_fingerprint_icon() {
46-
echo "Adding fingerprint icon to hyprlock placeholder text..."
47-
sed -i 's/placeholder_text = .*/placeholder_text = <span> Enter Password 󰈷 <\/span>/' ~/.config/hypr/hyprlock.conf
48-
sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = true/' ~/.config/hypr/hyprlock.conf
45+
setup_lock_fingerprint_pam() {
46+
echo "Configuring lock screen for fingerprint authentication..."
47+
sudo tee /etc/pam.d/omarchy-lock-fingerprint >/dev/null <<'EOF'
48+
#%PAM-1.0
49+
auth required pam_fprintd.so
50+
account include system-local-login
51+
EOF
4952
}
5053

54+
5155
echo -e "\e[32mSetting up fingerprint scanner for authentication.\n\e[0m"
5256

5357
# Install required packages
@@ -71,9 +75,6 @@ fi
7175
# Configure PAM
7276
setup_pam_config
7377

74-
# Add fingerprint icon to hyprlock placeholder text
75-
add_hyprlock_fingerprint_icon
76-
7778
# Enroll first fingerprint
7879
echo -e "\e[32m\nLet's setup your right index finger as the first fingerprint.\e[0m"
7980
echo -e "Keep moving the finger around on sensor until the process completes.\n"
@@ -84,8 +85,9 @@ if sudo fprintd-enroll "$USER"; then
8485
# Verify
8586
echo -e "\nNow let's verify that it's working correctly.\n"
8687
if fprintd-verify; then
88+
setup_lock_fingerprint_pam
8789
echo -e "\e[32m\nPerfect! Fingerprint authentication is now configured.\e[0m"
88-
echo "You can use your fingerprint for sudo, polkit, and lock screen (Super + Escape)."
90+
echo "You can use your fingerprint for sudo, polkit, and lock screen (Super + Ctrl + L)."
8991
else
9092
echo -e "\e[31m\nVerification failed. You may want to try enrolling again.\e[0m"
9193
fi

0 commit comments

Comments
 (0)