aboutsummaryrefslogtreecommitdiff
path: root/.config/hypr
diff options
context:
space:
mode:
Diffstat (limited to '.config/hypr')
-rw-r--r--.config/hypr/binds.lua53
-rw-r--r--.config/hypr/env.lua4
-rw-r--r--.config/hypr/hyprland.lua15
-rw-r--r--.config/hypr/input.lua26
-rw-r--r--.config/hypr/monitors.lua18
-rw-r--r--.config/hypr/perms.lua18
-rw-r--r--.config/hypr/start.lua7
-rw-r--r--.config/hypr/visual.lua34
-rw-r--r--.config/hypr/windows.lua43
-rw-r--r--.config/hypr/workspace_rules.lua18
10 files changed, 236 insertions, 0 deletions
diff --git a/.config/hypr/binds.lua b/.config/hypr/binds.lua
new file mode 100644
index 0000000..0d373b0
--- /dev/null
+++ b/.config/hypr/binds.lua
@@ -0,0 +1,53 @@
+local mainMod = "SUPER"
+
+-- https://wiki.hypr.land/Configuring/Basics/Binds/
+hl.bind(mainMod.." + Return", hl.dsp.exec_cmd(terminal))
+local closeWindowBind = hl.bind(mainMod.." + C", hl.dsp.window.close())
+-- closeWindowBind:set_enabled(false)
+hl.bind(mainMod.." + SHIFT + E", hl.dsp.exec_cmd("command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch 'hl.dsp.exit()'"))
+hl.bind(mainMod.." + Space", hl.dsp.window.float({ action = "toggle" }))
+hl.bind(mainMod.." + R", hl.dsp.exec_cmd(menu))
+hl.bind(mainMod.." + P", hl.dsp.window.pseudo())
+
+-- Move focus with mainMod + arrow keys
+hl.bind(mainMod.." + H", hl.dsp.focus({ direction = "left" }))
+hl.bind(mainMod.." + L", hl.dsp.focus({ direction = "right" }))
+hl.bind(mainMod.." + K", hl.dsp.focus({ direction = "up" }))
+hl.bind(mainMod.." + J", hl.dsp.focus({ direction = "down" }))
+
+-- Switch workspaces with mainMod + [0-9]
+-- Move active window to a workspace with mainMod + SHIFT + [0-9]
+for i = 1, 10 do
+ local key = i % 10 -- 10 maps to key 0
+ hl.bind(mainMod.." + "..key, hl.dsp.focus({ workspace = i}))
+ hl.bind(mainMod.." + SHIFT + "..key, hl.dsp.window.move({ workspace = i }))
+end
+
+-- Example special workspace (scratchpad)
+hl.bind(mainMod.." + S", hl.dsp.workspace.toggle_special("magic"))
+hl.bind(mainMod.." + SHIFT + S", hl.dsp.window.move({ workspace = "special:magic" }))
+
+-- Scroll through existing workspaces with mainMod + scroll
+hl.bind(mainMod.." + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
+hl.bind(mainMod.." + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
+
+-- Move/resize windows with mainMod + LMB/RMB and dragging
+hl.bind(mainMod.." + mouse:272", hl.dsp.window.drag(), { mouse = true })
+hl.bind(mainMod.." + mouse:273", hl.dsp.window.resize(), { mouse = true })
+
+-- media
+hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true })
+hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
+hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
+hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true })
+-- volume
+hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true, repeating = true })
+hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true, repeating = true })
+hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { locked = true, repeating = true })
+hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { locked = true, repeating = true })
+-- brightness
+hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%+"), { locked = true, repeating = true })
+hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%-"), { locked = true, repeating = true })
+
+-- screenshots
+hl.bind("Print", hl.dsp.exec_cmd("grim -g \"$(slurp)\" - | wl-copy"))
diff --git a/.config/hypr/env.lua b/.config/hypr/env.lua
new file mode 100644
index 0000000..a5d2af3
--- /dev/null
+++ b/.config/hypr/env.lua
@@ -0,0 +1,4 @@
+-- https://wiki.hypr.land/Configuring/Advanced-and-Cool/Environment-variables/
+
+hl.env("XCURSOR_SIZE", "24")
+hl.env("HYPRCURSOR_SIZE", "24")
diff --git a/.config/hypr/hyprland.lua b/.config/hypr/hyprland.lua
new file mode 100644
index 0000000..37f96e8
--- /dev/null
+++ b/.config/hypr/hyprland.lua
@@ -0,0 +1,15 @@
+-- https://wiki.hypr.land/Configuring/Start/
+
+mainMod = "SUPER"
+terminal = "foot"
+menu = "foot --app-id tux -T foot tux"
+
+require("monitors")
+require("env")
+require("start")
+require("perms")
+require("visual")
+--require("workspace-rules")
+require("input")
+require("binds")
+require("windows")
diff --git a/.config/hypr/input.lua b/.config/hypr/input.lua
new file mode 100644
index 0000000..3d549ad
--- /dev/null
+++ b/.config/hypr/input.lua
@@ -0,0 +1,26 @@
+hl.config({
+ input = {
+ kb_layout = "us",
+ kb_variant = "",
+ kb_model = "",
+ kb_options = "",
+ kb_rules = "",
+
+ follow_mouse = 1,
+ sensitivity = 0, --[[ -1.0 - 1.0, 0 means no modification. ]]
+ touchpad = { natural_scroll = false, },
+ },
+})
+
+hl.gesture({
+ fingers = 3,
+ direction = "horizontal",
+ action = "workspace"
+})
+
+-- https://wiki.hypr.land/Configuring/Advanced-and-Cool/Devices/
+--hl.device({
+-- name = "epic-mouse-v1",
+-- sensitivity = -0.5,
+--})
+
diff --git a/.config/hypr/monitors.lua b/.config/hypr/monitors.lua
new file mode 100644
index 0000000..8ed2443
--- /dev/null
+++ b/.config/hypr/monitors.lua
@@ -0,0 +1,18 @@
+hl.monitor({
+ output = "DP-2",
+ mode = "1920x1080@144",
+ position = "0x0",
+ scale = "1",
+})
+hl.monitor({
+ output = "DP-1",
+ mode = "1920x1080@75",
+ position = "1920x0",
+ scale = "1",
+})
+hl.monitor({
+ output = "HDMI-A-1",
+ mode = "1920x1080@50",
+ position = "960x-1080",
+ scale = "1",
+})
diff --git a/.config/hypr/perms.lua b/.config/hypr/perms.lua
new file mode 100644
index 0000000..c7b92d8
--- /dev/null
+++ b/.config/hypr/perms.lua
@@ -0,0 +1,18 @@
+-----------------------
+----- PERMISSIONS -----
+-----------------------
+
+-- See https://wiki.hypr.land/Configuring/Advanced-and-Cool/Permissions/
+-- Please note permission changes here require a Hyprland restart and are not applied on-the-fly
+-- for security reasons
+
+-- hl.config({
+-- ecosystem = {
+-- enforce_permissions = true,
+-- },
+-- })
+
+-- hl.permission("/usr/(bin|local/bin)/grim", "screencopy", "allow")
+-- hl.permission("/usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland", "screencopy", "allow")
+-- hl.permission("/usr/(bin|local/bin)/hyprpm", "plugin", "allow")
+
diff --git a/.config/hypr/start.lua b/.config/hypr/start.lua
new file mode 100644
index 0000000..65a9074
--- /dev/null
+++ b/.config/hypr/start.lua
@@ -0,0 +1,7 @@
+-- https://wiki.hypr.land/Configuring/Basics/Autostart/
+
+hl.on("hyprland.start", function ()
+ hl.exec_cmd("gentoo-pipewire-launcher")
+ hl.exec_cmd("gentoo-pipewire-launcher restart")
+ hl.exec_cmd(terminal)
+end)
diff --git a/.config/hypr/visual.lua b/.config/hypr/visual.lua
new file mode 100644
index 0000000..b8ed8d5
--- /dev/null
+++ b/.config/hypr/visual.lua
@@ -0,0 +1,34 @@
+-----------------------
+---- LOOK AND FEEL ----
+-----------------------
+-- https://wiki.hypr.land/Configuring/Basics/Variables/
+
+hl.config({
+ general = {
+ gaps_in = 2,
+ gaps_out = 2,
+ border_size = 2,
+ col = {
+ active_border = "rgba(ef934dff)",
+ inactive_border = "rgba(3b403cff)",
+ },
+ resize_on_border = false,
+ -- https://wiki.hypr.land/Configuring/Advanced-and-Cool/Tearing/
+ allow_tearing = false,
+ layout = "master",
+ },
+
+ decoration = {
+ rounding = 0,
+ shadow = { enabled = false, },
+ blur = { enabled = false, },
+ },
+
+ animations = { enabled = false, },
+
+ misc = {
+ force_default_wallpaper = 0,
+ disable_hyprland_logo = true,
+ },
+})
+
diff --git a/.config/hypr/windows.lua b/.config/hypr/windows.lua
new file mode 100644
index 0000000..4eb2a98
--- /dev/null
+++ b/.config/hypr/windows.lua
@@ -0,0 +1,43 @@
+-- https://wiki.hypr.land/Configuring/Basics/Window-Rules/
+-- https://wiki.hypr.land/Configuring/Basics/Workspace-Rules/
+
+local suppressMaximizeRule = hl.window_rule({
+ -- Ignore maximize requests from all apps. You'll probably like this.
+ name = "suppress-maximize-events",
+ match = { class = ".*" },
+
+ suppress_event = "maximize",
+})
+-- suppressMaximizeRule:set_enabled(false)
+
+hl.window_rule({
+ -- Fix some dragging issues with XWayland
+ name = "fix-xwayland-drags",
+ match = {
+ class = "^$",
+ title = "^$",
+ xwayland = true,
+ float = true,
+ fullscreen = false,
+ pin = false,
+ },
+
+ no_focus = true,
+})
+
+-- Layer rules also return a handle.
+-- local overlayLayerRule = hl.layer_rule({
+-- name = "no-anim-overlay",
+-- match = { namespace = "^my-overlay$" },
+-- no_anim = true,
+-- })
+-- overlayLayerRule:set_enabled(false)
+
+-- Hyprland-run windowrule
+hl.window_rule({
+ name = "move-hyprland-run",
+ match = { class = "hyprland-run" },
+
+ move = "20 monitor_h-120",
+ float = true,
+})
diff --git a/.config/hypr/workspace_rules.lua b/.config/hypr/workspace_rules.lua
new file mode 100644
index 0000000..dbf9aba
--- /dev/null
+++ b/.config/hypr/workspace_rules.lua
@@ -0,0 +1,18 @@
+-- https://wiki.hypr.land/Configuring/Basics/Workspace-Rules/
+-- "Smart gaps" / "No gaps when only"
+-- uncomment all if you wish to use that.
+-- hl.workspace_rule({ workspace = "w[tv1]", gaps_out = 0, gaps_in = 0 })
+-- hl.workspace_rule({ workspace = "f[1]", gaps_out = 0, gaps_in = 0 })
+-- hl.window_rule({
+-- name = "no-gaps-wtv1",
+-- match = { float = false, workspace = "w[tv1]" },
+-- border_size = 0,
+-- rounding = 0,
+-- })
+-- hl.window_rule({
+-- name = "no-gaps-f1",
+-- match = { float = false, workspace = "f[1]" },
+-- border_size = 0,
+-- rounding = 0,
+-- })
+