0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

hyprland.luaの書き方メモ

0
Posted at

abdstact

hyprlandの設定ファイルはversion 0.57 以降hyprland.conf から hyprland.lua に移行するらしい。
これに伴いluaで書き換えをしているのだが、どうせ書き方を忘れてまたWkiiを見ることになるだろうから、備忘録として基本的な記法を残しておく。
未来のおれ、感謝するがよい。
あと、書き途中であり、いつか追記する。

なお、luaの文法とかはあまり理解していない。

dir

~/.config/hypr/hyprland.lua

基本的な文法

  • local hoge = "fugo" で変数を定義できるぞ
  • hlってオブジェクトの中身を呼び出して使うようだぞ

NVIDIA製GPUで使う

hyprland.lua
hl.env("LIBVA_DRIVER_NAME","nvidia")
hl.env("__GLX_VENDOR_LIBRARY_NAME","nvidia")

(cf.Wiki)

モニタの設定

Wiki
hl.monitorのフィールドを埋めるよ。
e.g.

field type 補足
output string 出力先.hyprctl monitorsで調べよう
mode string 解像度とかフレッシュレートとか

hyprland起動時にコマンドを走らせる

Wiki-Autostart
hyprland起動時に自動的に起動したいアプリケーションなどに。
e.g. 起動時にhyprparerを起動する

hyprland.lua
hl.on("hyprland.start", function()
  hl.exec_cmd("hyprpaper")
end)

Key binds

Wiki-bindsのページ
hl.bind("keys", dispatcher or function(), {bind_flags} )つかうよ。
dispatcherってのはexec_cmd()とかで、hl.dspなるオブジェクトに含まれる。詳細はWiki-dspを参照のこと。
e.g. Super + Qでkittyを起動する

hyprland.lua
hl.bind("SUPER + Q", hl.dsp.exec_cmd("kitty"))

よく使うdispatcherをいくつかメモ。

hl.dsp.exec_cmd("echo 'hello world'") --コマンドを実行
hl.dsp.focus({direction = "left"}) --フォーカスを移動
hl.dsp.window.move({direction = "left"}) --ウィンドウを移動

Rules

Wiki-Window Rules
Windowの表示とかの設定。

e.g. Xwaylandを使用してるwindowは表示をかえる

h-yprland.lua
hl.window_rule({
	name = "Xwayland",
	match = {
		xwayland = true,
	},
	border_size = 6,
	border_color = "rgba(cca222ff)",
})

Animation

curve

Wiki-animation

あとでかく

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?