diff --git a/dotfiles/kmonad/README.md b/dotfiles/kmonad/README.md new file mode 100644 index 0000000..747719c --- /dev/null +++ b/dotfiles/kmonad/README.md @@ -0,0 +1,6 @@ +# KMonad config + +## Useful links + +- [Config tutorial](https://github.com/kmonad/kmonad/blob/master/keymap/tutorial.kbd) +- [Homerow mod stuff](https://precondition.github.io/home-row-mods#using-home-row-mods-with-kmonad) diff --git a/dotfiles/kmonad/keymap.kbd b/dotfiles/kmonad/keymap.kbd index b453dcb..b59377c 100644 --- a/dotfiles/kmonad/keymap.kbd +++ b/dotfiles/kmonad/keymap.kbd @@ -17,6 +17,7 @@ allow-cmd false ) +;; Layer template: #| (deflayer qwerty _ _ _ _ _ _ _ _ _ _ _ _ _ _ @@ -79,6 +80,7 @@ mathExtra (layer-toggle math-extra) sft (tap-macro lsft (layer-toggle shiftedQwerty)) ;; make this work differently based on the next key pressed j (tap-macro 7 lsft) + ;; spc (spc) ;; (tap-hold-next-release 130 spc lsft) ) ;; more "special" stuff @@ -99,11 +101,11 @@ (deflayer qwerty esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del - grv 1 2 3 4 5 6 @j 8 9 0 - = bspc + grv 1 2 3 4 5 6 7 8 9 0 - = bspc tab q w e r t y u i o p [ ] \ @mth a s d f g h j k l ; ' ret @sft z x c v b n m , . / rsft - @mov lsgt lmet lalt spc ralt rctl + @mov lsgt lmet lalt spc ralt rctl ) (deflayer shiftedQwerty @@ -112,7 +114,7 @@ S-tab Q W E R T Y U I O P { } | @Mth A S D F G H J K L : " S-ret XX Z X C V B N M < > ? _ - _ _ _ _ S-spc S-ralt S-rctl + _ _ _ _ spc S-ralt S-rctl ) (deflayer movement diff --git a/dotfiles/neovim/ftplugin/tex.lua b/dotfiles/neovim/ftplugin/tex.lua index d22a1c5..4219a88 100644 --- a/dotfiles/neovim/ftplugin/tex.lua +++ b/dotfiles/neovim/ftplugin/tex.lua @@ -11,18 +11,19 @@ local abbreviations = { -- Greek chars { "eps", "\\epsilon" }, { "delta", "\\delta" }, + { "pi", "\\pi" }, { "nuls", "\\varnothing" }, -- Exponents - { "en1", "^{-1}" }, - { "e1", "^{0}" }, + { "ei", "^{-1}" }, + { "e0", "^{0}" }, { "e1", "^{1}" }, { "e2", "^{2}" }, { "e3", "^{3}" }, { "e4", "^{4}" }, { "en", "^{n}" }, - { "enn", "^{-}" }, - { "epp", "^{+}" }, + { "etn", "^{-}" }, + { "etp", "^{+}" }, -- Subscripts { "s0", "_{0}" }, @@ -37,9 +38,18 @@ local abbreviations = { { "gx", "g(x)" }, { "hx", "h(x)" }, { "Px", "P(x)" }, + { "Pn", "P(n)" }, + { "foa", "f(a)" }, + { "goa", "g(a)" }, + { "hoa", "h(a)" }, + { "dfx", "f'(x)" }, + { "dgx", "g'(x)" }, + { "dhx", "h'(x)" }, -- Basic commands { "leq", "\\leq" }, + { "geq", "\\geq" }, + { "sdiff", "\\setminus" }, { "sst", "\\subset" }, { "sseq", "\\subseteq" }, { "neq", "\\neq" }, @@ -52,6 +62,17 @@ local abbreviations = { { "lor", "\\lor" }, { "frl", "\\forall" }, { "exs", "\\exists" }, + { "iinf", "\\infty" }, + { "ninf", "-\\infty" }, + { "nlnl", "\\pm" }, -- had this as npnp first but it was hard-ish to type + { "ccup", "\\cup" }, + { "ccap", "\\cap" }, + { "nope", "\\bot" }, + { "yee", "\\top" }, + { "mul", "\\cdot" }, + { "smul", "\\times" }, + { "texpl", "&& \\text{}" }, + { "card", "\\#" } } A.manyLocalAbbr(abbreviations) diff --git a/dotfiles/neovim/lua/my/plugins/autopairs.lua b/dotfiles/neovim/lua/my/plugins/autopairs.lua index da751e2..5736a07 100644 --- a/dotfiles/neovim/lua/my/plugins/autopairs.lua +++ b/dotfiles/neovim/lua/my/plugins/autopairs.lua @@ -1,13 +1,13 @@ local M = {} function M.setup() - local cmp_autopairs = require('nvim-autopairs.completion.cmp') - local cmp = require('cmp') - - cmp.event:on( - 'confirm_done', - cmp_autopairs.on_confirm_done() - ) + -- local cmp_autopairs = require('nvim-autopairs.completion.cmp') + -- local cmp = require('cmp') + -- + -- cmp.event:on( + -- 'confirm_done', + -- cmp_autopairs.on_confirm_done() + -- ) require('nvim-autopairs').setup({ enable_abbr = false diff --git a/dotfiles/neovim/lua/my/plugins/lspconfig.lua b/dotfiles/neovim/lua/my/plugins/lspconfig.lua index 35c8915..16f7fa1 100644 --- a/dotfiles/neovim/lua/my/plugins/lspconfig.lua +++ b/dotfiles/neovim/lua/my/plugins/lspconfig.lua @@ -16,7 +16,9 @@ function M.on_attach(client, bufnr) vim.api.nvim_create_autocmd("BufWritePre", { group = vim.api.nvim_create_augroup("LspFormatting", {}), - callback = vim.lsp.buf.format + callback = function() + vim.lsp.buf.format({async = false}) + end }) end diff --git a/dotfiles/polybar/README.md b/dotfiles/polybar/README.md new file mode 100644 index 0000000..40df621 --- /dev/null +++ b/dotfiles/polybar/README.md @@ -0,0 +1,6 @@ +# Polybar config + +## Useful links: + +- [Home manager polybar docs](https://rycee.gitlab.io/home-manager/options.html#opt-services.polybar.enable) +- [General config](https://github.com/polybar/polybar/wiki/Configuration) diff --git a/dotfiles/polybar/config.ini b/dotfiles/polybar/config.ini new file mode 100644 index 0000000..c17bcb6 --- /dev/null +++ b/dotfiles/polybar/config.ini @@ -0,0 +1,110 @@ +[module/battery] +type = internal/battery + +; Use the following command to list batteries and adapters: +; $ ls -1 /sys/class/power_supply/ +battery = BAT0 +adapter = AC + +format-charging = +format-discharging = +format-low = + +; Only applies if is used +animation-charging-0 =  +animation-charging-1 =  +animation-charging-2 =  +animation-charging-3 =  +animation-charging-4 =  +; Framerate in milliseconds +animation-charging-framerate = 750 + +; Only applies if is used +animation-discharging-0 =  +animation-discharging-1 =  +animation-discharging-2 =  +animation-discharging-3 =  +animation-discharging-4 =  +; Framerate in milliseconds +animation-discharging-framerate = 500 + +; Only applies if is used +; New in version 3.6.0 +animation-low-0 = ! +animation-low-1 = +animation-low-framerate = 200 + +[module/cpu] +type = internal/cpu + +[module/date] +type = internal/date +date = %d-%m-%Y% +time = %H:%M +label =  %date%  %time% + +[module/wireless-network] +type = internal/network +interface = wlp0s20f3 + +format-connected = +format-packetloss = +format-disconnected = + +label-connected =  %essid%  %downspeed%  %upspeed% +label-disconnected = 睊 +label-packetloss = %essid% + +animation-packetloss-0 = ⚠ +animation-packetloss-0-foreground = #ffa64c +animation-packetloss-1 = 📶 +animation-packetloss-1-foreground = #000000 +animation-packetloss-framerate = 500 + +[module/ewmh] +type = internal/xworkspaces +icon-0 = 1:dev; +icon-1 = 2:browser; +icon-2 = 3:chat;ﭮ +icon-3 = 4:reading; +icon-default =  + +format = + +label-active = %icon% +label-active-background = ${colors.text} +label-active-foreground = ${colors.base} +label-active-padding = 2 + +label-urgent = %icon% +label-urgent-background = ${colors.peach} +label-urgent-foreground = ${colors.base} +label-urgent-padding = 2 + +label-occupied = %icon% +label-occupied-padding = 2 + +label-empty = + +[bar/main] +font-0 = FiraCode Nerd Font:style=Regular +font-1 = Source Code Pro Nerd Font:style=Regular + +modules-left = date battery +modules-center = ewmh +modules-right = wireless-network + +padding-right = 2 +padding-left = 2 +padding-top = 4 +module-margin = 2 + +height=4% + +border-top-size = 1 +border-top-color = ${colors.text} + +background = ${colors.base} +foreground = ${colors.text} + +bottom = true diff --git a/dotfiles/vscode-snippets/snippets/latex/core.json b/dotfiles/vscode-snippets/snippets/latex/core.json index d77346c..0488831 100644 --- a/dotfiles/vscode-snippets/snippets/latex/core.json +++ b/dotfiles/vscode-snippets/snippets/latex/core.json @@ -108,6 +108,16 @@ "description": "Create a limit", "body": "\\lim _{$1 \\to $2}$0" }, + "Limit to infinity": { + "prefix": "ilim", + "description": "Create a limit as a variable goes to infinity", + "body": "\\lim _{$1 \\to \\infty}$0" + }, + "Limit to negative infinity": { + "prefix": "nlim", + "description": "Create a limit as a variable goes to negative infinity", + "body": "\\lim _{$1 \\to -\\infty}$0" + }, "Sqrt": { "prefix": "sqrt", "description": "Create a sqrt", @@ -148,6 +158,21 @@ "description": "Create an aligned environment", "body": ["\\begin{aligned}", "\t$0", "\\end{aligned}"] }, + "Explanation in math mode": { + "prefix": "texpl", + "description": "Explain a step in math mode", + "body": "&& \\text{$1}$0" + }, + "Let": { + "prefix": "let", + "description": "Let something equal something else", + "body": "Let $$1 = $2$. $0" + }, + "Force newline": { + "prefix": "cr", + "description": "Force newline in math mode", + "body": "{\\ \\\\}" + }, "Aligned display math": { "prefix": "maligned", "description": "Create an aligned display math environment", diff --git a/modules/applications/alacritty.nix b/modules/applications/alacritty.nix index d8b985b..9645290 100644 --- a/modules/applications/alacritty.nix +++ b/modules/applications/alacritty.nix @@ -10,14 +10,22 @@ in } ]; - home-manager.users.adrielus.programs.alacritty = { - enable = true; - settings = { - window.decorations = "none"; - fonts.normal.family = "Nerd Font Source Code Pro"; - env = { TERM = "xterm-256color"; }; + home-manager.users.adrielus = { + xdg.configFile."alacritty/extraConfig.yml".text = theme.alacritty.extraConfig or ""; + programs.alacritty = { + enable = true; + + settings = { + import = [ "~/.config/alacritty/extraConfig.yml" ]; + + window.decorations = "none"; + fonts.normal.family = "Nerd Font Source Code Pro"; + + env = { TERM = "xterm-256color"; }; + working_directory = "~/Projects"; + }; }; }; } diff --git a/modules/applications/default.nix b/modules/applications/default.nix index 18466a2..448711c 100644 --- a/modules/applications/default.nix +++ b/modules/applications/default.nix @@ -24,6 +24,7 @@ ./direnv.nix # ./chromium.nix ./vieb.nix + ./polybar.nix ]; } diff --git a/modules/applications/polybar.nix b/modules/applications/polybar.nix new file mode 100644 index 0000000..3fef671 --- /dev/null +++ b/modules/applications/polybar.nix @@ -0,0 +1,21 @@ +{ pkgs, lib, paths, ... }: +{ + home-manager.users.adrielus.services.polybar = { + enable = true; + extraConfig = '' + ${pkgs.myThemes.current.polybar.config or ""} + include-file = ${paths.dotfiles}/polybar/config.ini + ''; + + script = '' + polybar main & + ''; + }; + + home-manager.users.adrielus.xsession = { + enable = true; + initExtra = '' + polybar main & + ''; + }; +} diff --git a/modules/applications/xmonad/Main.hs b/modules/applications/xmonad/Main.hs index 7428083..eac54d1 100644 --- a/modules/applications/xmonad/Main.hs +++ b/modules/applications/xmonad/Main.hs @@ -33,12 +33,14 @@ main = handleEventHook = handleEventHook kdeConfig <+> fullscreenEventHook, terminal = myTerminal, workspaces = myWorkspaces, - borderWidth = 0 + borderWidth = 5, + focusedBorderColor = "#4c4f69", + normalBorderColor = "#4c4f69" } `additionalKeysP` keymap where myWorkspaces = - ["1:dev", "2:browser", "3:chat", "4:terminal", "5", "6", "7", "8", "9", "0"] + ["1:dev", "2:browser", "3:chat", "4:reading", "5", "6"] appWorkspaceConfig = [ (3, "Discord"), @@ -100,6 +102,4 @@ main = myLayoutHook = desktopLayoutModifiers $ spacingHook layouts startup :: X () - startup = do - -- The file is dynamically set in wallpaper.nix - spawn "xwallpaper --zoom ~/.config/wallpaper" + startup = pure () diff --git a/modules/applications/xmonad/default.nix b/modules/applications/xmonad/default.nix index 82ade1b..e63fbce 100644 --- a/modules/applications/xmonad/default.nix +++ b/modules/applications/xmonad/default.nix @@ -13,7 +13,7 @@ # "export KDEWM=/home/adrielus/.nix-profile/bin/xmonad"; services.picom = { - enable = true; + enable = false; blur = true; shadow = false; extraOptions = '' diff --git a/modules/overlays/myPackages.nix b/modules/overlays/myPackages.nix index f5fc556..b32205f 100644 --- a/modules/overlays/myPackages.nix +++ b/modules/overlays/myPackages.nix @@ -3,7 +3,7 @@ self: super: let allThemes = self.callPackage (import ../themes/themes.nix) { }; # currentTheme = "github-light"; - currentTheme = "catppuccin-macchiato"; + currentTheme = "catppuccin-latte"; in with self; { myHelpers = self.callPackage (import ../helpers.nix) { }; diff --git a/modules/themes/catppuccin/default.nix b/modules/themes/catppuccin/default.nix index 5a5d4fd..c67bb1d 100644 --- a/modules/themes/catppuccin/default.nix +++ b/modules/themes/catppuccin/default.nix @@ -2,9 +2,10 @@ let githubTheme = pkgs.myVimPlugins.githubNvimTheme; # github theme for neovim foreign = pkgs.callPackage (import ./foreign.nix) { }; + v = (a: b: if variant == "latte" then a else b); + rofi-variant = "basic"; - # rofi-variant = "deathemonic"; in { name = "catppuccin-${variant}"; @@ -19,12 +20,10 @@ in lualineTheme = "catppuccin"; }; - # grub.path = "${foreign.grub}/catppuccin-grub-theme/theme.txt"; tmux.path = "${foreign.tmux}/catppuccin-${variant}.conf"; sddm.path = "${foreign.sddm}"; - grub.path = pkgs.nixos-grub2-theme; - xresources = builtins.readFile "${foreign.xresources}/${variant}.Xresources"; + xresources.config = builtins.readFile "${foreign.xresources}/${variant}.Xresources"; rofi = { themes = "${foreign.rofi}/${rofi-variant}/.local/share/rofi/themes/"; @@ -35,27 +34,34 @@ in ''; }; - chromium.extensions = [ - # https://github.com/catppuccin/chrome - (v - "cmpdlhmnmjhihmcfnigoememnffkimlk" - "bkkmolkhemgaeaeggcmfbghljjjoofoh") - ]; - fish.dangerousColors = lib.strings.concatStringsSep " " - [ - "F2CDCD" - "DDB6F2" - "F5C2E7" - "E8A2AF" - "F28FAD" - "F8BD96" - "FAE3B0" - "ABE9B3" - "B5E8E0" - "96CDFB" - "89DCEB" - ]; + (v + [ + "dc8a78" + "dd7878" + "ea76cb" + "8839ef" + "d20f39" + "e64553" + "fe640b" + "df8e1d" + "40a02b" + "179299" + "04a5e5" + ] + [ + "F2CDCD" + "DDB6F2" + "F5C2E7" + "E8A2AF" + "F28FAD" + "F8BD96" + "FAE3B0" + "ABE9B3" + "B5E8E0" + "96CDFB" + "89DCEB" + ]); zathura = { enable = true; @@ -63,19 +69,25 @@ in name = "catppuccin-${variant}"; }; - alacritty.settings = { - import = [ "${foreign.alacritty}/catppuccin.yml" ]; - # colors = "*${variant}"; - window = { - padding = { - x = 0; - y = 0; + polybar.config = builtins.readFile "${foreign.polybar}/${variant}.ini"; + + alacritty = { + extraConfig = '' + ${builtins.readFile "${foreign.alacritty}/catppuccin.yml"} + colors: *${variant} + ''; + + settings = { + window = { + padding = { + x = 4; + y = 4; + }; + + opacity = transparency; + + gtk_theme_variant = v "light" "dark"; }; - - opacity = transparency; - - gtk_theme_variant = v "light" "dark"; }; - }; } diff --git a/modules/themes/catppuccin/foreign.nix b/modules/themes/catppuccin/foreign.nix index b3d3098..a76fa39 100644 --- a/modules/themes/catppuccin/foreign.nix +++ b/modules/themes/catppuccin/foreign.nix @@ -53,4 +53,10 @@ sha256 = "17q2jn8bx712c0789vc00y9jb2vng7g7mnmqm8ypivrl616igzli"; rev = "b9553c7e398c1a157e5543ea52d20e570f730dd6"; }; + polybar = fetchFromGitHub { + owner = "catppuccin"; + repo = "polybar"; + sha256 = "0842kqxgq1sm17rm29qglj2wwb3zvy0apfx39y7cvl4248jxhzgj"; + rev = "94ffe6ed93ff5c54fe938c60dc2babde89046083"; + }; } diff --git a/modules/themes/themes.nix b/modules/themes/themes.nix index 6190af0..a318ec0 100644 --- a/modules/themes/themes.nix +++ b/modules/themes/themes.nix @@ -13,9 +13,22 @@ lib.lists.map (theme: pkgs.callPackage theme { }) [ # wallpaper = "landscapes/salty_mountains.png"; # wallpaper = "misc/rainbow.png"; # wallpaper.foreign = ./wallpapers/eye.png; + # wallpaper.foreign = ./wallpapers/mountain.png; transparency = 0.93; variant = "macchiato"; }) + (catppuccin { + # wallpaper = "os/nix-magenta-pink-1920x1080.png"; + # wallpaper = "minimalistic/tetris.png"; + # wallpaper = "misc/comfy-home.png"; + # wallpaper = "landscapes/forrest.png"; + # wallpaper = "landscapes/salty_mountains.png"; + # wallpaper = "misc/rainbow.png"; + # wallpaper.foreign = ./wallpapers/eye.png; + wallpaper.foreign = ./wallpapers/mountain.png; + transparency = 1; + variant = "latte"; + }) (githubVariant { variant = "light"; # wallpaper = ./wallpapers/wall.png; diff --git a/modules/themes/wallpaper.nix b/modules/themes/wallpaper.nix index e6da9a9..eb4f339 100644 --- a/modules/themes/wallpaper.nix +++ b/modules/themes/wallpaper.nix @@ -1,5 +1,14 @@ -{ pkgs, ... }: { +# Tutorial regarding this: +# https://www.codyhiar.com/blog/how-to-set-desktop-wallpaper-on-nixos/ +{ pkgs, config, ... }: { home-manager.users.adrielus = { - xdg.configFile.wallpaper.source = pkgs.myThemes.current.wallpaper; + xdg.configFile."wallpaper".source = pkgs.myThemes.current.wallpaper; + xsession = { + enable = true; + initExtra = '' + xwallpaper --zoom ~/.config/wallpaper + ''; + }; }; + } diff --git a/modules/themes/wallpapers/mountain.png b/modules/themes/wallpapers/mountain.png new file mode 100644 index 0000000..766a7df Binary files /dev/null and b/modules/themes/wallpapers/mountain.png differ diff --git a/modules/themes/xresources.nix b/modules/themes/xresources.nix index 5200394..c2f1ee4 100644 --- a/modules/themes/xresources.nix +++ b/modules/themes/xresources.nix @@ -4,6 +4,6 @@ let in { home-manager.users.adrielus.xresources = { - extraConfig = theme.xresources or ""; + extraConfig = theme.xresources.config or ""; }; } diff --git a/modules/xserver.nix b/modules/xserver.nix index 8229c2d..94e9877 100644 --- a/modules/xserver.nix +++ b/modules/xserver.nix @@ -30,22 +30,12 @@ in }; }; + # displayManager.gdm.enable = true; + desktopManager.gnome.enable = false; + + # Enable xmonad - windowManager.xmonad = { - enable = true; - enableContribAndExtras = true; - }; - - # Enable xfce I think? - # desktopManager = { - # xterm.enable = false; - # xfce = { - # enable = true; - # noDesktop = true; - # enableXfwm = false; - # }; - # }; - + windowManager.xmonad.enable = true; libinput = { # Enable touchpad support. @@ -61,10 +51,30 @@ in }; }; + # I think this has to do with multiple monitors and stuff? services.xserver.displayManager.sessionCommands = '' ${lib.getBin pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource 2 0 ''; services.fractalart.enable = true; hardware.opengl.enable = true; + + environment.gnome.excludePackages = (with pkgs; [ + # gnome-photos + # gnome-tour + ]) ++ (with pkgs.gnome; [ + cheese # webcam tool + gnome-music + gnome-terminal + gedit # text editor + epiphany # web browser + geary # email reader + evince # document viewer + gnome-characters + totem # video player + tali # poker game + iagno # go game + hitori # sudoku game + atomix # puzzle game + ]); }