From 2246ae3eaaa8f70a773a126cd44fb0fa8a8844fe Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Sun, 4 Jun 2023 08:12:51 +0200 Subject: [PATCH] Tried to add plover & updated vimclip to support wayland --- dotfiles/neovim/lazy-lock.json | 78 ++++++++++---------- dotfiles/neovim/lua/my/plugins/dashboard.lua | 5 +- home/features/neovim/default.nix | 1 + home/features/wayland/hyprland/hyprland.conf | 4 +- home/features/xorg/default.nix | 1 - home/tethys.nix | 1 + overlays/default.nix | 3 + overlays/plover.nix | 55 ++++++++++++++ pkgs/vimclip.nix | 23 +++--- 9 files changed, 115 insertions(+), 56 deletions(-) create mode 100644 overlays/plover.nix diff --git a/dotfiles/neovim/lazy-lock.json b/dotfiles/neovim/lazy-lock.json index e5c9280..ad40dd7 100644 --- a/dotfiles/neovim/lazy-lock.json +++ b/dotfiles/neovim/lazy-lock.json @@ -1,70 +1,70 @@ { - "LuaSnip": { "branch": "master", "commit": "8d6c0a93dec34900577ba725e91c44b8d3ca1f45" }, + "LuaSnip": { "branch": "master", "commit": "51ebb4b6637290e1b8e0fb0d6f38b605d3c24940" }, "abbreinder.nvim": { "branch": "main", "commit": "5b2b5ff08a9ada42238d733aeebc6d3d96314d77" }, "abbremand.nvim": { "branch": "main", "commit": "d633341f632b0b2666dfc6dfe6b9842ba1610a1d" }, - "clipboard-image.nvim": { "branch": "main", "commit": "3d10d535cb3bf300fb8e74d886840edb81a63bd4" }, + "clipboard-image.nvim": { "branch": "main", "commit": "af8fdaad7e6fed0741e18dbf2f57bdc7494adaee" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "af88e700417c6449719fc77f6f3745f88e42d5da" }, + "cmp-cmdline": { "branch": "main", "commit": "5af1bb7d722ef8a96658f01d6eb219c4cf746b32" }, "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, - "crates.nvim": { "branch": "main", "commit": "1d4bb1e7a0fe8bae3f97061be5fbf6f9081a27e2" }, - "dashboard-nvim": { "branch": "master", "commit": "275e7c8579858c3ee06f32c16bdc687153ca7204" }, + "crates.nvim": { "branch": "main", "commit": "3648f8787656d7572740560331553abdaa8cb982" }, + "dashboard-nvim": { "branch": "master", "commit": "0af0ad181db271ef8d5a332f4cfcec9118340497" }, "dhall-vim": { "branch": "master", "commit": "68500ef46ff3706f46c99db3be7a0c8abcf6a3ae" }, - "dressing.nvim": { "branch": "master", "commit": "0e3e1eba147fee6e638ac1ac28f0495bcde17319" }, + "dressing.nvim": { "branch": "master", "commit": "f19cbd56f7f8cad212c58a7285d09c5d9c273896" }, "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, - "firenvim": { "branch": "master", "commit": "ee4ef314bd990b2b05b7fbd95b857159e444a2fe" }, + "firenvim": { "branch": "master", "commit": "e2d5a0f97d1f41e03c8d2a3c71ee60b1a4a6bb83" }, "github-actions-yaml.vim": { "branch": "master", "commit": "f2f16243447cea174daa6b4a9ffd3ff9213814ef" }, "gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" }, - "glow.nvim": { "branch": "main", "commit": "a3f24fdaa71d2c25a2b88026032b34f5b6a6e215" }, - "harpoon": { "branch": "master", "commit": "f7040fd0c44e7a4010369136547de5604b9c22a1" }, + "glow.nvim": { "branch": "main", "commit": "bbd0473d72a45094495ee5600b5577823543eefe" }, + "harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" }, "hydra.nvim": { "branch": "master", "commit": "3ced42c0b6a6c85583ff0f221635a7f4c1ab0dd0" }, "hyprland-vim-syntax": { "branch": "main", "commit": "254df6b476db5784bc6bfe3f612129b73dfc43b5" }, - "idris2-nvim": { "branch": "main", "commit": "dd850c1c67bcacd2395121b0898374fe9cdd228f" }, + "idris2-nvim": { "branch": "main", "commit": "3a2b4d2b5ffeab9e47298456c59c31b4e1ddebc9" }, "inc-rename.nvim": { "branch": "main", "commit": "fb1b7468f27d874feb209eac46be5205e20b7fd3" }, "iron.nvim": { "branch": "master", "commit": "792dd11752c4699ea52c737b5e932d6f21b25834" }, "jupytext.vim": { "branch": "master", "commit": "32c1e37b2edf63a7e38d0deb92cc3f1462cc4dcd" }, "kmonad-vim": { "branch": "master", "commit": "37978445197ab00edeb5b731e9ca90c2b141723f" }, "knap": { "branch": "main", "commit": "8c083d333b8a82421a521539eb1c450b06c90eb6" }, "kotlin-vim": { "branch": "master", "commit": "53fe045906df8eeb07cb77b078fc93acda6c90b8" }, - "lazy.nvim": { "branch": "main", "commit": "5c89dc52f42e5058a46b0912d7d9042f564e44e0" }, - "lean.nvim": { "branch": "main", "commit": "157ca8a08ad13845cf67b440a595b55b25b9a459" }, - "leap": { "branch": "main", "commit": "0eb3611593e135150e2f7880ec67568ccb51c17a" }, - "live-command.nvim": { "branch": "main", "commit": "ce4b104ce702c7bb9fdff863059af6d47107ca61" }, - "lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" }, - "lualine.nvim": { "branch": "master", "commit": "84ffb80e452d95e2c46fa29a98ea11a240f7843e" }, + "lazy.nvim": { "branch": "main", "commit": "e6bf3a0d9c4899dcf832270f79bb1cee8fbc506e" }, + "lean.nvim": { "branch": "main", "commit": "ea68b6abc252e65f88a08305a3d6e1578a27b720" }, + "leap": { "branch": "main", "commit": "be918a8e6aa00a6cfa7270d4bfcc11b2f80d6902" }, + "live-command.nvim": { "branch": "main", "commit": "bc7e094e7ff52caf682c1430ff3a43ff55f6a58b" }, + "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, + "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, "magma-nvim": { "branch": "main", "commit": "395b48e2e202d82fca76c15d2dcd8785c125d686" }, "mind.nvim": { "branch": "master", "commit": "002137dd7cf97865ebd01b6a260209d2daf2da66" }, - "neoconf.nvim": { "branch": "main", "commit": "315161d16fafb172cd4e46563a5b602fd8550a00" }, - "neodev.nvim": { "branch": "main", "commit": "e812f3d0e62e21a164b70f90f642cf30129503e4" }, - "neogit": { "branch": "master", "commit": "69a6ca7c41b023ebf9cad70778e227b3209b40c4" }, - "neorg": { "branch": "main", "commit": "f742e90d6d8ec831f0bce939c37a3c04407c0e9f" }, - "neorg-telescope": { "branch": "main", "commit": "787f95c527d4f3fe1c25600e92d939456967e944" }, - "nui.nvim": { "branch": "main", "commit": "ecd9def93891b9260b15b5fcef542eaabf4145c9" }, - "null-ls.nvim": { "branch": "main", "commit": "f8ffcd7cb8fb3325c711d459152ef132b5b65aed" }, - "nvim-autopairs": { "branch": "master", "commit": "58985de5eeab159462bc262de5cc1b9c9b375595" }, - "nvim-cmp": { "branch": "main", "commit": "777450fd0ae289463a14481673e26246b5e38bf2" }, + "neoconf.nvim": { "branch": "main", "commit": "ee205ffd079f96d32c837dcf29af259e0dde8557" }, + "neodev.nvim": { "branch": "main", "commit": "358f11c585fdccfcb5e8eae720c423fbed6d92de" }, + "neogit": { "branch": "master", "commit": "80be328067b370744c39323674a2ebaf515dea14" }, + "neorg": { "branch": "main", "commit": "e0fcf254fbdb95fa0918692aee1c93b938e883f8" }, + "neorg-telescope": { "branch": "main", "commit": "d24f445c912451ddbf17cbe8da36561b51b10d39" }, + "nui.nvim": { "branch": "main", "commit": "2b2732528e4a79eb8542568bd51d25f710395bd6" }, + "null-ls.nvim": { "branch": "main", "commit": "c89333e034a8daba654ebfcf9a4ec9f87765f01e" }, + "nvim-autopairs": { "branch": "master", "commit": "59df87a84c80a357ca8d8fe86e451b93ac476ccc" }, + "nvim-cmp": { "branch": "main", "commit": "fc0f694af1a742ada77e5b1c91ff405c746f4a26" }, "nvim-comment": { "branch": "main", "commit": "e9ac16ab056695cad6461173693069ec070d2b23" }, - "nvim-lspconfig": { "branch": "master", "commit": "eddaef928c1e1dd79a96f5db45f2fd7f2efe7ea0" }, - "nvim-tree.lua": { "branch": "master", "commit": "0db85a70248f9a90e61af5cdbafe5d9f4320f719" }, - "nvim-treesitter": { "branch": "master", "commit": "e2cf8977fda35ad666d7b431b0254d8da710968a" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "8673926519ea61069f9c1366d1ad1949316d250e" }, - "nvim-web-devicons": { "branch": "master", "commit": "4ec26d67d419c12a4abaea02f1b6c57b40c08d7e" }, - "nvim_context_vt": { "branch": "master", "commit": "e592a9142fbfe0878ce886cd0d745963604c61d2" }, + "nvim-lspconfig": { "branch": "master", "commit": "9166622781a39a829878d1fd24c174529d996838" }, + "nvim-tree.lua": { "branch": "master", "commit": "e2a4c9d09d205ebe5f071264f43f73a0077c43a3" }, + "nvim-treesitter": { "branch": "master", "commit": "62146fe415193879290c523b54cb5072e1f5dbbc" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "95b76b95eff25e1e64f363938cd853852355d70a" }, + "nvim-web-devicons": { "branch": "master", "commit": "2a125024a137677930efcfdf720f205504c97268" }, + "nvim_context_vt": { "branch": "master", "commit": "dcfd29699e614035dd6ab863039e1c1811cace91" }, "paperplanes.nvim": { "branch": "master", "commit": "d704b2e1e594b32d454cc7e0c5f2cf9b391e3cc1" }, - "plenary.nvim": { "branch": "master", "commit": "9ac3e9541bbabd9d73663d757e4fe48a675bb054" }, + "plenary.nvim": { "branch": "master", "commit": "499e0743cf5e8075cd32af68baa3946a1c76adf1" }, "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, "purescript-vim": { "branch": "main", "commit": "82348352e6568fcc0385bd7c99a8ead3a479feea" }, "rasi.vim": { "branch": "main", "commit": "eac9969cf935cd4380987dc99bfa10d69d3f34a6" }, - "rose-pine": { "branch": "main", "commit": "667851c05f87874826084474b5f04829940b6451" }, + "rose-pine": { "branch": "main", "commit": "15aac8c529bb38ac39fdb22f7be7f37c0e39dd0c" }, "rust-tools.nvim": { "branch": "master", "commit": "71d2cf67b5ed120a0e31b2c8adb210dd2834242f" }, "scrap.nvim": { "branch": "main", "commit": "16db44ae9403ec9c4b140394f294475d1af80a18" }, - "smart-splits.nvim": { "branch": "master", "commit": "31589a973ca8cd3ec8e4b96f14d7a37f22025a12" }, - "telescope-file-browser.nvim": { "branch": "master", "commit": "e0fcb12702ad0d2873544a31730f9aaef04fd032" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" }, + "smart-splits.nvim": { "branch": "master", "commit": "e9a8f08b9db566ebc2b942b4776567f981b2986c" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "6cf29d5139601993343c4e70ee2d1f67959d9cc5" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, "telescope.nvim": { "branch": "master", "commit": "e960efa60e97df58e089b00270f09d60f27202c8" }, - "typst.vim": { "branch": "main", "commit": "a9bb264d29331c52ef462e42e0501e3411bc3efb" }, + "typst.vim": { "branch": "main", "commit": "6750b01970045affed30efe063d7e21b399f1efc" }, "undotree": { "branch": "master", "commit": "485f01efde4e22cb1ce547b9e8c9238f36566f21" }, "venn.nvim": { "branch": "main", "commit": "c114563960b8fb1197695d42798d1f3e7190b798" }, "vim-abolish": { "branch": "master", "commit": "cb3dcb220262777082f63972298d57ef9e9455ec" }, @@ -72,8 +72,8 @@ "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-teal": { "branch": "master", "commit": "d2aa107b257879e774680792a2aebaf9cd5742e0" }, "vim-tmux-navigator": { "branch": "master", "commit": "cdd66d6a37d991bba7997d593586fc51a5b37aa8" }, - "vim-wakatime": { "branch": "master", "commit": "515dbcc2278a9279a19de838fa29fc5078e34e56" }, + "vim-wakatime": { "branch": "master", "commit": "02be9238319937e04afea73fd0fc7da5413ee041" }, "vimux": { "branch": "master", "commit": "616fcb4799674a7a809b14ca2dc155bb6ba25788" }, - "which-key.nvim": { "branch": "main", "commit": "94cb020ff33a1e0e22fac1c41663d2c439741f17" }, + "which-key.nvim": { "branch": "main", "commit": "e271c28118998c93a14d189af3395812a1aa646c" }, "yuck.vim": { "branch": "master", "commit": "9b5e0370f70cc30383e1dabd6c215475915fe5c3" } } \ No newline at end of file diff --git a/dotfiles/neovim/lua/my/plugins/dashboard.lua b/dotfiles/neovim/lua/my/plugins/dashboard.lua index c180913..e8e5e77 100644 --- a/dotfiles/neovim/lua/my/plugins/dashboard.lua +++ b/dotfiles/neovim/lua/my/plugins/dashboard.lua @@ -6,9 +6,8 @@ local M = { opts = { theme = "hyper", config = { - week_header = { - enable = true, - }, + week_header = { enable = true }, + project = { enable = false }, -- TODO: actually customize these shortcut = { { diff --git a/home/features/neovim/default.nix b/home/features/neovim/default.nix index 405a5c0..73681f9 100644 --- a/home/features/neovim/default.nix +++ b/home/features/neovim/default.nix @@ -146,6 +146,7 @@ in home.packages = [ neovim neovide + pkgs.vimclip ]; # }}} # {{{ Firenvim diff --git a/home/features/wayland/hyprland/hyprland.conf b/home/features/wayland/hyprland/hyprland.conf index bba7690..9cdd2e9 100644 --- a/home/features/wayland/hyprland/hyprland.conf +++ b/home/features/wayland/hyprland/hyprland.conf @@ -12,8 +12,8 @@ decoration { blur = true blur_size = 10 blur_passes = 3 - active_opacity = 0.9 - inactive_opacity = 0.9 + active_opacity = 1.0 + inactive_opacity = 1.0 } input { diff --git a/home/features/xorg/default.nix b/home/features/xorg/default.nix index 531c770..0290cb6 100644 --- a/home/features/xorg/default.nix +++ b/home/features/xorg/default.nix @@ -10,6 +10,5 @@ home.packages = with pkgs; [ xclip # Clipboard stuff spectacle # Take screenshots - vimclip # Vim anywhere! ]; } diff --git a/home/tethys.nix b/home/tethys.nix index dd7f52b..03ac530 100644 --- a/home/tethys.nix +++ b/home/tethys.nix @@ -27,6 +27,7 @@ kicad # PCB editing # google-chrome # Not my primary browser, but sometimes needed in webdev # obs-studio # video recorder + plover.dev # steno engine # Clis agenix # Secret encryption diff --git a/overlays/default.nix b/overlays/default.nix index b7f3c40..9655a6f 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -10,4 +10,7 @@ # ... # }); }; + + # Wayland version of plover + plover = import ./plover.nix; } diff --git a/overlays/plover.nix b/overlays/plover.nix new file mode 100644 index 0000000..6072b3a --- /dev/null +++ b/overlays/plover.nix @@ -0,0 +1,55 @@ +# Taken from [here](https://github.com/openstenoproject/plover/pull/1461#issuecomment-1094511201) +# Wayland version of plover +(self: super: rec { + python3Packages = { + plover-stroke = self.python3Packages.buildPythonPackage rec { + pname = "plover_stroke"; + version = "1.0.1"; + src = super.python3Packages.fetchPypi { + inherit pname version; + sha256 = "t+ZM0oDEwitFDC1L4due5IxCWEPzJbF3fi27HDyto8Q="; + }; + }; + rtf-tokenize = self.python3Packages.buildPythonPackage rec { + pname = "rtf_tokenize"; + version = "1.0.0"; + src = super.python3Packages.fetchPypi { + inherit pname version; + sha256 = "XD3zkNAEeb12N8gjv81v37Id3RuWroFUY95+HtOS1gg="; + }; + }; + pywayland_0_4_7 = super.python3Packages.pywayland.overridePythonAttrs + (oldAttrs: rec { + pname = "pywayland"; + version = "0.4.7"; + src = super.python3Packages.fetchPypi { + inherit pname version; + sha256 = "0IMNOPTmY22JCHccIVuZxDhVr41cDcKNkx8bp+5h2CU="; + }; + }); + } // super.python3Packages; + plover.dev = super.plover.dev.overridePythonAttrs + (oldAttrs: { + src = self.fetchFromGitHub { + owner = "openstenoproject"; + repo = "plover"; + rev = "fd5668a3ad9bd091289dd2e5e8e2c1dec063d51f"; + sha256 = "2xvcNcJ07q4BIloGHgmxivqGq1BuXwZY2XWPLbFrdXg="; + }; + propagatedBuildInputs = oldAttrs.propagatedBuildInputs + ++ [ + python3Packages.plover-stroke + python3Packages.rtf-tokenize + python3Packages.pywayland_0_4_7 + ]; + nativeBuildInputs = (oldAttrs.nativeBuildInputs or [ ]) ++ [ + self.pkg-config + ]; + doCheck = false; # TODO: get tests working + postPatch = '' + sed -i /PyQt5/d setup.cfg + substituteInPlace plover_build_utils/setup.py \ + --replace "/usr/share/wayland/wayland.xml" "${self.wayland}/share/wayland/wayland.xml" + ''; + }); +}) diff --git a/pkgs/vimclip.nix b/pkgs/vimclip.nix index b070278..176dd3d 100644 --- a/pkgs/vimclip.nix +++ b/pkgs/vimclip.nix @@ -1,5 +1,5 @@ -{ pkgs, ... }: -pkgs.stdenv.mkDerivation rec { +{ pkgs, lib, ... }: +let vimclip = pkgs.stdenv.mkDerivation rec { name = "vimclip"; rev = "7f53433"; @@ -10,18 +10,19 @@ pkgs.stdenv.mkDerivation rec { sha256 = "cl5y7Lli5frwx823hoN17B2aQLNY7+njmKEDdIbhc4Y="; }; - buildInputs = [ - pkgs.makeWrapper - ]; - installPhase = '' mkdir -p $out/bin cp ./vimclip $out/bin/vimclip chmod +x $out/bin/vimclip ''; +}; in +pkgs.writeShellScriptBin "vimclip" '' + if ["wayland" = $XDG_SESSION_TYPE] + then + export VIMCLIP_CLIPBOARD_COMMAND = ${pkgs.wl-clipboard}/bin/wl-copy + else + export VIMCLIP_CLIPBOARD_COMMAND = ${lib.getExe pkgs.xsel} + fi - postFixup = '' - wrapProgram $out/bin/vimclip \ - --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.xsel ]} \ - ''; -} + ${lib.getExe vimclip} +''