diff --git a/dotfiles/hypr-lap/hyprland.lua b/dotfiles/hypr-lap/hyprland.lua new file mode 100644 index 0000000..a302f45 --- /dev/null +++ b/dotfiles/hypr-lap/hyprland.lua @@ -0,0 +1,18 @@ +--------------- +--- SOURCES --- +--------------- + +-- MONITORS +require("source/monitors") +-- BINDS +require("source/binds") +-- AUTOSTART +require("source/autostart") +-- ENVIRONMENT VARIABLES +require("source/ev") +-- LOOK AND FEEL +require("source/look") +-- INPUT +require("source/input") +-- WINDOWS AND WORKSPACES +require("source/winandwork") diff --git a/dotfiles/hypr-lap/source/autostart.lua b/dotfiles/hypr-lap/source/autostart.lua new file mode 100644 index 0000000..9c0c81c --- /dev/null +++ b/dotfiles/hypr-lap/source/autostart.lua @@ -0,0 +1,16 @@ +-- exec_once +hl.on("hyprland.start", function () + hl.exec_cmd("waybar") + hl.exec_cmd("/home/smayzy/.config/hypr/battery.sh") + hl.exec_cmd("systemctl --user start hypr-wallpaper.service") + hl.exec_cmd("wl-paste --type text --watch cliphist store") + hl.exec_cmd("wl-paste --type image --watch cliphist store") + hl.exec_cmd("systemctl --user start hyprpolkitagent") + hl.exec_cmd("mako") + hl.exec_cmd("thunderbird", {workspace = "10 silent"}) +end) + +-- exec at each reload +hl.on("config.reloaded", function () + hl.exec_cmd("killall waybar && waybar") +end) diff --git a/dotfiles/hypr-lap/source/binds.lua b/dotfiles/hypr-lap/source/binds.lua new file mode 100644 index 0000000..c5a6741 --- /dev/null +++ b/dotfiles/hypr-lap/source/binds.lua @@ -0,0 +1,94 @@ +------------------------------------ +--- USE WEV TO GET THE KEYS CODE --- +------------------------------------ + +-------------------- +--- KEYBINDINGSS --- +-------------------- + +-- MainMod +mainMod = "SUPER" + +-- exec +hl.bind(mainMod .. " + comma", hl.dsp.exit()) +hl.bind(mainMod .. " + F", hl.dsp.window.fullscreen()) +hl.bind(mainMod .. " + T", hl.dsp.window.float()) +hl.bind(mainMod .. " + C", hl.dsp.window.close()) +hl.bind(mainMod .. " + Q", hl.dsp.exec_cmd("kitty")) +hl.bind(mainMod .. " + A", hl.dsp.exec_cmd("alacritty")) +hl.bind(mainMod .. " + E", hl.dsp.exec_cmd("dolphin")) +hl.bind(mainMod .. " + R", hl.dsp.exec_cmd("wofi --show drun")) +hl.bind(mainMod .. " + W", hl.dsp.exec_cmd("wlogout")) +hl.bind("XF86Calculator", hl.dsp.exec_cmd("qalculate-gtk")) + +-- Volume +hl.bind("XF86AudioMute" , hl.dsp.exec_cmd("pactl set-sink-volume @DEFAULT_SINK@ 0%")) +hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("pactl set-sink-volume @DEFAULT_SINK@ +5%")) +hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("pactl set-sink-volume @DEFAULT_SINK@ -5%")) + +-- Brightness +hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl set 5%-")) +hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl set 5%+")) + +-- Change wallpaper +hl.bind(mainMod .. " + SHIFT + W", hl.dsp.exec_cmd("echo trigger > /tmp/wallpaper-trigger")) + +-- Reload waybar +hl.bind(mainMod .. " + SHIFT + B", hl.dsp.exec_cmd("pkill waybar && waybar")) + +-- Hide waybar +hl.bind(mainMod .. " + X", hl.dsp.exec_cmd("pkill waybar || waybar")) + +-- Clipboard history +hl.bind(mainMod .. " + V", hl.dsp.exec_cmd("cliphist list | wofi -dmenu | cliphist decode | wl-copy")) + +-- Screenshot to clipboard +hl.bind(mainMod .. " + SHIFT + S", hl.dsp.exec_cmd("grim -g \"$(slurp -d)\" - | wl-copy")) + +-- 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"})) + +-- 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 }) + +-- Resize Windows +hl.bind(mainMod .. " + CTRL + h", hl.dsp.window.resize({ x = -20 , y = 0 , relative = true })) +hl.bind(mainMod .. " + CTRL + l", hl.dsp.window.resize({ x = 20 , y = 0 , relative = true })) +hl.bind(mainMod .. " + CTRL + k", hl.dsp.window.resize({ x = 0 , y = -20 , relative = true })) +hl.bind(mainMod .. " + CTRL + j", hl.dsp.window.resize({ x = 0 , y = 20 , relative = true })) + +-- Switch workspaces +hl.bind(mainMod .. " + ampersand", hl.dsp.focus({ workspace = "1"})) +hl.bind(mainMod .. " + eacute", hl.dsp.focus({ workspace = "2"})) +hl.bind(mainMod .. " + quotedbl", hl.dsp.focus({ workspace = "3"})) +hl.bind(mainMod .. " + apostrophe", hl.dsp.focus({ workspace = "4"})) +hl.bind(mainMod .. " + parenleft", hl.dsp.focus({ workspace = "5"})) +hl.bind(mainMod .. " + minus", hl.dsp.focus({ workspace = "6"})) +hl.bind(mainMod .. " + egrave", hl.dsp.focus({ workspace = "7"})) +hl.bind(mainMod .. " + underscore", hl.dsp.focus({ workspace = "8"})) +hl.bind(mainMod .. " + ccedilla", hl.dsp.focus({ workspace = "9"})) +hl.bind(mainMod .. " + agrave", hl.dsp.focus({ workspace = "10"})) +hl.bind(mainMod .. " + dead_circumflex", hl.dsp.focus({ workspace = "11"})) +hl.bind(mainMod .. " + dollar", hl.dsp.focus({ workspace = "12"})) +hl.bind(mainMod .. " + ugrave", hl.dsp.focus({ workspace = "13"})) +hl.bind(mainMod .. " + asterisk", hl.dsp.focus({ workspace = "14"})) + +-- Move active window to a workspace +hl.bind(mainMod .. " + SHIFT + ampersand", hl.dsp.window.move({ workspace = "1"})) +hl.bind(mainMod .. " + SHIFT + eacute", hl.dsp.window.move({ workspace = "2"})) +hl.bind(mainMod .. " + SHIFT + quotedbl", hl.dsp.window.move({ workspace = "3"})) +hl.bind(mainMod .. " + SHIFT + apostrophe", hl.dsp.window.move({ workspace = "4"})) +hl.bind(mainMod .. " + SHIFT + parenleft", hl.dsp.window.move({ workspace = "5"})) +hl.bind(mainMod .. " + SHIFT + minus", hl.dsp.window.move({ workspace = "6"})) +hl.bind(mainMod .. " + SHIFT + egrave", hl.dsp.window.move({ workspace = "7"})) +hl.bind(mainMod .. " + SHIFT + underscore", hl.dsp.window.move({ workspace = "8"})) +hl.bind(mainMod .. " + SHIFT + ccedilla", hl.dsp.window.move({ workspace = "9"})) +hl.bind(mainMod .. " + SHIFT + agrave", hl.dsp.window.move({ workspace = "10"})) +hl.bind(mainMod .. " + SHIFT + dead_circumflex", hl.dsp.window.move({ workspace = "11"})) +hl.bind(mainMod .. " + SHIFT + dollar", hl.dsp.window.move({ workspace = "12"})) +hl.bind(mainMod .. " + SHIFT + ugrave", hl.dsp.window.move({ workspace = "13"})) +hl.bind(mainMod .. " + SHIFT + asterisk", hl.dsp.window.move({ workspace = "14"})) diff --git a/dotfiles/hypr-lap/source/ev.lua b/dotfiles/hypr-lap/source/ev.lua new file mode 100644 index 0000000..c604a19 --- /dev/null +++ b/dotfiles/hypr-lap/source/ev.lua @@ -0,0 +1,6 @@ +-- Set env here +hl.env("XCURSOR_SIZE", "24") +hl.env("HYPRCURSOR_SIZE", "24") +hl.env("XDG_SESSION_TYPE", "wayland") +hl.env("HYPRLAND_NO_SD_VARS", "1") +hl.env("LD_LIBRARY_PATH", "/nix/store/p5c2hfgw9pipp2vd0xvxjmly99nbsdki-pipewire-1.6.8-jack/lib/") diff --git a/dotfiles/hypr-lap/source/input.lua b/dotfiles/hypr-lap/source/input.lua new file mode 100644 index 0000000..468c035 --- /dev/null +++ b/dotfiles/hypr-lap/source/input.lua @@ -0,0 +1,22 @@ +--Set inputs here + +hl.config({ + input = { + kb_layout = "fr", + kb_variant = "", + kb_model = "pc105", + kb_options = "terminate:ctrl_alt_bksp", + kb_rules = "", + + follow_mouse = 1, + + sensitivity = 0, + + touchpad = { + natural_scroll = false, + }, + }, + cursor = { + no_hardware_cursors = 0, + } +}) diff --git a/dotfiles/hypr-lap/source/look.lua b/dotfiles/hypr-lap/source/look.lua new file mode 100644 index 0000000..7fbee87 --- /dev/null +++ b/dotfiles/hypr-lap/source/look.lua @@ -0,0 +1,61 @@ +--Set look and feel here + +hl.config({ + general = { + layout = "dwindle", + gaps_in = 3, + gaps_out = 5, + border_size = 1, + col = { + active_border = { colors = {"rgba(33ccffee)", "rgba(00ff99ee)"}, angle = 45 }, + inactive_border = "rgba(595959aa)", + }, + }, + + decoration = { + rounding = 6, + rounding_power = 2, + + active_opacity = 1.0, + inactive_opacity = 1.0, + + shadow = { + enabled = false + }, + + blur = { + enabled = false, + }, + }, + + animations = { + enabled = true, + }, + + dwindle = { + preserve_split = true, + }, + + master = { + new_status = "master", + }, + + misc = { + force_default_wallpaper = 0, + disable_hyprland_logo = true, + }, + + ecosystem = { + no_update_news = true, + no_donation_nag = true, + } +}) + +hl.curve( "mybezier", { type = "bezier", points = { {0.05, 0.9}, {0.1, 1.05} } }) + +hl.animation({ leaf = "windows", enabled = true, speed = 7, bezier = "mybezier" }) +hl.animation({ leaf = "windowsOut", enabled = true, speed = 7, bezier = "mybezier" }) +hl.animation({ leaf = "border", enabled = true, speed = 7, bezier = "mybezier" }) +hl.animation({ leaf = "borderangle", enabled = true, speed = 7, bezier = "mybezier" }) +hl.animation({ leaf = "fade", enabled = true, speed = 7, bezier = "mybezier" }) +hl.animation({ leaf = "workspaces", enabled = true, speed = 7, bezier = "mybezier" }) diff --git a/dotfiles/hypr-lap/source/monitors.lua b/dotfiles/hypr-lap/source/monitors.lua new file mode 100644 index 0000000..9ee5aae --- /dev/null +++ b/dotfiles/hypr-lap/source/monitors.lua @@ -0,0 +1,6 @@ +hl.monitor({ + output = "", + mode = "preferred", + position = "auto", + scale = 1 +}) diff --git a/dotfiles/hypr-lap/source/winandwork.lua b/dotfiles/hypr-lap/source/winandwork.lua new file mode 100644 index 0000000..129ac50 --- /dev/null +++ b/dotfiles/hypr-lap/source/winandwork.lua @@ -0,0 +1,19 @@ +hl.window_rule({ + name = "suppress-maximize-events", + match = {class = ".*"}, + suppress_event = "maximize" +}) + +hl.window_rule({ + name = "fix-xwayland-drags", + match = { + class = "^$", + title = "^$", + xwayland = true, + float = true, + fullscreen = false, + pin = false, + }, + + no_focus = true, +})