diff --git a/Readme.md b/Readme.md index ceac8c2..8ce20b8 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,6 @@ ### Dotfiles for Me - Migrating to Nix -Heavy wip, not ready for use. +Heavy wip, not ready for use. Will eventually manage my servers and computers. diff --git a/config/eww/eww.yuck b/config/eww/eww.yuck index 59dfbc4..00158fc 100644 --- a/config/eww/eww.yuck +++ b/config/eww/eww.yuck @@ -1,4 +1,4 @@ -;;;; (defpoll time :interval "1s" 'date +%s') +;;;; (defpoll time :interval "1s" 'date +%s') (defwidget clock [] (box :orientation "vertical" @@ -22,12 +22,12 @@ )))))) -(defwidget circle [val prog sty char] +(defwidget circle [val prog sty char] (box :halign "center" :orientation "vertical" :valign "end" - (circular-progress :value prog - :start-at 10 + (circular-progress :value prog + :start-at 10 :clockwise false :thickness 3 :width 30 @@ -38,14 +38,14 @@ (box :class "circle" :style sty char))) (defwidget battery [] - (circle :prog {EWW_BATTERY.BAT1.capacity * (77778 /100000)} + (circle :prog {EWW_BATTERY.BAT1.capacity * (77778 /100000)} :sty "color: ${EWW_BATTERY.BAT1.status == 'Charging' ? '#1a1': EWW_BATTERY.BAT1.capacity < 20 ? '#a11': '#cac'};" :val {EWW_BATTERY.BAT1.capacity} :char "󱐋")) (deflisten vol "cat ~/.cache/eww/vol && inotifywait -q -m -e close_write ~/.cache/eww/vol | while read -r filename event; do cat ~/.cache/eww/vol; done") -(defwidget volume [] +(defwidget volume [] (circle :prog {vol * 7/10} :sty "font-size: 12; margin-right: 2px;" :val {vol + 1 - 1} @@ -79,7 +79,7 @@ :space-evenly false (_workspaces) (clock) - (box :orientation "vertical" :spacing -25 :valign "end" + (box :orientation "vertical" :spacing -25 :valign "end" (brightness) (mic) (volume) diff --git a/config/hypr/binds.conf b/config/hypr/binds.conf index 742efaf..fc0c916 100644 --- a/config/hypr/binds.conf +++ b/config/hypr/binds.conf @@ -3,14 +3,14 @@ # Main Bindings # # Foot, you done goofed -bind=ALT,RETURN,exec,foot +bind=ALT,RETURN,exec,footclient #bind=ALT,RETURN,exec,kitty bind=ALT,Q,killactive, bind=SUPER,M,exec,hyprctl dispatch exit 0 bind=ALT,E,exec,dolphin bind=ALT,V,togglefloating, -bindr=ALTSHIFT,RETURN,exec,pkill wofi || wofi -S drun --allow-images +bindr=ALTSHIFT,RETURN,exec,pkill wofi || wofi -S drun --allow-images bind=ALTSHIFT,F,fullscreen,1 bind=ALTSHIFT,M,fullscreen,0 bind=,Print,exec,grim -g "$(slurp)" -t jpeg - | wl-copy diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index c1da5a1..33459c4 100755 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -26,7 +26,7 @@ input { sensitivity=.4 accel_profile=adaptive - touchpad { + touchpad { natural_scroll=false disable_while_typing=false } @@ -58,11 +58,11 @@ decoration { shadow_range=15 shadow_render_power=2 shadow_ignore_window=1 - col.shadow=0xdb331153 + col.shadow=0xdb331153 col.shadow_inactive=0x99333333 shadow_offset=3 2 - - # Other + + # Other rounding=15 inactive_opacity=.8 fullscreen_opacity=1 multiplier @@ -70,7 +70,7 @@ decoration { animations { enabled=true - + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 animation = windows, 1, 7, myBezier @@ -78,7 +78,7 @@ animations { animation = border, 1, 10, default animation = borderangle, 1, 8, default animation = fade, 1, 7, default - animation = workspaces, 1, 6, default + animation = workspaces, 1, 6, default } dwindle { diff --git a/config/nvim/lua/keymap.lua b/config/nvim/lua/keymap.lua index d397bdd..7bf310c 100644 --- a/config/nvim/lua/keymap.lua +++ b/config/nvim/lua/keymap.lua @@ -17,13 +17,13 @@ map({ "n", "x" }, "", "6k") map({ "n", "x" }, "M", "J", { desc = "Merge" }) -- Replace the join command map("n", "gh", vim.lsp.buf.hover, { desc = "Hover" }) -- Code action hover - + -- Move to window using the hjkl keys map("n", "", "h", { desc = "Go to left window", remap = true }) map("n", "", "j", { desc = "Go to lower window", remap = true }) map("n", "", "k", { desc = "Go to upper window", remap = true }) map("n", "", "l", { desc = "Go to right window", remap = true }) - + -- Move between buffers map("n", "", "BufferLineCyclePrev", { desc = "Move buffer left", silent = true }) map("n", "", "BufferLineCycleNext", { desc = "Move buffer right", silent = true }) @@ -50,6 +50,72 @@ map("n", "e", function() require("neo-tree.command").execute({ action = "show", position = "right", toggle = true, dir = vim.loop.cwd() }) end, { desc = "Open Neotree", remap = true }) + +-- Conform Formatting +map({ "n", "v" }, "mp", function() + require("conform").format({ + lsp_fallback = true, + async = false, + timeout_ms = 500, + }) +end, { desc = "Format file or range (in visual mode)" }) + +-- diagnostic +---@param next "f"|"b" +---@param severity "ERROR"|"WARN"? +local diagnostic_goto = function(next, severity) + local go = (next == "f") and vim.diagnostic.goto_next or vim.diagnostic.goto_prev + local severity_index = severity and vim.diagnostic.severity[severity] or nil + return function() + go({ severity = severity_index }) + end +end +map("n", "cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" }) +map("n", "]d", diagnostic_goto("f"), { desc = "Next Diagnostic" }) +map("n", "[d", diagnostic_goto("b"), { desc = "Prev Diagnostic" }) +map("n", "]e", diagnostic_goto("f", "ERROR"), { desc = "Next Error" }) +map("n", "[e", diagnostic_goto("b", "ERROR"), { desc = "Prev Error" }) +map("n", "]w", diagnostic_goto("f", "WARN"), { desc = "Next Warning" }) +map("n", "[w", diagnostic_goto("b", "WARN"), { desc = "Prev Warning" }) + +---- +-- Plugins +---- + +-- Telescope (fuzzy finder) +local function telescope_git_fallback() + vim.fn.system("git rev-parse --is-inside-work-tree") + local is_git_repo = vim.v.shell_error == 0 + + if is_git_repo then + require("telescope.builtin").git_files() + else + require("telescope.builtin").find_files() + end +end +local function telescope_files() + require("telescope.builtin").find_files({ cwd = vim.uv.cwd() }) +end +local function telescope_oldfiles() + require("telescope.builtin").oldfiles({ cwd = vim.uv.cwd() }) +end +local function telescope_live_grep() + vim.fn.system("git rev-parse --is-inside-work-tree") + local is_git_repo = vim.v.shell_error == 0 + local git_root = vim.fn.fnamemodify(vim.fn.finddir(".git", ".;"), ":h") + + require("telescope.builtin").live_grep({ + cwd = is_git_repo and git_root or vim.uv.cwd(), + }) +end +map("n", "", telescope_git_fallback, { desc = "Find files (git/fallback, cwd)" }) +map("n", "ff", telescope_files, { desc = "Find files (cwd)" }) +map("n", "fo", telescope_oldfiles, { desc = "Find files (cwd)" }) +map("n", "/", telescope_live_grep, { desc = "Live grep (cwd)" }) +map("n", ",", require("telescope.builtin").buffers, { desc = "Find buffers" }) +map("n", "\"", require("telescope.builtin").registers, { desc = "Find registers" }) + + ---- -- Fixes ---- @@ -80,3 +146,5 @@ map("t", "", "wincmd k", { desc = "Go to upper window" }) map("t", "", "wincmd l", { desc = "Go to right window" }) map("t", "", "close", { desc = "Hide Terminal" }) map("t", "", "close", { desc = "which_key_ignore" }) + + diff --git a/config/swaylock/config b/config/swaylock/config index 2016e3e..113fb7b 100644 --- a/config/swaylock/config +++ b/config/swaylock/config @@ -12,4 +12,4 @@ inside-color 00000088 separator-color 00000000 fade-in=0.2 datestr="%a, %b %e %Y" -greyscale +greyscale diff --git a/config/zshrc b/config/zshrc index 47489dc..0595102 100755 --- a/config/zshrc +++ b/config/zshrc @@ -102,7 +102,7 @@ compinit # End of lines added by compinstall eval "$(zoxide init zsh)" - + # Default Programs export EDITOR=nvim diff --git a/flake.nix b/flake.nix index b83de7c..310483f 100644 --- a/flake.nix +++ b/flake.nix @@ -1,8 +1,6 @@ { description = "System Configuration Flake"; - - - outputs = inputs@{ + outputs = inputs@{ nixpkgs, nixpkgs-xr, nixos-hardware, diff --git a/hosts/lappy/default.nix b/hosts/lappy/default.nix index 4143226..4c49ef7 100644 --- a/hosts/lappy/default.nix +++ b/hosts/lappy/default.nix @@ -15,8 +15,8 @@ services.logind.powerKey = "ignore"; services.logind.powerKeyLongPress = "poweroff"; networking = { - hostName = "lappy"; - networkmanager.enable = true; + hostName = "lappy"; + networkmanager.enable = true; }; time.timeZone = "America/Lost_Angeles"; diff --git a/hosts/malachite/default.nix b/hosts/malachite/default.nix index 8e7052e..020f10f 100644 --- a/hosts/malachite/default.nix +++ b/hosts/malachite/default.nix @@ -1,6 +1,6 @@ { config, nixpkgs-xr, pkgs, lib, ... }: let - passthrough = pkgs.writeShellApplication { + passthrough = pkgs.writeShellApplication { name = "passthrough.sh"; runtimeInputs = lib.attrVals [ "coreutils" "kmod" "libvirt" "procps" ] pkgs; text = '' @@ -116,7 +116,7 @@ in { environment.systemPackages = [ pkgs.wlx-overlay-s ]; - + networking.hostName = "malachite"; time.timeZone = "America/Los_Angeles"; diff --git a/hosts/malachite/hardware-configuration.nix b/hosts/malachite/hardware-configuration.nix index c95853a..b9202b5 100644 --- a/hosts/malachite/hardware-configuration.nix +++ b/hosts/malachite/hardware-configuration.nix @@ -87,7 +87,7 @@ XRT_COMPOSITOR_COMPUTE = "1"; }; - hardware = { + hardware = { graphics = { enable = true; enable32Bit = true;