Vendor the command set the menu and shell depend on
This commit is contained in:
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
# blob:summary=Lock the computer and turn off the display
|
||||
# blob:group=system
|
||||
# blob:name=lock
|
||||
# blob:examples=blob system lock
|
||||
|
||||
blob-shell lock lock >/dev/null
|
||||
|
||||
# Set keyboard layout to default (first layout)
|
||||
hyprctl switchxkblayout all 0 > /dev/null 2>&1
|
||||
|
||||
# Ensure 1password is locked. Use timeout because `1password --lock` can
|
||||
# otherwise leave a full Electron helper tree running after each lock.
|
||||
if pgrep -x "1password" >/dev/null && blob-cmd-present 1password; then
|
||||
(
|
||||
flock -n 9 || exit 0
|
||||
timeout --kill-after=1s 3s 1password --lock >/dev/null 2>&1 || true
|
||||
) 9>"${XDG_RUNTIME_DIR:-/tmp}/blob-1password-lock.lock" &
|
||||
fi
|
||||
|
||||
# Avoid running screensaver when locked
|
||||
pkill -x ttfx 2>/dev/null || true
|
||||
# ttfx handles SIGTERM asynchronously, so keep its terminal alive until it exits.
|
||||
timeout 1s pidwait -x ttfx 2>/dev/null || true
|
||||
pkill -f '[o]rg.blob.screensaver' 2>/dev/null || true
|
||||
Reference in New Issue
Block a user