From f17b922131dc33e0306b4f8c50cff59b42d4798f Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Fri, 9 Sep 2022 00:16:11 +0200 Subject: [PATCH] Lots of latex stuff and idk what else (timezone change!) --- README.md | 15 +- configuration.nix | 15 +- dotfiles/kmonad/keymap.kbd | 3 +- dotfiles/kmonad/xcompose | 1 + dotfiles/neovim/ftplugin/tex.lua | 49 ++++++ dotfiles/neovim/lua/my/abbreviations.lua | 15 +- dotfiles/neovim/lua/my/keymaps.lua | 2 +- dotfiles/neovim/lua/my/paq.lua | 1 + dotfiles/neovim/lua/my/plugins/autopairs.lua | 17 ++ dotfiles/neovim/lua/my/plugins/cmp.lua | 12 +- dotfiles/neovim/lua/my/plugins/init.lua | 2 +- dotfiles/neovim/lua/my/plugins/lean.lua | 12 +- dotfiles/neovim/lua/my/plugins/lspconfig.lua | 13 ++ dotfiles/neovim/lua/my/plugins/treesitter.lua | 4 +- dotfiles/neovim/lua/my/plugins/vimtex.lua | 13 +- dotfiles/neovim/lua/my/plugins/vimux.lua | 6 +- dotfiles/vscode-snippets/package.json | 21 ++- .../vscode-snippets/snippets/latex/core.json | 151 ++++++++++++++++++ flake.lock | 12 +- modules/applications/default.nix | 1 + modules/applications/locale.nix | 3 +- modules/applications/misc.nix | 3 +- modules/applications/neovim.nix | 2 + modules/applications/shells/aliases.nix | 15 +- modules/applications/xmonad/Main.hs | 4 +- modules/applications/xmonad/default.nix | 2 +- modules/applications/zathura.nix | 19 +++ modules/themes/catppuccin/default.nix | 18 ++- modules/themes/catppuccin/foreign.nix | 26 +-- modules/themes/catppuccin/nvim.lua | 6 +- modules/users.nix | 2 +- 31 files changed, 398 insertions(+), 67 deletions(-) create mode 100644 dotfiles/neovim/ftplugin/tex.lua create mode 100644 dotfiles/neovim/lua/my/plugins/autopairs.lua create mode 100644 dotfiles/vscode-snippets/snippets/latex/core.json create mode 100644 modules/applications/zathura.nix diff --git a/README.md b/README.md index 3d5790c..a9cdb3c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,18 @@ My flake based nixos configuration. To use this, just rebuild your system using `sudo nixos-rebuild switch --flake .` while in the project directory. - -## Neovim config +## Neovim config Check out my neovim config in [this directory](./dotfiles/neovim) + + diff --git a/configuration.nix b/configuration.nix index f5f2ebd..7ceda16 100644 --- a/configuration.nix +++ b/configuration.nix @@ -9,16 +9,23 @@ in home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; + boot.kernelPackages = pkgs.linuxPackages_latest; services.xserver.videoDrivers = [ # "displaylink" "modesetting" ]; - hardware = { - pulseaudio = { - enable = true; - }; + hardware.pulseaudio.enable = lib.mkForce false; + + # rtkit is optional but recommended + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; }; boot.loader = { diff --git a/dotfiles/kmonad/keymap.kbd b/dotfiles/kmonad/keymap.kbd index e969454..b453dcb 100644 --- a/dotfiles/kmonad/keymap.kbd +++ b/dotfiles/kmonad/keymap.kbd @@ -41,6 +41,7 @@ gs #(ralt s h) ;; sigma go #(ralt o h) ;; omega gu #(ralt u h) ;; uspilon + gd #(ralt d h) ;; delta gph #(ralt l p h h) ;; phi gth #(ralt l t h h) ;; theta @@ -136,7 +137,7 @@ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ @ex _ _ _ _ _ @alp @arp @neg _ _ _ @shr @go @ge _ @gt _ @gu _ @go @gp _ _ _ - _ @ga @gs _ _ @gg @gth @gps @gph @ml _ _ _ + _ @ga @gs @gd _ @gg @gth @gps @gph @ml _ _ _ @Mth _ @gx _ @fal @gb _ @gm @lar @rar _ _ _ _ _ _ @mathExtra _ _ ) diff --git a/dotfiles/kmonad/xcompose b/dotfiles/kmonad/xcompose index db20780..94bf7a7 100644 --- a/dotfiles/kmonad/xcompose +++ b/dotfiles/kmonad/xcompose @@ -12,6 +12,7 @@ : "σ" U0260 # LATIN SMALL LETTER SIGMA : "ω" U0261 # LATIN SMALL LETTER OMEGA : "υ" U0262 # LATIN SMALL LETTER UPSILON + : "δ" U0263 # LATIN SMALL LETTER DELTA

