diff --git a/.vscode/settings.json b/.vscode/settings.json index a8b67ce..e2618d8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "cSpell.enabled": false + "cSpell.enabled": false, + "Lua.workspace.library": ["/usr/share/hypr/stubs"] } diff --git a/home/config/hypr/.vscode b/home/config/hypr/.vscode new file mode 120000 index 0000000..c3282dc --- /dev/null +++ b/home/config/hypr/.vscode @@ -0,0 +1 @@ +/Users/Maaz/.vscode \ No newline at end of file diff --git a/home/config/hypr/autostart.lua b/home/config/hypr/autostart.lua new file mode 100644 index 0000000..1f02e6b --- /dev/null +++ b/home/config/hypr/autostart.lua @@ -0,0 +1,8 @@ +local config = require("variables.lua") + +hl.on("hyprland.start", function () + hl.exec_cmd(config.terminal) + hl.exec_cmd("nm-applet") + hl.exec_cmd(config.wallpaper_cmd) + hl.exec_cmd(config.bar_cmd) +end) \ No newline at end of file diff --git a/home/config/hypr/decoration.lua b/home/config/hypr/decoration.lua new file mode 100644 index 0000000..ec66e4b --- /dev/null +++ b/home/config/hypr/decoration.lua @@ -0,0 +1,21 @@ +hl.config({ + decoration = { + rounding = 0, + rounding_power = 0, + + -- Change transparency of focused and unfocused windows + active_opacity = 1.0, + inactive_opacity = 0.9, + + shadow = { + enabled = false, + }, + + blur = { + enabled = true, + size = 3, + passes = 1, + vibrancy = 0.1696, + }, + } +}) \ No newline at end of file diff --git a/home/config/hypr/general.lua b/home/config/hypr/general.lua new file mode 100644 index 0000000..78786df --- /dev/null +++ b/home/config/hypr/general.lua @@ -0,0 +1,29 @@ +local theme = require("themes.lua") + +hl.config({ + general = { + gaps_in = 2, + gaps_out = 10, + + border_size = 1, + + col = { + active_border = theme.primary, + inactive_border = theme.secondary, + }, + + resize_on_border = false, + + allow_tearing = false, + + layout = "dwindle", + }, + + animations = { + enabled = true, + }, + + dwindle = { + preserve_split = true, + } +}) \ No newline at end of file diff --git a/home/config/hypr/hyprland.lua b/home/config/hypr/hyprland.lua index e69de29..5edfb6b 100644 --- a/home/config/hypr/hyprland.lua +++ b/home/config/hypr/hyprland.lua @@ -0,0 +1,7 @@ +require("autostart.lua") +require("keybinds.lua") +require("monitor.lua") +require("decoration.lua") +require("general.lua") +require("smart-gaps.lua") +require("inputs.lua") \ No newline at end of file diff --git a/home/config/hypr/inputs.lua b/home/config/hypr/inputs.lua new file mode 100644 index 0000000..b6e8e80 --- /dev/null +++ b/home/config/hypr/inputs.lua @@ -0,0 +1,23 @@ +hl.config({ + input = { + kb_layout = "us", + kb_variant = "", + kb_model = "", + kb_options = "", + kb_rules = "", + + follow_mouse = 1, + + sensitivity = 0, + + touchpad = { + natural_scroll = true, + }, + }, +}) + +hl.gesture({ + fingers = 3, + direction = "horizontal", + action = "workspace" +}) \ No newline at end of file diff --git a/home/config/hypr/keybinds.lua b/home/config/hypr/keybinds.lua new file mode 100644 index 0000000..647feec --- /dev/null +++ b/home/config/hypr/keybinds.lua @@ -0,0 +1,45 @@ +local config = require("variables.lua") + + +local mainMod = "SUPER" + + +-- Application Binds +hl.bind(mainMod .. " + Return", hl.dsp.exec_cmd(config.terminal)) +hl.bind(mainMod .. " + E", hl.dsp.exec_cmd(config.file_manager)) +hl.bind("ALT + SPACE", hl.dsp.exec_cmd(config.menu)) + + +hl.bind(mainMod .. " + Q", hl.dsp.window.close()) +hl.bind(mainMod .. " + Escape", hl.dsp.exec_cmd("command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch 'hl.dsp.exit()'")) +hl.bind(mainMod .. " + V", hl.dsp.window.float({ action = "toggle" })) +hl.bind(mainMod .. " + J", hl.dsp.layout("togglesplit")) + +-- Window Binds +hl.bind(mainMod .. " + left", hl.dsp.focus({ direction = "left" })) +hl.bind(mainMod .. " + right", hl.dsp.focus({ direction = "right" })) +hl.bind(mainMod .. " + up", hl.dsp.focus({ direction = "up" })) +hl.bind(mainMod .. " + down", hl.dsp.focus({ direction = "down" })) +hl.bind(mainMod .. " + SHIFT + LEFT", hl.dsp.move({ direction = "left" })) +hl.bind(mainMod .. " + SHIFT + RIGHT", hl.dsp.move({ direction = "right" })) +hl.bind(mainMod .. " + SHIFT + UP", hl.dsp.move({ direction = "up" })) +hl.bind(mainMod .. " + SHIFT + DOWN", hl.dsp.move({ direction = "down" })) + +-- Workspace Binds +for i = 1, 10 do + local key = i % 10 + hl.bind(mainMod .. " + " .. key, hl.dsp.focus({ workspace = i})) + hl.bind(mainMod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i })) +end + +-- Resize Windows +hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true }) +hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true }) + +-- Laptop Multimedia Keys +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 }) +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 }) \ No newline at end of file diff --git a/home/config/hypr/monitor.lua b/home/config/hypr/monitor.lua new file mode 100644 index 0000000..b5b3a9f --- /dev/null +++ b/home/config/hypr/monitor.lua @@ -0,0 +1,6 @@ +hl.monitor({ + output = "eDP-1", + mode = "1920x1080@60", + position = "0x0", + scale = 1, +}) \ No newline at end of file diff --git a/home/config/hypr/smart-gaps.lua b/home/config/hypr/smart-gaps.lua new file mode 100644 index 0000000..9f958a9 --- /dev/null +++ b/home/config/hypr/smart-gaps.lua @@ -0,0 +1,14 @@ +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, +}) \ No newline at end of file diff --git a/home/config/hypr/themes.lua b/home/config/hypr/themes.lua new file mode 100644 index 0000000..7348945 --- /dev/null +++ b/home/config/hypr/themes.lua @@ -0,0 +1,17 @@ +local normal = { + primary = "rgba(33ccffee)", + secondary = "rgba(595959aa)", +}; + +local gray_blue = { + primary = "rgba(D9F7FAaa)", + secondary = "rgba(D8DDDEaa)", +} + +local purple = { + primary = "rgba(9fa1ffff)", + secondary = "rgba(b5baffff)" +} + +-- Change the option: +return purple \ No newline at end of file diff --git a/home/config/hypr/variables.lua b/home/config/hypr/variables.lua new file mode 100644 index 0000000..5ea335a --- /dev/null +++ b/home/config/hypr/variables.lua @@ -0,0 +1,25 @@ +local function wallpaper_util(wallpaper_path) + local ext = wallpaper_path:lower():match("^.+%.([a-z0-9]+)$") + + if ext == "mp4" or ext == "mkv" or ext == "webm" or ext == "mov" then + return string.format( + 'mpvpaper ALL "%s" --mpv-options="loop-file=inf no-audio"', + wallpaper_path + ) + end + + return string.format( + 'mpvpaper '*' "%s"', + wallpaper_path + ) + end + +return { + terminal = "ghostty", + file_manager = "dolphin", + screen_shot_cmd = "hyprshot -m region -o ~/Pictures/Screenshots", + menu = "rofi -show drun", + wallpaper_cmd = wallpaper_util("/home/river/Videos/Wallpapers/Wallpaper.mp4"), + browser = "brave", + bar_cmd = "qs" +} \ No newline at end of file diff --git a/modules/core/default.nix b/modules/core/default.nix index acb115d..2fd4c75 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -19,6 +19,8 @@ mpv wl-clipboard ghostty + wireplumber + brightnessctl ]; nix.gc = {