Switch hyprlock to QS
This commit is contained in:
Executable
+55
@@ -0,0 +1,55 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Show idle, screensaver, and lock diagnostics
|
||||
# omarchy:group=debug
|
||||
# omarchy:args=[log-lines]
|
||||
# omarchy:examples=omarchy debug idle | omarchy-debug-idle 400
|
||||
|
||||
lines=${1:-200}
|
||||
if [[ ! $lines =~ ^[0-9]+$ ]]; then
|
||||
lines=200
|
||||
fi
|
||||
|
||||
section() {
|
||||
printf '\n== %s ==\n' "$1"
|
||||
}
|
||||
|
||||
section "Time"
|
||||
date -Is
|
||||
|
||||
section "Idle IPC status"
|
||||
omarchy-shell idle status 2>&1 | jq . 2>/dev/null || omarchy-shell idle status 2>&1 || true
|
||||
|
||||
section "Quickshell instances"
|
||||
quickshell list -p "$OMARCHY_PATH/shell" --any-display 2>&1 || true
|
||||
|
||||
section "Recent idle logs"
|
||||
quickshell --no-color log -p "$OMARCHY_PATH/shell" --any-display --tail "$lines" --log-times -r 'quickshell.wayland.idle_notify=true' 2>&1 \
|
||||
| grep -Ei 'omarchy idle|idle_notify|screensaver|lock|error|warn|failed' || true
|
||||
|
||||
section "Relevant processes"
|
||||
ps -eo pid=,args= \
|
||||
| grep -E 'quickshell -n -p|dbus-monitor.*PrepareForSleep|org\.omarchy\.screensaver|omarchy-screensaver|(^|/| )tte( |$)' \
|
||||
| grep -v grep || true
|
||||
|
||||
section "Hyprland screensaver clients"
|
||||
hyprctl clients -j 2>/dev/null \
|
||||
| jq -r '.[] | select(.class == "org.omarchy.screensaver" or .initialClass == "org.omarchy.screensaver") | [.pid,.class,.initialClass,.title,.focusHistoryID] | @tsv' || true
|
||||
|
||||
section "Idle inhibitors"
|
||||
hyprctl clients -j 2>/dev/null \
|
||||
| jq -r '.[] | select(.inhibitingIdle == true or ((.tags // []) | index("noidle"))) | [.pid,.class,.title,((.tags // []) | join(",")),.inhibitingIdle] | @tsv' || true
|
||||
|
||||
section "Screensaver detector"
|
||||
if hyprctl clients -j 2>/dev/null | jq -e '.[] | select(.class == "org.omarchy.screensaver" or .initialClass == "org.omarchy.screensaver")' >/dev/null; then
|
||||
echo "running-window"
|
||||
elif pgrep -f '[o]rg.omarchy.screensaver' >/dev/null; then
|
||||
echo "running-process"
|
||||
elif omarchy-toggle-enabled screensaver-off; then
|
||||
echo "disabled"
|
||||
else
|
||||
echo "stopped"
|
||||
fi
|
||||
|
||||
section "Lock detector"
|
||||
omarchy-shell lock status 2>&1 | jq . 2>/dev/null || omarchy-shell lock status 2>&1 || true
|
||||
@@ -26,8 +26,6 @@ if [[ -n $font_name ]]; then
|
||||
sed -i "s/^font=.*/font=$font_name:size=9/g" ~/.config/foot/foot.ini
|
||||
fi
|
||||
|
||||
sed -i "s/font_family = .*/font_family = $font_name/g" ~/.config/hypr/hyprlock.conf
|
||||
|
||||
# fontconfig is the canonical source of truth — the omarchy shell, Qt
|
||||
# apps, and anything else that resolves "monospace" all read from here.
|
||||
xmlstarlet ed -L \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# omarchy:summary=Open a config file in the user's editor and surface a toast
|
||||
# omarchy:args=<path>
|
||||
# omarchy:examples=omarchy launch config-editor ~/.config/hypr/hyprlock.conf
|
||||
# omarchy:examples=omarchy launch config-editor ~/.config/hypr/hyprland.lua
|
||||
|
||||
path="${1-}"
|
||||
|
||||
|
||||
@@ -10,14 +10,14 @@ if [[ -z $config_file ]]; then
|
||||
Usage: $0 [config_file]
|
||||
|
||||
Must provide a file path from the .config directory to be refreshed.
|
||||
To copy ~/.local/share/omarchy/config/hypr/hyprlock.conf to ~/.config/hypr/hyprlock.conf
|
||||
To copy ~/.local/share/omarchy/config/hypr/hyprland.lua to ~/.config/hypr/hyprland.lua
|
||||
|
||||
$0 hypr/hyprlock.conf
|
||||
$0 hypr/hyprland.lua
|
||||
USAGE
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Backup the destination file (with timestamp) to avoid clobbering (Ex: hyprlock.conf.bak.1753817951)
|
||||
# Backup the destination file (with timestamp) to avoid clobbering (Ex: hyprland.lua.bak.1753817951)
|
||||
user_config_file="${HOME}/.config/$config_file"
|
||||
default_config_file="$OMARCHY_PATH/config/$config_file"
|
||||
backup_config_file="$user_config_file.bak.$(date +%s)"
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Overwrite the user config for hyprlock with the Omarchy default.
|
||||
|
||||
omarchy-refresh-config hypr/hyprlock.conf
|
||||
@@ -20,16 +20,18 @@ remove_pam_config() {
|
||||
fi
|
||||
}
|
||||
|
||||
remove_hyprlock_fingerprint_icon() {
|
||||
echo "Removing fingerprint icon from hyprlock placeholder text..."
|
||||
sed -i 's/placeholder_text = .*/placeholder_text = Enter Password/' ~/.config/hypr/hyprlock.conf
|
||||
sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = false/' ~/.config/hypr/hyprlock.conf
|
||||
remove_lock_fingerprint_pam() {
|
||||
if [[ -f /etc/pam.d/omarchy-lock-fingerprint ]]; then
|
||||
echo "Removing lock screen fingerprint authentication..."
|
||||
sudo rm -f /etc/pam.d/omarchy-lock-fingerprint
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
echo -e "\e[32mRemoving fingerprint scanner from authentication.\n\e[0m"
|
||||
|
||||
remove_pam_config
|
||||
remove_hyprlock_fingerprint_icon
|
||||
remove_lock_fingerprint_pam
|
||||
|
||||
echo "Removing fingerprint packages..."
|
||||
omarchy-pkg-drop fprintd libfprint-git
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
|
||||
CONFIG_DIR="$OMARCHY_PATH/shell"
|
||||
|
||||
if ! quickshell reload -p "$CONFIG_DIR" >/dev/null 2>&1; then
|
||||
setsid quickshell -n -p "$CONFIG_DIR" >/dev/null 2>&1 &
|
||||
fi
|
||||
quickshell kill -p "$CONFIG_DIR" --any-display >/dev/null 2>&1 || true
|
||||
sleep 0.2
|
||||
setsid quickshell -n -p "$CONFIG_DIR" >/dev/null 2>&1 &
|
||||
|
||||
Executable
+62
@@ -0,0 +1,62 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Configure Quickshell lock screen authentication
|
||||
# omarchy:group=setup
|
||||
# omarchy:name=lock
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
set -e
|
||||
|
||||
target_user=${SUDO_USER:-}
|
||||
if [[ -z $target_user && -n ${PKEXEC_UID:-} ]]; then
|
||||
target_user=$(getent passwd "$PKEXEC_UID" | cut -d: -f1)
|
||||
fi
|
||||
target_user=${target_user:-$USER}
|
||||
target_home=$(getent passwd "$target_user" | cut -d: -f6)
|
||||
target_group=$(id -gn "$target_user" 2>/dev/null || echo "$target_user")
|
||||
|
||||
as_root() {
|
||||
if (( EUID == 0 )); then
|
||||
"$@"
|
||||
else
|
||||
sudo "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
tee_root() {
|
||||
local path="$1"
|
||||
|
||||
if (( EUID == 0 )); then
|
||||
tee "$path"
|
||||
else
|
||||
sudo tee "$path"
|
||||
fi
|
||||
}
|
||||
|
||||
echo "Configuring lock screen password authentication..."
|
||||
|
||||
tee_root /etc/pam.d/omarchy-lock-password >/dev/null <<'EOF'
|
||||
#%PAM-1.0
|
||||
auth required pam_faillock.so preauth silent deny=10 unlock_time=120
|
||||
-auth [success=2 default=ignore] pam_systemd_home.so
|
||||
auth [success=1 default=bad] pam_unix.so try_first_pass nullok
|
||||
auth [default=die] pam_faillock.so authfail deny=10 unlock_time=120
|
||||
auth optional pam_permit.so
|
||||
auth required pam_env.so
|
||||
auth required pam_faillock.so authsucc
|
||||
account include system-local-login
|
||||
EOF
|
||||
|
||||
if omarchy-cmd-present fprintd-list && fprintd-list "$target_user" 2>/dev/null | grep -qi finger; then
|
||||
echo "Configuring lock screen fingerprint authentication..."
|
||||
tee_root /etc/pam.d/omarchy-lock-fingerprint >/dev/null <<'EOF'
|
||||
#%PAM-1.0
|
||||
auth required pam_fprintd.so
|
||||
account include system-local-login
|
||||
EOF
|
||||
else
|
||||
as_root rm -f /etc/pam.d/omarchy-lock-fingerprint
|
||||
fi
|
||||
|
||||
|
||||
omarchy-shell lock status >/dev/null 2>&1 && echo "Lock screen authentication configured."
|
||||
@@ -42,12 +42,16 @@ EOF
|
||||
fi
|
||||
}
|
||||
|
||||
add_hyprlock_fingerprint_icon() {
|
||||
echo "Adding fingerprint icon to hyprlock placeholder text..."
|
||||
sed -i 's/placeholder_text = .*/placeholder_text = <span> Enter Password <\/span>/' ~/.config/hypr/hyprlock.conf
|
||||
sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = true/' ~/.config/hypr/hyprlock.conf
|
||||
setup_lock_fingerprint_pam() {
|
||||
echo "Configuring lock screen for fingerprint authentication..."
|
||||
sudo tee /etc/pam.d/omarchy-lock-fingerprint >/dev/null <<'EOF'
|
||||
#%PAM-1.0
|
||||
auth required pam_fprintd.so
|
||||
account include system-local-login
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
echo -e "\e[32mSetting up fingerprint scanner for authentication.\n\e[0m"
|
||||
|
||||
# Install required packages
|
||||
@@ -71,9 +75,6 @@ fi
|
||||
# Configure PAM
|
||||
setup_pam_config
|
||||
|
||||
# Add fingerprint icon to hyprlock placeholder text
|
||||
add_hyprlock_fingerprint_icon
|
||||
|
||||
# Enroll first fingerprint
|
||||
echo -e "\e[32m\nLet's setup your right index finger as the first fingerprint.\e[0m"
|
||||
echo -e "Keep moving the finger around on sensor until the process completes.\n"
|
||||
@@ -84,8 +85,9 @@ if sudo fprintd-enroll "$USER"; then
|
||||
# Verify
|
||||
echo -e "\nNow let's verify that it's working correctly.\n"
|
||||
if fprintd-verify; then
|
||||
setup_lock_fingerprint_pam
|
||||
echo -e "\e[32m\nPerfect! Fingerprint authentication is now configured.\e[0m"
|
||||
echo "You can use your fingerprint for sudo, polkit, and lock screen (Super + Escape)."
|
||||
echo "You can use your fingerprint for sudo, polkit, and lock screen (Super + Ctrl + L)."
|
||||
else
|
||||
echo -e "\e[31m\nVerification failed. You may want to try enrolling again.\e[0m"
|
||||
fi
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set Hyprland, Hyprlock, and Walker corners to sharp or round (the shell mirrors Hyprland)
|
||||
# omarchy:summary=Set Hyprland and Walker corners to sharp or round (the shell mirrors Hyprland)
|
||||
# omarchy:args=<sharp|round>
|
||||
# omarchy:examples=omarchy style corners round | omarchy style corners sharp
|
||||
|
||||
@@ -14,7 +14,6 @@ fi
|
||||
# state file is written. The old omarchy-style-corners-quickshell shim is
|
||||
# kept as a no-op so external callers don't error.
|
||||
omarchy-style-corners-hyprland "$1"
|
||||
omarchy-style-corners-hyprlock "$1"
|
||||
omarchy-style-corners-walker "$1"
|
||||
|
||||
case $1 in
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set or toggle rounded Hyprlock input field corners
|
||||
# omarchy:args=[toggle|sharp|round]
|
||||
# omarchy:examples=omarchy style corners hyprlock toggle | omarchy style corners hyprlock round | omarchy style corners hyprlock sharp
|
||||
|
||||
TOGGLES_CONFIG="$HOME/.local/state/omarchy/toggles/hyprlock.conf"
|
||||
|
||||
set_rounding() {
|
||||
local radius="$1"
|
||||
|
||||
mkdir -p "$(dirname "$TOGGLES_CONFIG")"
|
||||
|
||||
cat >"$TOGGLES_CONFIG" <<EOF
|
||||
input-field {
|
||||
rounding = $radius
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
case "${1:-toggle}" in
|
||||
round) set_rounding 6 ;;
|
||||
sharp) set_rounding 0 ;;
|
||||
toggle)
|
||||
if [[ -f $TOGGLES_CONFIG ]] && grep -q '^ rounding = 6$' "$TOGGLES_CONFIG"; then
|
||||
set_rounding 0
|
||||
else
|
||||
set_rounding 6
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Usage: omarchy-style-corners-hyprlock [toggle|sharp|round]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -5,12 +5,7 @@
|
||||
# omarchy:name=lock
|
||||
# omarchy:examples=omarchy system lock
|
||||
|
||||
if ! pidof hyprlock >/dev/null; then
|
||||
(
|
||||
hyprlock
|
||||
omarchy-system-wake
|
||||
) &
|
||||
fi
|
||||
omarchy-shell lock lock >/dev/null
|
||||
|
||||
# Set keyboard layout to default (first layout)
|
||||
hyprctl switchxkblayout all 0 > /dev/null 2>&1
|
||||
@@ -21,12 +16,12 @@ if pgrep -x "1password" >/dev/null; then
|
||||
fi
|
||||
|
||||
# Avoid running screensaver when locked
|
||||
pkill -f org.omarchy.screensaver
|
||||
pkill -f '[o]rg.omarchy.screensaver'
|
||||
|
||||
if [[ ${OMARCHY_LOCK_ONLY:-false} != "true" ]]; then
|
||||
(
|
||||
sleep 3
|
||||
pidof hyprlock >/dev/null || exit 0
|
||||
[[ $(omarchy-shell lock isLocked 2>/dev/null) == "true" ]] || exit 0
|
||||
omarchy-brightness-keyboard off
|
||||
omarchy-brightness-display off
|
||||
) &
|
||||
|
||||
Reference in New Issue
Block a user