From 004d646182ea0bdfd8cde040b37de085878c9540 Mon Sep 17 00:00:00 2001 From: Liam Malone Date: Thu, 14 Nov 2024 00:01:56 +0100 Subject: [PATCH] changes --- flake.lock | 210 +++++++++---------- flake.nix | 12 +- modules/desktop/hyprland.nix | 147 ++++++------- modules/old_configs/nvim/lua/liamm/remap.lua | 53 ++++- 4 files changed, 235 insertions(+), 187 deletions(-) diff --git a/flake.lock b/flake.lock index c18eb1b..24b9441 100644 --- a/flake.lock +++ b/flake.lock @@ -181,40 +181,17 @@ "type": "github" } }, - "hypridle": { - "inputs": { - "hyprlang": "hyprlang", - "hyprutils": "hyprutils", - "nixpkgs": [ - "nixpkgs" - ], - "systems": "systems_3" - }, - "locked": { - "lastModified": 1729679960, - "narHash": "sha256-RoFKwZsx4RHKUwO8LhEZtmI08VBVrWt3TdzoJgx1HJ0=", - "owner": "hyprwm", - "repo": "hypridle", - "rev": "4d2fb9e73eb6b75336ed3eb198e900f94ada24f4", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hypridle", - "type": "github" - } - }, "hyprland": { "inputs": { "aquamarine": "aquamarine", "hyprcursor": "hyprcursor", "hyprland-protocols": "hyprland-protocols", - "hyprlang": "hyprlang_2", - "hyprutils": "hyprutils_2", + "hyprlang": "hyprlang", + "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", "nixpkgs": "nixpkgs_2", "pre-commit-hooks": "pre-commit-hooks", - "systems": "systems_4", + "systems": "systems_3", "xdph": "xdph" }, "locked": { @@ -286,36 +263,32 @@ "type": "github" } }, + "hyprland-protocols_2": { + "inputs": { + "nixpkgs": [ + "hyprsunset", + "nixpkgs" + ], + "systems": [ + "hyprsunset", + "systems" + ] + }, + "locked": { + "lastModified": 1728345020, + "narHash": "sha256-xGbkc7U/Roe0/Cv3iKlzijIaFBNguasI31ynL2IlEoM=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "a7c183800e74f337753de186522b9017a07a8cee", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, "hyprlang": { - "inputs": { - "hyprutils": [ - "hypridle", - "hyprutils" - ], - "nixpkgs": [ - "hypridle", - "nixpkgs" - ], - "systems": [ - "hypridle", - "systems" - ] - }, - "locked": { - "lastModified": 1721324361, - "narHash": "sha256-BiJKO0IIdnSwHQBSrEJlKlFr753urkLE48wtt0UhNG4=", - "owner": "hyprwm", - "repo": "hyprlang", - "rev": "adbefbf49664a6c2c8bf36b6487fd31e3eb68086", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprlang", - "type": "github" - } - }, - "hyprlang_2": { "inputs": { "hyprutils": [ "hyprland", @@ -344,84 +317,53 @@ "type": "github" } }, - "hyprlang_3": { + "hyprsunset": { "inputs": { - "hyprutils": [ - "hyprlock", - "hyprutils" - ], + "hyprland-protocols": "hyprland-protocols_2", + "hyprutils": "hyprutils_2", + "hyprwayland-scanner": "hyprwayland-scanner_2", "nixpkgs": [ - "hyprlock", - "nixpkgs" + "hyprland" ], - "systems": [ - "hyprlock", - "systems" - ] + "systems": "systems_4" }, "locked": { - "lastModified": 1728168612, - "narHash": "sha256-AnB1KfiXINmuiW7BALYrKqcjCnsLZPifhb/7BsfPbns=", + "lastModified": 1731163989, + "narHash": "sha256-+M6/ZLT2g6l2JCBBQSNMp8oqXPMMUckWTNhHSXzvlXE=", "owner": "hyprwm", - "repo": "hyprlang", - "rev": "f054f2e44d6a0b74607a6bc0f52dba337a3db38e", + "repo": "hyprsunset", + "rev": "adaae9d2adac611151224b054f59db8cb0976779", "type": "github" }, "original": { "owner": "hyprwm", - "repo": "hyprlang", + "repo": "hyprsunset", "type": "github" } }, - "hyprlock": { + "hyprsysteminfo": { "inputs": { - "hyprlang": "hyprlang_3", "hyprutils": "hyprutils_3", "nixpkgs": [ - "nixpkgs" + "hyprland" ], "systems": "systems_5" }, "locked": { - "lastModified": 1729555766, - "narHash": "sha256-sUIsjWpZLplSJXWyJcDZdvDweksXLH5r9GSkwg0kgBw=", + "lastModified": 1729184813, + "narHash": "sha256-ARrsIQPFCHWjVl9Sxh8tedIoEsvnV4nORaDmYCyK+kk=", "owner": "hyprwm", - "repo": "hyprlock", - "rev": "a093a9eefda2db2430dd1612b2858a55daf14738", + "repo": "hyprsysteminfo", + "rev": "8b271e2ba39a5a9299e4e7bb60245a71704f5a89", "type": "github" }, "original": { "owner": "hyprwm", - "repo": "hyprlock", + "repo": "hyprsysteminfo", "type": "github" } }, "hyprutils": { - "inputs": { - "nixpkgs": [ - "hypridle", - "nixpkgs" - ], - "systems": [ - "hypridle", - "systems" - ] - }, - "locked": { - "lastModified": 1721324102, - "narHash": "sha256-WAZ0X6yJW1hFG6otkHBfyJDKRpNP5stsRqdEuHrFRpk=", - "owner": "hyprwm", - "repo": "hyprutils", - "rev": "962582a090bc233c4de9d9897f46794280288989", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprutils", - "type": "github" - } - }, - "hyprutils_2": { "inputs": { "nixpkgs": [ "hyprland", @@ -446,14 +388,39 @@ "type": "github" } }, - "hyprutils_3": { + "hyprutils_2": { "inputs": { "nixpkgs": [ - "hyprlock", + "hyprsunset", "nixpkgs" ], "systems": [ - "hyprlock", + "hyprsunset", + "systems" + ] + }, + "locked": { + "lastModified": 1727300645, + "narHash": "sha256-OvAtVLaSRPnbXzOwlR1fVqCXR7i+ICRX3aPMCdIiv+c=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "3f5293432b6dc6a99f26aca2eba3876d2660665c", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprutils_3": { + "inputs": { + "nixpkgs": [ + "hyprsysteminfo", + "nixpkgs" + ], + "systems": [ + "hyprsysteminfo", "systems" ] }, @@ -496,6 +463,31 @@ "type": "github" } }, + "hyprwayland-scanner_2": { + "inputs": { + "nixpkgs": [ + "hyprsunset", + "nixpkgs" + ], + "systems": [ + "hyprsunset", + "systems" + ] + }, + "locked": { + "lastModified": 1726874836, + "narHash": "sha256-VKR0sf0PSNCB0wPHVKSAn41mCNVCnegWmgkrneKDhHM=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "500c81a9e1a76760371049a8d99e008ea77aa59e", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1725634671, @@ -589,10 +581,10 @@ "ags": "ags", "ghostty": "ghostty", "home-manager": "home-manager", - "hypridle": "hypridle", "hyprland": "hyprland", "hyprland-plugins": "hyprland-plugins", - "hyprlock": "hyprlock", + "hyprsunset": "hyprsunset", + "hyprsysteminfo": "hyprsysteminfo", "nixpkgs": "nixpkgs_3" } }, diff --git a/flake.nix b/flake.nix index 55e6ad2..f9a7d9d 100644 --- a/flake.nix +++ b/flake.nix @@ -15,13 +15,13 @@ url = "github:hyprwm/hyprland-plugins"; inputs.hyprland.follows = "hyprland"; }; - hyprlock = { - url = "github:hyprwm/hyprlock"; - inputs.nixpkgs.follows = "nixpkgs"; + hyprsunset = { + url = "github:hyprwm/hyprsunset"; + inputs.nixpkgs.follows = "hyprland"; }; - hypridle = { - url = "github:hyprwm/hypridle"; - inputs.nixpkgs.follows = "nixpkgs"; + hyprsysteminfo = { + url = "github:hyprwm/hyprsysteminfo"; + inputs.nixpkgs.follows = "hyprland"; }; ghostty = { inputs = { diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix index ef14c35..39454a6 100644 --- a/modules/desktop/hyprland.nix +++ b/modules/desktop/hyprland.nix @@ -14,6 +14,8 @@ hypridle hyprpaper hyprland-protocols + inputs.hyprsunset + # inputs.hyprsysteminfo # hyprpolkit -- not in nixpkgs yet ]; @@ -350,78 +352,81 @@ }; lib.inputMethod.fcitx5.waylandFrontend = true; - programs.hyprlock = { - enable = true; - settings = { - general = { - disable_loading_bar = true; - hide_cursor = true; - no_fade_in = false; + + programs = { + hyprlock = { + enable = true; + settings = { + general = { + disable_loading_bar = true; + hide_cursor = true; + no_fade_in = false; + }; + background = [ + { + path = "~/pictures/.wallpapers/bloody_snow.jpg"; + blur_passes = 2; + blur_size = 8; + } + ]; + input-field = [ + { + monitor = ""; + size = "200, 30"; + outline_thickness = 3; + dots_size = 0.33; + dots_spacing = 0.15; + dots_center = false; + outer_color = "#fe0b00"; + inner_color = "#0c0c0c"; + font_color = "#efefef"; + fade_on_empty = true; + check_color = "#0eff0d"; + fail_color = "#ff009e"; + capslock_color = "#bb00ee"; + placeholder_text = "Input Password..."; + fail_text = "$FAIL ($ATTEMPTS)"; + } + ]; + label = [ + { + monitor = ""; + text = "$TIME"; + text_align = "center"; + color = "#ffffee"; + font_size = 28; + font_family = builtins.head osConfig.fonts.fontconfig.defaultFonts.sansSerif; + + position = "0, 80"; + halign = "center"; + valign = "center"; + } + { + monitor = ""; + text = "cmd[update:1000] echo \" $(date +'%A, %b %d %Y')\""; + text_align = "center"; + color = "#ffffee"; + font_size = 18; + font_family = builtins.head osConfig.fonts.fontconfig.defaultFonts.sansSerif; + + position = "80, 80"; + halign = "left"; + valign = "bottom"; + } + { + monitor = ""; + text = "cmd[update:1000] echo \"󰁿$(cat /sys/class/power_supply/BAT0/capacity)\""; + text_align = "center"; + color = "#ffffee"; + font_size = 18; + font_family = builtins.head osConfig.fonts.fontconfig.defaultFonts.sansSerif; + + position = "80, 80"; + halign = "right"; + valign = "bottom"; + } + ]; }; - background = [ - { - path = "~/pictures/.wallpapers/bloody_snow.jpg"; - blur_passes = 2; - blur_size = 8; - } - ]; - input-field = [ - { - monitor = ""; - size = "200, 30"; - outline_thickness = 3; - dots_size = 0.33; - dots_spacing = 0.15; - dots_center = false; - outer_color = "#fe0b00"; - inner_color = "#0c0c0c"; - font_color = "#efefef"; - fade_on_empty = true; - check_color = "#0eff0d"; - fail_color = "#ff009e"; - capslock_color = "#bb00ee"; - placeholder_text = "Input Password..."; - fail_text = "$FAIL ($ATTEMPTS)"; - } - ]; - label = [ - { - monitor = ""; - text = "$TIME"; - text_align = "center"; - color = "#ffffee"; - font_size = 28; - font_family = builtins.head osConfig.fonts.fontconfig.defaultFonts.sansSerif; - - position = "0, 80"; - halign = "center"; - valign = "center"; - } - { - monitor = ""; - text = "cmd[update:1000] echo \" $(date +'%A, %b %d %Y')\""; - text_align = "center"; - color = "#ffffee"; - font_size = 18; - font_family = builtins.head osConfig.fonts.fontconfig.defaultFonts.sansSerif; - - position = "80, 80"; - halign = "left"; - valign = "bottom"; - } - { - monitor = ""; - text = "cmd[update:1000] echo \"󰁿$(cat /sys/class/power_supply/BAT0/capacity)\""; - text_align = "center"; - color = "#ffffee"; - font_size = 18; - font_family = builtins.head osConfig.fonts.fontconfig.defaultFonts.sansSerif; - - position = "80, 80"; - halign = "right"; - valign = "bottom"; - } - ]; }; }; diff --git a/modules/old_configs/nvim/lua/liamm/remap.lua b/modules/old_configs/nvim/lua/liamm/remap.lua index e563e07..dd35963 100644 --- a/modules/old_configs/nvim/lua/liamm/remap.lua +++ b/modules/old_configs/nvim/lua/liamm/remap.lua @@ -25,6 +25,58 @@ vim.keymap.set("n", "x", "!chmod +x %", {silent = true}) vim.keymap.set("n", "bg", "") -- BUILD SCRIPT INVOKATIONS +-- generic build function +local function set(list) + local _set = {} + for _, l in ipairs(list) do + _set[l] = true + end + return _set +end + +-- TODO: add support for passing flags +function Build() + local out_buf = vim.api.nvim_create_buf(false, true) + + local build_scripts = set(vim.fs.find({ "build.sh", "build.zig", "build.bat" }, { upward = true, type = "file", path = "." })) + local output = "[No Build Output]" + + if build_scripts['build.zig'] then + vim.cmd('echo "Running build.zig"') + output = vim.fn.system({ 'zig', 'build' }) + else + if jit.os == 'Windows' and build_scripts['build.bat'] then + output = vim.fn.system({ 'build', '' }) + elseif build_scripts['build.sh'] then + output = vim.fn.system({ './build.sh', '' }) + else + end + end + vim.api.nvim_buf_set_lines(out_buf, -1, -1, true, {"[ Build Output ]"}) + vim.api.nvim_buf_set_lines(out_buf, -1, -1, true, vim.split(output, '\n')) + + local window = vim.api.nvim_open_win(out_buf, false, { + split = 'right', + win = 0, + width = math.floor(vim.o.columns * 0.35), + style = 'minimal', + }) + vim.api.nvim_set_current_win(window) + + -- Keybind to close the window on pressing Enter + vim.api.nvim_buf_set_keymap(out_buf, 'n', '', '', { + noremap = true, + silent = true, + callback = function() + vim.api.nvim_win_close(window, true) + end + }) +end + +-- TODO: add support for passing flags +vim.keymap.set("n", "bs", ":lua Build()") + +-- specific build scipt options -- `build.sh` script binds -- non-interactive binds @@ -63,7 +115,6 @@ vim.keymap.set("n", "zboRr" , ":!zig build run -Doptimize=ReleaseSafe ") vim.keymap.set("n", "zboRsr", ":!zig build run -Doptimize=ReleaseSmall ") vim.keymap.set("n", "zboRfr", ":!zig build run -Doptimize=ReleaseFast ") - -- emacs-inspired binds -- all can be done w spacebar-w vim.keymap.set("n", "w", "")