Zenn
🎅

Hyprlockを設定してみたよ

2025/03/13に公開

Hyprlandを設定していて、ロック機能がほしいと思ってHyprlockを設定した

環境:Fedora 41

install

sudo dnf install hyprlock

config fileを作ります!

touch ~/.config/hypr/hyprlock.conf

configしてみます。初めてなので適当につくリました。GitHubにあるサンプルconfigに壁紙要素を追加しました。

# sample hyprlock.conf
# for more configuration options, refer https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock

animations {
    enabled = true
    bezier = linear, 1, 1, 0, 0
    animation = fadeIn, 1, 5, linear
    animation = fadeOut, 1, 5, linear
}

input-field {
  monitor =
  fade_on_empty = false
}

background {
  # color = rgb(23, 39, 41)
  path = # Path to an image file
}

さらに、簡単に起動したいと思い、ショートカットコマンドで実行できるようにします。
以下をhyprland.confに追加します。
Super+Lでロックするように設定しましたが、そこはよしなに変更できます。

$lock = hyprlock
bind = $mainMod, L, exec, $lock

あと、ノートPCの場合、蓋を閉めたときにロックされてほしいですね。
以下をhyprland.confに設定します。

bindl=,switch:off:Lid Switch, exec, hyprlock --immediate # Lock lid on close

これでいい感じに使えそうです★

Discussion

ログインするとコメントできます