diff --git a/home/dot_config/nvim/ftplugin/markdown.lua b/home/dot_config/nvim/ftplugin/markdown.lua index f3610cf..d49e302 100644 --- a/home/dot_config/nvim/ftplugin/markdown.lua +++ b/home/dot_config/nvim/ftplugin/markdown.lua @@ -6,8 +6,9 @@ local bufmap = { { mode = "x", keys = "i", cmd = 'c*"*', opt = { desc = "Add italic to selected text" } }, { mode = "x", keys = "b", cmd = 'c**"**', opt = { desc = "Add bold to selected text" } }, { mode = "x", keys = "c", cmd = 'c`"`', opt = { desc = "Add code block to selected text" } }, - { mode = "x", keys = "d", cmd = 'c~~"~~', opt = { desc = "Add strikethrough to selected text" } }, + { mode = "x", keys = "D", cmd = 'c~~"~~', opt = { desc = "Add strikethrough to selected text" } }, { mode = "x", keys = "h", cmd = 'c=="==', opt = { desc = "Add highlight to selected text" } }, + { mode = "n", keys = "", cmd = "za", opt = { desc = "Toggle folding under current level" } }, } -- local set_buf_keymaps_prefix = require("keymaps.utils").set_buf_keymaps_prefix diff --git a/home/dot_config/nvim/init.lua b/home/dot_config/nvim/init.lua index 69a460b..7472234 100644 --- a/home/dot_config/nvim/init.lua +++ b/home/dot_config/nvim/init.lua @@ -10,6 +10,13 @@ require("config.options") local minimal = os.getenv("NVIM_MINIMAL") or os.getenv("EDITOR_POPUP") +local disable_ai = os.getenv("DISABLE_AI_ASSISTANT") or "0" + +if disable_ai == "1" then + vim.g.ai_enabled = false +else + vim.g.ai_enabled = true +end if minimal == "1" then -- require("profiles.minimal") @@ -50,6 +57,7 @@ if vim.g.neovide then vim.g.neovide_input_macos_option_key_is_meta = "only_left" end +-- TODO: Refractor this part to submodules -- 存储输入法状态的变量 vim.g.input_layout = nil diff --git a/home/dot_config/nvim/lsp/svelte-language-server.lua b/home/dot_config/nvim/lsp/svelte-language-server.lua new file mode 100644 index 0000000..3a7355f --- /dev/null +++ b/home/dot_config/nvim/lsp/svelte-language-server.lua @@ -0,0 +1,7 @@ +---@type vim.lsp.Config +return { + cmd = { "svelteserver" }, + root_markers = { "package.json", "svelte.config.js" }, + filetypes = { "svelte" }, + settings = {}, +} diff --git a/home/dot_config/nvim/lua/config/options.lua b/home/dot_config/nvim/lua/config/options.lua index 1ad8e36..75b1f2a 100644 --- a/home/dot_config/nvim/lua/config/options.lua +++ b/home/dot_config/nvim/lua/config/options.lua @@ -44,13 +44,13 @@ opt.termguicolors = true --- Fold opt.foldmethod = "expr" --- Folding provided by treesitter -opt.foldexpr = "nvim_treesitter#foldexpr()" +-- Use builtin Treesitter foldexpr +-- See: https://github.com/nvim-treesitter/nvim-treesitter/commit/dd7bb795c48b5b9795bde0537bb29ddf9fb7b42d +opt.foldexpr = "v:lua.vim.treesitter.foldexpr()" -- Disable fold at start opt.foldlevelstart = 99 opt.foldlevel = 99 -opt.foldenable = false -opt.foldlevelstart = 1 +opt.foldenable = true -- Hide Command Line if empty opt.cmdheight = 0 @@ -79,3 +79,5 @@ vim.fn.matchadd("Conceal", [[\%u200b]], 10, -1, { conceal = "" }) opt.grepformat = "%f:%l:%c:%m" opt.grepprg = "rg --vimgrep" + +vim.o.exrc = true diff --git a/home/dot_config/nvim/lua/keymaps/basic.lua b/home/dot_config/nvim/lua/keymaps/basic.lua index 087965b..7c45960 100644 --- a/home/dot_config/nvim/lua/keymaps/basic.lua +++ b/home/dot_config/nvim/lua/keymaps/basic.lua @@ -96,7 +96,6 @@ local keymaps_basic = { cmd = "5e", opts = { desc = "Down 5 Lines" }, }, - { keys = "", cmd = "", opts = { desc = "Focus on other panel" } }, -- { keys = "", cmd = "%" }, { keys = "Y", cmd = "y$", opts = { desc = "Yank to End of Line" } }, { mode = mode_arrow, keys = "J", cmd = "5j" }, diff --git a/home/dot_config/nvim/lua/plugins/lang/init.lua b/home/dot_config/nvim/lua/plugins/lang/init.lua index 56bdfa4..aa9c901 100644 --- a/home/dot_config/nvim/lua/plugins/lang/init.lua +++ b/home/dot_config/nvim/lua/plugins/lang/init.lua @@ -8,6 +8,7 @@ return { { import = "plugins.lang.lua" }, { import = "plugins.lang.verilog" }, { import = "plugins.lang.treesitter" }, + { import = "plugins.lang.neorg" }, { import = "plugins.mod.trouble-nvim" }, { import = "plugins.mod.conform-nvim" }, } diff --git a/home/dot_config/nvim/lua/plugins/lang/markdown/obsidian-nvim.lua b/home/dot_config/nvim/lua/plugins/lang/markdown/obsidian-nvim.lua index e340cd0..68228a1 100644 --- a/home/dot_config/nvim/lua/plugins/lang/markdown/obsidian-nvim.lua +++ b/home/dot_config/nvim/lua/plugins/lang/markdown/obsidian-nvim.lua @@ -75,7 +75,7 @@ return { enable = false, }, templates = { - folder = "_Global/LuaTemplates", + folder = "90 - System/LuaTemplates", date_format = "%Y-%m-%d", time_format = "%H:%M", substitutions = { @@ -87,51 +87,71 @@ return { }, ---@return table frontmatter = { + -- Update frontmatter in order func = function(note) - -- Add the title of the note as an alias. - if note.title then - note:add_alias(note.title) - end + local meta = note.metadata or {} - -- Force to use UUID as the note id. - local note_id = uuid() - if note.metadata.id == nil then + -- ID: Rule: Generate if not present, never overwrite + local note_id = meta.uuid + if note_id == nil then note_id = uuid() - else - note_id = note.metadata.id end - local out = { - -- id = note_id, - aliases = note.aliases, - tags = note.tags, - title = note.id, - -- date = os.date("%Y-%m-%dT00:00:00"), - -- mtime = os.date("%Y-%m-%dT%H:%M:%S"), - } + -- Aliases: Always ensure filename is in aliases + local aliases = meta.aliases or note.aliases or {} + if type(aliases) ~= "table" then + aliases = { aliases } + end - -- `note.metadata` contains any manually added fields in the frontmatter. - -- So here we just make sure those fields are kept in the frontmatter. - if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then - for k, v in pairs(note.metadata) do - out[k] = v + if note.title and note.id and note.title ~= note.id then + local is_duplicate = false + for _, v in pairs(aliases) do + if v == note.id then + is_duplicate = true + break + end + end + + if not is_duplicate then + table.insert(aliases, note.id) end end - -- Force to update mtime. + local out = { + uuid = note_id, + aliases = aliases, + tags = meta.tags or note.tags, + title = meta.title or note.id, -- 优先保留 metadata 中的 title,否则用 note.id + } + + -- 5. 合并其他自定义 Metadata + -- 使用 vim.tbl_extend "force" 策略: + -- 将 current_metadata 中的所有字段强制合并到 out 中。 + -- 这样可以确保:所有手动添加的字段(如 author, category 等)都不会丢失。 + -- 同时,如果 metadata 里本来就有 id,这里会再次确认覆盖,保证一致性。 + out = vim.tbl_extend("force", out, meta) + + -- 6. 强制更新 mtime (这是你希望每次保存都更新的) out.mtime = os.date("%Y-%m-%dT%H:%M:%S") + + -- 7. 保持 date (创建时间) 不变 + -- 如果 metadata 里没有 date,也许你想补一个?如果不需要,可以删掉下面这行 + if out.date == nil then + out.date = os.date("%Y-%m-%dT%H:%M:%S") + end + return out end, }, daily_notes = { - folder = "_Global/Periodic", + folder = "00 - Journal/Daily", date_format = "%Y-%m-%d", - default_tags = { "daily" }, + -- default_tags = { "daily" }, template = nil, }, -- see below for full list of options 👇 attachments = { - img_folder = "_Global/Assets", + img_folder = "90 - System/Assets", img_name_func = function() return string.format("%s-", os.time()) end, diff --git a/home/dot_config/nvim/lua/plugins/lang/neorg.lua b/home/dot_config/nvim/lua/plugins/lang/neorg.lua new file mode 100644 index 0000000..1600c1a --- /dev/null +++ b/home/dot_config/nvim/lua/plugins/lang/neorg.lua @@ -0,0 +1,65 @@ +return { + -- { + -- "benlubas/neorg-interim-ls", + -- }, + -- { + -- "nvim-neorg/neorg", + -- lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default + -- + -- version = "*", -- Pin Neorg to the latest stable release + -- config = true, + -- options = { + -- load = { + -- ["core.defaults"] = {}, -- Load all the default modules + -- ["core.concealer"] = {}, -- Allows for use of icons + -- ["core.norg.dirman"] = { -- Manages Neorg workspaces + -- config = { + -- workspaces = { + -- notes = "~/OrgFiles", + -- }, + -- }, + -- default_workspace = "notes", + -- }, + -- ["core.neorgcmd"] = {}, + -- ["core.ui.calendar"] = {}, + -- ["core.looing-glass"] = {}, + -- ["core.latex.renderer"] = {}, + -- ["core.completion"] = { + -- config = { + -- engine = { + -- module_name = "external.lsp-completion", + -- }, + -- }, + -- }, + -- ["external.interim-ls"] = { + -- config = { + -- -- default config shown + -- completion_provider = { + -- -- Enable or disable the completion provider + -- enable = true, + -- + -- -- Show file contents as documentation when you complete a file name + -- documentation = true, + -- + -- -- Try to complete categories provided by Neorg Query. Requires `benlubas/neorg-query` + -- categories = false, + -- + -- -- suggest heading completions from the given file for `{@x|}` where `|` is your cursor + -- -- and `x` is an alphanumeric character. `{@name}` expands to `[name]{:$/people:# name}` + -- people = { + -- enable = false, + -- + -- -- path to the file you're like to use with the `{@x` syntax, relative to the + -- -- workspace root, without the `.norg` at the end. + -- -- ie. `folder/people` results in searching `$/folder/people.norg` for headings. + -- -- Note that this will change with your workspace, so it fails silently if the file + -- -- doesn't exist + -- path = "people", + -- }, + -- }, + -- }, + -- }, + -- }, + -- }, + -- }, +} diff --git a/home/dot_config/nvim/lua/plugins/lang/treesitter.lua b/home/dot_config/nvim/lua/plugins/lang/treesitter.lua index b4c40f9..37c60c1 100644 --- a/home/dot_config/nvim/lua/plugins/lang/treesitter.lua +++ b/home/dot_config/nvim/lua/plugins/lang/treesitter.lua @@ -12,12 +12,12 @@ return { "BufReadPre", }, opts = { - ensure_installed = { "c", "lua", "vim", "vimdoc", "markdown", "markdown_inline", "latex" }, + ensure_installed = { "c", "lua", "vim", "vimdoc", "markdown" }, highlight = { enable = true }, indent = { enable = true }, }, - config = function() - require('nvim-treesitter.configs').setup({ highlight = { enable = true } }) - end + config = function(_, opts) + require("nvim-treesitter.configs").setup(opts) + end, }, } diff --git a/home/dot_config/nvim/lua/plugins/mod/copilot-lua.lua b/home/dot_config/nvim/lua/plugins/mod/copilot-lua.lua index 4714056..35b88cb 100644 --- a/home/dot_config/nvim/lua/plugins/mod/copilot-lua.lua +++ b/home/dot_config/nvim/lua/plugins/mod/copilot-lua.lua @@ -3,18 +3,19 @@ return { cmd = "Copilot", build = ":Copilot auth", event = "BufReadPost", + enabled = vim.g.ai_enabled, opts = { suggestion = { - enabled = not vim.g.ai_cmp, auto_trigger = true, - hide_during_completion = vim.g.ai_cmp, + -- hide_during_completion = vim.g.ai_cmp, keymap = { accept = "", -- Inspired from zed next = "", prev = "", }, }, - panel = { enabled = true }, + -- Disable to open Copilot panel + panel = { enabled = false }, filetypes = { markdown = true, help = true, diff --git a/home/dot_config/nvim/lua/plugins/mod/snacks-nvim.lua b/home/dot_config/nvim/lua/plugins/mod/snacks-nvim.lua index fcd3160..68c847e 100644 --- a/home/dot_config/nvim/lua/plugins/mod/snacks-nvim.lua +++ b/home/dot_config/nvim/lua/plugins/mod/snacks-nvim.lua @@ -86,6 +86,10 @@ return { enabled = true, -- See: ../lang/markdown/obsidian-nvim.lua img_dirs = { "90 - System/Assets" }, + math = { + enabled = true, + font_size = "small", + }, }, }, keys = { diff --git a/nixcfgs/flake.lock b/nixcfgs/flake.lock index 9f74200..7ea3e94 100644 --- a/nixcfgs/flake.lock +++ b/nixcfgs/flake.lock @@ -827,11 +827,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1764405884, - "narHash": "sha256-TnvBRPmcpcyinvLgsitHS7w5soSa6yNBfRYEI2TK1Ts=", + "lastModified": 1764488513, + "narHash": "sha256-xBUnv+ndZxRbY9mYSPEP0afaZRUVXDFcJx0WMD4ypfs=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "10aae4855ee275f7d80d85f4328c24265fb20f1f", + "rev": "9e3bbd170669d10846bae68d23dabef11832f8f2", "type": "github" }, "original": { @@ -860,11 +860,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1764399944, - "narHash": "sha256-FC9eYtSmplgxllCX4/3hJq5J3sXWKLSc7at8ZUxycVw=", + "lastModified": 1764485473, + "narHash": "sha256-RlGEcuZFB/IdvYLrYsf0RpgvNtCMyIuBLt3lS+GZvP8=", "owner": "YaLTeR", "repo": "niri", - "rev": "b35bcae35b3f9665043c335e55ed5828af77db85", + "rev": "311ca6b5da19f5acd7d3e481620de57240ce8f7c", "type": "github" }, "original": { diff --git a/nixcfgs/flake.nix b/nixcfgs/flake.nix index 9a07804..17a9f87 100644 --- a/nixcfgs/flake.nix +++ b/nixcfgs/flake.nix @@ -85,6 +85,7 @@ ... } @ inputs: let overlays = [ + niri-flake.overlays.niri nur.overlays.default firefox-addons.overlays.default (final: prev: { diff --git a/nixcfgs/users/js0ny/packages/gui.nix b/nixcfgs/users/js0ny/packages/gui.nix index 65ddfad..d556ba7 100644 --- a/nixcfgs/users/js0ny/packages/gui.nix +++ b/nixcfgs/users/js0ny/packages/gui.nix @@ -125,6 +125,7 @@ in { prismlauncher obsidian file-roller + siyuan ] ++ (mkFcitxIM [ pkgs.neovim-qt diff --git a/nixcfgs/users/js0ny/programs/desktop/gnome/default.nix b/nixcfgs/users/js0ny/programs/desktop/gnome/default.nix index ecc312e..5670985 100644 --- a/nixcfgs/users/js0ny/programs/desktop/gnome/default.nix +++ b/nixcfgs/users/js0ny/programs/desktop/gnome/default.nix @@ -4,16 +4,11 @@ lib, ... }: { - home.sessionVariables = { - QT_STYLE_OVERRIDE = "adwaita"; - }; home.packages = with pkgs; [ gnome-tweaks sushi dconf-editor gnome-menus - adwaita-qt - adwaita-qt6 showtime gobject-introspection gnomeExtensions.dash-to-dock @@ -50,7 +45,6 @@ icon-theme = "${config.my.desktop.style.iconTheme.dark}"; accent-color = "pink"; show-battery-percentage = true; - cursor-theme = "Adwaita"; }; "org/gnome/epiphany" = { ask-for-default = false; @@ -167,6 +161,4 @@ ramunit = "perc"; }; }; - - # qt.style.name = "adwaita"; } diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland/keymaps.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland/keymaps.nix index eebc598..3efe89c 100644 --- a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland/keymaps.nix +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland/keymaps.nix @@ -26,8 +26,8 @@ in { "$mainMod SHIFT, B, exec, firefox --private-window" "$mainMod, A, exec, kitty --class=kitty-terminal-popup -e aichat --session" "$mainMod SHIFT, A, exec, ${lib.getExe my.launch-or-focus} 'Cherry Studio' 'cherry-studio'" - "$mainMod, T, exec, kitty --class=kitty-terminal-popup" - "$mainMod SHIFT, T, exec, kitty --class=kitty-terminal-popup --working-directory='${config.home.homeDirectory}/.config/shells/nohist' -e nix develop" + "$mainMod ALT, return, exec, kitty --class=kitty-terminal-popup" + "$mainMod ALT SHIFT, return, exec, kitty --class=kitty-terminal-popup --working-directory='${config.home.homeDirectory}/.config/shells/nohist' -e nix develop" "$mainMod, O, exec, ${lib.getExe my.launch-or-focus} 'obsidian' 'obsidian'" "$mainMod, Q, killactive" ''$mainMod SHIFT, F, exec, hyprctl --batch "dispatch togglefloating ; dispatch resizeactive exact 1440 810 ; dispatch centerwindow 1;"'' @@ -36,7 +36,7 @@ in { "$mainMod, Apostrophe, exec, EDITOR_MINIMAL=1 ${term} -o close_on_child_death=yes --class=${term}-terminal-popup -e edit-clipboard --minimal" "$mainMod, V, exec, ${launcher} -m clipboard" "alt, space, exec, ${launcher} -m desktopapplications" - "$mainMod, E, exec, ${explorer}" + "$mainMod, E, exec, ${lib.getExe my.launch-or-focus} org.kde.dolphin ${explorer}" "$mainMod SHIFT, E, exec, ${term} -e ${explorerTerm}" "CTRL ALT, DELETE, exec, uwsm exit" "$mainMod, P, pseudo" diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprlock.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprlock.nix new file mode 100644 index 0000000..c501c04 --- /dev/null +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprlock.nix @@ -0,0 +1,47 @@ +{lib, ...}: { + programs.hyprlock = { + enable = true; + settings = { + general = { + hide_cursor = true; + ignore_empty_input = true; + }; + + animations = { + enabled = true; + fade_in = { + duration = 300; + bezier = "easeOutQuint"; + }; + fade_out = { + duration = 300; + bezier = "easeOutQuint"; + }; + }; + + background = lib.mkForce [ + { + path = "screenshot"; + blur_passes = 3; + blur_size = 8; + } + ]; + + # input-field = [ + # { + # size = "200, 50"; + # position = "0, -80"; + # monitor = ""; + # dots_center = true; + # fade_on_empty = false; + # font_color = "rgb(202, 211, 245)"; + # inner_color = "rgb(91, 96, 120)"; + # outer_color = "rgb(24, 25, 38)"; + # outline_thickness = 5; + # # placeholder_text = '\'Password...'\'; + # shadow_passes = 2; + # } + # ]; + }; + }; +} diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/default.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/default.nix index 89e76a5..1040a62 100644 --- a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/default.nix +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/default.nix @@ -7,27 +7,25 @@ programs.niri = { enable = true; - package = pkgs.niri; + package = pkgs.niri-unstable; settings = { prefer-no-csd = true; screenshot-path = "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"; workspaces = { - "master" = {}; - "project" = {}; - "remote" = {}; - "info" = {}; - "bg" = {}; + "1-master" = {}; + "2-project" = {}; + "3-alt" = {}; + "4-info" = {}; + "5-bg" = {}; }; spawn-at-startup = [ - {argv = ["waybar"];} - {argv = ["dunst"];} {argv = ["fcitx5"];} {argv = ["swww-daemon"];} # polkit/portal helpers - {argv = ["${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent"];} + # {argv = ["${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent"];} ]; input = { diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/keymaps.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/keymaps.nix index caa3dec..0155084 100644 --- a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/keymaps.nix +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/keymaps.nix @@ -21,7 +21,7 @@ in { "Mod+B".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "firefox" "firefox"; "Mod+Shift+B".hotkey-overlay.title = "Launch web browser in private mode"; "Mod+Shift+B".action = spawn "firefox" "--private-window"; - "Mod+A".action = spawn-sh "${term} --class=terminal-popup -e aichat --session"; + "Mod+A".action = spawn-sh "${term} --class=kitty-terminal-popup -e aichat --session"; "Mod+Shift+A".hotkey-overlay.title = "Focus or launch CherryStudio (AI assistant)"; "Mod+Shift+A".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "CherryStudio" "cherry-studio"; "Mod+O".hotkey-overlay.title = "Focus or launch Obsidian"; @@ -29,18 +29,21 @@ in { # TODO: Change "org.kde.dolphin" to a more generic explorer app id via config.currentUser "Mod+E".hotkey-overlay.title = "Focus or launch file explorer"; "Mod+E".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "org.kde.dolphin" "dolphin"; - "Mod+T".action = spawn-sh "${term} --class=terminal-popup"; - "Mod+Shift+T".action = spawn-sh "${term} --class=${term}-terminal-popup --working-directory='${config.home.homeDirectory}/.config/shells/nohist' -e nix develop"; + "Mod+Alt+Return".action = spawn-sh "${term} --class=kitty-terminal-popup"; + "Mod+Shift+Alt+Return".action = spawn-sh "${term} --class=kitty--terminal-popup --working-directory='${config.home.homeDirectory}/.config/shells/nohist' -e nix develop"; - "Mod+Semicolon".action = spawn "neovide" "${config.home.homeDirectory}/Atelier"; + "Mod+Shift+Return".action = spawn "neovide" "${config.home.homeDirectory}/Atelier"; "Mod+Apostrophe".action = - spawn-sh "EDITOR_MINIMAL=1 ${term} -o close_on_child_death=yes --class=terminal-popup -e edit-clipboard --minimal"; + spawn-sh "EDITOR_MINIMAL=1 ${term} -o close_on_child_death=yes --class=kitty-terminal-popup -e edit-clipboard --minimal"; "Mod+Shift+Slash".action = show-hotkey-overlay; "Mod+Return".hotkey-overlay.title = "Open a Terminal: ${term}"; "Mod+Return".action = spawn "${term}"; + "Mod+Alt+i".hotkey-overlay.title = "Hyprlock"; + "Mod+Alt+i".action = spawn "hyprlock"; + "Mod+D".hotkey-overlay.title = "Run an Application: rofi"; "Mod+D".action = spawn "${launcher}" "-m" "desktopapplications"; @@ -177,24 +180,24 @@ in { "Mod+Ctrl+Shift+WheelScrollDown".action = move-column-right; "Mod+Ctrl+Shift+WheelScrollUp".action = move-column-left; - "Mod+1".action = focus-workspace "master"; - "Mod+2".action = focus-workspace "project"; - "Mod+3".action = focus-workspace "remote"; - "Mod+4".action = focus-workspace "info"; - "Mod+5".action = focus-workspace 6; - "Mod+6".action = focus-workspace 7; - "Mod+7".action = focus-workspace 8; - "Mod+8".action = focus-workspace 9; - "Mod+9".action = focus-workspace "bg"; - "Mod+Shift+1".action.move-column-to-workspace = "master"; - "Mod+Shift+2".action.move-column-to-workspace = "project"; - "Mod+Shift+3".action.move-column-to-workspace = "remote"; - "Mod+Shift+4".action.move-column-to-workspace = "info"; - "Mod+Shift+5".action.move-column-to-workspace = 6; - "Mod+Shift+6".action.move-column-to-workspace = 7; - "Mod+Shift+7".action.move-column-to-workspace = 8; - "Mod+Shift+8".action.move-column-to-workspace = 9; - "Mod+Shift+9".action.move-column-to-workspace = "bg"; + "Mod+1".action = focus-workspace "1-master"; + "Mod+2".action = focus-workspace "2-project"; + "Mod+3".action = focus-workspace "3-alt"; + "Mod+4".action = focus-workspace "4-info"; + "Mod+5".action = focus-workspace "5-bg"; + "Mod+6".action = focus-workspace 6; + "Mod+7".action = focus-workspace 7; + "Mod+8".action = focus-workspace 8; + "Mod+9".action = focus-workspace 9; + "Mod+Shift+1".action.move-column-to-workspace = "1-master"; + "Mod+Shift+2".action.move-column-to-workspace = "2-project"; + "Mod+Shift+3".action.move-column-to-workspace = "3-alt"; + "Mod+Shift+4".action.move-column-to-workspace = "4-info"; + "Mod+Shift+5".action.move-column-to-workspace = "5-bg"; + "Mod+Shift+6".action.move-column-to-workspace = 6; + "Mod+Shift+7".action.move-column-to-workspace = 7; + "Mod+Shift+8".action.move-column-to-workspace = 8; + "Mod+Shift+9".action.move-column-to-workspace = 9; "Mod+BracketLeft".action = consume-or-expel-window-left; "Mod+BracketRight".action = consume-or-expel-window-right; diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/window-rules.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/window-rules.nix index f2b8755..b767690 100644 --- a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/window-rules.nix +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/window-rules.nix @@ -121,7 +121,7 @@ matches = [ {app-id = "^firefox$";} ]; - open-on-workspace = "master"; + open-on-workspace = "1-master"; } { matches = [ @@ -130,7 +130,7 @@ {app-id = "^Vitis IDE$";} {app-id = "^Vivado$";} ]; - open-on-workspace = "project"; + open-on-workspace = "2-project"; } { matches = [ @@ -139,7 +139,7 @@ {app-id = "^\.virt-manager-wrapped$";} {title = "^🌐 ssh.*";} ]; - open-on-workspace = "remote"; + open-on-workspace = "3-alt"; } { matches = [ @@ -151,14 +151,14 @@ {app-id = "^discord$";} {app-id = "^thunderbird$";} ]; - open-on-workspace = "info"; + open-on-workspace = "4-info"; } { matches = [ {app-id = "^feishin$";} {app-id = "^Cider$";} ]; - open-on-workspace = "bg"; + open-on-workspace = "5-bg"; } ]; }; diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/packages.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/packages.nix index 1a6e799..9971846 100644 --- a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/packages.nix +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/packages.nix @@ -37,8 +37,11 @@ in { ./waybar ./swww.nix ./kanshi.nix - ./swaylock.nix + # ./swaylock.nix ./polkit.nix + ./hyprlock.nix + ./swayidle.nix + ./sunsetr.nix ]; home.packages = with pkgs; [ swayidle # Screensaver diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/sunsetr.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/sunsetr.nix new file mode 100644 index 0000000..a12125a --- /dev/null +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/sunsetr.nix @@ -0,0 +1,53 @@ +{pkgs, ...}: { + systemd.user.services.sunsetr = { + Unit = { + Description = "Sunsetr blue-light filtering"; + PartOf = ["graphical-session.target"]; + After = ["graphical-session.target"]; + }; + + Service = { + Type = "simple"; + ExecStart = "${pkgs.sunsetr}/bin/sunsetr -b"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + + Install = { + WantedBy = ["graphical-session.target"]; + }; + }; + + xdg.configFile."sunsetr/sunsetr.toml".text = '' + #[Backend] + backend = "auto" # Backend to use: "auto", "hyprland", "hyprsunset" or "wayland" + transition_mode = "geo" # Select: "geo", "finish_by", "start_at", "center", "static" + + #[Smoothing] + smoothing = true # Enable smooth transitions during startup and exit + startup_duration = 0.5 # Duration of smooth startup in seconds (0.1-60 | 0 = instant) + shutdown_duration = 0.5 # Duration of smooth shutdown in seconds (0.1-60 | 0 = instant) + adaptive_interval = 1 # Adaptive interval base for smooth transitions (1-1000)ms + + #[Time-based config] + night_temp = 3300 # Color temperature during night (1000-20000) Kelvin + day_temp = 6500 # Color temperature during day (1000-20000) Kelvin + night_gamma = 90 # Gamma percentage for night (10-200%) + day_gamma = 100 # Gamma percentage for day (10-200%) + update_interval = 60 # Update frequency during transitions in seconds (10-300) + + #[Static config] + static_temp = 6500 # Color temperature for static mode (1000-20000) Kelvin + static_gamma = 100 # Gamma percentage for static mode (10-200%) + + #[Manual transitions] + sunset = "19:00:00" # Time for manual sunset calculations (HH:MM:SS) + sunrise = "06:00:00" # Time for manual sunrise calculations (HH:MM:SS) + transition_duration = 45 # Transition duration in minutes (5-120) + + #[Geolocation] + latitude = 55.950000 # Geographic latitude (auto-detected on first run) + longitude = -3.200000 # Geographic longitude (use 'sunsetr geo' to change) + ''; +} diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/swayidle.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/swayidle.nix new file mode 100644 index 0000000..b72e80a --- /dev/null +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/swayidle.nix @@ -0,0 +1,15 @@ +{pkgs, ...}: { + services.swayidle = { + enable = true; + timeouts = [ + { + timeout = 300; + command = "${pkgs.hyprlock}/bin/hyprlock"; + } + { + timeout = 600; + command = "${pkgs.systemd}/bin/systemctl suspend"; + } + ]; + }; +} diff --git a/nixcfgs/users/js0ny/programs/emacs.nix b/nixcfgs/users/js0ny/programs/emacs.nix index 9947b02..25bbdca 100644 --- a/nixcfgs/users/js0ny/programs/emacs.nix +++ b/nixcfgs/users/js0ny/programs/emacs.nix @@ -21,6 +21,10 @@ flycheck highlight-indent-guides magit + elfeed + elfeed-org + olivetti + org-modern ]; }; # TODO: tdlib version is too high diff --git a/nixcfgs/users/js0ny/programs/nvim.nix b/nixcfgs/users/js0ny/programs/nvim.nix index 6158c6f..6248f5e 100644 --- a/nixcfgs/users/js0ny/programs/nvim.nix +++ b/nixcfgs/users/js0ny/programs/nvim.nix @@ -17,6 +17,11 @@ in { nodejs-slim_24 # for copilot-lua lua-language-server vimPlugins.nvim-treesitter-parsers.diff + # Dependency of snacks.image + tectonic + vimPlugins.nvim-treesitter-parsers.latex + mermaid-cli + ghostscript ]; }; # home.packages = with pkgs; [lua-language-server]; diff --git a/nixcfgs/users/js0ny/programs/shell/nu.nix b/nixcfgs/users/js0ny/programs/shell/nu.nix index a0cc54c..baa4420 100644 --- a/nixcfgs/users/js0ny/programs/shell/nu.nix +++ b/nixcfgs/users/js0ny/programs/shell/nu.nix @@ -5,7 +5,7 @@ "la" = "ls -a"; "lt" = "lsd --tree"; "l" = "ls -la"; - "ll" = "ls -lh"; + "ll" = "ls -l"; }; extraConfig = '' $env.config.show_banner = false