: "ϕ" U0270 # LATIN SMALL LETTER PHI : "θ" U0271 # LATIN SMALL LETTER THETA diff --git a/dotfiles/neovim/ftplugin/tex.lua b/dotfiles/neovim/ftplugin/tex.lua new file mode 100644 index 0000000..6a3789e --- /dev/null +++ b/dotfiles/neovim/ftplugin/tex.lua @@ -0,0 +1,49 @@ +local A = require("my.abbreviations") + +vim.opt.conceallevel = 1 +vim.opt.wrap = true + +vim.g.tex_conceal = "abdmg" + +local abbreviations = { + -- Greek chars + { "eps", "\\epsilon" }, + { "delta", "\\delta" }, + + -- Exponents + { "en1", "^{-1}" }, + { "e1", "^{0}" }, + { "e1", "^{1}" }, + { "e2", "^{2}" }, + { "e3", "^{3}" }, + { "e4", "^{4}" }, + { "en", "^{n}" }, + + -- Subscripts + { "s0", "_{0}" }, + { "s1", "_{1}" }, + { "s2", "_{2}" }, + { "s3", "_{3}" }, + { "s4", "_{4}" }, + { "sn", "_{n}" }, + + -- Function calls + { "fx", "f(x)" }, + { "gx", "g(x)" }, + { "hx", "h(x)" }, + { "Px", "P(x)" }, + + -- Basic commands + { "leq", "\\leq" }, + { "neq", "\\neq" }, + { "nin", "\\not\\in" }, + { "iin", "\\in" }, + { "tto", "\\to" }, + { "iff", "\\iff" }, + { "land", "\\land" }, + { "lor", "\\lor" }, + { "frl", "\\forall" }, + { "exs", "\\exists" }, +} + +A.manyLocalAbbr(abbreviations) diff --git a/dotfiles/neovim/lua/my/abbreviations.lua b/dotfiles/neovim/lua/my/abbreviations.lua index 41c0eb9..5e1e90e 100644 --- a/dotfiles/neovim/lua/my/abbreviations.lua +++ b/dotfiles/neovim/lua/my/abbreviations.lua @@ -1,8 +1,19 @@ local M = {} +function M.localAbbr(lhs, rhs) + -- Create abbreviation + vim.cmd(":iabbrev " .. lhs .. " " .. rhs) +end + +function M.manyLocalAbbr(abbreviations) + for _, value in pairs(abbreviations) do + M.localAbbr(value[1], value[2]) + end +end + function M.abbr(lhs, rhs) - -- Create abbreviation - vim.cmd(":iabbrev " .. lhs .. " " .. rhs) + -- Create abbreviation + vim.cmd(":iabbrev " .. lhs .. " " .. rhs) end return M diff --git a/dotfiles/neovim/lua/my/keymaps.lua b/dotfiles/neovim/lua/my/keymaps.lua index e73518b..dc92977 100644 --- a/dotfiles/neovim/lua/my/keymaps.lua +++ b/dotfiles/neovim/lua/my/keymaps.lua @@ -28,7 +28,7 @@ function M.setup() arpeggio.chord("n", "vs", "v") -- Create vertical split arpeggio.chord("n", "ji", ":w") -- Saving arpeggio.chord("i", "jk", "") -- Remap Esc to jk - arpeggio.chord("inv", "a", "") -- Rebind switching to the last pane using leader+a + arpeggio.chord("nv", "a", "") -- Rebind switching to the last pane using leader+a arpeggio.chord("nv", "cp", "\"+") -- Press cp to use the global clipboard arpeggio.chord("n", "rw", ":%s//") -- Press rw to rename word under cursor end diff --git a/dotfiles/neovim/lua/my/paq.lua b/dotfiles/neovim/lua/my/paq.lua index ec34b81..34815e1 100644 --- a/dotfiles/neovim/lua/my/paq.lua +++ b/dotfiles/neovim/lua/my/paq.lua @@ -53,6 +53,7 @@ function M.setup() "rktjmp/paperplanes.nvim", -- export to pastebin like services "anuvyklack/hydra.nvim", -- keybinds where you only hit the head once "jbyuki/venn.nvim", -- draw ascii diagrams + "hrsh7th/cmp-omni", -- omnifunc source for cmp -- Git stuff "ruifm/gitlinker.nvim", -- generate permalinks for code diff --git a/dotfiles/neovim/lua/my/plugins/autopairs.lua b/dotfiles/neovim/lua/my/plugins/autopairs.lua new file mode 100644 index 0000000..da751e2 --- /dev/null +++ b/dotfiles/neovim/lua/my/plugins/autopairs.lua @@ -0,0 +1,17 @@ +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() + ) + + require('nvim-autopairs').setup({ + enable_abbr = false + }) +end + +return M diff --git a/dotfiles/neovim/lua/my/plugins/cmp.lua b/dotfiles/neovim/lua/my/plugins/cmp.lua index e477cba..f2ee2c9 100644 --- a/dotfiles/neovim/lua/my/plugins/cmp.lua +++ b/dotfiles/neovim/lua/my/plugins/cmp.lua @@ -24,10 +24,15 @@ function M.setup() formatting = { fields = { "kind", "abbr", "menu" }, format = function(entry, vim_item) - local kind = lspkind.cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item) + local kind = lspkind.cmp_format({ mode = "symbol", maxwidth = 50 + , symbol_map = { + Text = "." + } + })(entry, vim_item) local strings = vim.split(kind.kind, "%s", { trimempty = true }) + kind.kind = " " .. strings[1] .. " " - kind.menu = " (" .. strings[2] .. ")" + kind.menu = "" return kind end, @@ -63,7 +68,8 @@ function M.setup() }, sources = cmp.config.sources({ { name = 'nvim_lsp' }, -- lsp completion - { name = 'luasnip' } -- snippets + { name = 'luasnip' }, -- snippets + { name = 'omni' } -- omnifunc }, { { name = 'buffer' } }) } diff --git a/dotfiles/neovim/lua/my/plugins/init.lua b/dotfiles/neovim/lua/my/plugins/init.lua index 73d70bf..e3988ad 100644 --- a/dotfiles/neovim/lua/my/plugins/init.lua +++ b/dotfiles/neovim/lua/my/plugins/init.lua @@ -2,7 +2,6 @@ local vscode = require("my.helpers.vscode") local M = {} function M.setup() - require('nvim-autopairs').setup() require "gitlinker".setup() require('nvim_comment').setup() require('fidget').setup() @@ -22,6 +21,7 @@ function M.setup() require("my.plugins.vimux").setup() end) + require("my.plugins.autopairs").setup() require("my.plugins.paperplanes").setup() require("my.plugins.neogit").setup() require("my.plugins.telescope").setup() diff --git a/dotfiles/neovim/lua/my/plugins/lean.lua b/dotfiles/neovim/lua/my/plugins/lean.lua index 9de9032..77fb679 100644 --- a/dotfiles/neovim/lua/my/plugins/lean.lua +++ b/dotfiles/neovim/lua/my/plugins/lean.lua @@ -2,12 +2,12 @@ local lspconfig = require("my.plugins.lspconfig") local M = {} function M.setup() - require('lean').setup { - abbreviations = {builtin = true, cmp = true}, - lsp = {on_attach = lspconfig.on_attach}, - lsp3 = {on_attach = lspconfig.on_attach}, - mappings = true - } + require('lean').setup { + abbreviations = { builtin = true, cmp = true }, + lsp = { on_attach = lspconfig.on_attach }, + lsp3 = { on_attach = lspconfig.on_attach }, + mappings = true + } end return M diff --git a/dotfiles/neovim/lua/my/plugins/lspconfig.lua b/dotfiles/neovim/lua/my/plugins/lspconfig.lua index e721fbb..50c26b7 100644 --- a/dotfiles/neovim/lua/my/plugins/lspconfig.lua +++ b/dotfiles/neovim/lua/my/plugins/lspconfig.lua @@ -102,6 +102,19 @@ local servers = { }, rnix = {}, cssls = {}, + -- texlab = { + -- build = { + -- executable = "tectonic", + -- args = { + -- "-X", + -- "compile", + -- "%f", + -- "--synctex", + -- "--keep-logs", + -- "--keep-intermediates" + -- } + -- } + -- }, kotlin_language_server = {} -- agda = {}, Haven't gotten this one to work yet } diff --git a/dotfiles/neovim/lua/my/plugins/treesitter.lua b/dotfiles/neovim/lua/my/plugins/treesitter.lua index 6515f46..423a7db 100644 --- a/dotfiles/neovim/lua/my/plugins/treesitter.lua +++ b/dotfiles/neovim/lua/my/plugins/treesitter.lua @@ -10,9 +10,9 @@ function M.setup() sync_install = false, indent = { enable = true }, highlight = { - enable = true, + enable = false, - disable = { "kotlin" }, + disable = { "kotlin", "tex" }, -- Setting this to true will run `:h syntax` and tree-sitter at the same time. -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). diff --git a/dotfiles/neovim/lua/my/plugins/vimtex.lua b/dotfiles/neovim/lua/my/plugins/vimtex.lua index 9e745f3..dd5ced5 100644 --- a/dotfiles/neovim/lua/my/plugins/vimtex.lua +++ b/dotfiles/neovim/lua/my/plugins/vimtex.lua @@ -3,10 +3,15 @@ local global = require("my.helpers").global local M = {} function M.setup() - -- Viewer method - global("vimtex_view_method", "zathura") - global("Tex_DefaultTargetFormat", "pdf") - global("vimtex_compiler_latexmk", {options = {"-pdf", "-shell-escape", "-verbose", "-file-line-error", "-synctex=1", "-interaction=nonstopmode"}}) + -- Viewer method + vim.g.vimtex_view_method = "zathura" + vim.g.Tex_DefaultTargetFormat = "pdf" + vim.g.vimtex_fold_enabled = 1 + vim.g.vimtex_compiler_latexmk = { + options = { + "-pdf", "-shell-escape", "-verbose", "-file-line-error", "-synctex=1", "-interaction=nonstopmode" + } + } end return M diff --git a/dotfiles/neovim/lua/my/plugins/vimux.lua b/dotfiles/neovim/lua/my/plugins/vimux.lua index d078e9b..f99eb1b 100644 --- a/dotfiles/neovim/lua/my/plugins/vimux.lua +++ b/dotfiles/neovim/lua/my/plugins/vimux.lua @@ -3,9 +3,9 @@ local arpeggio = require("my.plugins.arpeggio") local M = {} function M.setup() - arpeggio.chordSilent("n", "vp", ":VimuxPromptCommand") - arpeggio.chordSilent("n", "vc", ":VimuxRunCommand \"clear\"") - arpeggio.chordSilent("n", "vl", ":VimuxRunLastCommand") + arpeggio.chordSilent("n", "vp", ":VimuxPromptCommand") + arpeggio.chordSilent("n", "vc", ":VimuxRunCommand \"clear\"") + arpeggio.chordSilent("n", "vl", ":VimuxRunLastCommand") end return M diff --git a/dotfiles/vscode-snippets/package.json b/dotfiles/vscode-snippets/package.json index dec0896..3800190 100644 --- a/dotfiles/vscode-snippets/package.json +++ b/dotfiles/vscode-snippets/package.json @@ -6,16 +6,31 @@ "contributes": { "snippets": [ { - "language": ["purs", "purescript"], + "language": [ + "purs", + "purescript" + ], "path": "./snippets/purescript/other.json" }, { - "language": ["purs", "purescript"], + "language": [ + "purs", + "purescript" + ], "path": "./snippets/purescript/imports.json" }, { - "language": ["purs", "purescript"], + "language": [ + "purs", + "purescript" + ], "path": "./snippets/purescript/deriving.json" + }, + { + "language": [ + "tex" + ], + "path": "./snippets/latex/core.json" } ] } diff --git a/dotfiles/vscode-snippets/snippets/latex/core.json b/dotfiles/vscode-snippets/snippets/latex/core.json new file mode 100644 index 0000000..01fca44 --- /dev/null +++ b/dotfiles/vscode-snippets/snippets/latex/core.json @@ -0,0 +1,151 @@ +{ + "Begin": { + "prefix": "begin", + "description": "Begin anything", + "body": ["\\begin{$1}", "\t$0", "\\end{$1}"] + }, + "Set": { + "prefix": "set", + "description": "Set I guess", + "body": "\\{$1\\\\}$0" + }, + "Absolute value": { + "prefix": "abs", + "description": "Absolute values", + "body": "|$1|$0" + }, + "Lemma": { + "prefix": "lemma", + "description": "Create a lemma", + "body": ["\\begin{lemma}[$1] \\label{lem:$1}", "\t$0", "\\end{lemma}"] + }, + "Theorem": { + "prefix": "theorem", + "description": "Create a theorem", + "body": ["\\begin{theorem}[$1] \\label{thm:$1}", "\t$0", "\\end{theorem}"] + }, + "Exercise": { + "prefix": "exercise", + "description": "Create a exercise", + "body": ["\\begin{exercise}[$1] \\label{exe:$1}", "\t$0", "\\end{exercise}"] + }, + "Definition": { + "prefix": "definition", + "description": "Create a definition", + "body": [ + "\\begin{definition}[$1] \\label{def:$1}", + "\t$0", + "\\end{definition}" + ] + }, + "Display math": { + "prefix": "dm", + "description": "Display math section", + "body": ["\\[", "$0", "\\]"] + }, + "Subscript": { + "prefix": "ss", + "description": "Subscript", + "body": "_{$1}$0" + }, + "Section": { + "prefix": "section", + "description": "Add section", + "body": ["\\section{$1}", "$0"] + }, + "Subsection": { + "prefix": "subsection", + "description": "Add subsection", + "body": ["\\subsection{$1}", "$0"] + }, + "Subsubsection": { + "prefix": "subsubsection", + "description": "Add subsubsection", + "body": ["\\subsubsection{$1}", "$0"] + }, + "Chapter": { + "prefix": "chapter", + "description": "Add chapter", + "body": ["\\chapter{$1}", "$0"] + }, + "Proof": { + "prefix": "proof", + "description": "Create proof", + "body": ["\\begin{proof}", "\t$0", "\\end{proof}"] + }, + "Itemize": { + "prefix": "item", + "body": ["\\\\begin{itemize}", "\t\\item $0", "\\\\end{itemize}"], + "description": "Itemize" + }, + "Reference definition": { + "prefix": "rdef", + "description": "Reference a definition", + "body": "\\ref{def:$1}$0" + }, + "Reference lemma": { + "prefix": "rlemma", + "description": "Reference a lemma", + "body": "\\ref{lem:$1}$0" + }, + "Reference theorem": { + "prefix": "rtheorem", + "description": "Reference a theorem", + "body": "\\ref{thm:$1}$0" + }, + "Fraction": { + "prefix": "frac", + "description": "Create a fraction", + "body": "\\frac{$1}{$2}$0" + }, + "Limit": { + "prefix": "lim", + "description": "Create a limit", + "body": "\\lim _{$1 \\to $2}$0" + }, + "Sqrt": { + "prefix": "sqrt", + "description": "Create a sqrt", + "body": "\\sqrt[$1]{$2}$0" + }, + "Real numbers": { + "prefix": "reals", + "description": "ℝ", + "body": "\\mathbb{R}" + }, + "Complex numbers": { + "prefix": "complex", + "description": "Fancy C symbol", + "body": "\\mathbb{C}" + }, + "Natural numbers": { + "prefix": "nats", + "description": "ℕ", + "body": "\\mathbb{N}" + }, + "Integers": { + "prefix": "ints", + "description": "ℤ", + "body": "\\mathbb{Z}" + }, + "Rationals": { + "prefix": "rats", + "description": "ℚ", + "body": "\\mathbb{Q}" + }, + "Fields": { + "prefix": "fields", + "description": "Fanch F symbol", + "body": "\\mathbb{F}" + }, + "Aligned": { + "prefix": "aligned", + "description": "Create an aligned environment", + "body": ["\\begin{aligned}", "\t$0", "\\end{aligned}"] + }, + "Aligned display math": { + "prefix": "maligned", + "description": "Create an aligned display math environment", + "body": ["\\[", "\t\\begin{aligned}", "\t\t$0", "\t\\end{aligned}", "\\]"] + } +} diff --git a/flake.lock b/flake.lock index 4d17a28..d0e433c 100644 --- a/flake.lock +++ b/flake.lock @@ -529,11 +529,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1660711471, - "narHash": "sha256-KcSufGje9D2EWAFq5EkPQoDqzQsfNsSg/m5gIkS7IKU=", + "lastModified": 1662451801, + "narHash": "sha256-/k86NFXnZEcVXNzDdifxd9cQ5gZzLc0qqNDztYmM+mg=", "owner": "neovim", "repo": "neovim", - "rev": "bccb5de89da452d9136b3c813be584f15d3018ba", + "rev": "5b8d6e0b3200c5cb9d98cbdb4ed0afe2b4edd38d", "type": "github" }, "original": { @@ -552,11 +552,11 @@ ] }, "locked": { - "lastModified": 1660724221, - "narHash": "sha256-XywsLM2OxjCGARNlyvAvgO3ZjD+iF6AsLnJ4mJQZ6LM=", + "lastModified": 1662452250, + "narHash": "sha256-0qP89RrJ71sj6/oWRuC5oJXZ+q37DovGUworw46O15s=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "6a8790f60859a7ba074af3d0bc373813f2eac15b", + "rev": "ffbbedc805ee3e7bf5937dd4f5140bd542de6751", "type": "github" }, "original": { diff --git a/modules/applications/default.nix b/modules/applications/default.nix index 9b2416a..18466a2 100644 --- a/modules/applications/default.nix +++ b/modules/applications/default.nix @@ -12,6 +12,7 @@ ./steam.nix ./docker.nix ./misc.nix + ./zathura.nix ./discord.nix ./locale.nix # ./memes.nix diff --git a/modules/applications/locale.nix b/modules/applications/locale.nix index 8029565..982d749 100644 --- a/modules/applications/locale.nix +++ b/modules/applications/locale.nix @@ -1,6 +1,7 @@ { ... }: { i18n.defaultLocale = "en_US.UTF-8"; - time.timeZone = "Europe/Bucharest"; + # time.timeZone = "Europe/Bucharest"; + time.timeZone = "Europe/Amsterdam"; i18n.inputMethod = { enabled = "ibus"; diff --git a/modules/applications/misc.nix b/modules/applications/misc.nix index 8cd097d..082a192 100644 --- a/modules/applications/misc.nix +++ b/modules/applications/misc.nix @@ -27,11 +27,12 @@ # unison-ucm xorg.libX11 # wtf is this okular # forgot what this does - zathura # pdf thing? spotify-tui # spotify terminal ui # kdeconnect # connect with your phone sloc # line of code counter update-nix-fetchgit # for updating fetchgit calls in nix files + pamixer # set pipewire volume + pulseaudio # pactl and stuff (same thing as above) # editors # vscodium diff --git a/modules/applications/neovim.nix b/modules/applications/neovim.nix index 8dbceab..581c822 100644 --- a/modules/applications/neovim.nix +++ b/modules/applications/neovim.nix @@ -18,6 +18,8 @@ let rnix-lsp # nix haskell-language-server # haskell kotlin-language-server # kotlin + tectonic # also latex something? + texlab # latex # vscode-langservers-extracted # css and shit # Formatters diff --git a/modules/applications/shells/aliases.nix b/modules/applications/shells/aliases.nix index e374d98..05a155d 100644 --- a/modules/applications/shells/aliases.nix +++ b/modules/applications/shells/aliases.nix @@ -9,11 +9,16 @@ wifi = "sudo nmcli con up id"; # Volume controls - "v-up" = "amixer set Master 8%+"; - "v-down" = "amixer set Master 8%-"; - "v-min" = "amixer set Master 0%"; - "v-mid" = "amixer set Master 50%"; - "v-max" = "amixer set Master 100%"; + "v-up" = "pactl set-sink-volume @DEFAULT_SINK@ +5%"; + "v-down" = "pactl set-sink-volume @DEFAULT_SINK@ +5%"; + "v-min" = "pactl set-sink-volume @DEFAULT_SINK@ 0%"; + "v-mid" = "pactl set-sink-volume @DEFAULT_SINK@ 50%"; + "v-max" = "pactl set-sink-volume @DEFAULT_SINK@ 100%"; + # "v-up" = "amixer set Master 8%+"; + # "v-down" = "amixer set Master 8%-"; + # "v-min" = "amixer set Master 0%"; + # "v-mid" = "amixer set Master 50%"; + # "v-max" = "amixer set Master 100%"; # Print available battery battery = "acpi"; diff --git a/modules/applications/xmonad/Main.hs b/modules/applications/xmonad/Main.hs index 755c4f6..7428083 100644 --- a/modules/applications/xmonad/Main.hs +++ b/modules/applications/xmonad/Main.hs @@ -90,8 +90,8 @@ main = ] uniformBorder = join $ join $ join Border - border = uniformBorder 4 - spacingHook = spacingRaw True border True border True + border = uniformBorder 0 + spacingHook = spacingRaw False border False border True tall = Tall 1 (3 / 100) (1 / 2) threeCols = ThreeCol 1 (3 / 100) (1 / 2) diff --git a/modules/applications/xmonad/default.nix b/modules/applications/xmonad/default.nix index ed6f579..82ade1b 100644 --- a/modules/applications/xmonad/default.nix +++ b/modules/applications/xmonad/default.nix @@ -15,7 +15,7 @@ services.picom = { enable = true; blur = true; - shadow = true; + shadow = false; extraOptions = '' blur: { diff --git a/modules/applications/zathura.nix b/modules/applications/zathura.nix new file mode 100644 index 0000000..004593a --- /dev/null +++ b/modules/applications/zathura.nix @@ -0,0 +1,19 @@ +{ pkgs, lib, ... }: +let + theme = pkgs.myThemes.current; +in +{ + imports = [ + { + home-manager.users.adrielus.programs.zathura.enable = true; + } + ]; + home-manager.users.adrielus = lib.mkIf theme.zathura.enable { + xdg.configFile."zathura/${theme.zathura.name}".source = theme.zathura.theme; + programs.zathura = { + extraConfig = '' + include ${theme.zathura.name} + ''; + }; + }; +} diff --git a/modules/themes/catppuccin/default.nix b/modules/themes/catppuccin/default.nix index 0708b2f..5a5d4fd 100644 --- a/modules/themes/catppuccin/default.nix +++ b/modules/themes/catppuccin/default.nix @@ -3,6 +3,8 @@ 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}"; @@ -18,16 +20,16 @@ in }; # grub.path = "${foreign.grub}/catppuccin-grub-theme/theme.txt"; - tmux.path = "${foreign.tmux}/catppuccin.conf"; + tmux.path = "${foreign.tmux}/catppuccin-${variant}.conf"; sddm.path = "${foreign.sddm}"; grub.path = pkgs.nixos-grub2-theme; xresources = builtins.readFile "${foreign.xresources}/${variant}.Xresources"; rofi = { - themes = "${foreign.rofi}/.local/share/rofi/themes/"; + themes = "${foreign.rofi}/${rofi-variant}/.local/share/rofi/themes/"; config = '' - @import "${foreign.rofi}/.config/rofi/config.rasi" + @import "${foreign.rofi}/${rofi-variant}/.config/rofi/config.rasi" @theme "catppuccin-${variant}" @import "${./rofi.rasi}" ''; @@ -55,13 +57,19 @@ in "89DCEB" ]; + zathura = { + enable = true; + theme = "${foreign.zathura}/src/catppuccin-${variant}"; + name = "catppuccin-${variant}"; + }; + alacritty.settings = { import = [ "${foreign.alacritty}/catppuccin.yml" ]; # colors = "*${variant}"; window = { padding = { - x = 4; - y = 4; + x = 0; + y = 0; }; opacity = transparency; diff --git a/modules/themes/catppuccin/foreign.nix b/modules/themes/catppuccin/foreign.nix index eb091ca..b3d3098 100644 --- a/modules/themes/catppuccin/foreign.nix +++ b/modules/themes/catppuccin/foreign.nix @@ -2,8 +2,8 @@ tmux = fetchFromGitHub { owner = "catppuccin"; repo = "tmux"; - sha256 = "1vz6srk4zfgsjpwb7xa7n9mg5kfb3x7aq963mwqnl8m4zvmcy8vz"; - rev = "1c87a9e1d2fac21815497ed7f599a1c1208d40cd"; + sha256 = "1x95db3wjjbaljk30db3iqjddxfp1gg2m9f0318vnincsdfllmz1"; + rev = "317159f824eeb4d170ecad34e0457281b13244d2"; }; sddm = fetchFromGitHub { owner = "catppuccin"; @@ -14,20 +14,20 @@ grub = fetchFromGitHub { owner = "catppuccin"; repo = "grub"; - sha256 = "0ra1psb37wsgdag5swfwwzcgy73014j34c9njnvxz1jdv0k56qlc"; - rev = "b2919a93ef37ea1b220bab90fa0a5fa3a26eec0b"; + sha256 = "0d9vbq63bilikgnyzk9gfrzddvbvxi55k22cw8k0mdavfy24m1q4"; + rev = "fc5fba2896db095aee7b0d6442307c3035a24fa7"; }; gtk = fetchFromGitHub { owner = "catppuccin"; repo = "gtk"; - sha256 = "1q9iq0agdk5rm5cfnpr1b1bzy6fdx67pvkakx478j1dlyr1d78bl"; - rev = "87a79fd2bf07accc694455df30a32a82b1b31f4f"; + sha256 = "1fzc7yzj9b9pc48qqaygbyskqjanb771x0i4ssn40hpbhj17n2ny"; + rev = "fc336313a84e0d7ec1a3499047fb1e73eef8a005"; }; rofi = fetchFromGitHub { owner = "catppuccin"; repo = "rofi"; - sha256 = "1bs7l5mpqryjl7dz6pi419n1p9c68362vnczj0lcpbxnfpw0af24"; - rev = "39fc2a0b51d594e559cb03bf9d4e743cb96f7b01"; + sha256 = "00p1pnnas281hdszzs8jki4l48vs76r0b5b5j5yas3vh3h352m99"; + rev = "5de33131d5904d4d96f4f218b1a54b9c79634965"; }; alacritty = fetchFromGitHub { owner = "catppuccin"; @@ -44,7 +44,13 @@ xresources = fetchFromGitHub { owner = "catppuccin"; repo = "xresources"; - sha256 = "1ffx73l6s0pkf4d4g5lp2d0cfxjrbczsr5fy45i0503sa279fan7"; - rev = "a9cd582faeef2f7410eb7d4b5a83d026e3f2b865"; + sha256 = "08dh1av7kb921fdzkqhcp2yd2q848ay0kqgyf3zbnnvs0j92ap0q"; + rev = "046c2f9c3027af1b7aaca14377dda5ea19b61593"; + }; + zathura = fetchFromGitHub { + owner = "catppuccin"; + repo = "zathura"; + sha256 = "17q2jn8bx712c0789vc00y9jb2vng7g7mnmqm8ypivrl616igzli"; + rev = "b9553c7e398c1a157e5543ea52d20e570f730dd6"; }; } diff --git a/modules/themes/catppuccin/nvim.lua b/modules/themes/catppuccin/nvim.lua index eb27fbe..8fa1229 100644 --- a/modules/themes/catppuccin/nvim.lua +++ b/modules/themes/catppuccin/nvim.lua @@ -4,15 +4,15 @@ M.deps = { { "catppuccin/nvim", as = "catppuccin" } } function M.setup() local catppuccin = require("catppuccin") + vim.g.catppuccin_flavour = os.getenv("CATPPUCCIN_FLAVOUR") catppuccin.setup({ - compile = { enabled = true }, transparent_background = false, - integrations = { nvimtree = { transparent_panel = false } } + integrations = { nvimtree = true } }) + print("loaded this theme!") - vim.g.catppuccin_flavour = os.getenv("CATPPUCCIN_FLAVOUR") vim.cmd [[colorscheme catppuccin]] end diff --git a/modules/users.nix b/modules/users.nix index a6fbb85..f7c8b3e 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -15,7 +15,7 @@ mutableUsers = false; users.adrielus = { passwordFile = "~/water/pass"; - extraGroups = [ "wheel" "networkmanager" "lp" "docker" ]; + extraGroups = [ "wheel" "networkmanager" "lp" "docker" "audio" "sound" "video" "input" "tty" ]; isNormalUser = true; shell = pkgs.fish; };