Compare commits
9 Commits
8493ad4365
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 0fea6f1450 | |||
| ddf2db90e9 | |||
| 8b2ec0c7d7 | |||
| 968ab1ec10 | |||
| b0177ed346 | |||
| a143b1a1f1 | |||
| b2d5ecdd0e | |||
| aa96d67e71 | |||
| 9257437dc8 |
548
flake.lock
generated
Normal file
548
flake.lock
generated
Normal file
@@ -0,0 +1,548 @@
|
||||
{
|
||||
"nodes": {
|
||||
"aquamarine": {
|
||||
"inputs": {
|
||||
"hyprutils": [
|
||||
"hyprland",
|
||||
"hyprutils"
|
||||
],
|
||||
"hyprwayland-scanner": [
|
||||
"hyprland",
|
||||
"hyprwayland-scanner"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1782073106,
|
||||
"narHash": "sha256-dnS5SaZlPqR1E0dPXaPc+lFkBwLUbAgbwsVMk7uA6dY=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "aquamarine",
|
||||
"rev": "6d6e2384f381def4ea4ea81543cba4bbdac72457",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "aquamarine",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1767039857,
|
||||
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
|
||||
"owner": "NixOS",
|
||||
"repo": "flake-compat",
|
||||
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"pre-commit-hooks",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709087332,
|
||||
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprcursor": {
|
||||
"inputs": {
|
||||
"hyprlang": [
|
||||
"hyprland",
|
||||
"hyprlang"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1776511930,
|
||||
"narHash": "sha256-fCpwFiTW0rT7oKJqr3cqHMnkwypSwQKpbtUEtxdkgrM=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprcursor",
|
||||
"rev": "39435900785d0c560c6ae8777d29f28617d031ef",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprcursor",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprgraphics": {
|
||||
"inputs": {
|
||||
"hyprutils": [
|
||||
"hyprland",
|
||||
"hyprutils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1782566056,
|
||||
"narHash": "sha256-haEZcHzYrePnjFOYSWTbxm/Nrla0aPslJfmvdCvqtVc=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprgraphics",
|
||||
"rev": "c6e7b9f673f4360bc813d3dc75028f75ee88d3f8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprgraphics",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprland": {
|
||||
"inputs": {
|
||||
"aquamarine": "aquamarine",
|
||||
"hyprcursor": "hyprcursor",
|
||||
"hyprgraphics": "hyprgraphics",
|
||||
"hyprland-guiutils": "hyprland-guiutils",
|
||||
"hyprland-protocols": "hyprland-protocols",
|
||||
"hyprlang": "hyprlang",
|
||||
"hyprutils": "hyprutils",
|
||||
"hyprwayland-scanner": "hyprwayland-scanner",
|
||||
"hyprwire": "hyprwire",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"pre-commit-hooks": "pre-commit-hooks",
|
||||
"systems": "systems",
|
||||
"xdph": "xdph"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1783106555,
|
||||
"narHash": "sha256-D+CFZ784rsLLhIjGjlmiR8TBbjZ1N8NbD+3u8HF0nuw=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "Hyprland",
|
||||
"rev": "37b02954ec347642edcb8eefdf15846d2da9180f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "Hyprland",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprland-guiutils": {
|
||||
"inputs": {
|
||||
"aquamarine": [
|
||||
"hyprland",
|
||||
"aquamarine"
|
||||
],
|
||||
"hyprgraphics": [
|
||||
"hyprland",
|
||||
"hyprgraphics"
|
||||
],
|
||||
"hyprlang": [
|
||||
"hyprland",
|
||||
"hyprlang"
|
||||
],
|
||||
"hyprtoolkit": "hyprtoolkit",
|
||||
"hyprutils": [
|
||||
"hyprland",
|
||||
"hyprutils"
|
||||
],
|
||||
"hyprwayland-scanner": [
|
||||
"hyprland",
|
||||
"hyprwayland-scanner"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1782563850,
|
||||
"narHash": "sha256-rs/EzgrgPHbCtJjFZN4aR1HYldH/0NtGAempWVpWQTs=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprland-guiutils",
|
||||
"rev": "5ba080ee036c30cb2485f2647ff8a61f7aa08178",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprland-guiutils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprland-protocols": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1772460177,
|
||||
"narHash": "sha256-/6G/MsPvtn7bc4Y32pserBT/Z4SUUdBd4XYJpOEKVR4=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprland-protocols",
|
||||
"rev": "1cb6db5fd6bb8aee419f4457402fa18293ace917",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprland-protocols",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprlang": {
|
||||
"inputs": {
|
||||
"hyprutils": [
|
||||
"hyprland",
|
||||
"hyprutils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1777320127,
|
||||
"narHash": "sha256-Qu+Wf2Bp5qUjyn2YpZNq8a7JyzTGowhT1knrwE38a9U=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprlang",
|
||||
"rev": "090117506ddc3d7f26e650ff344d378c2ec329cc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprlang",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprtoolkit": {
|
||||
"inputs": {
|
||||
"aquamarine": [
|
||||
"hyprland",
|
||||
"hyprland-guiutils",
|
||||
"aquamarine"
|
||||
],
|
||||
"hyprgraphics": [
|
||||
"hyprland",
|
||||
"hyprland-guiutils",
|
||||
"hyprgraphics"
|
||||
],
|
||||
"hyprlang": [
|
||||
"hyprland",
|
||||
"hyprland-guiutils",
|
||||
"hyprlang"
|
||||
],
|
||||
"hyprutils": [
|
||||
"hyprland",
|
||||
"hyprland-guiutils",
|
||||
"hyprutils"
|
||||
],
|
||||
"hyprwayland-scanner": [
|
||||
"hyprland",
|
||||
"hyprland-guiutils",
|
||||
"hyprwayland-scanner"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"hyprland-guiutils",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"hyprland-guiutils",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1782554491,
|
||||
"narHash": "sha256-+p3MlyN/nqRefcf2IckPlGRUn9+hielqpS9XClbLleM=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprtoolkit",
|
||||
"rev": "bdba25ced39ea39ab004a8f31593ba0b0ff1ca35",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprtoolkit",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprutils": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1783002634,
|
||||
"narHash": "sha256-xGqHIUK0wIZoW7SiMalwvO6uGOO/VrlQwoRobpE7dDI=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprutils",
|
||||
"rev": "41fb809557abd29a57151b6e1aaeabd05f9437e1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprutils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprwayland-scanner": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1777159683,
|
||||
"narHash": "sha256-Jxixw6wZphUp+nHYxOKUYSckL17QMBx2d5Zp0rJHr1g=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprwayland-scanner",
|
||||
"rev": "b8632713a6beaf28b56f2a7b0ab2fb7088dbb404",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprwayland-scanner",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprwire": {
|
||||
"inputs": {
|
||||
"hyprutils": [
|
||||
"hyprland",
|
||||
"hyprutils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1778410714,
|
||||
"narHash": "sha256-o6RzFj4nJXaPRY7EM01siuCQeT41RfwwmcmFQqwFJJg=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprwire",
|
||||
"rev": "85148a8e612808cf5ddb25d0b3c5840f3498a7dc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprwire",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1782467914,
|
||||
"narHash": "sha256-pGvFkM8N0xEkIIXDe5YYfbEAvHrk4IxBrjB/x8OomhE=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e73de5be04e0eff4190a1432b946d469c794e7b4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1782723713,
|
||||
"narHash": "sha256-oPXCU/SSUokcGaJREHibG1CBX3+s/W7orDWQOZDsEeQ=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b5aa0fbd538984f6e3d201be0005b4463d8b09f8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1773734432,
|
||||
"narHash": "sha256-IF5ppUWh6gHGHYDbtVUyhwy/i7D261P7fWD1bPefOsw=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "cda48547b432e8d3b18b4180ba07473762ec8558",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pre-commit-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1781733627,
|
||||
"narHash": "sha256-U3yTuGBnmXvXoQI3qkpfEDsn9RovQPAjN7ndRco+3u0=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "3bbec39bc90eadfa031e6f3b77272f3f60803e39",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"hyprland": "hyprland",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"wrappers": "wrappers"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1689347949,
|
||||
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default-linux",
|
||||
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default-linux",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"wrappers": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1782375095,
|
||||
"narHash": "sha256-bRepNpAluz2i0IIk7Tmzw/4BkyOrwABvc66NEgXPEhA=",
|
||||
"owner": "lassulus",
|
||||
"repo": "wrappers",
|
||||
"rev": "cd780e92c0fa66c2e721e1d91894f3db13b9f2b4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "lassulus",
|
||||
"repo": "wrappers",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"xdph": {
|
||||
"inputs": {
|
||||
"hyprland-protocols": [
|
||||
"hyprland",
|
||||
"hyprland-protocols"
|
||||
],
|
||||
"hyprlang": [
|
||||
"hyprland",
|
||||
"hyprlang"
|
||||
],
|
||||
"hyprutils": [
|
||||
"hyprland",
|
||||
"hyprutils"
|
||||
],
|
||||
"hyprwayland-scanner": [
|
||||
"hyprland",
|
||||
"hyprwayland-scanner"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"hyprland",
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1782311043,
|
||||
"narHash": "sha256-07zLc2M3/ax+JsjxGTft17/Joua41LHE9/9AC/F9zeU=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "xdg-desktop-portal-hyprland",
|
||||
"rev": "882ad01e195ce201b07c618bbee44a0cad8b9e5a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "xdg-desktop-portal-hyprland",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
30
flake.nix
Normal file
30
flake.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
description = "A very basic flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
hyprland.url = "github:hyprwm/Hyprland";
|
||||
wrappers.url = "github:lassulus/wrappers";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
wrappers,
|
||||
...
|
||||
} @ inputs: let
|
||||
system = "x86_64-linux";
|
||||
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
hypr = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||
in {
|
||||
packages.${pkgs.stdenv.hostPlatform.system}.default = wrappers.lib.wrapPackage {
|
||||
inherit pkgs;
|
||||
package = hypr;
|
||||
exePath = pkgs.lib.getExe hypr;
|
||||
flags = {
|
||||
"--config" = ./hyprland.lua;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,69 +1,4 @@
|
||||
-- Set modifier keys
|
||||
local mainMod = "SUPER + "
|
||||
local subMod = mainMod
|
||||
local keyboardString = "qwertyuiop"
|
||||
local keybindIndex = 1
|
||||
|
||||
-- Set different modifiers on laptop
|
||||
if Hostname == "mobile02" then
|
||||
mainMod = "ALT + "
|
||||
subMod = "SUPER + "
|
||||
keyboardString = "1234567890"
|
||||
keybindIndex = 2
|
||||
end
|
||||
|
||||
-- Delete windows
|
||||
hl.bind(mainMod .. "backspace", hl.dsp.window.close())
|
||||
|
||||
-- If otter is open, focus it, if not make a new window
|
||||
hl.bind(mainMod .. "d", function()
|
||||
if hl.get_windows({ class = "otter" })[1] ~= nil then
|
||||
hl.dispatch(hl.dsp.focus({ window = "class:otter" }))
|
||||
else
|
||||
hl.exec_cmd("kitty --class otter --title otter-launcher -e sh -c 'sleep 0.05 && otter-launcher'")
|
||||
end
|
||||
end)
|
||||
|
||||
-- Open windows
|
||||
local globalAppBinds = {
|
||||
{ key = { "RETURN" }, dispatch = "kitty" },
|
||||
{ key = { "f", "o" }, dispatch = "firefox" },
|
||||
{ key = { "s" }, dispatch = "nemo" },
|
||||
{ key = { "a", "e" }, dispatch = "wlogout -b 5" },
|
||||
{ mod = subMod, key = { "SHIFT + s" }, dispatch = "grimblast copy area" },
|
||||
}
|
||||
|
||||
for _, bind in ipairs(globalAppBinds) do
|
||||
local modBind = bind.mod or mainMod
|
||||
if bind.key[keybindIndex] then
|
||||
hl.bind(modBind .. bind.key[keybindIndex], hl.dsp.exec_cmd(bind.dispatch))
|
||||
else
|
||||
hl.bind(modBind .. bind.key[1], hl.dsp.exec_cmd(bind.dispatch))
|
||||
end
|
||||
end
|
||||
|
||||
-- Workspace functions
|
||||
local keyboardSplit = {}
|
||||
|
||||
for char in keyboardString:gmatch(".") do
|
||||
table.insert(keyboardSplit, char)
|
||||
end
|
||||
|
||||
for index, bind in ipairs(keyboardSplit) do
|
||||
hl.bind(mainMod .. bind, hl.dsp.focus({ workspace = index }))
|
||||
hl.bind(mainMod .. "SHIFT + " .. bind, hl.dsp.window.move({ workspace = index, follow = false }))
|
||||
end
|
||||
|
||||
-- Music workspace
|
||||
hl.bind(mainMod .. "m", hl.dsp.workspace.toggle_special("music"))
|
||||
|
||||
-- Move windows with hjkl
|
||||
hl.bind(mainMod .. "SHIFT + h", hl.dsp.layout("swapcol l"))
|
||||
hl.bind(mainMod .. "SHIFT + l", hl.dsp.layout("swapcol r"))
|
||||
hl.bind(mainMod .. "k", hl.dsp.focus({ direction = "up" }))
|
||||
hl.bind(mainMod .. "j", hl.dsp.focus({ direction = "down" }))
|
||||
|
||||
-- Function to get window position relative to monitor
|
||||
-- Get window position relative to monitor
|
||||
local function normalise_current_window_pos()
|
||||
local active = hl.get_active_window()
|
||||
if active then
|
||||
@@ -82,44 +17,179 @@ local function normalise_current_window_pos()
|
||||
end
|
||||
end
|
||||
|
||||
-- Change scroll binds to be better
|
||||
hl.bind(mainMod .. "h", function()
|
||||
local pos = normalise_current_window_pos()
|
||||
if pos then
|
||||
-- 9 derived from 5 gap plus 3 border (8), so first pixel of window is 9
|
||||
if pos == 9 then
|
||||
-- If first window, then move to monitor to the left
|
||||
hl.dispatch(hl.dsp.focus({ monitor = "+1" }))
|
||||
else
|
||||
-- If not the first window then go to the column to the left
|
||||
hl.dispatch(hl.dsp.layout("move -col"))
|
||||
-- Notification helper function
|
||||
local function notif(text, timeout, icon)
|
||||
hl.notification.create({
|
||||
text = text or "notification",
|
||||
timeout = timeout or 2000,
|
||||
icon = icon or "ok",
|
||||
})
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
hl.bind(mainMod .. "l", function()
|
||||
-- Set modifier keys
|
||||
local mainMod = "SUPER + "
|
||||
local subMod = mainMod
|
||||
local keyboardString = "qwertyuiop"
|
||||
local keybindIndex = 1
|
||||
local recordingMode = 0
|
||||
|
||||
-- Set different modifiers on laptop
|
||||
if Hostname == "mobile02" then
|
||||
mainMod = "ALT + "
|
||||
subMod = "SUPER + "
|
||||
keyboardString = "1234567890"
|
||||
keybindIndex = 2
|
||||
end
|
||||
|
||||
local globalAppBinds = {
|
||||
|
||||
---- Window functions
|
||||
{ key = { "BACKSPACE" }, dispatch = hl.dsp.window.close() },
|
||||
{ key = { "b", "f" }, dispatch = hl.dsp.window.fullscreen({ action = "toggle" }) },
|
||||
{ mod = subMod, key = { "space" }, dispatch = hl.dsp.window.float() },
|
||||
|
||||
---- Apps
|
||||
-- Launcher
|
||||
{
|
||||
key = { "d" },
|
||||
dispatch = function()
|
||||
if hl.get_windows({ class = "otter" })[1] ~= nil then
|
||||
hl.dispatch(hl.dsp.focus({ window = "class:otter" }))
|
||||
else
|
||||
hl.exec_cmd("kitty --class otter --title otter-launcher -e sh -c 'sleep 0.05 && otter-launcher'")
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Terminal
|
||||
{
|
||||
key = { "RETURN" },
|
||||
dispatch = function()
|
||||
if recordingMode == 1 then
|
||||
hl.exec_cmd("kitty -o font_size=24 -o window_margin_width=20")
|
||||
else
|
||||
hl.exec_cmd("kitty")
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Firefox and file browser
|
||||
{ key = { "f", "o" }, dispatch = "firefox" },
|
||||
{ key = { "s" }, dispatch = "nemo" },
|
||||
|
||||
---- Move windows
|
||||
{ key = { "k" }, dispatch = hl.dsp.focus({ direction = "up" }) },
|
||||
{ key = { "j" }, dispatch = hl.dsp.focus({ direction = "down" }) },
|
||||
{ key = { "SHIFT + h" }, dispatch = hl.dsp.layout("swapcol l") },
|
||||
{ key = { "SHIFT + l" }, dispatch = hl.dsp.layout("swapcol r") },
|
||||
{
|
||||
key = { "l" },
|
||||
dispatch = function()
|
||||
-- Move before so you can detect if it is the last window
|
||||
hl.dispatch(hl.dsp.layout("move +col"))
|
||||
if not normalise_current_window_pos() then
|
||||
-- Go back a window
|
||||
hl.dispatch(hl.dsp.layout("move -col"))
|
||||
-- Move to monitor to the right
|
||||
hl.dispatch(hl.dsp.focus({ monitor = "-1" }))
|
||||
hl.dispatch(hl.dsp.focus({ monitor = "right" }))
|
||||
end
|
||||
end)
|
||||
end,
|
||||
},
|
||||
{
|
||||
key = { "h" },
|
||||
dispatch = function()
|
||||
local pos = normalise_current_window_pos()
|
||||
if pos then
|
||||
-- 9 derived from 5 gap plus 3 border (8), so first pixel of window is 9
|
||||
if pos == 9 then
|
||||
-- If first window, then move to monitor to the left
|
||||
hl.dispatch(hl.dsp.focus({ monitor = "left" }))
|
||||
else
|
||||
-- If not the first window then go to the column to the left
|
||||
hl.dispatch(hl.dsp.layout("move -col"))
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Fullscreen with b
|
||||
hl.bind(mainMod .. "b", hl.dsp.window.fullscreen({ action = "toggle" }))
|
||||
---- Special Workspaces
|
||||
{ key = { "m" }, dispatch = hl.dsp.workspace.toggle_special("music") },
|
||||
{ key = { "minus" }, dispatch = hl.dsp.workspace.toggle_special("scratch") },
|
||||
{ key = { "SHIFT + minus" }, dispatch = hl.dsp.window.move({ workspace = "special:scratch", follow = false }) },
|
||||
|
||||
-- SubMod plus space to float
|
||||
hl.bind(subMod .. "space", hl.dsp.window.float())
|
||||
-- Youtuber mode lol
|
||||
{
|
||||
key = { "z" },
|
||||
dispatch = function()
|
||||
if recordingMode == 0 then
|
||||
recordingMode = 1
|
||||
hl.exec_cmd(
|
||||
"wshowkeys -a right -F 'FiraMono Nerd Font 35' -s '#cba6f7ff' -f '#cdd6f4ff' -b '#45475a99' -m 70 -l 60 -t 1000 -a top"
|
||||
)
|
||||
notif("Recording Mode Enabled")
|
||||
else
|
||||
recordingMode = 0
|
||||
hl.exec_cmd("pkill wshowkeys")
|
||||
notif("Recording Mode Disabled")
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Special workspace
|
||||
hl.bind(mainMod .. "minus", hl.dsp.workspace.toggle_special("scratch"))
|
||||
hl.bind(mainMod .. "SHIFT + minus", hl.dsp.window.move({ workspace = "special:scratch", follow = false }))
|
||||
{
|
||||
key = { "x" },
|
||||
dispatch = function()
|
||||
if recordingMode == 1 then
|
||||
hl.exec_cmd("woomer --output DP-1 --radius 2 --monitor DP-1 -S")
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- Float resize and move window with mouse
|
||||
hl.bind(subMod .. "mouse:272", hl.dsp.window.drag(), { mouse = true })
|
||||
hl.bind(subMod .. "mouse:272", hl.dsp.window.float(), { mouse = true, click = true })
|
||||
hl.bind(subMod .. "mouse:272", hl.dsp.layout("promote"), { mouse = true, release = true })
|
||||
hl.bind(subMod .. "SHIFT + mouse:272", hl.dsp.window.resize(), { mouse = true })
|
||||
-- Logout menu
|
||||
{ key = { "a", "e" }, dispatch = "wlogout -b 5" },
|
||||
|
||||
-- Screenshot
|
||||
{ mod = subMod, key = { "SHIFT + s" }, dispatch = "grimblast copy area" },
|
||||
|
||||
-- Mouse for moving windows
|
||||
{ mod = subMod, key = { "mouse:272" }, dispatch = hl.dsp.window.drag(), opts = { mouse = true } },
|
||||
{ mod = subMod, key = { "mouse:272" }, dispatch = hl.dsp.window.float(), opts = { mouse = true, click = true } },
|
||||
{
|
||||
mod = subMod,
|
||||
key = { "mouse:272" },
|
||||
dispatch = hl.dsp.layout("promote"),
|
||||
opts = { mouse = true, release = true },
|
||||
},
|
||||
{ mod = subMod, key = { "SHIFT + mouse:272" }, dispatch = hl.dsp.window.resize(), opts = { mouse = true } },
|
||||
}
|
||||
|
||||
-- Workspace switch keys
|
||||
for _, bind in ipairs(globalAppBinds) do
|
||||
local modBind = bind.mod or mainMod
|
||||
local command
|
||||
if type(bind.dispatch) ~= "string" then
|
||||
command = bind.dispatch
|
||||
else
|
||||
command = hl.dsp.exec_cmd(bind.dispatch)
|
||||
end
|
||||
local opts = {}
|
||||
if bind.opts then
|
||||
opts = bind.opts
|
||||
end
|
||||
if bind.key[keybindIndex] then
|
||||
hl.bind(modBind .. bind.key[keybindIndex], command, opts)
|
||||
else
|
||||
hl.bind(modBind .. bind.key[1], command)
|
||||
end
|
||||
end
|
||||
|
||||
-- Workspace functions
|
||||
local keyboardSplit = {}
|
||||
|
||||
for char in keyboardString:gmatch(".") do
|
||||
table.insert(keyboardSplit, char)
|
||||
end
|
||||
|
||||
for index, bind in ipairs(keyboardSplit) do
|
||||
hl.bind(mainMod .. bind, hl.dsp.focus({ workspace = index }))
|
||||
hl.bind(mainMod .. "SHIFT + " .. bind, hl.dsp.window.move({ workspace = index, follow = false }))
|
||||
end
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
local appList = {
|
||||
"waybar",
|
||||
"dunst",
|
||||
"wpaperd -d",
|
||||
"syncthing -home=/home/user01/.config/syncthing -no-browser",
|
||||
"gotify-desktop",
|
||||
'sleep 5 && curl -X POST -H "Content-Type: application/json" -d "{\\"ref\\":\\"$(git -C ~/.dotfiles rev-parse HEAD)\\", \\"status\\":\\"$(git -C ~/.dotfiles diff --quiet && echo "clean" || echo "dirty")\\"}" https://n8n.voidarc.co.uk/webhook/config-checker',
|
||||
'sleep 5 && curl -X POST -H "Content-Type: application/json" -d "{\\"ref\\":\\"$(git -C ~/.dotfiles rev-parse HEAD)\\", \\"status\\":\\"$(git -C ~/.dotfiles diff --quiet && echo "clean" || echo "dirty")\\"}" http://192.168.1.180:5678/webhook/config-checker',
|
||||
}
|
||||
|
||||
local localAppList
|
||||
@@ -12,11 +10,14 @@ if Hostname == "HACKSTATION" then
|
||||
-- If on desktop do desktop things
|
||||
localAppList = {
|
||||
"wayvnc 0.0.0.0 --output=DP-1",
|
||||
"quickshell",
|
||||
}
|
||||
elseif Hostname == "mobile02" then
|
||||
-- If on laptop, do laptop things
|
||||
localAppList = {
|
||||
"way-edges",
|
||||
"waybar",
|
||||
"dunst",
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -65,6 +65,14 @@ hl.window_rule({
|
||||
animation = "slide top",
|
||||
})
|
||||
|
||||
hl.window_rule({
|
||||
name = "woomer no anim",
|
||||
match = {
|
||||
title = "woomer",
|
||||
},
|
||||
no_anim = true,
|
||||
})
|
||||
|
||||
-- Define gaps for music workspace
|
||||
hl.workspace_rule({
|
||||
workspace = "special:music",
|
||||
@@ -137,3 +145,12 @@ hl.layer_rule({
|
||||
blur = false,
|
||||
ignore_alpha = 0,
|
||||
})
|
||||
|
||||
hl.layer_rule({
|
||||
name = "showkeys",
|
||||
match = {
|
||||
namespace = "showkeys",
|
||||
},
|
||||
blur = false,
|
||||
no_anim = true,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user