From fbccfa48e4329aec8e8f402a9e425e04a012a940 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 5 Feb 2023 23:56:40 +0300 Subject: [PATCH] feat: discord rpc --- modules/modules.nix | 1 + modules/presence/default.nix | 5 ++++ modules/presence/discord-nvim.nix | 45 +++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 modules/presence/default.nix create mode 100644 modules/presence/discord-nvim.nix diff --git a/modules/modules.nix b/modules/modules.nix index c392cc3..6777c30 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -25,6 +25,7 @@ ./dashboard ./notifications ./utility + ./presence ]; pkgsModule = {config, ...}: { diff --git a/modules/presence/default.nix b/modules/presence/default.nix new file mode 100644 index 0000000..649fa76 --- /dev/null +++ b/modules/presence/default.nix @@ -0,0 +1,5 @@ +_: { + imports = [ + ./discord-nvim.nix + ]; +} diff --git a/modules/presence/discord-nvim.nix b/modules/presence/discord-nvim.nix new file mode 100644 index 0000000..4d48a4c --- /dev/null +++ b/modules/presence/discord-nvim.nix @@ -0,0 +1,45 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; +with builtins; let + cfg = config.vim.presence.presence-nvim; +in { + options.vim.presence.presence-nvim = { + enable = mkEnableOption "Enable presence.nvim plugin"; + }; + + config = mkIf cfg.enable { + vim.startPlugins = ["presence-nvim"]; + + vim.luaConfigRC.presence-nvim = nvim.dag.entryAnywhere '' + -- Description of each option can be found in https://github.com/andweeb/presence.nvim444 + require("presence").setup({ + -- General options + auto_update = true, + neovim_image_text = "The One True Text Editor", + main_image = "neovim", + client_id = "793271441293967371", + log_level = nil, + debounce_timeout = 10, + enable_line_number = false, + blacklist = {}, + buttons = true, + file_assets = {}, + show_time = true, + + -- Rich Presence text options + editing_text = "Editing %s", + file_explorer_text = "Browsing %s", + git_commit_text = "Committing changes", + plugin_manager_text = "Managing plugins", + reading_text = "Reading %s", + workspace_text = "Working on %s", + line_number_text = "Line %s out of %s", + }) + ''; + }; +}