From 0051a163c37a5053c01dc71f13ca31ee43a4eefa Mon Sep 17 00:00:00 2001 From: js0ny Date: Sat, 27 Sep 2025 02:25:06 +0100 Subject: [PATCH] breaking: Remove setup script and use chezmoi --- .chezmoiignore | 13 + .just.d/check.just | 45 --- .just.d/cmds.just | 26 -- .just.d/common.just | 52 --- .just.d/linux.just | 61 ---- .just.d/misc.just | 15 - .just.d/tools.just | 69 ---- .just.d/vars.just | 42 --- Justfile | 15 - bootstrap/components/emacs.sh | 11 - bootstrap/components/mocha-port.bash | 231 ------------- bootstrap/components/mocha_port.fish | 43 --- bootstrap/components/pwsh.ps1 | 3 - bootstrap/components/requirements.txt | 112 ------- bootstrap/components/rime.sh | 17 - bootstrap/components/symlinks.bash | 110 ------ bootstrap/components/zsh.sh | 28 -- bootstrap/linux/appman.bash | 12 - bootstrap/linux/chromium-flags.bash | 71 ---- bootstrap/linux/chromium-flags.hypr.bash | 71 ---- bootstrap/linux/electron_flag_append.py | 44 --- bootstrap/linux/main.bash | 193 ----------- bootstrap/linux/symlinks.bash | 29 -- bootstrap/linux/wsl.bash | 1 - bootstrap/macOS/Brewfile | 150 --------- bootstrap/macOS/duti.zsh | 74 ---- bootstrap/macOS/main.zsh | 106 ------ bootstrap/macOS/plist.zsh | 37 -- bootstrap/macOS/symlinks.zsh | 29 -- bootstrap/setup.ps1 | 223 ------------- bootstrap/setup.sh | 28 -- bootstrap/win/Defender.ps1 | 23 -- bootstrap/win/Environments.ps1 | 93 ------ bootstrap/win/Registry.ps1 | 11 - bootstrap/win/Tasks.ps1 | 21 -- bootstrap/win/symlinks.ps1 | 78 ----- {tools => dot_config}/doom/beancount.el | 0 {tools => dot_config}/doom/calendar.el | 0 {tools => dot_config}/doom/config.el | 0 dot_config/doom/dot_custom.el | 13 + .../doom/dot_gitignore | 0 {tools => dot_config}/doom/evil.el | 0 {tools => dot_config}/doom/init.el | 0 .../lisp/org-pomodoro-music-controller.el | 0 .../lisp/org-pomodoro-telegram-notifier.el | 0 {tools => dot_config}/doom/org.el | 0 {tools => dot_config}/doom/packages.el | 0 .../doom/snippets/org-mode/align-math | 0 .../doom/snippets/org-mode/display-math | 0 .../doom/snippets/org-mode/inline-math | 0 .../doom/snippets/org-mode/limit | 0 .../doom/snippets/org-mode/summation | 0 .../doom/snippets/org-mode/unnumbered | 0 {tools => dot_config}/doom/telega.el | 0 {tools => dot_config}/doom/treemacs.el | 0 dot_config/fish/completions/.keep | 0 {tools => dot_config}/fish/conf.d/0init.fish | 0 {tools => dot_config}/fish/conf.d/alias.fish | 0 .../fish/conf.d/colorscheme.fish | 0 {tools => dot_config}/fish/conf.d/keymap.fish | 0 .../fish/conf.d/keymap/+colemak.fish | 0 {tools => dot_config}/fish/conf.d/navi.fish | 0 {tools => dot_config}/fish/conf.d/prompt.fish | 0 .../fish/conf.d/winterop.fish | 0 {tools => dot_config}/fish/config.fish | 0 .../fish/dot_gitignore | 0 dot_config/fish/functions/.keep | 0 dot_config/fish/private_fish_variables | 39 +++ {tools => dot_config}/fish/readme.md | 0 .../fish/themes/Catppuccin Latte.theme | 0 .../fish/themes/Catppuccin Mocha.theme | 0 .../fish/themes/Rosé Pine Dawn.theme | 0 .../kitty/dark-theme.auto.conf | 0 {tools => dot_config}/kitty/kitty.conf | 0 .../kitty/light-theme.auto.conf | 0 {tools => dot_config}/kitty/window.py | 0 .../nvim/dot_editorconfig | 0 {tools => dot_config}/nvim/init.lua | 0 dot_config/nvim/lazy-lock.json | 53 +++ {tools => dot_config}/nvim/lsp/bashls.lua | 0 {tools => dot_config}/nvim/lsp/beancount.lua | 0 {tools => dot_config}/nvim/lsp/clangd.lua | 0 {tools => dot_config}/nvim/lsp/gopls.lua | 0 {tools => dot_config}/nvim/lsp/jdtls.lua | 0 {tools => dot_config}/nvim/lsp/jsonls.lua | 0 {tools => dot_config}/nvim/lsp/luals.lua | 0 .../nvim/lsp/markdown_oxide.lua | 0 {tools => dot_config}/nvim/lsp/pyright.lua | 0 .../nvim/lsp/rust_analyzer.lua | 0 {tools => dot_config}/nvim/lsp/taplo.lua | 0 {tools => dot_config}/nvim/lsp/vimls.lua | 0 {tools => dot_config}/nvim/lsp/yamlls.lua | 0 .../nvim/lua/config/colors.lua | 0 .../nvim/lua/config/colorscheme.lua | 0 .../nvim/lua/config/diagnostics.lua | 0 .../nvim/lua/config/icons.lua | 0 .../nvim/lua/config/keymaps.lua | 0 .../nvim/lua/config/migration.lua | 0 .../nvim/lua/config/options.lua | 0 .../nvim/lua/config/plugins.lua | 0 .../nvim/lua/config/servers.lua | 0 .../nvim/lua/config/vscode.lua | 0 .../nvim/lua/keymaps/basic.lua | 0 .../nvim/lua/keymaps/buffer.lua | 0 .../nvim/lua/keymaps/init.lua | 0 .../nvim/lua/keymaps/language.lua | 0 .../nvim/lua/keymaps/leaders.bak | 0 .../nvim/lua/keymaps/leaders.lua | 0 .../nvim/lua/keymaps/lspkeys.lua | 0 .../nvim/lua/keymaps/modifier.lua | 0 .../nvim/lua/keymaps/nvim-tree.lua | 0 .../nvim/lua/keymaps/user-command.lua | 0 .../nvim/lua/keymaps/utils.lua | 0 .../nvim/lua/keymaps/visual-multi.lua | 0 .../nvim/lua/keymaps/which.lua | 0 .../nvim/lua/plugins/appearance.lua | 0 .../nvim/lua/plugins/completion.lua | 0 .../nvim/lua/plugins/dap.lua | 0 .../nvim/lua/plugins/edit.lua | 0 .../nvim/lua/plugins/fileutils.lua | 0 .../nvim/lua/plugins/init.lua | 0 .../nvim/lua/plugins/lang/beancount.lua | 0 .../nvim/lua/plugins/lang/init.lua | 0 .../nvim/lua/plugins/lang/just.lua | 0 .../nvim/lua/plugins/lang/lua.lua | 0 .../nvim/lua/plugins/lang/markdown/init.lua | 0 .../plugins/lang/markdown/markview.lua.bak | 0 .../plugins/lang/markdown/obsidian-nvim.lua | 0 .../plugins/lang/markdown/render-markdown.lua | 0 .../nvim/lua/plugins/lang/org.lua | 0 .../nvim/lua/plugins/lang/tex.lua | 0 .../nvim/lua/plugins/lang/treesitter.lua | 0 .../nvim/lua/plugins/lang/typst.lua | 0 .../nvim/lua/plugins/lazy-nvim.lua | 0 .../nvim/lua/plugins/misc.lua | 0 .../nvim/lua/plugins/mod/alpha-nvim.lua | 0 .../nvim/lua/plugins/mod/autopairs.lua | 0 .../nvim/lua/plugins/mod/avante-nvim.lua | 0 .../nvim/lua/plugins/mod/blink-cmp.lua | 0 .../nvim/lua/plugins/mod/bufferline.lua | 0 .../nvim/lua/plugins/mod/conform-nvim.lua | 0 .../nvim/lua/plugins/mod/copilot-lua.lua | 0 .../nvim/lua/plugins/mod/fzf.lua | 0 .../nvim/lua/plugins/mod/hover-nvim.lua | 0 .../nvim/lua/plugins/mod/image-nvim.lua | 0 .../nvim/lua/plugins/mod/img-clip.lua | 0 .../lua/plugins/mod/lualine/components.lua | 0 .../nvim/lua/plugins/mod/lualine/init.lua | 0 .../nvim/lua/plugins/mod/mc.lua | 0 .../nvim/lua/plugins/mod/neo-tree.lua | 0 .../nvim/lua/plugins/mod/nvim-cmp.lua | 0 .../nvim/lua/plugins/mod/nvim-lspconfig.lua | 0 .../nvim/lua/plugins/mod/nvim-tree.lua | 0 .../nvim/lua/plugins/mod/snacks-nvim.lua | 0 .../nvim/lua/plugins/mod/telescope.lua | 0 .../nvim/lua/plugins/mod/toggleterm.lua | 0 .../nvim/lua/plugins/mod/trouble-nvim.lua | 0 .../nvim/lua/plugins/mod/which-keys-nvim.lua | 0 {tools => dot_config}/nvim/readme.md | 0 {tools => dot_config}/nvim/stylua.toml | 0 {common => dot_config/rtorrent}/rtorrent.rc | 0 {tools => dot_config}/tmux/+colemak.tmux | 0 {tools => dot_config}/tmux/+qwerty.tmux | 0 {tools => dot_config}/tmux/tmux.conf | 0 tools/emacs.d/.gitignore | 30 -- tools/emacs.d/early-init.el | 1 - tools/emacs.d/init.el | 65 ---- tools/emacs.d/lisp/init-ai.el | 14 - tools/emacs.d/lisp/init-appearance.el | 110 ------ tools/emacs.d/lisp/init-basic.el | 81 ----- tools/emacs.d/lisp/init-beancount.el | 39 --- tools/emacs.d/lisp/init-calendar.el | 99 ------ tools/emacs.d/lisp/init-counsel.el | 31 -- tools/emacs.d/lisp/init-edit.el | 102 ------ tools/emacs.d/lisp/init-evil.el | 93 ------ tools/emacs.d/lisp/init-file.el | 87 ----- tools/emacs.d/lisp/init-keymaps.el | 8 - tools/emacs.d/lisp/init-latex.el | 50 --- tools/emacs.d/lisp/init-markdown.el | 12 - tools/emacs.d/lisp/init-org.el | 315 ------------------ tools/emacs.d/lisp/init-package.el | 68 ---- tools/emacs.d/lisp/init-scratch.el | 5 - tools/emacs.d/lisp/init-treesitter.el | 28 -- tools/emacs.d/lisp/init-wayland.el | 11 - tools/emacs.d/lisp/init-writer.el | 8 - tools/emacs.d/site-lisp | 1 - tools/emacs.d/snippets/org-mode/begin_quote | 7 - tools/emacs.d/snippets/org-mode/begin_src | 8 - .../emacs.d/snippets/org-mode/begin_src_elisp | 8 - tools/nvim/lua/plugins/mod/dap-setup.lua | 1 - 190 files changed, 118 insertions(+), 3456 deletions(-) create mode 100644 .chezmoiignore delete mode 100644 .just.d/check.just delete mode 100644 .just.d/cmds.just delete mode 100644 .just.d/common.just delete mode 100644 .just.d/linux.just delete mode 100644 .just.d/misc.just delete mode 100644 .just.d/tools.just delete mode 100644 .just.d/vars.just delete mode 100644 Justfile delete mode 100644 bootstrap/components/emacs.sh delete mode 100644 bootstrap/components/mocha-port.bash delete mode 100644 bootstrap/components/mocha_port.fish delete mode 100644 bootstrap/components/pwsh.ps1 delete mode 100644 bootstrap/components/requirements.txt delete mode 100644 bootstrap/components/rime.sh delete mode 100644 bootstrap/components/symlinks.bash delete mode 100644 bootstrap/components/zsh.sh delete mode 100644 bootstrap/linux/appman.bash delete mode 100755 bootstrap/linux/chromium-flags.bash delete mode 100755 bootstrap/linux/chromium-flags.hypr.bash delete mode 100644 bootstrap/linux/electron_flag_append.py delete mode 100644 bootstrap/linux/main.bash delete mode 100644 bootstrap/linux/symlinks.bash delete mode 100644 bootstrap/linux/wsl.bash delete mode 100644 bootstrap/macOS/Brewfile delete mode 100644 bootstrap/macOS/duti.zsh delete mode 100644 bootstrap/macOS/main.zsh delete mode 100644 bootstrap/macOS/plist.zsh delete mode 100644 bootstrap/macOS/symlinks.zsh delete mode 100644 bootstrap/setup.ps1 delete mode 100644 bootstrap/setup.sh delete mode 100644 bootstrap/win/Defender.ps1 delete mode 100644 bootstrap/win/Environments.ps1 delete mode 100644 bootstrap/win/Registry.ps1 delete mode 100644 bootstrap/win/Tasks.ps1 delete mode 100644 bootstrap/win/symlinks.ps1 rename {tools => dot_config}/doom/beancount.el (100%) rename {tools => dot_config}/doom/calendar.el (100%) rename {tools => dot_config}/doom/config.el (100%) create mode 100644 dot_config/doom/dot_custom.el rename tools/doom/.gitignore => dot_config/doom/dot_gitignore (100%) rename {tools => dot_config}/doom/evil.el (100%) rename {tools => dot_config}/doom/init.el (100%) rename {tools => dot_config}/doom/lisp/org-pomodoro-music-controller.el (100%) rename {tools => dot_config}/doom/lisp/org-pomodoro-telegram-notifier.el (100%) rename {tools => dot_config}/doom/org.el (100%) rename {tools => dot_config}/doom/packages.el (100%) rename {tools => dot_config}/doom/snippets/org-mode/align-math (100%) rename {tools => dot_config}/doom/snippets/org-mode/display-math (100%) rename {tools => dot_config}/doom/snippets/org-mode/inline-math (100%) rename {tools => dot_config}/doom/snippets/org-mode/limit (100%) rename {tools => dot_config}/doom/snippets/org-mode/summation (100%) rename {tools => dot_config}/doom/snippets/org-mode/unnumbered (100%) rename {tools => dot_config}/doom/telega.el (100%) rename {tools => dot_config}/doom/treemacs.el (100%) create mode 100644 dot_config/fish/completions/.keep rename {tools => dot_config}/fish/conf.d/0init.fish (100%) rename {tools => dot_config}/fish/conf.d/alias.fish (100%) rename {tools => dot_config}/fish/conf.d/colorscheme.fish (100%) rename {tools => dot_config}/fish/conf.d/keymap.fish (100%) rename {tools => dot_config}/fish/conf.d/keymap/+colemak.fish (100%) rename {tools => dot_config}/fish/conf.d/navi.fish (100%) rename {tools => dot_config}/fish/conf.d/prompt.fish (100%) rename {tools => dot_config}/fish/conf.d/winterop.fish (100%) rename {tools => dot_config}/fish/config.fish (100%) rename tools/fish/.gitignore => dot_config/fish/dot_gitignore (100%) create mode 100644 dot_config/fish/functions/.keep create mode 100644 dot_config/fish/private_fish_variables rename {tools => dot_config}/fish/readme.md (100%) rename {tools => dot_config}/fish/themes/Catppuccin Latte.theme (100%) rename {tools => dot_config}/fish/themes/Catppuccin Mocha.theme (100%) rename {tools => dot_config}/fish/themes/Rosé Pine Dawn.theme (100%) rename {tools => dot_config}/kitty/dark-theme.auto.conf (100%) rename {tools => dot_config}/kitty/kitty.conf (100%) rename {tools => dot_config}/kitty/light-theme.auto.conf (100%) rename {tools => dot_config}/kitty/window.py (100%) rename tools/nvim/.editorconfig => dot_config/nvim/dot_editorconfig (100%) rename {tools => dot_config}/nvim/init.lua (100%) create mode 100644 dot_config/nvim/lazy-lock.json rename {tools => dot_config}/nvim/lsp/bashls.lua (100%) rename {tools => dot_config}/nvim/lsp/beancount.lua (100%) rename {tools => dot_config}/nvim/lsp/clangd.lua (100%) rename {tools => dot_config}/nvim/lsp/gopls.lua (100%) rename {tools => dot_config}/nvim/lsp/jdtls.lua (100%) rename {tools => dot_config}/nvim/lsp/jsonls.lua (100%) rename {tools => dot_config}/nvim/lsp/luals.lua (100%) rename {tools => dot_config}/nvim/lsp/markdown_oxide.lua (100%) rename {tools => dot_config}/nvim/lsp/pyright.lua (100%) rename {tools => dot_config}/nvim/lsp/rust_analyzer.lua (100%) rename {tools => dot_config}/nvim/lsp/taplo.lua (100%) rename {tools => dot_config}/nvim/lsp/vimls.lua (100%) rename {tools => dot_config}/nvim/lsp/yamlls.lua (100%) rename {tools => dot_config}/nvim/lua/config/colors.lua (100%) rename {tools => dot_config}/nvim/lua/config/colorscheme.lua (100%) rename {tools => dot_config}/nvim/lua/config/diagnostics.lua (100%) rename {tools => dot_config}/nvim/lua/config/icons.lua (100%) rename {tools => dot_config}/nvim/lua/config/keymaps.lua (100%) rename {tools => dot_config}/nvim/lua/config/migration.lua (100%) rename {tools => dot_config}/nvim/lua/config/options.lua (100%) rename {tools => dot_config}/nvim/lua/config/plugins.lua (100%) rename {tools => dot_config}/nvim/lua/config/servers.lua (100%) rename {tools => dot_config}/nvim/lua/config/vscode.lua (100%) rename {tools => dot_config}/nvim/lua/keymaps/basic.lua (100%) rename {tools => dot_config}/nvim/lua/keymaps/buffer.lua (100%) rename {tools => dot_config}/nvim/lua/keymaps/init.lua (100%) rename {tools => dot_config}/nvim/lua/keymaps/language.lua (100%) rename {tools => dot_config}/nvim/lua/keymaps/leaders.bak (100%) rename {tools => dot_config}/nvim/lua/keymaps/leaders.lua (100%) rename {tools => dot_config}/nvim/lua/keymaps/lspkeys.lua (100%) rename {tools => dot_config}/nvim/lua/keymaps/modifier.lua (100%) rename {tools => dot_config}/nvim/lua/keymaps/nvim-tree.lua (100%) rename {tools => dot_config}/nvim/lua/keymaps/user-command.lua (100%) rename {tools => dot_config}/nvim/lua/keymaps/utils.lua (100%) rename {tools => dot_config}/nvim/lua/keymaps/visual-multi.lua (100%) rename {tools => dot_config}/nvim/lua/keymaps/which.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/appearance.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/completion.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/dap.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/edit.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/fileutils.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/init.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/lang/beancount.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/lang/init.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/lang/just.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/lang/lua.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/lang/markdown/init.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/lang/markdown/markview.lua.bak (100%) rename {tools => dot_config}/nvim/lua/plugins/lang/markdown/obsidian-nvim.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/lang/markdown/render-markdown.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/lang/org.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/lang/tex.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/lang/treesitter.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/lang/typst.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/lazy-nvim.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/misc.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/alpha-nvim.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/autopairs.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/avante-nvim.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/blink-cmp.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/bufferline.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/conform-nvim.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/copilot-lua.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/fzf.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/hover-nvim.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/image-nvim.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/img-clip.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/lualine/components.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/lualine/init.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/mc.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/neo-tree.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/nvim-cmp.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/nvim-lspconfig.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/nvim-tree.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/snacks-nvim.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/telescope.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/toggleterm.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/trouble-nvim.lua (100%) rename {tools => dot_config}/nvim/lua/plugins/mod/which-keys-nvim.lua (100%) rename {tools => dot_config}/nvim/readme.md (100%) rename {tools => dot_config}/nvim/stylua.toml (100%) rename {common => dot_config/rtorrent}/rtorrent.rc (100%) rename {tools => dot_config}/tmux/+colemak.tmux (100%) rename {tools => dot_config}/tmux/+qwerty.tmux (100%) rename {tools => dot_config}/tmux/tmux.conf (100%) delete mode 100644 tools/emacs.d/.gitignore delete mode 100644 tools/emacs.d/early-init.el delete mode 100644 tools/emacs.d/init.el delete mode 100644 tools/emacs.d/lisp/init-ai.el delete mode 100644 tools/emacs.d/lisp/init-appearance.el delete mode 100644 tools/emacs.d/lisp/init-basic.el delete mode 100644 tools/emacs.d/lisp/init-beancount.el delete mode 100644 tools/emacs.d/lisp/init-calendar.el delete mode 100644 tools/emacs.d/lisp/init-counsel.el delete mode 100644 tools/emacs.d/lisp/init-edit.el delete mode 100644 tools/emacs.d/lisp/init-evil.el delete mode 100644 tools/emacs.d/lisp/init-file.el delete mode 100644 tools/emacs.d/lisp/init-keymaps.el delete mode 100644 tools/emacs.d/lisp/init-latex.el delete mode 100644 tools/emacs.d/lisp/init-markdown.el delete mode 100644 tools/emacs.d/lisp/init-org.el delete mode 100644 tools/emacs.d/lisp/init-package.el delete mode 100644 tools/emacs.d/lisp/init-scratch.el delete mode 100644 tools/emacs.d/lisp/init-treesitter.el delete mode 100644 tools/emacs.d/lisp/init-wayland.el delete mode 100644 tools/emacs.d/lisp/init-writer.el delete mode 120000 tools/emacs.d/site-lisp delete mode 100644 tools/emacs.d/snippets/org-mode/begin_quote delete mode 100644 tools/emacs.d/snippets/org-mode/begin_src delete mode 100644 tools/emacs.d/snippets/org-mode/begin_src_elisp delete mode 100644 tools/nvim/lua/plugins/mod/dap-setup.lua diff --git a/.chezmoiignore b/.chezmoiignore new file mode 100644 index 0000000..9f409eb --- /dev/null +++ b/.chezmoiignore @@ -0,0 +1,13 @@ +# .chezmoiignore + +# macOS only +{{ if ne .chezmoi.os "darwin" -}} +{{ end -}} + +# Linux only +{{ if ne .chezmoi.os "linux" -}} +{{ end -}} + +# Windows only +{{ if ne .chezmoi.os "windows" -}} +{{ end -}} diff --git a/.just.d/check.just b/.just.d/check.just deleted file mode 100644 index b06d518..0000000 --- a/.just.d/check.just +++ /dev/null @@ -1,45 +0,0 @@ - -test: - echo "DOTFILES={{DOTFILES}}" - echo "XDG_CONFIG_HOME={{XDG_CONFIG_HOME}}" - echo "XDG_DATA_HOME={{XDG_DATA_HOME}}" - - -check: - @just check_shell -format: - @just format_shell - - -[private] -[unix] -check_shell: - shellcheck -x -s sh --severity=error **/*.sh platforms/mac/yabairc - shellcheck -x -s bash --severity=error **/*.bash tools/bash/* **/*.bashrc - -[private] -[unix] -format_shell: - shfmt -w -i 2 -ci -bn -p **/*.sh - shfmt -w -i 2 -ci -bn -ln bash **/*.bash platforms/mac/sketchybar/sketchybarrc - # Ignore syntax errors in zsh files - shfmt -w -i 2 -ci -bn -ln bash **/*.zsh tools/zsh/**/* **/zshrc || true - -[private] -check_info: - shellcheck -x -s sh **/*.sh platforms/mac/yabairc - shellcheck -x -s bash **/*.bash tools/bash/* scripts/*.{sh,zsh,bash} **/*.bashrc - -[private] -init: - git remote add github git@github.com:js0ny/dotfiles.git - git remote add codeberg git@codeberg.org:js0ny/dotfiles.git - -[private] -push: - git push github master - git push codeberg master - -[private] -pull: - git pull github master diff --git a/.just.d/cmds.just b/.just.d/cmds.just deleted file mode 100644 index eb93a58..0000000 --- a/.just.d/cmds.just +++ /dev/null @@ -1,26 +0,0 @@ - -# Sudo and coreutils are required -LN := \ - if os_family() == "windows" { - "sudo ln -sf" - } else { - "ln -sf" - } -CLIP := \ - if os() == "windows" { "clip.exe" } \ - else if os() == "linux" { "wl-copy" } \ - else if os() == "macos" { "pbcopy" } \ - else { "" } - - -CURL := \ - if os() == "windows" { "Invoke-WebRequest" } \ - else if os() == "linux" { "curl -L" } \ - else if os() == "macos" { "curl -L" } \ - else { "" } - -CURL_OUT := \ - if os() == "windows" { "-OutFile" } \ - else if os() == "linux" { "-o" } \ - else if os() == "macos" { "-o" } \ - else { "" } diff --git a/.just.d/common.just b/.just.d/common.just deleted file mode 100644 index 1530a10..0000000 --- a/.just.d/common.just +++ /dev/null @@ -1,52 +0,0 @@ -ideavim: - {{LN}} {{DOTFILES}}/common/ideavimrc {{XDG_CONFIG_HOME}}/ideavim/ideavimrc - git clone https://github.com/MarcoIeni/intellimacs {{join(home_directory(), ".local/share/intellimacs")}} --depth 1 - -lsd: - -mkdir {{XDG_CONFIG_HOME}}/lsd - {{LN}} {{DOTFILES}}/common/lsd.yaml {{XDG_CONFIG_HOME}}/lsd/config.yaml - -bat: - mkdir -p "$(bat --config-dir)/themes" - wget -P "$(bat --config-dir)/themes" https://github.com/catppuccin/bat/raw/main/themes/Catppuccin%20Latte.tmTheme - wget -P "$(bat --config-dir)/themes" https://github.com/catppuccin/bat/raw/main/themes/Catppuccin%20Frappe.tmTheme - wget -P "$(bat --config-dir)/themes" https://github.com/catppuccin/bat/raw/main/themes/Catppuccin%20Macchiato.tmTheme - wget -P "$(bat --config-dir)/themes" https://github.com/catppuccin/bat/raw/main/themes/Catppuccin%20Mocha.tmTheme - {{LN}} {{DOTFILES}}/common/bat.config.dark {{DOTFILES}}/common/bat.config - {{LN}} {{DOTFILES}}/common/bat.config {{XDG_CONFIG_HOME}}/bat/config - -[unix] -neovide: - which neovide - -mkdir -p {{XDG_CONFIG_HOME}}/neovide - {{LN}} {{DOTFILES}}/platforms/{{OS}}/neovide.toml {{XDG_CONFIG_HOME}}/neovide/config.toml - - -[linux] -readline: - mkdir -p {{XDG_CONFIG_HOME}}/readline - {{LN}} {{DOTFILES}}/common/inputrc {{XDG_CONFIG_HOME}}/readline/inputrc - -[unix] -rtorrent: - mkdir -p {{XDG_CONFIG_HOME}}/rtorrent - {{LN}} {{DOTFILES}}/common/rtorrent.rc {{XDG_CONFIG_HOME}}/rtorrent/rtorrent.rc - mkdir -p {{XDG_DATA_HOME}}/rtorrent/session - mkdir -p {{XDG_DATA_HOME}}/rtorrent/watch - -starship: - {{LN}} {{DOTFILES}}/common/starship.toml {{XDG_CONFIG_HOME}}/starship.toml - - -[unix] -vim: - mkdir -p {{XDG_DATA_HOME}}/vim/after - mkdir -p {{XDG_STATE_HOME}}/vim/{backup,swap,undo,view} - mkdir -p {{XDG_CONFIG_HOME}}/vim/ - ln -sf {{DOTFILES}}/common/vimrc {{XDG_CONFIG_HOME}}/vim/vimrc - - -[windows] -vim: - New-Item -ItemType SymbolicLink -Path $HOME/_vimrc -Value {{DOTFILES}}/common/vim.noxdg.vimrc - diff --git a/.just.d/linux.just b/.just.d/linux.just deleted file mode 100644 index f5ac99d..0000000 --- a/.just.d/linux.just +++ /dev/null @@ -1,61 +0,0 @@ - -[linux] -systemd: - {{LN}} {{DOTFILES}}/platforms/{{OS}}/systemd {{XDG_CONFIG_HOME}}/systemd - -[linux] -keyd: - -which keyd || sudo pacman -S keyd --noconfirm || sudo apt install keyd --yes || @just build_keyd - sudo mkdir /etc/keyd/ - sudo cp {{DOTFILES}}/platforms/linux/keyd/default.conf /etc/keyd/default.conf - mkdir -p {{XDG_CONFIG_HOME}}/keyd - {{LN}} {{DOTFILES}}/platforms/linux/keyd/app.conf {{XDG_CONFIG_HOME}}/keyd/app.conf - sudo systemctl enable --now keyd.service - -[linux] -[private] -build_keyd: - git clone https://github.com/rvaiya/keyd $HOME/.local/build/keyd - cd $HOME/.local/build/keyd && make && sudo make install - -[linux] -flatpak: - flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo - -[linux] -swaylock: - mkdir -p {{XDG_CONFIG_HOME}}/swaylock - {{LN}} {{DOTFILES}}/platforms/linux/swaylock {{XDG_CONFIG_HOME}}/swaylock/config - -[linux] -dunst: - mkdir -p {{XDG_CONFIG_HOME}}/dunst - {{LN}} {{DOTFILES}}/platforms/linux/dunstrc {{XDG_CONFIG_HOME}}/dunst/dunstrc - -[linux] -hypr: - {{LN}} {{DOTFILES}}/platforms/linux/hypr/hyprland/dark.conf {{DOTFILES}}/platforms/linux/hypr/hyprland/current.conf - {{LN}} {{DOTFILES}}/platforms/linux/hypr {{XDG_CONFIG_HOME}}/hypr - -[linux] -rofi: - {{LN}} {{DOTFILES}}/platforms/linux/rofi/dark.rasi {{DOTFILES}}/platforms/linux/rofi/current.rasi - {{LN}} {{DOTFILES}}/platforms/linux/rofi {{XDG_CONFIG_HOME}}/rofi - -[linux] -waybar: - {{LN}} {{DOTFILES}}/platforms/linux/waybar {{XDG_CONFIG_HOME}}/waybar - {{LN}} {{DOTFILES}}/platforms/linux/waybar/dark.css {{DOTFILES}}/platforms/linux/waybar/current.css - -[linux] -hyprland: - @just hypr - @just dunst - @just swaylock - @just rofi - - -[linux] -fcitx: - [ -d {{XDG_CONFIG_HOME}}/fcitx5 ] && mv {{XDG_CONFIG_HOME}}/fcitx {{XDG_CONFIG_HOME}}/fcitx5.bak - {{LN}} {{DOTFILES}}/platforms/linux/fcitx5 {{XDG_CONFIG_HOME}}/fcitx5 diff --git a/.just.d/misc.just b/.just.d/misc.just deleted file mode 100644 index aef7bc8..0000000 --- a/.just.d/misc.just +++ /dev/null @@ -1,15 +0,0 @@ -uv: - uv init {{XDG_DATA_HOME}}/uvenv - cd {{XDG_DATA_HOME}}/uvenv - uv venv - uv add -r {{DOTFILES}}/bootstrap/components/requirements.txt - -vivaldi: - {{CURL}} https://github.com/catppuccin/vivaldi/releases/download/1.0.0-ctpv2/Catppuccin.Latte.Lavender.zip {{CURL_OUT}} "$HOME/Downloads/vivaldi-light.zip" # Catppuccin Latte Lavender - {{CURL}} https://github.com/catppuccin/vivaldi/releases/download/1.0.0-ctpv2/Catppuccin.Mocha.Lavender.zip {{CURL_OUT}} "$HOME/Downloads/vivaldi-dark.zip" # Catppuccin Mocha Lavender - - -zotero: - {{CURL}} https://github.com/syt2/zotero-addons/releases/download/V1.8.1/zotero-addons.xpi {{CURL_OUT}} "$HOME/Downloads/zotero-addons.xpi" - - diff --git a/.just.d/tools.just b/.just.d/tools.just deleted file mode 100644 index b0a4096..0000000 --- a/.just.d/tools.just +++ /dev/null @@ -1,69 +0,0 @@ -[unix] -kitty: - which kitty - {{LN}} {{DOTFILES}}/tools/kitty {{XDG_CONFIG_HOME}}/kitty - -neovim: - which nvim - {{LN}} {{DOTFILES}}/tools/nvim {{XDG_CONFIG_HOME}}/nvim - nvim --headless +checkhealth +"w nvim-healthcheck.txt" +qall - -nvim: - @just neovim - -[linux] -bash: - {{LN}} {{DOTFILES}}/tools/bash {{XDG_CONFIG_HOME}}/bash - sudo cp {{DOTFILES}}/tools/bash/xdg-compat.sh /etc/profile.d/xdg-compat.sh - -[unix] -fish: - {{LN}} {{DOTFILES}}/tools/fish {{XDG_CONFIG_HOME}}/fish - {{CURL}} https://raw.githubusercontent.com/SpaceAceMonkey/dotenv-for-fish/refs/heads/main/dotenv.fish {{CURL_OUT}} "{{DOTFILES}}/tools/fish/functions/dotenv.fish" - -[unix] -screen: - {{LN}} {{DOTFILES}}/tools/screen {{XDG_CONFIG_HOME}}/screen - -[unix] -tmux: - {{LN}} {{DOTFILES}}/tools/tmux {{XDG_CONFIG_HOME}}/tmux - -thunderbird: - {{CURL}} https://github.com/wshanks/tbkeys/releases/download/v2.4.0/tbkeys.xpi {{CURL_OUT}} "$HOME/Downloads/tbkeys.xpi" - {{CURL}} https://github.com/htyxyt/htyxyt-immersive-translate-Thunderbird/releases/download/thunderbird-v1.14.8/immersive-translate-Thunderbird.v1.14.8.xpi {{CURL_OUT}} "$HOME/Downloads/immersive-translate-Thunderbird.xpi" - {{CURL}} https://raw.githubusercontent.com/catppuccin/thunderbird/refs/heads/main/themes/mocha/mocha-lavender.xpi {{CURL_OUT}} "$HOME/Downloads/thunderbird-dark.xpi" - cat {{DOTFILES}}/tools/thunderbird/tbkeys.json | {{CLIP}} - -wezterm: - which wezterm - {{LN}} {{DOTFILES}}/tools/wezterm {{XDG_CONFIG_HOME}}/wezterm - - -yazi: - which yazi || cargo install --locked yazi-fm yazi-cli - -ya pack -a llanosrocas/yaziline - -ya pack -a yazi-rs/plugins:git - -ya pack -a Rolv-Apneseth/starship - -[unix] -zsh: - -[[ -f /etc/zshenv ]] && sudo cp {{DOTFILES}}/tools/zsh/global.zshenv /etc/zshenv # or /etc/zsh/zshenv - -[[ -f /etc/zsh/zshenv ]] && sudo cp {{DOTFILES}}/tools/zsh/global.zshenv /etc/zsh/zshenv - mkdir -p {{XDG_CONFIG_HOME}}/zsh - {{LN}} {{DOTFILES}}/tools/zsh/zshenv {{XDG_CONFIG_HOME}}/zsh/.zshenv - {{LN}} {{DOTFILES}}/tools/zsh/zshrc {{XDG_CONFIG_HOME}}/zsh/.zshrc - {{LN}} {{DOTFILES}}/tools/zsh/zprofile {{XDG_CONFIG_HOME}}/zsh/.zprofile - test -d {{XDG_CONFIG_HOME}}/zsh/plugins/zsh-autosuggestions || git clone --depth 1 https://github.com/zsh-users/zsh-autosuggestions.git {{XDG_CONFIG_HOME}}/zsh/plugins/zsh-autosuggestions - test -d {{XDG_CONFIG_HOME}}/zsh/plugins/zsh-syntax-highlighting || git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting.git {{XDG_CONFIG_HOME}}/zsh/plugins/zsh-syntax-highlighting - test -d {{XDG_CONFIG_HOME}}/zsh/plugins/zsh-history-substring-search || git clone --depth 1 https://github.com/zsh-users/zsh-history-substring-search.git {{XDG_CONFIG_HOME}}/zsh/plugins/zsh-history-substring-search - test -d {{XDG_CONFIG_HOME}}/zsh/plugins/zsh-completions || git clone --depth 1 https://github.com/zsh-users/zsh-completions.git {{XDG_CONFIG_HOME}}/zsh/plugins/zsh-completions - -[linux] -install_emacs: - git clone --depth 1 https://github.com/emacs-mirror/emacs.git --branch feature/igc $HOME/.local/build/emacs-igc-build - cd $HOME/.local/build/emacs-igc-build - ./autogen.sh - ./configure --with-mailutils --with-native-compilation --with-pgtk --with-tree-sitter --with-imagemagick - make -j$(nproc) - sudo make install diff --git a/.just.d/vars.just b/.just.d/vars.just deleted file mode 100644 index 5fd1146..0000000 --- a/.just.d/vars.just +++ /dev/null @@ -1,42 +0,0 @@ -OS := \ - if os() == "linux" { - if env("WSL_DISTRO_NAME","") != "" { - "wsl" - } else { - "linux" - } - } else if os() == "windows" { - "win" - } else if os() == "macos" { - "mac" - } else { "" } -DOTFILES := join(home_directory(), ".dotfiles") -XDG_CONFIG_HOME := \ - if env("XDG_CONFIG_HOME", "") != "" {env("XDG_CONFIG_HOME", "")} \ - else { - if os_family() == "windows" { - env("APPDATA") - } else { - join(home_directory(), ".config") - } - } - -XDG_DATA_HOME := \ - if env("XDG_DATA_HOME", "") != "" {env("XDG_DATA_HOME", "")} \ - else { - if os_family() == "windows" { - env("LOCALAPPDATA", "") - } else { - join(home_directory(), ".local/share") - } - } - -XDG_STATE_HOME := \ - if env("XDG_STATE_HOME", "") != "" {env("XDG_STATE_HOME", "")} \ - else { - if os_family() == "windows" { - join(env("LOCALAPPDATA", ""), "state") - } else { - join(home_directory(), ".local/state") - } - } diff --git a/Justfile b/Justfile deleted file mode 100644 index e81b300..0000000 --- a/Justfile +++ /dev/null @@ -1,15 +0,0 @@ -# set shell := ["fish", "-c"] -set shell := ["bash", "-c"] -set windows-shell := ["pwsh", "-c"] - -import '.just.d/vars.just' -import '.just.d/cmds.just' -import '.just.d/common.just' -import '.just.d/tools.just' -import '.just.d/misc.just' -import '.just.d/linux.just' -import '.just.d/check.just' - -_default: - @just test - @just --list diff --git a/bootstrap/components/emacs.sh b/bootstrap/components/emacs.sh deleted file mode 100644 index 1784a0a..0000000 --- a/bootstrap/components/emacs.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# shellcheck shell=sh -echo "[INFO] Installing DOOM Emacs" -echo "[ACTION] Request Human Takeover" -test -d ~/.config/emacs && mv ~/.config/emacs ~/.config/emacs.bak -git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs -~/.config/emacs/bin/doom install -~/.config/emacs/bin/doom sync - -echo "[INFO] Installing Emacs-Rime" -git clone --depth 1 https://github.com/js0ny/Rime.git ~/.config/emacs/.local/cache/rime diff --git a/bootstrap/components/mocha-port.bash b/bootstrap/components/mocha-port.bash deleted file mode 100644 index ceabe73..0000000 --- a/bootstrap/components/mocha-port.bash +++ /dev/null @@ -1,231 +0,0 @@ -#!/usr/bin/env bash -# Adds better error handling and safety features -# shellcheck disable=SC2016 - -set -e # Exit immediately if a command exits with a non-zero status -set -u # Treat unset variables as an error - -# Create temporary working directory -TEMP_DIR="${HOME}/.tmp/catppuccin-install" -mkdir -p "${TEMP_DIR}" - -# Create config directories -mkdir -p "${HOME}/.config/tmux/plugins" -mkdir -p "${HOME}/.config/yazi" -mkdir -p "${HOME}/.config/btop/themes" -mkdir -p "${HOME}/.config/git" -mkdir -p "${HOME}/.config/lsd" -mkdir -p "${HOME}/.local/share/mc/skins" -mkdir -p "${HOME}/.config/fish/themes" -mkdir -p "${HOME}/.local/share/fcitx5/themes" - -# Function for downloading files -download_file() { - local url="$1" - local output_path="$2" - local output_dir - - # Extract directory from output path - output_dir=$(dirname "$output_path") - - # Create directory if it doesn't exist - if [ ! -d "$output_dir" ]; then - mkdir -p "$output_dir" - fi - - # Print status message - echo "Downloading: $url" - echo " to: $output_path" - - # Download with curl (using -L to follow redirects) - if ! curl -L -s --fail "$url" -o "$output_path"; then - echo "Error: Failed to download $url" >&2 - return 1 - fi - - # Verify file was downloaded - if [ ! -f "$output_path" ]; then - echo "Error: File was not created at $output_path" >&2 - return 1 - fi - - echo "Download successful." - return 0 -} - -# Function to check if command exists -command_exists() { - command -v "$1" >/dev/null 2>&1 -} - -# Install Bat themes -if command_exists bat; then - BAT_CONFIG_DIR=$(bat --config-dir 2>/dev/null || echo "${HOME}/.config/bat") - mkdir -p "${BAT_CONFIG_DIR}/themes" - - echo "Installing Bat themes..." - THEMES=("Latte" "Frappe" "Macchiato" "Mocha") - - for theme in "${THEMES[@]}"; do - download_file "https://github.com/catppuccin/bat/raw/main/themes/Catppuccin%20${theme}.tmTheme" \ - "${BAT_CONFIG_DIR}/themes/Catppuccin ${theme}.tmTheme" - done - - echo "Rebuilding Bat cache..." - bat cache --build || echo "WARNING: Failed to rebuild Bat cache" >&2 -else - echo "Bat not found, skipping Bat themes installation" >&2 -fi - -# Install Tmux plugin -if command_exists tmux; then - echo "Installing Tmux plugin..." - - TMUX_PLUGIN_DIR="${HOME}/.config/tmux/plugins/catppuccin" - rm -rf "${TMUX_PLUGIN_DIR}" - mkdir -p "${TMUX_PLUGIN_DIR}" - - if command_exists git; then - if ! git clone -b v2.1.2 --depth=1 https://github.com/catppuccin/tmux.git "${TMUX_PLUGIN_DIR}/tmux" 2>/dev/null; then - echo "WARNING: Failed to clone Tmux plugin repository" >&2 - fi - else - echo "Git not found, skipping Tmux plugin installation" >&2 - fi -else - echo "Tmux not found, skipping Tmux plugin installation" >&2 -fi - -# Install Yazi theme -if command_exists yazi; then - echo "Installing Yazi theme..." - download_file "https://raw.githubusercontent.com/catppuccin/yazi/main/themes/mocha/catppuccin-mocha-lavender.toml" \ - "${HOME}/.config/yazi/theme.toml" -else - echo "Yazi not found, skipping Yazi theme installation" >&2 -fi - -# Install BTopa themes -if command_exists btop; then - echo "Installing BTopa themes..." - download_file "https://raw.githubusercontent.com/catppuccin/btop/main/themes/catppuccin_mocha.theme" \ - "${HOME}/.config/btop/themes/catppuccin_mocha.theme" - download_file "https://raw.githubusercontent.com/catppuccin/btop/main/themes/catppuccin_latte.theme" \ - "${HOME}/.config/btop/themes/catppuccin_latte.theme" -else - echo "BTopa not found, skipping BTopa themes installation" >&2 -fi - -# Install Delta config -echo "Installing Delta config..." -download_file "https://raw.githubusercontent.com/catppuccin/delta/main/catppuccin.gitconfig" \ - "${HOME}/.config/git/catppuccin-delta.gitconfig" - -# Configure FZF -if command_exists fzf; then - echo "Configuring FZF..." - - # Check shell type to determine how to set environment variables - if [ -n "${FISH_VERSION:-}" ] || command_exists fish; then - # For Fish shell - fish -c 'set -U FZF_DEFAULT_OPTS "--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 --color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc --color=marker:#b4befe,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8 --color=selected-bg:#45475a --multi"' \ - || echo "WARNING: Failed to set FZF options for Fish shell" >&2 - else - # For Bash/Zsh - add to both .bashrc and .zshrc if they exist - FZF_CONFIG="export FZF_DEFAULT_OPTS=\"--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 --color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc --color=marker:#b4befe,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8 --color=selected-bg:#45475a --multi\"" - - # Add to .bashrc if it exists - if [ -f "${HOME}/.bashrc" ]; then - if ! grep -q "FZF_DEFAULT_OPTS.*catppuccin" "${HOME}/.bashrc"; then - echo "${FZF_CONFIG}" >>"${HOME}/.bashrc" - echo "Added FZF configuration to .bashrc" - fi - fi - - # Add to .zshrc if it exists - if [ -f "${HOME}/.zshrc" ]; then - if ! grep -q "FZF_DEFAULT_OPTS.*catppuccin" "${HOME}/.zshrc"; then - echo "${FZF_CONFIG}" >>"${HOME}/.zshrc" - echo "Added FZF configuration to .zshrc" - fi - fi - fi -else - echo "FZF not found, skipping FZF configuration" >&2 -fi - -# Install LSD themes -if command_exists lsd; then - echo "Installing LSD themes..." - download_file "https://raw.githubusercontent.com/catppuccin/lsd/main/themes/catppuccin-mocha/colors.yaml" \ - "${HOME}/.config/lsd/colors.yaml" - download_file "https://raw.githubusercontent.com/catppuccin/lsd/main/themes/catppuccin-latte/colors.yaml" \ - "${HOME}/.config/lsd/colors-light.yaml" -else - echo "LSD not found, skipping LSD themes installation" >&2 -fi - -# Install Midnight Commander skin -echo "Installing Midnight Commander skin..." -download_file "https://raw.githubusercontent.com/catppuccin/mc/main/catppuccin.ini" \ - "${HOME}/.local/share/mc/skins/catppuccin.ini" - -# Print MC configuration hint -echo "Note: To use the Midnight Commander theme:" -echo " - Change or add skin=catppuccin in the [Midnight-Commander] section inside ~/.config/mc/ini" -echo " - OR choose the skin inside Midnight Commander through F9 > Options > Appearance" -echo " - Save setup through F9 > Options > Save setup" - -# Install PowerShell module -if command_exists pwsh; then - echo "Installing PowerShell module..." - PS_MODULE_PATH=$(pwsh -C 'Write-Output $Env:PSModulePath.split(":")[0]' 2>/dev/null) - - if [ -n "${PS_MODULE_PATH}" ]; then - if command_exists git; then - if ! git clone --depth=1 https://github.com/catppuccin/powershell.git "${PS_MODULE_PATH}/Catppuccin" 2>/dev/null; then - echo "WARNING: Failed to clone PowerShell module repository" >&2 - fi - else - echo "Git not found, skipping PowerShell module installation" >&2 - fi - else - echo "PowerShell module path not found, skipping PowerShell module installation" >&2 - fi -else - echo "PowerShell not found, skipping PowerShell module installation" >&2 -fi - -# Install Fish themes -if command_exists fish; then - echo "Installing Fish themes..." - download_file "https://raw.githubusercontent.com/catppuccin/fish/main/themes/Catppuccin%20Mocha.theme" \ - "${HOME}/.config/fish/themes/Catppuccin Mocha.theme" - download_file "https://raw.githubusercontent.com/catppuccin/fish/main/themes/Catppuccin%20Latte.theme" \ - "${HOME}/.config/fish/themes/Catppuccin Latte.theme" -else - echo "Fish not found, skipping Fish themes installation" >&2 -fi - -# Install Fcitx5 themes -if command_exists fcitx5; then - echo "Installing Fcitx5 themes..." - - rm -rf "${TEMP_DIR}/fcitx5" - if command_exists git; then - if git clone --depth=1 https://github.com/catppuccin/fcitx5.git "${TEMP_DIR}/fcitx5" 2>/dev/null; then - cp -r "${TEMP_DIR}/fcitx5/src/"* "${HOME}/.local/share/fcitx5/themes/" - else - echo "WARNING: Failed to clone Fcitx5 repository" >&2 - fi - else - echo "Git not found, skipping Fcitx5 themes installation" >&2 - fi -else - echo "Fcitx5 not found, skipping Fcitx5 themes installation" >&2 -fi - -# Clean up temporary directory -rm -rf "${TEMP_DIR}" - -echo "Catppuccin themes installation completed!" diff --git a/bootstrap/components/mocha_port.fish b/bootstrap/components/mocha_port.fish deleted file mode 100644 index 804cf22..0000000 --- a/bootstrap/components/mocha_port.fish +++ /dev/null @@ -1,43 +0,0 @@ -mkdir -p ~/.tmp -# Bat -mkdir -p "$(bat --config-dir)/themes" -wget -P "$(bat --config-dir)/themes" https://github.com/catppuccin/bat/raw/main/themes/Catppuccin%20Latte.tmTheme -wget -P "$(bat --config-dir)/themes" https://github.com/catppuccin/bat/raw/main/themes/Catppuccin%20Frappe.tmTheme -wget -P "$(bat --config-dir)/themes" https://github.com/catppuccin/bat/raw/main/themes/Catppuccin%20Macchiato.tmTheme -wget -P "$(bat --config-dir)/themes" https://github.com/catppuccin/bat/raw/main/themes/Catppuccin%20Mocha.tmTheme -bat cache --build -# Tmux -mkdir -p ~/.config/tmux/plugins/catppuccin:w -git clone -b v2.1.2 https://github.com/catppuccin/tmux.git ~/.config/tmux/plugins/catppuccin/tmux -# Yazi -curl https://raw.githubusercontent.com/catppuccin/yazi/refs/heads/main/themes/mocha/catppuccin-mocha-lavender.toml -o ~/.config/yazi/theme.toml -# BTop -curl https://raw.githubusercontent.com/catppuccin/btop/refs/heads/main/themes/catppuccin_mocha.theme -o ~/.config/btop/themes/catppuccin_mocha.theme -curl https://raw.githubusercontent.com/catppuccin/btop/refs/heads/main/themes/catppuccin_latte.theme -o ~/.config/btop/themes/catppuccin_latte.theme -# Delta -curl https://raw.githubusercontent.com/catppuccin/delta/refs/heads/main/catppuccin.gitconfig -o ~/.config/git/catppuccin-delta.gitconfig -# Fzf -set -Ux FZF_DEFAULT_OPTS "\ ---color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \ ---color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \ ---color=marker:#b4befe,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8 \ ---color=selected-bg:#45475a \ ---multi" -# LsD -curl https://raw.githubusercontent.com/catppuccin/lsd/refs/heads/main/themes/catppuccin-mocha/colors.yaml -o ~/.config/lsd/colors.yaml -curl https://raw.githubusercontent.com/catppuccin/lsd/refs/heads/main/themes/catppuccin-latte/colors.yaml -o ~/.config/lsd/colors-light.yaml -# Midnight Commander -# Change or add skin=catppuccin in the [Midnight-Commander] section inside ~/.config/mc/ini OR Choose the skin inside Midnight Commander through F9>Options>Appearance and Save setup through F9>Options/Save setup -mkdir -p $HOME/.local/share/mc/skins -curl https://raw.githubusercontent.com/catppuccin/mc/refs/heads/main/catppuccin.ini -o $HOME/.local/share/mc/skins/catppuccin.ini -# PowerShell -pwsh -C 'git clone https://github.com/catppuccin/powershell.git (Join-Path $Env:PSModulePath.split(":")[0] Catppuccin)' -# Fish -mkdir -p ~/.config/fish/themes -curl https://raw.githubusercontent.com/catppuccin/fish/refs/heads/main/themes/Catppuccin%20Mocha.theme -o ~/.config/fish/themes/Catppuccin\ Mocha.theme -curl https://raw.githubusercontent.com/catppuccin/fish/refs/heads/main/themes/Catppuccin%20Latte.theme -o ~/.config/fish/themes/Catppuccin\ Latte.theme -# fcitx5 -git clone https://github.com/catppuccin/fcitx5.git ~/.tmp/fcitx5 -cd ~/.tmp/fcitx5 -mkdir -p ~/.local/share/fcitx5/themes -cp -r ./src/* ~/.local/share/fcitx5/themes diff --git a/bootstrap/components/pwsh.ps1 b/bootstrap/components/pwsh.ps1 deleted file mode 100644 index 086f340..0000000 --- a/bootstrap/components/pwsh.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -Install-Module CompletionPredictor -Install-Module PSFzf -Install-Module Posh-Git diff --git a/bootstrap/components/requirements.txt b/bootstrap/components/requirements.txt deleted file mode 100644 index fa5157a..0000000 --- a/bootstrap/components/requirements.txt +++ /dev/null @@ -1,112 +0,0 @@ -anyio==4.8.0 -argon2-cffi==23.1.0 -argon2-cffi-bindings==21.2.0 -arrow==1.3.0 -asttokens==3.0.0 -async-lru==2.0.4 -attrs==25.1.0 -babel==2.17.0 -beautifulsoup4==4.13.3 -bleach==6.2.0 -certifi==2025.1.31 -cffi==1.17.1 -charset-normalizer==3.4.1 -comm==0.2.2 -contourpy==1.3.1 -cycler==0.12.1 -debugpy==1.8.13 -decorator==5.2.1 -defusedxml==0.7.1 -executing==2.2.0 -fastjsonschema==2.21.1 -fonttools==4.56.0 -fqdn==1.5.1 -h11==0.14.0 -httpcore==1.0.7 -httpx==0.28.1 -idna==3.10 -ipykernel==6.29.5 -ipython==9.0.2 -ipython-pygments-lexers==1.1.1 -ipywidgets==8.1.5 -isoduration==20.11.0 -jedi==0.19.2 -jinja2==3.1.6 -joblib==1.4.2 -json5==0.10.0 -jsonpointer==3.0.0 -jsonschema==4.23.0 -jsonschema-specifications==2024.10.1 -jupyter==1.1.1 -jupyter-client==8.6.3 -jupyter-console==6.6.3 -jupyter-core==5.7.2 -jupyter-events==0.12.0 -jupyter-lsp==2.2.5 -jupyter-server==2.15.0 -jupyter-server-terminals==0.5.3 -jupyterlab==4.3.5 -jupyterlab-pygments==0.3.0 -jupyterlab-server==2.27.3 -jupyterlab-widgets==3.0.13 -kiwisolver==1.4.8 -markupsafe==3.0.2 -matplotlib==3.10.1 -matplotlib-inline==0.1.7 -mistune==3.1.2 -nbclient==0.10.2 -nbconvert==7.16.6 -nbformat==5.10.4 -nest-asyncio==1.6.0 -notebook==7.3.2 -notebook-shim==0.2.4 -numpy==2.2.3 -overrides==7.7.0 -packaging==24.2 -pandas==2.2.3 -pandocfilters==1.5.1 -parso==0.8.4 -pexpect==4.9.0 -pillow==11.1.0 -platformdirs==4.3.6 -prometheus-client==0.21.1 -prompt-toolkit==3.0.50 -psutil==7.0.0 -ptyprocess==0.7.0 -pure-eval==0.2.3 -pycparser==2.22 -pygments==2.19.1 -pyparsing==3.2.1 -python-dateutil==2.9.0.post0 -python-json-logger==3.3.0 -pytz==2025.1 -pyyaml==6.0.2 -pyzmq==26.2.1 -referencing==0.36.2 -requests==2.32.3 -rfc3339-validator==0.1.4 -rfc3986-validator==0.1.1 -rpds-py==0.23.1 -scikit-learn==1.6.1 -scipy==1.15.2 -send2trash==1.8.3 -setuptools==76.0.0 -six==1.17.0 -sniffio==1.3.1 -soupsieve==2.6 -stack-data==0.6.3 -terminado==0.18.1 -threadpoolctl==3.5.0 -tinycss2==1.4.0 -tornado==6.4.2 -traitlets==5.14.3 -types-python-dateutil==2.9.0.20241206 -typing-extensions==4.12.2 -tzdata==2025.1 -uri-template==1.3.0 -urllib3==2.3.0 -wcwidth==0.2.13 -webcolors==24.11.1 -webencodings==0.5.1 -websocket-client==1.8.0 -widgetsnbextension==4.0.13 diff --git a/bootstrap/components/rime.sh b/bootstrap/components/rime.sh deleted file mode 100644 index 89ea323..0000000 --- a/bootstrap/components/rime.sh +++ /dev/null @@ -1,17 +0,0 @@ -echo "[INFO] Installing Rime" - -case "$(uname)" in - Linux) - RIMEDIR="${RIMEDIR:-$HOME/.local/share/fcitx5/rime}" - ;; - Darwin) - RIMEDIR="${RIMEDIR:-$HOME/Library/Rime}" - ;; -esac - -git clone --depth 1 https://github.com/js0ny/rime_wanxiang_pro.git "$RIMEDIR" -cd "$RIMEDIR" || exit - -just init -# just install_rime -just clone_plum diff --git a/bootstrap/components/symlinks.bash b/bootstrap/components/symlinks.bash deleted file mode 100644 index 2273a84..0000000 --- a/bootstrap/components/symlinks.bash +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env bash -# vim:ft=bash -# shellcheck disable=SC1090 shell=bash -# This should be run with bash > 4.0 or zsh -set -e # Exit immediately if a command exits with a non-zero status - -DOTFILES="${DOTFILES:-$HOME/.dotfiles}" -ZDOTDIR="${ZDOTDIR:-$HOME/.config/zsh}" -XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" -NPM_CONFIG_USERCONFIG="${NPM_CONFIG_USERCONFIG:-$XDG_CONFIG_HOME/npm/npmrc}" -GUI_SETUP="${GUI_SETUP:-1}" -WHEEL="${WHEEL:-0}" - -XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" -XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" -XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}" - -echo "[INFO] Setting up some local directories" -test -d "$XDG_CACHE_HOME" || mkdir -p "$XDG_CACHE_HOME" -test -d "$XDG_DATA_HOME" || mkdir -p "$XDG_DATA_HOME" -test -d "$XDG_STATE_HOME" || mkdir -p "$XDG_STATE_HOME" -test -d ~/.local/state/zsh || mkdir -p ~/.local/state/zsh - -# echo "[INFO] Setting up system-wide zsh configuration" -# echo "[ACTION] Elevation required!" -# test -f "/etc/zsh/zshenv" && sudo cp "$DOTFILES/tools/zsh/zshenv" "/etc/zsh/zshenv" -# test -f "/etc/zshenv" && sudo cp "$DOTFILES/tools/zsh/zshenv" "/etc/zshenv" - -declare -A linkDots - -linkDots=( - ["$DOTFILES/common/condarc.yaml"]="$XDG_CONFIG_HOME/conda/.condarc" - # ["$DOTFILES/common/gitconfig"]="$XDG_CONFIG_HOME/git/config" - ["$DOTFILES/common/glow.yaml"]="$HOME/.config/glow/config.yml" - ["$DOTFILES/common/haskeline"]="$HOME/.haskeline" - ["$DOTFILES/common/ideavimrc"]="$XDG_CONFIG_HOME/ideavim/ideavimrc" - ["$DOTFILES/common/lazygit.yaml"]="$XDG_CONFIG_HOME/lazygit/config.yml" - ["$DOTFILES/common/lesskey"]="$XDG_CONFIG_HOME/lesskey" - ["$DOTFILES/common/npmrc"]="$NPM_CONFIG_USERCONFIG" - ["$DOTFILES/common/NuGet.Config"]="$XDG_CONFIG_HOME/NuGet/NuGet.Config" - ["$DOTFILES/common/pip.conf"]="$XDG_CONFIG_HOME/pip/pip.conf" - ["$DOTFILES/common/starship.toml"]="$HOME/.config/starship.toml" - ["$DOTFILES/common/tmux.conf"]="$XDG_CONFIG_HOME/tmux/tmux.conf" - ["$DOTFILES/common/vimrc"]="$XDG_CONFIG_HOME/vim/vimrc" - ["$DOTFILES/common/zellij.config.kdl"]="$HOME/.config/zellij/config.kdl" - # ["$DOTFILES/tools/emacs.d"]="$HOME/.emacs.d" - ["$DOTFILES/tools/doom"]="$HOME/.config/doom" - ["$DOTFILES/tools/fish"]="$HOME/.config/fish" - ["$DOTFILES/tools/ipython"]="$XDG_CONFIG_HOME/ipython" - ["$DOTFILES/tools/nvim"]="$XDG_CONFIG_HOME/nvim" - ["$DOTFILES/tools/yazi"]="$HOME/.config/yazi" - ["$DOTFILES/tools/zsh/zshrc"]="$ZDOTDIR/.zshrc" - ["$DOTFILES/tools/zsh/zshenv"]="$ZDOTDIR/.zshenv" - ["$DOTFILES/platforms/mac/pwshProfile.ps1"]="$HOME/.config/powershell/Microsoft.PowerShell_profile.ps1" -) - -if [ $(uname) = "Darwin" ]; then - echo "[INFO] Running on macOS" - linkDots+=( - ["$DOTFILES/platforms/mac/karabiner"]="$HOME/.config/karabiner" - ["$DOTFILES/platforms/mac/skhdrc"]="$XDG_CONFIG_HOME/skhd/skhdrc" - ["$DOTFILES/platforms/mac/sketchybarrc"]="$XDG_CONFIG_HOME/sketchybar/sketchybarrc" - ["$DOTFILES/platforms/mac/yabairc"]="$XDG_CONFIG_HOME/yabai/yabairc" - ["$DOTFILES/tools/wezterm"]="$HOME/.config/wezterm" - ["$DOTFILES/tools/zed"]="$HOME/.config/zed" - ["$DOTFILES/tools/sioyek"]="$HOME/.config/sioyek" - ) -else - echo "[INFO] Running on Linux" - linkDots+=( - ["$DOTFILES/common/inputrc"]="$XDG_CONFIG_HOME/readline/inputrc" - ) - # WSL1 : Microsoft - # WSL2 : microsoft - # if [ "$(uname -r)" = *icrosoft* ]; then - # echo "[INFO] Running on WSL" - # : # NOP - if [ "$GUI_SETUP" -eq 1 ]; then - echo "[INFO] Setting up Linux GUI Applications" - linkDots+=( - ["$DOTFILES/platforms/linux/awesome"]="$HOME/.config/awesome" - ["$DOTFILES/platforms/linux/hypr"]="$HOME/.config/hypr" - ["$DOTFILES/platforms/linux/waybar"]="$HOME/.config/waybar" - ["$DOTFILES/platforms/linux/wlogout"]="$HOME/.config/wlogout" - ["$DOTFILES/platforms/linux/mako-config"]="$HOME/.config/mako/config" - ["$DOTFILES/tools/wezterm"]="$HOME/.config/wezterm" - ["$DOTFILES/tools/zed"]="$HOME/.config/zed" - ["$DOTFILES/tools/sioyek"]="$HOME/.config/sioyek" - ) - for kde in "$DOTFILES/platforms/linux/kde/"*; do - linkDots+=["$kde"]="$HOME/.config/kde/$(basename "$kde")" - # echo "Linking $kde to $HOME/.config/kde/$(basename $kde)" - done - if [ "$WHEEL" -eq 1 ]; then - echo "[INFO] Setting up system environment variables" - echo "[ACTION] Elevation required!" - sudo cp "$DOTFILES/platforms/linux/etc/environment" "/etc/environment" - fi - fi -fi - -echo "[INFO] Copying example files" -test -d $XDG_CONFIG_HOME/git || mkdir -p $XDG_CONFIG_HOME/git -test -f $XDG_CONFIG_HOME/git/config && mv $XDG_CONFIG_HOME/git/config $XDG_CONFIG_HOME/git/config.bak -cp $DOTFILES/common/gitconfig.example $XDG_CONFIG_HOME/git/config -echo "[INFO] Don't forget to update your gitconfig!" - -test -f ~/.wakatime.cfg && mv ~/.wakatime.cfg ~/.wakatime.cfg.bak -cp $DOTFILES/common/wakatime.example.cfg ~/.wakatime.cfg -echo "[INFO] Don't forget to update your wakatime config!" diff --git a/bootstrap/components/zsh.sh b/bootstrap/components/zsh.sh deleted file mode 100644 index 485ac1d..0000000 --- a/bootstrap/components/zsh.sh +++ /dev/null @@ -1,28 +0,0 @@ -WHEEL="${WHEEL:-1}" - -echo "[INFO] ZDOTDIR = $ZDOTDIR" -echo "[INFO] DOTFILES = $DOTFILES" -echo "[INFO] WHEEL = $WHEEL" - -echo "[ACTION] Press any key to proceed" -read -n 1 - -if [ "$WHEEL" -eq 1 ]; then - echo "[INFO] Setting up system-wide zsh configuration" - echo "[ACTION] Elevation required" - test -f "/etc/zsh/zshenv" && sudo cp "$DOTFILES/tools/zsh/global.zshenv" "/etc/zsh/zshenv" - test -f "/etc/zshenv" && sudo cp "$DOTFILES/tools/zsh/global.zshenv" "/etc/zshenv" - if [ "$(uname)" = "Darwin" ]; then - sudo cp "$DOTFILES/tools/zsh/global.zshenv" "/etc/zshenv" - fi -else - echo "[INFO] Setting up user zsh configuration" - # A fallback case to set $ZDOTDIR in ~/.zshenv if the user cannot access global zshenv - ln -sf "$DOTFILES/tools/zsh/zshenv" "$HOME/.zshenv" -fi - -echo "[INFO] Installing zsh plugins" -test -d "$ZDOTDIR"/plugins/zsh-autosuggestions || git clone --depth 1 https://github.com/zsh-users/zsh-autosuggestions.git "$ZDOTDIR"/plugins/zsh-autosuggestions -test -d "$ZDOTDIR"/plugins/zsh-syntax-highlighting || git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting.git "$ZDOTDIR"/plugins/zsh-syntax-highlighting -test -d "$ZDOTDIR"/plugins/zsh-history-substring-search || git clone --depth 1 https://github.com/zsh-users/zsh-history-substring-search.git "$ZDOTDIR"/plugins/zsh-history-substring-search -test -d "$ZDOTDIR"/plugins/zsh-completions || git clone --depth 1 https://github.com/zsh-users/zsh-completions.git "$ZDOTDIR"/plugins/zsh-completions diff --git a/bootstrap/linux/appman.bash b/bootstrap/linux/appman.bash deleted file mode 100644 index dad1f09..0000000 --- a/bootstrap/linux/appman.bash +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -# vim:ft=bash -echo "[INFO] Installing AppMan" -echo "[ACTION] Type [2] to install AppMan" -wget -q https://raw.githubusercontent.com/ivan-hc/AM/main/AM-INSTALLER && chmod a+x ./AM-INSTALLER && ./AM-INSTALLER - -APPMAN_PATH="$HOME/.local/bin/appman" - -if command -v "$APPMAN_PATH" >/dev/null 2>&1; then - $APPMAN_PATH install wezterm - $APPMAN_PATH install nvim -fi diff --git a/bootstrap/linux/chromium-flags.bash b/bootstrap/linux/chromium-flags.bash deleted file mode 100755 index 2ad6bbd..0000000 --- a/bootstrap/linux/chromium-flags.bash +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash -# vim:ft=bash -# chromium-flags.sh -# Set Chromium & Electron Flags - -echo "[INFO] Set Chromium & Electron Flags" - -DOTFILES="${DOTFILES:-$HOME/.dotfiles}" -XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" -BROWSER_FLAG=$DOTFILES/platforms/linux/chromium-flags.conf -ELECTRON_FLAG=$DOTFILES/platforms/linux/electron-flags.conf - - -parse_args() { - while [[ $# -gt 0 ]]; do - case "$1" in - # --debug|-d) - # export LOG_LEVEL="DEBUG" - # log_debug "Debug mode enabled" - # shift - # ;; - --force|-f) - FORCE_FILE="true" - echo "Force update enabled" - shift - ;; - *) - echo "Unknown argument: $1" - echo "Usage: chromium-flags.sh [--debug|-d] [--force|-f]" - exit 1 - ;; - esac - done -} - -parse_args "$@" - -# Browser Flags - -browser_flags_path=( - "$XDG_CONFIG_HOME/chromium-flags.conf" # Chromium - "$XDG_CONFIG_HOME/chrome-flags.conf" # Google Chrome - "$XDG_CONFIG_HOME/thorium-flags.conf" # Thorium - "$XDG_CONFIG_HOME/vivaldi-flags.conf" # Vivaldi - "$XDG_CONFIG_HOME/vivaldi-stable.conf" # Vivaldi - -) - -electron_flags_path=( - "$XDG_CONFIG_HOME/electron-flags.conf" # General - "$XDG_CONFIG_HOME/code-flags.conf" # VSCode - "$XDG_CONFIG_HOME/qq-electron-flags.conf" # QQ -) - -for path in "${browser_flags_path[@]}"; do - if [ -f "$path" ] && [ "$FORCE_FILE" != "true" ]; then - echo "[INFO] Found Browser Flags: $path" - else - echo "[INFO] Creating Browser Flags: $path" - ln -sf "$BROWSER_FLAG" "$path" - fi -done - -for path in "${electron_flags_path[@]}"; do - if [ -f "$path" ] && [ "$FORCE_FILE" != "true" ]; then - echo "[INFO] Found Electron Flags: $path" - else - echo "[INFO] Creating Electron Flags: $path" - ln -sf "$ELECTRON_FLAG" "$path" - fi -done diff --git a/bootstrap/linux/chromium-flags.hypr.bash b/bootstrap/linux/chromium-flags.hypr.bash deleted file mode 100755 index 982fb59..0000000 --- a/bootstrap/linux/chromium-flags.hypr.bash +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash -# vim:ft=bash -# chromium-flags.sh -# Set Chromium & Electron Flags - -echo "[INFO] Set Chromium & Electron Flags" - -DOTFILES="${DOTFILES:-$HOME/.dotfiles}" -XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" -BROWSER_FLAG=$DOTFILES/platforms/linux/chromium-flags.hypr.conf -ELECTRON_FLAG=$DOTFILES/platforms/linux/electron-flags.hypr.conf - - -parse_args() { - while [[ $# -gt 0 ]]; do - case "$1" in - # --debug|-d) - # export LOG_LEVEL="DEBUG" - # log_debug "Debug mode enabled" - # shift - # ;; - --force|-f) - FORCE_FILE="true" - echo "Force update enabled" - shift - ;; - *) - echo "Unknown argument: $1" - echo "Usage: chromium-flags.sh [--debug|-d] [--force|-f]" - exit 1 - ;; - esac - done -} - -parse_args "$@" - -# Browser Flags - -browser_flags_path=( - "$XDG_CONFIG_HOME/chromium-flags.conf" # Chromium - "$XDG_CONFIG_HOME/chrome-flags.conf" # Google Chrome - "$XDG_CONFIG_HOME/thorium-flags.conf" # Thorium - "$XDG_CONFIG_HOME/vivaldi-flags.conf" # Vivaldi - "$XDG_CONFIG_HOME/vivaldi-stable.conf" # Vivaldi - -) - -electron_flags_path=( - "$XDG_CONFIG_HOME/electron-flags.conf" # General - "$XDG_CONFIG_HOME/code-flags.conf" # VSCode - "$XDG_CONFIG_HOME/qq-electron-flags.conf" # QQ -) - -for path in "${browser_flags_path[@]}"; do - if [ -f "$path" ] && [ "$FORCE_FILE" != "true" ]; then - echo "[INFO] Found Browser Flags: $path" - else - echo "[INFO] Creating Browser Flags: $path" - ln -sf "$BROWSER_FLAG" "$path" - fi -done - -for path in "${electron_flags_path[@]}"; do - if [ -f "$path" ] && [ "$FORCE_FILE" != "true" ]; then - echo "[INFO] Found Electron Flags: $path" - else - echo "[INFO] Creating Electron Flags: $path" - ln -sf "$ELECTRON_FLAG" "$path" - fi -done diff --git a/bootstrap/linux/electron_flag_append.py b/bootstrap/linux/electron_flag_append.py deleted file mode 100644 index 31388bc..0000000 --- a/bootstrap/linux/electron_flag_append.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env false -# TODO: This script is not ready for use yet -# -*- coding: utf-8 -*- -# Append Electron argument (for wayland) to *.desktop files - -import argparse -import configparser -import os - -APPEND_ARG_FILE = "~/.dotfiles/platforms/linux/electron-flags.conf" - - -with open(os.path.expanduser(APPEND_ARG_FILE)) as f: - APPEND_ARGS = list(map(str.strip, f.readlines())) - -# for file in desktop_files: -# config = configparser.ConfigParser() -# config.read(file) - - -def append_arg(file): - config = configparser.ConfigParser() - config.read(file) - try: - exec_line = config["Desktop Entry"].get("Exec") - except KeyError: - print(f"Skipping {file} as it does not have an Exec key") - return - print(f"Appending {APPEND_ARGS} to {exec_line}") - config["Desktop Entry"].update({"Exec": f"{exec_line} {' '.join(APPEND_ARGS)}"}) - with open(file, "w") as f: - config.write(f) - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument("-f", "--file", help="Desktop file to modify") - args = parser.parse_args() - append_arg(args.file) - pass - - -if __name__ == "__main__": - main() diff --git a/bootstrap/linux/main.bash b/bootstrap/linux/main.bash deleted file mode 100644 index fe6c916..0000000 --- a/bootstrap/linux/main.bash +++ /dev/null @@ -1,193 +0,0 @@ -#!/usr/bin/env bash -# vim:ft=bash - -set -e - -echo "Running the setup script" - -# Variables - -export DOTFILES="${DOTFILES:-$HOME/.dotfiles}" - -# If is in the sudo or wheel group, set the WHEEL variable to 1 -WHEEL=0 -groups "$(whoami)" | grep -E -q '\b(sudo|wheel)\b' && WHEEL=1 - -if [ "$WHEEL" -eq 1 ]; then - echo "[INFO] Running as sudo or wheel group" -else - echo "[INFO] Not running as sudo or wheel group" -fi - -export WHEEL - -GUI_SETUP=0 - -IS_WSL=0 -WINDOWS_USER="" -PACKAGE_MANAGER="" - -# WSL detection -# NOTE: This is NOT a POSIX-compliant way, for POSIX-compliant way, use case/esac -if [[ "$(uname -r)" = *icrosoft* ]]; then - echo "[INFO] Running on WSL" - WINDOWS_USER="$(cmd.exe /c "echo %USERNAME%" | tr -d '\r')" - IS_WSL=1 -fi - -if [ "$IS_WSL" -eq 1 ]; then - if [[ "$(uname -r)" = *Microsoft* ]]; then - IS_WSL=1 - elif [[ "$(uname -r)" = *microsoft* ]]; then - IS_WSL=2 - fi -fi - -if [ "$IS_WSL" -eq 1 ]; then - echo "[INFO] Running on WSL1 Skipping GUI setup" -else - read -p "[ACTION] Do you want to setup Linux GUI? (y/N) " -r choice - case "$choice" in - y | Y) - GUI_SETUP=1 - ;; - *) - echo "[INFO] Skipping GUI setup" - ;; - esac -fi - -export GUI_SETUP - -# base-devel - -if [ "$WHEEL" -eq 1 ]; then - echo "[INFO] Installing basic build tools" - if command -v apt >/dev/null 2>&1; then - sudo apt update - sudo apt install -y build-essential - PACKAGE_MANAGER="apt" - elif command -v pacman >/dev/null 2>&1; then - sudo pacman -Syu --noconfirm - sudo pacman -S --noconfirm base-devel - PACKAGE_MANAGER="pacman" - else - echo "[ERROR] Unsupported package manager" - read -p "[ACTION] Do you still want to continue? (y/N) " -r choice - case "$choice" in - y | Y) - : - ;; - *) - echo "[ERROR] Exiting" - exit 1 - ;; - esac - fi -fi - -echo "[INFO] Cloning Dotfiles" - -if [ -d "$DOTFILES" ]; then - echo "[INFO] Dotfiles already cloned" -elif [ "$IS_WSL" -eq 1 ]; then - ln -sf "/mnt/c/Users/$WINDOWS_USER/.dotfiles" "$DOTFILES" -elif command -v git >/dev/null 2>&1; then - git clone https://github.com/js0ny/dotfiles.git "$DOTFILES" --depth 1 -else - echo "[ERROR] Git is not installed" - exit 1 -fi - -if [ "$WHEEL" -eq 0 ]; then - read -p "[ACTION] Do you want to install some AppImages (by AppMan)? (y/N) " -r choice - case "$choice" in - y | Y) - source "$DOTFILES/bootstrap/linux/appman.bash" - ;; - *) - echo "[INFO] Skipping AppMan installation" - : - ;; - esac -fi - -echo "[INFO] Setting up symbolic links" - -source "$DOTFILES"/bootstrap/linux/symlinks.bash - -set +x - -if [ "$WHEEL" -eq 1 ]; then - source "$DOTFILES"/tools/bash/xdg-compat.sh - source "$DOTFILES"/tools/bash/global.bashrc -fi -source "$DOTFILES"/tools/bash/profile -source "$DOTFILES"/tools/bash/bashrc -source "$DOTFILES"/tools/bash/bash_aliases - -set -x - -if command -v zsh >/dev/null 2>&1; then - - read -p "[ACTION] Do you want to setup zsh? (Y/n) " -r choice - case "$choice" in - n | N) - : - ;; - *) - source "$DOTFILES"/bootstrap/components/zsh.sh - ;; - esac -fi - -if [ "$WHEEL" -eq 0 ]; then - echo "Done!" - exit 0 -fi - -# TODO: Add this part -read -p "[ACTION] Do you want to use other package managers? (y/N) " -r choice -case "$choice" in - y | Y) - : - ;; - *) - : - ;; -esac - -echo "[INFO] Installing Doom Emacs" - -source "$DOTFILES"/bootstrap/components/emacs.sh - -if [ "$IS_WSL" -eq 1 ]; then - ln -sf "/mnt/c/Users/$WINDOWS_USER" "$HOME/winhome" - ln -sf "/mnt/c/Users/$WINDOWS_USER/Downloads" "$HOME/Downloads" - ln -sf "/mnt/c/Users/$WINDOWS_USER/Documents" "$HOME/Documents" - ln -sf "/mnt/c/Users/$WINDOWS_USER/Desktop" "$HOME/Desktop" - ln -sf "/mnt/c/Users/$WINDOWS_USER/Pictures" "$HOME/Pictures" - ln -sf "/mnt/c/Users/$WINDOWS_USER/Music" "$HOME/Music" - ln -sf "/mnt/c/Users/$WINDOWS_USER/Videos" "$HOME/Videos" -fi - -if [ "$GUI_SETUP" -eq 0 ]; then - echo "Done!" - exit 0 -fi - -# Wayland - -source "$DOTFILES"/bootstrap/linux/chromium-flags.bash - -# Rime - -source "$DOTFILES"/bootstrap/components/rime.sh - -echo "[INFO] Installing Color Scheme (Catppuccin Mocha)" - -# fish $DOTFILES/bootstrap/temp/mocha_port.fish - -source "$DOTFILES"/bootstrap/components/mocha-port.bash - -echo "Done!" diff --git a/bootstrap/linux/symlinks.bash b/bootstrap/linux/symlinks.bash deleted file mode 100644 index 6842444..0000000 --- a/bootstrap/linux/symlinks.bash +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# vim:ft=bash -set -e # Exit immediately if a command exits with a non-zero status - -declare -A linkDots - -source "$DOTFILES/bootstrap/components/symlinks.bash" - -echo "[INFO] DOTFILES = $DOTFILES" - -echo "[ACTION] Press any key to proceed" -read -r -n1 -s - -echo "[INFO] Setting up symbolic links" - -for src in "${!linkDots[@]}"; do - dest="${linkDots[$src]}" - echo "Linking $src to $dest" - if [ -d "$src" ]; then - test -d "$dest" && mv "$dest" "$dest.bak" - ln -sf "$src" "$dest" - elif [ -f "$src" ]; then - dest_parent=$(dirname "$dest") - test -d "$dest_parent" || mkdir -p "$dest_parent" - ln -sf "$src" "$dest" - else - echo "[ERROR] $src does not exist" - fi -done diff --git a/bootstrap/linux/wsl.bash b/bootstrap/linux/wsl.bash deleted file mode 100644 index 8b13789..0000000 --- a/bootstrap/linux/wsl.bash +++ /dev/null @@ -1 +0,0 @@ - diff --git a/bootstrap/macOS/Brewfile b/bootstrap/macOS/Brewfile deleted file mode 100644 index ab56c89..0000000 --- a/bootstrap/macOS/Brewfile +++ /dev/null @@ -1,150 +0,0 @@ -tap "daipeihust/tap" -tap "felixkratz/formulae" -tap "homebrew/bundle" -tap "homebrew/services" -tap "koekeishiya/formulae" -tap "nikitabobko/tap" -tap "railwaycat/emacsmacport" -brew "age" -brew "aichat" -brew "bat" -brew "bottom" -brew "broot" -brew "btop" -brew "cmake" -brew "composer" -brew "coreutils" -brew "curlie" -brew "dark-mode" -brew "dos2unix" -brew "duf" -brew "dust" -brew "duti" -brew "fastfetch" -brew "fd" -brew "ffmpeg" -brew "fish" -brew "fzf" -brew "gh" -brew "ghcup" -brew "git-delta" -brew "glow" -brew "go" -brew "hugo" -brew "hyperfine" -brew "imagemagick" -brew "ipython" -brew "julia" -brew "just" -brew "lazygit" -brew "less" -brew "pkgconf" -brew "lua" -brew "librime" -brew "lsd" -brew "luajit" -brew "luarocks" -brew "macvim", link: false -brew "node" -brew "markdownlint-cli" -brew "mas" -brew "neovim" -brew "nowplaying-cli" -brew "nushell" -brew "openjdk@21" -brew "pandoc" -brew "pipx" -brew "pnpm" -brew "procs" -brew "ripgrep" -brew "ripgrep-all" -brew "rlwrap" -brew "rust" -brew "rustup" -brew "screenfetch" -brew "sd" -brew "sevenzip" -brew "speedtest-cli" -brew "starship" -brew "switchaudio-osx" -brew "tldr" -brew "tmux" -brew "tree" -brew "uv" -brew "vim" -brew "wget" -brew "wget2" -brew "yarn" -brew "yazi" -brew "zellij" -brew "zoxide" -brew "daipeihust/tap/im-select" -brew "felixkratz/formulae/borders" -brew "felixkratz/formulae/sketchybar" -brew "koekeishiya/formulae/skhd" -brew "koekeishiya/formulae/yabai" -brew "railwaycat/emacsmacport/emacs-mac" -cask "activitywatch" -cask "alacritty" -cask "alex313031-thorium" -cask "alt-tab" -cask "apparency" -cask "appcleaner" -cask "arc" -cask "betterdisplay" -cask "chatgpt" -cask "discord" -cask "dotnet-sdk" -cask "font-caskaydia-cove-nerd-font" -cask "font-iosevka-nerd-font" -cask "font-jetbrains-mono-nerd-font" -cask "font-lxgw-wenkai" -cask "font-sf-mono" -cask "font-sf-pro" -cask "google-drive" -cask "iina" -cask "iterm2" -cask "jordanbaird-ice" -cask "karabiner-elements" -cask "keka" -cask "keyguard" -cask "kitty" -cask "localsend" -cask "ltspice" -cask "macfuse" -cask "neovide" -cask "obsidian" -cask "onedrive" -cask "orbstack" -cask "powershell" -cask "protonvpn" -cask "qlcolorcode" -cask "qlimagesize" -cask "qlmarkdown" -cask "qlstephen" -cask "qlvideo" -cask "qspace-pro" -cask "quicklook-json" -cask "quicklookase" -cask "r" -cask "raycast" -cask "rider" -cask "rstudio" -cask "rustdesk" -cask "scroll-reverser" -cask "sf-symbols" -cask "sioyek" -cask "skim" -cask "squirrel" -cask "steam" -cask "suspicious-package" -cask "telegram-desktop" -cask "typora" -cask "visual-studio-code" -cask "vivaldi" -cask "warp" -cask "wezterm" -cask "zen-browser" -mas "QQ", id: 451108668 -mas "SnippetsLab", id: 1006087419 -mas "微信", id: 836500024 diff --git a/bootstrap/macOS/duti.zsh b/bootstrap/macOS/duti.zsh deleted file mode 100644 index 8f1ccf5..0000000 --- a/bootstrap/macOS/duti.zsh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/zsh -# duti.zsh -# Set default apps (duti) -# The id of the app can be found by running -# `osascript -e 'id of app "AppName"'` -brew install --formula duti -echo "[INFO] Setting Default Apps" - -# Define an associative array with file extensions and corresponding app IDs -typeset -A app_defaults -app_defaults=( - # Markdown -> Typora - .md abnerworks.Typora - .markdown abnerworks.Typora - # PDF -> Sioyek - .pdf info.sioyek.sioyek - # Raw Text -> Neovide - .txt com.neovide.neovide - # Archive -> Keka - .zip com.aone.keka - .rar com.aone.keka - .7z com.aone.keka - .tar com.aone.keka - # Source Code Light -> Neovim - .gitignore com.neovide.neovide - .vimrc com.neovide.neovide - .vim com.neovide.neovide - .lua com.neovide.neovide - .py com.neovide.neovide - .jl com.neovide.neovide - .sh com.neovide.neovide - .c com.neovide.neovide - # Source Code DOTNET -> VSCode - .cs com.microsoft.VSCode - .fs com.microsoft.VSCode - .fsx com.microsoft.VSCode - .csx com.microsoft.VSCode - .ps1 com.microsoft.VSCode - # Source Code Web -> VSCode - .js com.microsoft.VSCode - .ts com.microsoft.VSCode - .jsx com.microsoft.VSCode - .tsx com.microsoft.VSCode - .css com.microsoft.VSCode - .scss com.microsoft.VSCode - .sass com.microsoft.VSCode - .vue com.microsoft.VSCode - # Source Code Config -> Neovim - .json com.neovide.neovide - .yaml com.neovide.neovide - .yml com.neovide.neovide - .toml com.neovide.neovide - .ini com.neovide.neovide - .cfg com.neovide.neovide - .conf com.neovide.neovide - .kdl com.neovide.neovide - .xml com.neovide.neovide - # Source Code Jupyter -> VSCode - .ipynb com.microsoft.VSCode - # Source Code DotNet Project -> Rider - .sln com.jetbrains.rider - .csproj com.jetbrains.rider - .fsproj com.jetbrains.rider - # Video -> IINA - .mp4 com.colliderli.iina - .mkv com.colliderli.iina -) - -# Loop through the array and set the default apps -for ext app_id in ${(kv)app_defaults}; do - duti -s $app_id $ext all -done - -unset app_defaults diff --git a/bootstrap/macOS/main.zsh b/bootstrap/macOS/main.zsh deleted file mode 100644 index 07a3855..0000000 --- a/bootstrap/macOS/main.zsh +++ /dev/null @@ -1,106 +0,0 @@ -#! /bin/zsh - -echo "Running the setup script" -set -e -set -x - -# VARIABLES - -export DOTFILES="${DOTFILES:-$HOME/.dotfiles}" - -# In macOS, consider the user as sudoer by default -export WHEEL=1 -export GUI_SETUP=1 - -# Xcode Command Line Tools -echo "[INFO] Installing Xcode Command Line Tools" -echo "[ACTION] Request Human Takeover" - -xcode-select --install - -# Press any key to continue (if Xcode Command Line Tools are installed) -echo "[ACTION] Press any key to continue when xcode CLI tools are installed" -read -n 1 - -# System Preferences -# Installation Sources -echo "[INFO] Setting Installation Sources" -echo "[ACTION] Request Human Takeover" -echo "In macOS Sequoia, setup manually (System preferences -> Security & Privacy -> General -> Allow apps downloaded from: Anywhere)" -# sudo spctl --master-disable -# In Mac OS Sequoia, the command above is not working -# Should be set up manually (System Preferences -> Security & Privacy -> General -> Allow apps downloaded from: Anywhere) - -echo "[INFO] Installing Homebrew" -echo "[ACTION] Request Human Input" -/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - -echo "[ACTION] Press any key to continue when xcode CLI tools are installed" -read -n 1 - -echo "[INFO] Cloning Dotfiles" - -git clone https://github.com/js0ny/dotfiles.git $DOTFILES - -echo "[INFO] Setting up system properties" - -source $DOTFILES/bootstrap/macOS/plist.zsh - -read -p "[ACTION] Do you want to use sudo with touch ID? (Y/n) " -r choice -case "$choice" in - n | N) - : - ;; - *) - # Use `sudo cp` to prevent losing sudo access - sudo cp /etc/pam.d/sudo /etc/pam.d/sudo.bak - sudo cp $DOTFILES/platforms/mac/etc/pam.d/sudo /etc/pam.d/sudo - ;; -esac - -echo "[INFO] Installing Homebrew Packages" - -# Load Brewfile -eval "$(/opt/homebrew/bin/brew shellenv)" -brew bundle --file=$DOTFILES/bootstrap/macOS/Brewfile - -# Setting up emacs -ln -s /usr/local/opt/emacs-mac/Emacs.app /Applications/Emacs.app - -# Setting Default Apps - -source $DOTFILES/bootstrap/macOS/duti.zsh - -# Setting up Dotfiles - -source $DOTFILES/bootstrap/macOS/symlinks.zsh -source $DOTFILES/bootstrap/components/zsh.sh - -source $DOTFILES/tools/zsh/global.zshenv -source $DOTFILES/tools/zsh/zshenv -source $DOTFILES/tools/zsh/zshrc - -# Rime - -source $DOTFILES/bootstrap/components/rime.sh - -echo "[INFO] Installing Doom Emacs" - -source $DOTFILES/bootstrap/components/emacs.sh - - -echo "[INFO] Installing Color Scheme (Catppuccin Mocha)" - -bash $DOTFILES/bootstrap/components/mocha-port.bash - -# Misc - -dotnet tool install --global dotnet-repl - -pnpm install -g typescript -pnpm install -g tsx - -echo "Done! For additional setup, boot to recovery mode and run the following command:" -echo "csrutil enable --without fs --without debug --without nvram" -echo "Then, reboot the system" -echo "Run the post-install script to finish the setup" diff --git a/bootstrap/macOS/plist.zsh b/bootstrap/macOS/plist.zsh deleted file mode 100644 index 9d7982c..0000000 --- a/bootstrap/macOS/plist.zsh +++ /dev/null @@ -1,37 +0,0 @@ -## Finder -echo "[INFO] Setting Finder Preferences" -defaults write com.apple.finder QuitMenuItem -bool true # Quit with CMD+Q -defaults write com.apple.finder ShowPathbar -bool true # Show Path Bar -defaults write com.apple.finder ShowStatusBar -bool true # Show Status Bar -defaults write NSGlobalDomain AppleShowAllExtensions -bool true # Show All File Extensions -defaults write com.apple.finder AppleShowAllFiles -bool true # Show Hidden Files -defaults write com.apple.finder _FXSortFoldersFirst -bool true -defaults write com.apple.finder FinderSpawnTab -bool true -# Don't show External Hard Drives on Desktop -defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool false -defaults write com.apple.finder ShowHardDrivesOnDesktop -bool false -defaults write com.apple.finder ShowMountedServersOnDesktop -bool false -defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool false -# No DS_Store on Network -defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true -# Keyboard -# Disable Accent Menu -defaults write NSGlobalDomain ApplePressAndHoldEnabled -boolean false -killall Finder -killall Dock -## Dock -echo "[INFO] Setting Dock Preferences" -defaults write com.apple.dock persistent-apps -array -defaults write com.apple.dock persistent-others -array -defaults write com.apple.dock autohide -bool true # Autohide Dock -defaults write com.apple.dock autohide-time-modifier -float 0.5 -defaults write com.apple.dock autohide-delay -float 0 # Immediately Autohide Dock -defaults write com.apple.dock show-recents -bool false # Hide Recent Applications -killall Dock -## Trackpad -echo "[INFO] Setting Trackpad Preferences" -defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerDrag -bool true -defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerDrag -bool true -defaults write com.apple.AppleMultitouchTrackpad Clicking -bool true -defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true -defaults write -g NSWindowShouldDragOnGesture -bool true diff --git a/bootstrap/macOS/symlinks.zsh b/bootstrap/macOS/symlinks.zsh deleted file mode 100644 index f9466ca..0000000 --- a/bootstrap/macOS/symlinks.zsh +++ /dev/null @@ -1,29 +0,0 @@ -set -e # Exit immediately if a command exits with a non-zero status - -# 声明为关联数组 -typeset -A linkDots - -# 从通用配置文件加载 -source "$DOTFILES/bootstrap/components/symlinks.bash" - -echo "[INFO] DOTFILES = $DOTFILES" - -echo "[ACTION] Press any key to proceed" -read -r -n1 - -echo "[INFO] Setting up symbolic links" -# 使用 zsh 的关联数组语法 -for src in ${(k)linkDots}; do - dest="${linkDots[$src]}" - echo "Linking $src to $dest" - if [ -d "$src" ]; then - test -d $dest && mv $dest $dest.bak - ln -sf $src $dest - elif [ -f "$src" ]; then - dest_parent=$(dirname $dest) - test -d $dest_parent || mkdir -p $dest_parent - ln -sf $src $dest - else - echo "[ERROR] $src does not exist" - fi -done diff --git a/bootstrap/setup.ps1 b/bootstrap/setup.ps1 deleted file mode 100644 index fbbdd94..0000000 --- a/bootstrap/setup.ps1 +++ /dev/null @@ -1,223 +0,0 @@ -#Requires -RunAsAdministrator -# TODO: This file is under development -exit 1 - -$DOTFILES = if ($Env:DOTFILES) { $Env:DOTFILES } else { Join-Path "$Env:USERPROFILE" "dotfiles" } - - -New-Item -ItemType Directory -Path (Join-Path $Env:UserProfile "Temp") -Force - -winget install -e --id Git.Git - -if (Get-Command git -ErrorAction SilentlyContinue) { - git clone https://github.com/js0ny/dotfiles.git "$DOTFILES" --depth 1 -} -else { - Write-Output "[ERROR] Git is not installed" - exit 1 -} - -# Install scoop -Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression - -# Inline `sudo` -sudo sudo config --enable normal - -$BOOTSTRAP = Join-Path $DOTFILES "bootstrap" "win" - -. (Join-Path $BOOTSTRAP "Environment.ps1") -. (Join-Path $BOOTSTRAP "Registry.ps1") -. (Join-Path $BOOTSTRAP "Symlinks.ps1") - -scoop import (Join-Path $BOOTSTRAP "Scoopfile.json") - -# Rime - -$RIMEDIR = Join-Path $Env:AppData "Rime" -git clone --depth 1 https://github.com/js0ny/rime_wanxiang_pro.git $RIMEDIR - -Set-Location $RIMEDIR -just init -just clone_plum - -# The section below not done yet -exit 1 - -#!C:\Program Files\WindowsApps\Microsoft.PowerShell_7.4.6.0_x64__8wekyb3d8bbwe\pwsh.EXE -# Run with PowerShell 7 -winget install -e --id Git.Git -git clone https://github.com/js0ny/dotfiles.git ~\.dotfiles -Set-Location -Path ~\.dotfiles -Remove-Item -Force $PROFILE -$DOTFILES = "$HOME\.dotfiles" -New-Item -ItemType SymbolicLink -Path $PROFILE -Target "$DOTFILES\win\Microsoft.PowerShell_profile.ps1" -. $PROFILE -# Install Scoop -Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression -# Install Chocolatey -# Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) - -# Set Dotfiles -# $DOTFILES\.config -$folders = @("conda", "git", "ideavim", "ipython", "markdownlint", "npm", "NuGet", "nvim", "pip", "Vim") -foreach ($folder in $folders) { - New-Item -ItemType Directory -Path "$Env:XDG_CONFIG_HOME\$folder" -Force -} -New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\conda\.condarc" -Target "$DOTFILES\.config\conda\condarc.yaml" -Force -New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\git\config" -Target "$DOTFILES\.config\git\.gitconfig" -Force -New-Item -ItemType SymbolicLink -Path "~\.haskeline" -Target "$DOTFILES\.haskeline" -Force -New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\ideavim\.ideavimrc" -Target "$DOTFILES\.config\ideavim\.ideavimrc" -Force -New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\ipython" -Target "$DOTFILES\.config\ipython" -Force -# New-Item -ItemType SymbolicLink -Path "~\.markdownlint.json" -Target "$DOTFILES\.markdownlint.json" -Force -New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\npm\npmrc" -Target "$DOTFILES\.config\npm\npmrc" -Force -New-Item -ItemType SymbolicLink -Path "$Env:AppData\NuGet\NuGet.Config" -Target "$DOTFILES\.config\NuGet\NuGet.Config" -Force -New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\nvim" -Target "$DOTFILES\.config\nvim" -Force -New-Item -ItemType SymbolicLink -Path "$Env:AppData\pip\pip.ini" -Target "$DOTFILES\.config\pip\pip.conf" -Force -New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\Vim\_vimrc" -Target "$DOTFILES\.config\vim\vimrc" -Force -New-Item -ItemType SymbolicLink -Path "~\.wslconfig" -Target "$DOTFILES\win\.wslconfig" -Force -New-Item -ItemType SymbolicLink -Path "$Env:AppData\neovide\config.toml" -Target "$DOTFILES\win\neovide.toml" -Force -# New-Item -ItemType SymbolicLink -Path "~\.vscode.vimrc" -Target "$DOTFILES\vscode\vscode.vimrc" Use Absolute Path -# Hide dotfiles -Get-ChildItem -Force -Filter .* -Path $HOME | ForEach-Object { $_.Attributes += "Hidden" } -@( - Join-Path $HOME '.config' - Join-Path $HOME '.dotfiles' -) | ForEach-Object { - $_.Attributes -band -bnot [System.IO.FileAttributes]::Hidden -} -Set-Location $HOME\Documents -# Match WindowsPowerShell and PowerShell -Get-ChildItem -Force -Filter *owerShell | ForEach-Object { $_.Attributes += "Hidden" } - -# Windows Terminal -if (Get-Command wt -ErrorAction SilentlyContinue) { - Write-Output "Windows Terminal (wt) installed" -} -else { - winget install -e --id Microsoft.WindowsTerminal -} - -# Uninstall Windows Apps -Get-AppxPackage *solit* | Remove-AppxPackage # 纸牌 -Get-AppxPackage *sound* | Remove-AppxPackage # 錄音機 -Get-AppxPackage *camera* | Remove-AppxPackage # 相機 -Get-AppxPackage *weather* | Remove-AppxPackage # 天氣 -Get-AppxPackage *Map* | Remove-AppxPackage # 地圖 -# Get-AppxPackage *clipchamp* | Remove-AppxPackage # 其實這個還行 - -# Added Packages -scoop bucket add main -scoop bucket add nerd-fonts -scoop bucket add extras -scoop bucket add nonportable - -# CLI Tools -# winget install -e --id GnuWin32.Grep # Use Select-String instead -scoop install main/make -# winget install -e --id GnuWin32.Which # Use Get-Command instead -scoop install main/fzf -scoop install main/ripgrep -scoop install main/wget -scoop install main/wget2 -scoop install main/cmake -scoop install main/bat # modern cat -scoop install main/zoxide # Directory Jump -scoop install main/dos2unix # Convert line endings -scoop install main/hyperfine # Benchmark -scoop install main/bottom # System Monitor -scoop install main/delta # diff -scoop install extras/gpg4win - -# File Management -scoop install extras/everything -scoop install main/7zip -scoop install extras/bandizip -scoop install main/pandoc -scoop install extras/sumatrapdf -winget install -e --id Google.GoogleDrive -sudo scoop install nonportable/winbtrfs-np - -# System Enhancements -scoop install extras/fancontrol -scoop install extras/powertoys -scoop install extras/msiafterburner -winget install -e --id Yuanli.uTools -scoop install extras/geekuninstaller -scoop install extras/flow-launcher -# winget install -e --id AutoHotkey.AutoHotkey -scoop install extras/autohotkey -scoop install nonportable/mactype-np -scoop install extras/diskgenius -# winget install -e --id Nilesoft.Shell -# scoop install umi-ocr-paddle - -# Editor -scoop install main/vim -scoop install main/neovim -scoop install extras/vscodium -scoop install extras/vscode -scoop install extras/neovide - - -# Security -scoop bucket add keyguard https://github.com/AChep/keyguard-repo-scoop -scoop install keyguard/keyguard - -# PKM -scoop install extras/obsidian -winget install -e --id 9P7HPMXP73K4 # Siyuan -scoop install extras/typora -scoop install extras/zotero -scoop install extras/anki -# winget install -e --id Notion.Notion - -# Browser -# Use Microsoft Edge directly -# winget install -e --id TheBrowserCompany.Arc -# winget install -e --id Mozilla.Firefox.Nightly # Not working - -# Programming Languages -winget install -e --id Python.Python.3.13 -winget install -e --id Anaconda.Miniconda3 -winget install -e --id OpenJS.NodeJS -winget install -e --id Rustlang.Rustup -winget install -e --id Microsoft.DotNet.SDK.9 - -# Dev -scoop install extras/docker -scoop install extras/lazygit - -# IDE -scoop install extras/rider - -# Gaming -winget install -e --id Valve.Steam - -# IME -winget install -e --id Rime.Weasel # 小狼毫 Rime - -# Misc -winget install -e --id 9N5LW3JBCXKF --source msstore # MSIX Packaging Tool -winget install -e --id 9PKTQ5699M62 --source msstore # iCloud -winget install -e --id RazerInc.RazerInstaller # Razer Synapse - -# Social -winget install -e --id 9N97ZCKPD60Q --source msstore # Unigram (Telegram client) -winget install -e --id Tencent.QQ.NT -winget install -e --id XPFCKBRNFZQ62G --source msstore # WeChat in Windows Store (MSIX) - -# Others -winget install -e --id Appest.TickTick -winget install -e --id 9NBLGGH4Z1SP --source msstore # ShareX (screen capture) - -# Fonts -scoop install FiraCode-NF -scoop install CascadiaCode-NF -scoop install LXGWWenKai # 霞鹜文楷 -scoop install LXGWWenKaiMono # 霞鹜文楷Mono - -# WSL -scoop install archwsl -wsl --set-version Arch 1 diff --git a/bootstrap/setup.sh b/bootstrap/setup.sh deleted file mode 100644 index bd6c661..0000000 --- a/bootstrap/setup.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# shellcheck disable=SC1090 shell=sh -# Date: 2025-02-11 -# Author: js0ny -# IMPORTANT: The default `bash` in macOS is outdated, run with zsh or install the latest `bash` via Homebrew -# If you are macOS, run `xcode select --install` first - -set -o errexit -set -o xtrace - -DOTFILES="${DOTFILES:-$HOME/.dotfiles}" - -mkdir -p ~/.local/.tmp - -export DOTFILES - -case "$(uname)" in - Linux) - curl https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/bootstrap/linux/main.bash -o ~/.local/.tmp/main.bash - source ~/.local/.tmp/main.bash - rm -rf ~/.local/.tmp/main.bash - ;; - Darwin) - curl https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/bootstrap/macOS/main.zsh -o ~/.local/.tmp/main.zsh - zsh ~/.local/.tmp/main.zsh - rm -rf ~/.local/.tmp/main.zsh - ;; -esac diff --git a/bootstrap/win/Defender.ps1 b/bootstrap/win/Defender.ps1 deleted file mode 100644 index 06577de..0000000 --- a/bootstrap/win/Defender.ps1 +++ /dev/null @@ -1,23 +0,0 @@ -#Requires -RunAsAdministrator - -Set-MpPreference -EnableControlledFolderAccess 1 - -$protected = (Get-MpPreference).ControlledFolderAccessProtectedFolders -$protected += "$Env:UserProfile\.ssh" -$protected += "$Env:UserProfile\.config" -$protected += "$Env:UserProfile\Vault" -Set-MpPreference -ControlledFolderAccessProtectedFolders $protected - -$apps = (Get-MpPreference).ControlledFolderAccessAllowedApplications -$apps += "$Env:Windir\System32\OpenSSH\ssh.exe" -$apps += "$Env:ProgramFiles\GPSoftware\Directory Opus\DOpus.exe" -$apps += (Get-Command -Name code).Source.Replace("bin\code.cmd", "Code.exe") -$apps += (Get-Command -Name pwsh).Source -$apps += (Get-Command -Name git).Source -Set-MpPreference -ControlledFolderAccessAllowedApplications $apps - -$exclusion = (Get-MpPreference).ExclusionPath -$exclusion += "$env:ProgramFiles\JetBrains" -$exclusion += "$env:LocalAppData\JetBrains" -$exclusion += "D:\Source" -Set-MpPreference -ExclusionPath $exclusion diff --git a/bootstrap/win/Environments.ps1 b/bootstrap/win/Environments.ps1 deleted file mode 100644 index 06feb5f..0000000 --- a/bootstrap/win/Environments.ps1 +++ /dev/null @@ -1,93 +0,0 @@ -# Set Environment Variables -# Use %PATH_EXT% to prevent PATH from being too long -[System.Environment]::SetEnvironmentVariable("Path_EXT_0", "D:\bin", "User") -[System.Environment]::SetEnvironmentVariable("Path_EXT_0", "C:\Users\jsony\AppData\Local\Cargo\bin", "User") -[System.Environment]::SetEnvironmentVariable("Path_EXT_1", "C:\Users\jsony\AppData\Local\Go\bin", "User") -[System.Environment]::SetEnvironmentVariable("Path_EXT_2", "C:\Users\jsony\AppData\Local\Cargo\bin", "User") -$currentPath = [System.Environment]::GetEnvironmentVariable("Path", "User") -if ($currentPath -notlike "*%PATH_EXT%*") { - $currentPath += ";%PATH_EXT_0%;%PATH_EXT_1%;%PATH_EXT_2%" -} -[System.Environment]::SetEnvironmentVariable("Path", $currentPath, "User") -[System.Environment]::SetEnvironmentVariable("PATH_EXT_0", "", [System.EnvironmentVariableTarget]::Machine) -[System.Environment]::SetEnvironmentVariable("PATH_EXT_1", "", [System.EnvironmentVariableTarget]::Machine) -[System.Environment]::SetEnvironmentVariable("PATH_EXT_2", "", [System.EnvironmentVariableTarget]::Machine) -$currentPath = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine) -if ($currentPath -notlike "*%PATH_EXT%*") { - $currentPath += ";%PATH_EXT_0%;%PATH_EXT_1%;%PATH_EXT_2%" -} -[System.Environment]::SetEnvironmentVariable("Path", $currentPath, [System.EnvironmentVariableTarget]::Machine) -# Simulate XDG Base Directory Specification -$Env:XDG_CONFIG_HOME = "$Env:AppData" -$Env:XDG_DATA_HOME = "$Env:LocalAppData" -$Env:XDG_CACHE_HOME = "$Env:LocalAppData\Cache" -$Env:XDG_STATE_HOME = "$Env:LocalAppData\State" -[System.Environment]::SetEnvironmentVariable("XDG_CONFIG_HOME", "$Env:XDG_CONFIG_HOME", "User") -[System.Environment]::SetEnvironmentVariable("XDG_DATA_HOME", "$Env:XDG_DATA_HOME", "User") -New-Item -ItemType Directory -Path "$Env:LocalAppData\cache" -Force -[System.Environment]::SetEnvironmentVariable("XDG_CACHE_HOME", "$Env:XDG_CACHE_HOME", "User") -New-Item -ItemType Directory -Path "$Env:LocalAppData\state" -Force -[System.Environment]::SetEnvironmentVariable("XDG_STATE_HOME", "$Env:XDG_STATE_HOME", "User") -# Add environment variables -[System.Environment]::SetEnvironmentVariable("DOTFILES", "$DOTFILES", "User") -# Set potential environment variables to prevent softwares put their configs in the wrong place -# eg. dotfiles in %UserProfile% -# ~\.aws -> %AppData%\aws :: AWS CLI -New-Item -ItemType Directory -Path "$Env:AppData\aws" -Force -[System.Environment]::SetEnvironmentVariable("AWS_CONFIG_FILE", "$Env:AppData\aws\config", "User") -[System.Environment]::SetEnvironmentVariable("AWS_SHARED_CREDENTIALS_FILE", "$Env:AppData\aws\credentials", "User") -# ~\.azure -> %LocalAppData%\Azure :: Azure CLIcargo install --list -[System.Environment]::SetEnvironmentVariable("AZURE_CONFIG_DIR", "$Env:LocalAppData\Azure", "User") -# ~\.cargo -> %LocalAppData%\Cargo :: Rust https://doc.rust-lang.org/cargo/guide/cargo-home.html -[System.Environment]::SetEnvironmentVariable("CARGO_HOME", "$Env:LocalAppData\Cargo", "User") -# ~\.docker -> %AppData%\dotDocker :: Docker (Docker takes %AppData%\Docker, use dotDocker instead) -[System.Environment]::SetEnvironmentVariable("DOCKER_CONFIG", "$Env:AppData\dotDocker", "User") -# ~\.dotnet -> %LocalAppData%\dotNET :: .NET Core -[System.Environment]::SetEnvironmentVariable("DOTNET_CLI_HOME", "$Env:LocalAppData\dotNET", "User") -# ~\.emacs.d -> %AppData%\.emacs.d :: Emacs (This is default) -# [System.Environment]::SetEnvironmentVariable("EMACS_HOME", "$Env:AppData\emacs.d", "User") -# ~\go -> %LocalAppData%\GO :: golang -[System.Environment]::SetEnvironmentVariable("GOPATH", "$Env:LocalAppData\GO", "User") -# ~\.ipython -> %AppData%\ipython :: IPython -# IPython won't check XDG on Windows https://github.com/ipython/ipython/blob/0615526f80691452f2e282c363bce197c0141561/IPython/utils/path.py#L200 -[System.Environment]::SetEnvironmentVariable("IPYTHONDIR", "$Env:AppData\ipython", "User") -# ~\.julia -> %LocalAppData%\julia :: Julia -[System.Environment]::SetEnvironmentVariable("JULIA_DEPOT_PATH", "$Env:LocalAppData\julia", "User") -# ~\_lesshst -> %LocalAppData%\state\lesshst :: less -[System.Environment]::SetEnvironmentVariable("LESSHISTFILE", "$Env:XDG_STATE_HOME\lesshst", "User") -# %AppData%\less\lesskey :: less -New-Item -ItemType Directory -Path "$Env:AppData\less" -Force -[System.Environment]::SetEnvironmentVariable("LESSKEYIN", "$Env:AppData\less\lesskey", "User") -# ~\.matplotlib -> %LocalAppData%\matplotlib :: Matplotlib -[System.Environment]::SetEnvironmentVariable("MPLCONFIGDIR", "$Env:LocalAppData\matplotlib", "User") -# ~\.npmrc -> %AppData%\npm\npmrc :: npm -[System.Environment]::SetEnvironmentVariable("NPM_CONFIG_USERCONFIG", "$Env:AppData\npm\npmrc", "User") -# ~\.node_repl_history -> %LocalAppData%\state\node\repl_history :: Node.js -New-Item -ItemType Directory -Path "$Env:XDG_STATE_HOME\node" -Force -[System.Environment]::SetEnvironmentVariable("NODE_REPL_HISTORY", "$Env:XDG_STATE_HOME\node\repl_history", "User") -# ~\.ts_node_repl_history -> %LocalAppData%\state\node\ts_node_repl_history :: Node.js -# NOTE: ts-node doesn't support this yet -# [System.Environment]::SetEnvironmentVariable("TS_NODE_REPL_HISTORY", "$Env:XDG_STATE_HOME\node\ts_node_repl_history", "User") -# ~\.nuget\packages -> %LocalAppData%\cache\NuGet\packages :: NuGet -[System.Environment]::SetEnvironmentVariable("NUGET_PACKAGES", "$Env:XDG_CACHE_HOME\NuGet\packages", "User") -# ~\.omnisharp -> %AppData%\OmniSharp :: OmniSharp -[System.Environment]::SetEnvironmentVariable("OMNISHARPHOME", "$Env:AppData\OmniSharp", "User") -# ~\.python_history -> %LocalAppData%\state\python\python_history :: Python -# Only works for Python 3.13+ https://docs.python.org/3.13/using/cmdline.html#envvar-PYTHON_HISTORY -New-Item -ItemType Directory -Path "$Env:XDG_STATE_HOME\python" -Force -[System.Environment]::SetEnvironmentVariable("PYTHON_HISTORY", "$Env:XDG_STATE_HOME\python\python_history", "User") -# ~\.rustup -> %LocalAppData%\Rustup :: Rust -[System.Environment]::SetEnvironmentVariable("RUSTUP_HOME", "$Env:LocalAppData\Rustup", "User") -# ~\.vimrc -> %AppData%\Vim\_vimrc :: Vim -New-Item -ItemType Directory -Path "$Env:AppData\Vim" -Force -[System.Environment]::SetEnvironmentVariable("VIM", "$Env:AppData\Vim", "User") -[System.Environment]::SetEnvironmentVariable("KOMOREBI_CONFIG_HOME", "$Env:AppData\komorebi", "User") -# ~\.vuerc -> %AppData%\vue\.vuerc :: Vue CLI -# Currently, Vue CLI doesn't support file path configuration:https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli/lib/confifile -# [System.Environment]::SetEnvironmentVariable("VUE_CLI_CONFIG_PATH", "$Env:AppData\vue\.vuerc", "User") -# ~\.wget-hsts -> %LocalAppData%\cache\wget-hsts :: wget -# Use Alias, wget host file path is not configurable -# ~\.yarnrc -> %AppData%\yarn\config.yaml :: Yarn v1 -# Use Alias, yarnrc path is not configurable - -# Reload required here to make sure the environment variables are set diff --git a/bootstrap/win/Registry.ps1 b/bootstrap/win/Registry.ps1 deleted file mode 100644 index a170680..0000000 --- a/bootstrap/win/Registry.ps1 +++ /dev/null @@ -1,11 +0,0 @@ - -# Disable StickyKeys -REG ADD "HKEY_CURRENT_USER\Control Panel\Accessibility\StickyKeys" /v "Flags" /t REG_SZ /d "506" /f - -# Disable Hyper+Keys to open Office apps -REG ADD HKCU\Software\Classes\ms-officeapp\Shell\Open\Command /t REG_SZ /d rundll32 - -# Disable DOS 8.3 file name creation -sudo fsutil 8dot3name set 1 -# Delete all known DOS 8.3 file name -fsutil 8dot3name strip /s /v C:\ diff --git a/bootstrap/win/Tasks.ps1 b/bootstrap/win/Tasks.ps1 deleted file mode 100644 index d12756f..0000000 --- a/bootstrap/win/Tasks.ps1 +++ /dev/null @@ -1,21 +0,0 @@ -#Requires -RunAsAdministrator - -Write-Output "[INFO] Setting up KMonad Tasks" - -# PowerShell Path, use 7 if available -if (Get-Command "pwsh" -ErrorAction SilentlyContinue) { - $PowerShellPath = (Get-Command "pwsh").Source -} -else { - $PowerShellPath = (Get-Command "powershell").Source -} - -$DotStartUpPath = "$Env:DOTFILES\platforms\win\start" - -$KMonadRunnerPath = Join-Path $DotStartUpPath "KMonad.ps1" -$Action = New-ScheduledTaskAction -Execute $PowerShellPath -Argument "-NoProfile -ExecutionPolicy Bypass -File $KMonadRunnerPath" -$Trigger = New-ScheduledTaskTrigger -AtLogOn -$Principal = New-ScheduledTaskPrincipal -UserId "$env:USERNAME" -LogonType Interactive -RunLevel Highest -$Settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -DontStopOnIdleEnd -Hidden - -Register-ScheduledTask -TaskName "Start Kmonad" -Action $Action -Trigger $Trigger -Principal $Principal -Settings $Settings -TaskPath "\Personal" diff --git a/bootstrap/win/symlinks.ps1 b/bootstrap/win/symlinks.ps1 deleted file mode 100644 index 4b137ad..0000000 --- a/bootstrap/win/symlinks.ps1 +++ /dev/null @@ -1,78 +0,0 @@ -# $DOTFILES\bootstrap\set_symlink_win.ps1 -# Date: 2024-12-01 -# Author: js0ny -# Set symlinks for dotfiles on Windows -# 在 Windows 上设置 配置文件的符号链接 - -# Run this with Administrator privileges - -$DOTFILES = Join-Path $Env:UserProfile ".dotfiles" -$BASE_COMMON = Join-Path $DOTFILES "common" -$BASE_TOOLS = Join-Path $DOTFILES "tools" -$BASE_WIN = Join-Path $DOTFILES "platforms" "win" -$STARTUP = [System.Environment]::GetFolderPath("Startup") - -$BAT_CONF = Join-Path $Env:AppData "bat" "config" -if ((Get-Command bat).Source -ccontains "scoop") { - $BAT_CONF = Join-Path (scoop prefix bat) "config" -} - - -$SIOYEKDIR = scoop prefix sioyek - -$SIOYEKCFG = Get-ChildItem "$BASE_TOOLS\sioyek" -Filter "*.config" - -foreach ($cfg in $SIOYEKCFG) { - $cfgName = $cfg.Name - $cfgPath = Join-Path $SIOYEKDIR $cfgName - New-Item -ItemType SymbolicLink -Target $cfg -Path $cfgPath -Force -} - -$linkDots = @{ - "$BASE_WIN\wslconfig" = "$Env:UserProfile\.wslconfig" - "$BASE_WIN\glzr" = "$Env:UserProfile\.glzr" - "$BASE_WIN\neovide.toml" = "$Env:AppData\neovide\config.toml" - "$BASE_WIN\vsvimrc" = "$Env:UserProfile\.vsvimrc" - "$BASE_COMMON\bat.config" = "$BAT_CONF" - "$BASE_COMMON\condarc.yaml" = "$Env:XDG_CONFIG_HOME\conda\.condarc" - "$BASE_COMMON\glow.yaml" = "$Env:AppData\glow\glow.yml" - "$BASE_COMMON\haskeline" = "$Env:UserProfile\.haskeline" - "$BASE_COMMON\ideavimrc" = "$Env:XDG_CONFIG_HOME\ideavim\ideavimrc" - "$BASE_COMMON\lazygit.yaml" = "$Env:AppData\lazygit\config.yml" - "$BASE_COMMON\lesskey" = "$Env:LessKeyIn" - "$BASE_COMMON\lsd" = "$Env:AppData\lsd\config.yaml" - "$BASE_COMMON\npmrc" = "$Env:NPM_CONFIG_USERCONFIG" - "$BASE_COMMON\NuGet.Config" = "$Env:AppData\NuGet\NuGet.Config" - "$BASE_COMMON\starship.toml" = "$Env:UserProfile\.config\starship.toml" - "$BASE_COMMON\pip.conf" = "$Env:AppData\pip\pip.ini" - "$BASE_COMMON\vimrc.noxdg.vimrc" = "$Env:UserProfile\_vimrc" - "$BASE_COMMON\emacs.d" = "$Env:AppData\.emacs.d" - "$BASE_TOOLS\ipython" = "$Env:IPYTHONDIR" - "$BASE_TOOLS\nvim" = "$Env:XDG_CONFIG_HOME\nvim" - "$BASE_TOOLS\wezterm" = "$Env:XDG_CONFIG_HOME\wezterm" - "$BASE_TOOLS\yazi" = "$Env:AppData\yazi\config" - "$BASE_TOOLS\zed" = "$Env:AppData\Zed" -} - - - -foreach ($src in $linkDots.Keys) { - $dest = $linkDots[$src] - # Auto create directories (Untested) - if (Test-Path -Path $src -PathType Container) { - New-Item -ItemType Directory -Path $dest -Force - } - else { - $Local:destParent = Split-Path -Path $dest -Parent - New-Item -ItemType Directory -Path $destParent -Force - } - if (Test-Path -Path $dest) { - Move-Item $dest "$dest.bak" -Force - } - New-Item -ItemType SymbolicLink -Target $src -Path $dest -Force -} - -New-Item -ItemType SymbolicLink -Target "$BASE_WIN\Microsoft.PowerShell_profile.ps1" -Path "$Env:UserProfile\Documents\PowerShell\Microsoft.PowerShell_profile.ps1" -Force - -Copy-Item (Join-Path $BASE_WIN "ahk" "bin" "Caps.exe") $STARTUP -Copy-Item (Join-Path $BASE_COMMON "gitconfig") $Env:UserProfile diff --git a/tools/doom/beancount.el b/dot_config/doom/beancount.el similarity index 100% rename from tools/doom/beancount.el rename to dot_config/doom/beancount.el diff --git a/tools/doom/calendar.el b/dot_config/doom/calendar.el similarity index 100% rename from tools/doom/calendar.el rename to dot_config/doom/calendar.el diff --git a/tools/doom/config.el b/dot_config/doom/config.el similarity index 100% rename from tools/doom/config.el rename to dot_config/doom/config.el diff --git a/dot_config/doom/dot_custom.el b/dot_config/doom/dot_custom.el new file mode 100644 index 0000000..418534a --- /dev/null +++ b/dot_config/doom/dot_custom.el @@ -0,0 +1,13 @@ +;;; -*- lexical-binding: t -*- +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(auth-source-save-behavior nil)) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/tools/doom/.gitignore b/dot_config/doom/dot_gitignore similarity index 100% rename from tools/doom/.gitignore rename to dot_config/doom/dot_gitignore diff --git a/tools/doom/evil.el b/dot_config/doom/evil.el similarity index 100% rename from tools/doom/evil.el rename to dot_config/doom/evil.el diff --git a/tools/doom/init.el b/dot_config/doom/init.el similarity index 100% rename from tools/doom/init.el rename to dot_config/doom/init.el diff --git a/tools/doom/lisp/org-pomodoro-music-controller.el b/dot_config/doom/lisp/org-pomodoro-music-controller.el similarity index 100% rename from tools/doom/lisp/org-pomodoro-music-controller.el rename to dot_config/doom/lisp/org-pomodoro-music-controller.el diff --git a/tools/doom/lisp/org-pomodoro-telegram-notifier.el b/dot_config/doom/lisp/org-pomodoro-telegram-notifier.el similarity index 100% rename from tools/doom/lisp/org-pomodoro-telegram-notifier.el rename to dot_config/doom/lisp/org-pomodoro-telegram-notifier.el diff --git a/tools/doom/org.el b/dot_config/doom/org.el similarity index 100% rename from tools/doom/org.el rename to dot_config/doom/org.el diff --git a/tools/doom/packages.el b/dot_config/doom/packages.el similarity index 100% rename from tools/doom/packages.el rename to dot_config/doom/packages.el diff --git a/tools/doom/snippets/org-mode/align-math b/dot_config/doom/snippets/org-mode/align-math similarity index 100% rename from tools/doom/snippets/org-mode/align-math rename to dot_config/doom/snippets/org-mode/align-math diff --git a/tools/doom/snippets/org-mode/display-math b/dot_config/doom/snippets/org-mode/display-math similarity index 100% rename from tools/doom/snippets/org-mode/display-math rename to dot_config/doom/snippets/org-mode/display-math diff --git a/tools/doom/snippets/org-mode/inline-math b/dot_config/doom/snippets/org-mode/inline-math similarity index 100% rename from tools/doom/snippets/org-mode/inline-math rename to dot_config/doom/snippets/org-mode/inline-math diff --git a/tools/doom/snippets/org-mode/limit b/dot_config/doom/snippets/org-mode/limit similarity index 100% rename from tools/doom/snippets/org-mode/limit rename to dot_config/doom/snippets/org-mode/limit diff --git a/tools/doom/snippets/org-mode/summation b/dot_config/doom/snippets/org-mode/summation similarity index 100% rename from tools/doom/snippets/org-mode/summation rename to dot_config/doom/snippets/org-mode/summation diff --git a/tools/doom/snippets/org-mode/unnumbered b/dot_config/doom/snippets/org-mode/unnumbered similarity index 100% rename from tools/doom/snippets/org-mode/unnumbered rename to dot_config/doom/snippets/org-mode/unnumbered diff --git a/tools/doom/telega.el b/dot_config/doom/telega.el similarity index 100% rename from tools/doom/telega.el rename to dot_config/doom/telega.el diff --git a/tools/doom/treemacs.el b/dot_config/doom/treemacs.el similarity index 100% rename from tools/doom/treemacs.el rename to dot_config/doom/treemacs.el diff --git a/dot_config/fish/completions/.keep b/dot_config/fish/completions/.keep new file mode 100644 index 0000000..e69de29 diff --git a/tools/fish/conf.d/0init.fish b/dot_config/fish/conf.d/0init.fish similarity index 100% rename from tools/fish/conf.d/0init.fish rename to dot_config/fish/conf.d/0init.fish diff --git a/tools/fish/conf.d/alias.fish b/dot_config/fish/conf.d/alias.fish similarity index 100% rename from tools/fish/conf.d/alias.fish rename to dot_config/fish/conf.d/alias.fish diff --git a/tools/fish/conf.d/colorscheme.fish b/dot_config/fish/conf.d/colorscheme.fish similarity index 100% rename from tools/fish/conf.d/colorscheme.fish rename to dot_config/fish/conf.d/colorscheme.fish diff --git a/tools/fish/conf.d/keymap.fish b/dot_config/fish/conf.d/keymap.fish similarity index 100% rename from tools/fish/conf.d/keymap.fish rename to dot_config/fish/conf.d/keymap.fish diff --git a/tools/fish/conf.d/keymap/+colemak.fish b/dot_config/fish/conf.d/keymap/+colemak.fish similarity index 100% rename from tools/fish/conf.d/keymap/+colemak.fish rename to dot_config/fish/conf.d/keymap/+colemak.fish diff --git a/tools/fish/conf.d/navi.fish b/dot_config/fish/conf.d/navi.fish similarity index 100% rename from tools/fish/conf.d/navi.fish rename to dot_config/fish/conf.d/navi.fish diff --git a/tools/fish/conf.d/prompt.fish b/dot_config/fish/conf.d/prompt.fish similarity index 100% rename from tools/fish/conf.d/prompt.fish rename to dot_config/fish/conf.d/prompt.fish diff --git a/tools/fish/conf.d/winterop.fish b/dot_config/fish/conf.d/winterop.fish similarity index 100% rename from tools/fish/conf.d/winterop.fish rename to dot_config/fish/conf.d/winterop.fish diff --git a/tools/fish/config.fish b/dot_config/fish/config.fish similarity index 100% rename from tools/fish/config.fish rename to dot_config/fish/config.fish diff --git a/tools/fish/.gitignore b/dot_config/fish/dot_gitignore similarity index 100% rename from tools/fish/.gitignore rename to dot_config/fish/dot_gitignore diff --git a/dot_config/fish/functions/.keep b/dot_config/fish/functions/.keep new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/fish/private_fish_variables b/dot_config/fish/private_fish_variables new file mode 100644 index 0000000..fcdebd7 --- /dev/null +++ b/dot_config/fish/private_fish_variables @@ -0,0 +1,39 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR __fish_initialized:3800 +SETUVAR fish_color_autosuggestion:brblack +SETUVAR fish_color_cancel:\x2dr +SETUVAR fish_color_command:normal +SETUVAR fish_color_comment:red +SETUVAR fish_color_cwd:green +SETUVAR fish_color_cwd_root:red +SETUVAR fish_color_end:green +SETUVAR fish_color_error:brred +SETUVAR fish_color_escape:brcyan +SETUVAR fish_color_history_current:\x2d\x2dbold +SETUVAR fish_color_host:normal +SETUVAR fish_color_host_remote:yellow +SETUVAR fish_color_normal:normal +SETUVAR fish_color_operator:brcyan +SETUVAR fish_color_param:cyan +SETUVAR fish_color_quote:yellow +SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold +SETUVAR fish_color_search_match:white\x1e\x2d\x2dbackground\x3dbrblack\x1e\x2d\x2dbold +SETUVAR fish_color_selection:white\x1e\x2d\x2dbackground\x3dbrblack\x1e\x2d\x2dbold +SETUVAR fish_color_status:red +SETUVAR fish_color_user:brgreen +SETUVAR fish_color_valid_path:\x2d\x2dunderline +SETUVAR fish_pager_color_background:\x1d +SETUVAR fish_pager_color_completion:normal +SETUVAR fish_pager_color_description:yellow\x1e\x2di +SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline +SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan\x1e\x2d\x2dbold +SETUVAR fish_pager_color_secondary_background:\x1d +SETUVAR fish_pager_color_secondary_completion:\x1d +SETUVAR fish_pager_color_secondary_description:\x1d +SETUVAR fish_pager_color_secondary_prefix:\x1d +SETUVAR fish_pager_color_selected_background:\x2dr +SETUVAR fish_pager_color_selected_completion:\x1d +SETUVAR fish_pager_color_selected_description:\x1d +SETUVAR fish_pager_color_selected_prefix:\x1d +SETUVAR fish_user_paths:/home/js0ny/\x2elocal/bin\x1e/home/js0ny/\x2elocal/build\x1e/usr/bin\x1e/usr/local/bin diff --git a/tools/fish/readme.md b/dot_config/fish/readme.md similarity index 100% rename from tools/fish/readme.md rename to dot_config/fish/readme.md diff --git a/tools/fish/themes/Catppuccin Latte.theme b/dot_config/fish/themes/Catppuccin Latte.theme similarity index 100% rename from tools/fish/themes/Catppuccin Latte.theme rename to dot_config/fish/themes/Catppuccin Latte.theme diff --git a/tools/fish/themes/Catppuccin Mocha.theme b/dot_config/fish/themes/Catppuccin Mocha.theme similarity index 100% rename from tools/fish/themes/Catppuccin Mocha.theme rename to dot_config/fish/themes/Catppuccin Mocha.theme diff --git a/tools/fish/themes/Rosé Pine Dawn.theme b/dot_config/fish/themes/Rosé Pine Dawn.theme similarity index 100% rename from tools/fish/themes/Rosé Pine Dawn.theme rename to dot_config/fish/themes/Rosé Pine Dawn.theme diff --git a/tools/kitty/dark-theme.auto.conf b/dot_config/kitty/dark-theme.auto.conf similarity index 100% rename from tools/kitty/dark-theme.auto.conf rename to dot_config/kitty/dark-theme.auto.conf diff --git a/tools/kitty/kitty.conf b/dot_config/kitty/kitty.conf similarity index 100% rename from tools/kitty/kitty.conf rename to dot_config/kitty/kitty.conf diff --git a/tools/kitty/light-theme.auto.conf b/dot_config/kitty/light-theme.auto.conf similarity index 100% rename from tools/kitty/light-theme.auto.conf rename to dot_config/kitty/light-theme.auto.conf diff --git a/tools/kitty/window.py b/dot_config/kitty/window.py similarity index 100% rename from tools/kitty/window.py rename to dot_config/kitty/window.py diff --git a/tools/nvim/.editorconfig b/dot_config/nvim/dot_editorconfig similarity index 100% rename from tools/nvim/.editorconfig rename to dot_config/nvim/dot_editorconfig diff --git a/tools/nvim/init.lua b/dot_config/nvim/init.lua similarity index 100% rename from tools/nvim/init.lua rename to dot_config/nvim/init.lua diff --git a/dot_config/nvim/lazy-lock.json b/dot_config/nvim/lazy-lock.json new file mode 100644 index 0000000..4d74762 --- /dev/null +++ b/dot_config/nvim/lazy-lock.json @@ -0,0 +1,53 @@ +{ + "LuaSnip": { "branch": "master", "commit": "de10d8414235b0a8cabfeba60d07c24304e71f5c" }, + "auto-session": { "branch": "main", "commit": "7d37d1cae7a39ff57da9a452d21b5dbfc5636c18" }, + "avante.nvim": { "branch": "main", "commit": "2791db9984d01674c3a507cc1a522ad7234f400a" }, + "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, + "bullets.vim": { "branch": "master", "commit": "1c13e510e11d08b0259e8e627f128359c5521962" }, + "catppuccin": { "branch": "main", "commit": "30fa4d122d9b22ad8b2e0ab1b533c8c26c4dde86" }, + "conform.nvim": { "branch": "master", "commit": "a0ab60ed666c56b37fd7ed1847d2ac52f2482ce0" }, + "copilot.lua": { "branch": "master", "commit": "f0c0d981de2737abc50bd7b5bb034ae440826827" }, + "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, + "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, + "fzf-lua": { "branch": "main", "commit": "7d66cd81cf485fb17c22d82021cc166ce332a14c" }, + "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, + "grug-far.nvim": { "branch": "main", "commit": "385d1949dc21d0c39e7a74b4f4a25da18817bc86" }, + "image.nvim": { "branch": "master", "commit": "5cbb891eb8dde53f350dde69e23106d4e85d898b" }, + "img-clip.nvim": { "branch": "main", "commit": "d8b6b030672f9f551a0e3526347699985a779d93" }, + "kanagawa.nvim": { "branch": "master", "commit": "debe91547d7fb1eef34ce26a5106f277fbfdd109" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, + "leetcode.nvim": { "branch": "master", "commit": "422b6beb4a64eca0524fbff94edd9550c156afc5" }, + "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, + "luasnip-latex-snippets.nvim": { "branch": "main", "commit": "d3dd5223ef37a99c4adf3b5c7844fc760751b397" }, + "multiple-cursors.nvim": { "branch": "main", "commit": "1ac15d047a4b265cc2389957bcc56ee561b29e02" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "cea666ef965884414b1b71f6b39a537f9238bdb2" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" }, + "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-dap": { "branch": "master", "commit": "968f89f8aac11b6bdbfc942c71d3436658c1435f" }, + "nvim-dap-python": { "branch": "master", "commit": "bd771691da93846b0fc7e095512146a150218bfd" }, + "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-surround": { "branch": "main", "commit": "d56752df477ebd808cb82cea2fc68cf7455abb21" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-treesitter-context": { "branch": "master", "commit": "dca8726fea2c14e1ce6adbaa76a04816fbfaff61" }, + "nvim-web-devicons": { "branch": "master", "commit": "c2599a81ecabaae07c49ff9b45dcd032a8d90f1a" }, + "obsidian.nvim": { "branch": "main", "commit": "705cc9b4f66eca1e54040ac819102e80a32896d3" }, + "org-bullets.nvim": { "branch": "main", "commit": "21437cfa99c70f2c18977bffd423f912a7b832ea" }, + "orgmode": { "branch": "master", "commit": "b924cbb7e9c5f2c34f84d92e49dc76e01f32cad9" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "render-markdown.nvim": { "branch": "main", "commit": "8074a9cc9a6f737320b7a0d76b2c4c3485155688" }, + "rose-pine": { "branch": "main", "commit": "72befaffeac38db7bdd49e0549eaa2c4806dd878" }, + "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, + "toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" }, + "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, + "typst-preview.nvim": { "branch": "master", "commit": "dea4525d5420b7c32eebda7de15a6beb9d6574fa" }, + "vim-beancount": { "branch": "master", "commit": "589a4f06f3b2fd7cd2356c2ef1dafadf6b7a97cf" }, + "vim-just": { "branch": "main", "commit": "04b0f122f14c83f55a0f8bb2a087754dc98cdccc" }, + "vim-wakatime": { "branch": "master", "commit": "3403495670f0ee08887401a28f8430dc4ac67429" }, + "vimtex": { "branch": "master", "commit": "dc90feacb86f7b85b0b791d8073eefc769a23725" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } +} diff --git a/tools/nvim/lsp/bashls.lua b/dot_config/nvim/lsp/bashls.lua similarity index 100% rename from tools/nvim/lsp/bashls.lua rename to dot_config/nvim/lsp/bashls.lua diff --git a/tools/nvim/lsp/beancount.lua b/dot_config/nvim/lsp/beancount.lua similarity index 100% rename from tools/nvim/lsp/beancount.lua rename to dot_config/nvim/lsp/beancount.lua diff --git a/tools/nvim/lsp/clangd.lua b/dot_config/nvim/lsp/clangd.lua similarity index 100% rename from tools/nvim/lsp/clangd.lua rename to dot_config/nvim/lsp/clangd.lua diff --git a/tools/nvim/lsp/gopls.lua b/dot_config/nvim/lsp/gopls.lua similarity index 100% rename from tools/nvim/lsp/gopls.lua rename to dot_config/nvim/lsp/gopls.lua diff --git a/tools/nvim/lsp/jdtls.lua b/dot_config/nvim/lsp/jdtls.lua similarity index 100% rename from tools/nvim/lsp/jdtls.lua rename to dot_config/nvim/lsp/jdtls.lua diff --git a/tools/nvim/lsp/jsonls.lua b/dot_config/nvim/lsp/jsonls.lua similarity index 100% rename from tools/nvim/lsp/jsonls.lua rename to dot_config/nvim/lsp/jsonls.lua diff --git a/tools/nvim/lsp/luals.lua b/dot_config/nvim/lsp/luals.lua similarity index 100% rename from tools/nvim/lsp/luals.lua rename to dot_config/nvim/lsp/luals.lua diff --git a/tools/nvim/lsp/markdown_oxide.lua b/dot_config/nvim/lsp/markdown_oxide.lua similarity index 100% rename from tools/nvim/lsp/markdown_oxide.lua rename to dot_config/nvim/lsp/markdown_oxide.lua diff --git a/tools/nvim/lsp/pyright.lua b/dot_config/nvim/lsp/pyright.lua similarity index 100% rename from tools/nvim/lsp/pyright.lua rename to dot_config/nvim/lsp/pyright.lua diff --git a/tools/nvim/lsp/rust_analyzer.lua b/dot_config/nvim/lsp/rust_analyzer.lua similarity index 100% rename from tools/nvim/lsp/rust_analyzer.lua rename to dot_config/nvim/lsp/rust_analyzer.lua diff --git a/tools/nvim/lsp/taplo.lua b/dot_config/nvim/lsp/taplo.lua similarity index 100% rename from tools/nvim/lsp/taplo.lua rename to dot_config/nvim/lsp/taplo.lua diff --git a/tools/nvim/lsp/vimls.lua b/dot_config/nvim/lsp/vimls.lua similarity index 100% rename from tools/nvim/lsp/vimls.lua rename to dot_config/nvim/lsp/vimls.lua diff --git a/tools/nvim/lsp/yamlls.lua b/dot_config/nvim/lsp/yamlls.lua similarity index 100% rename from tools/nvim/lsp/yamlls.lua rename to dot_config/nvim/lsp/yamlls.lua diff --git a/tools/nvim/lua/config/colors.lua b/dot_config/nvim/lua/config/colors.lua similarity index 100% rename from tools/nvim/lua/config/colors.lua rename to dot_config/nvim/lua/config/colors.lua diff --git a/tools/nvim/lua/config/colorscheme.lua b/dot_config/nvim/lua/config/colorscheme.lua similarity index 100% rename from tools/nvim/lua/config/colorscheme.lua rename to dot_config/nvim/lua/config/colorscheme.lua diff --git a/tools/nvim/lua/config/diagnostics.lua b/dot_config/nvim/lua/config/diagnostics.lua similarity index 100% rename from tools/nvim/lua/config/diagnostics.lua rename to dot_config/nvim/lua/config/diagnostics.lua diff --git a/tools/nvim/lua/config/icons.lua b/dot_config/nvim/lua/config/icons.lua similarity index 100% rename from tools/nvim/lua/config/icons.lua rename to dot_config/nvim/lua/config/icons.lua diff --git a/tools/nvim/lua/config/keymaps.lua b/dot_config/nvim/lua/config/keymaps.lua similarity index 100% rename from tools/nvim/lua/config/keymaps.lua rename to dot_config/nvim/lua/config/keymaps.lua diff --git a/tools/nvim/lua/config/migration.lua b/dot_config/nvim/lua/config/migration.lua similarity index 100% rename from tools/nvim/lua/config/migration.lua rename to dot_config/nvim/lua/config/migration.lua diff --git a/tools/nvim/lua/config/options.lua b/dot_config/nvim/lua/config/options.lua similarity index 100% rename from tools/nvim/lua/config/options.lua rename to dot_config/nvim/lua/config/options.lua diff --git a/tools/nvim/lua/config/plugins.lua b/dot_config/nvim/lua/config/plugins.lua similarity index 100% rename from tools/nvim/lua/config/plugins.lua rename to dot_config/nvim/lua/config/plugins.lua diff --git a/tools/nvim/lua/config/servers.lua b/dot_config/nvim/lua/config/servers.lua similarity index 100% rename from tools/nvim/lua/config/servers.lua rename to dot_config/nvim/lua/config/servers.lua diff --git a/tools/nvim/lua/config/vscode.lua b/dot_config/nvim/lua/config/vscode.lua similarity index 100% rename from tools/nvim/lua/config/vscode.lua rename to dot_config/nvim/lua/config/vscode.lua diff --git a/tools/nvim/lua/keymaps/basic.lua b/dot_config/nvim/lua/keymaps/basic.lua similarity index 100% rename from tools/nvim/lua/keymaps/basic.lua rename to dot_config/nvim/lua/keymaps/basic.lua diff --git a/tools/nvim/lua/keymaps/buffer.lua b/dot_config/nvim/lua/keymaps/buffer.lua similarity index 100% rename from tools/nvim/lua/keymaps/buffer.lua rename to dot_config/nvim/lua/keymaps/buffer.lua diff --git a/tools/nvim/lua/keymaps/init.lua b/dot_config/nvim/lua/keymaps/init.lua similarity index 100% rename from tools/nvim/lua/keymaps/init.lua rename to dot_config/nvim/lua/keymaps/init.lua diff --git a/tools/nvim/lua/keymaps/language.lua b/dot_config/nvim/lua/keymaps/language.lua similarity index 100% rename from tools/nvim/lua/keymaps/language.lua rename to dot_config/nvim/lua/keymaps/language.lua diff --git a/tools/nvim/lua/keymaps/leaders.bak b/dot_config/nvim/lua/keymaps/leaders.bak similarity index 100% rename from tools/nvim/lua/keymaps/leaders.bak rename to dot_config/nvim/lua/keymaps/leaders.bak diff --git a/tools/nvim/lua/keymaps/leaders.lua b/dot_config/nvim/lua/keymaps/leaders.lua similarity index 100% rename from tools/nvim/lua/keymaps/leaders.lua rename to dot_config/nvim/lua/keymaps/leaders.lua diff --git a/tools/nvim/lua/keymaps/lspkeys.lua b/dot_config/nvim/lua/keymaps/lspkeys.lua similarity index 100% rename from tools/nvim/lua/keymaps/lspkeys.lua rename to dot_config/nvim/lua/keymaps/lspkeys.lua diff --git a/tools/nvim/lua/keymaps/modifier.lua b/dot_config/nvim/lua/keymaps/modifier.lua similarity index 100% rename from tools/nvim/lua/keymaps/modifier.lua rename to dot_config/nvim/lua/keymaps/modifier.lua diff --git a/tools/nvim/lua/keymaps/nvim-tree.lua b/dot_config/nvim/lua/keymaps/nvim-tree.lua similarity index 100% rename from tools/nvim/lua/keymaps/nvim-tree.lua rename to dot_config/nvim/lua/keymaps/nvim-tree.lua diff --git a/tools/nvim/lua/keymaps/user-command.lua b/dot_config/nvim/lua/keymaps/user-command.lua similarity index 100% rename from tools/nvim/lua/keymaps/user-command.lua rename to dot_config/nvim/lua/keymaps/user-command.lua diff --git a/tools/nvim/lua/keymaps/utils.lua b/dot_config/nvim/lua/keymaps/utils.lua similarity index 100% rename from tools/nvim/lua/keymaps/utils.lua rename to dot_config/nvim/lua/keymaps/utils.lua diff --git a/tools/nvim/lua/keymaps/visual-multi.lua b/dot_config/nvim/lua/keymaps/visual-multi.lua similarity index 100% rename from tools/nvim/lua/keymaps/visual-multi.lua rename to dot_config/nvim/lua/keymaps/visual-multi.lua diff --git a/tools/nvim/lua/keymaps/which.lua b/dot_config/nvim/lua/keymaps/which.lua similarity index 100% rename from tools/nvim/lua/keymaps/which.lua rename to dot_config/nvim/lua/keymaps/which.lua diff --git a/tools/nvim/lua/plugins/appearance.lua b/dot_config/nvim/lua/plugins/appearance.lua similarity index 100% rename from tools/nvim/lua/plugins/appearance.lua rename to dot_config/nvim/lua/plugins/appearance.lua diff --git a/tools/nvim/lua/plugins/completion.lua b/dot_config/nvim/lua/plugins/completion.lua similarity index 100% rename from tools/nvim/lua/plugins/completion.lua rename to dot_config/nvim/lua/plugins/completion.lua diff --git a/tools/nvim/lua/plugins/dap.lua b/dot_config/nvim/lua/plugins/dap.lua similarity index 100% rename from tools/nvim/lua/plugins/dap.lua rename to dot_config/nvim/lua/plugins/dap.lua diff --git a/tools/nvim/lua/plugins/edit.lua b/dot_config/nvim/lua/plugins/edit.lua similarity index 100% rename from tools/nvim/lua/plugins/edit.lua rename to dot_config/nvim/lua/plugins/edit.lua diff --git a/tools/nvim/lua/plugins/fileutils.lua b/dot_config/nvim/lua/plugins/fileutils.lua similarity index 100% rename from tools/nvim/lua/plugins/fileutils.lua rename to dot_config/nvim/lua/plugins/fileutils.lua diff --git a/tools/nvim/lua/plugins/init.lua b/dot_config/nvim/lua/plugins/init.lua similarity index 100% rename from tools/nvim/lua/plugins/init.lua rename to dot_config/nvim/lua/plugins/init.lua diff --git a/tools/nvim/lua/plugins/lang/beancount.lua b/dot_config/nvim/lua/plugins/lang/beancount.lua similarity index 100% rename from tools/nvim/lua/plugins/lang/beancount.lua rename to dot_config/nvim/lua/plugins/lang/beancount.lua diff --git a/tools/nvim/lua/plugins/lang/init.lua b/dot_config/nvim/lua/plugins/lang/init.lua similarity index 100% rename from tools/nvim/lua/plugins/lang/init.lua rename to dot_config/nvim/lua/plugins/lang/init.lua diff --git a/tools/nvim/lua/plugins/lang/just.lua b/dot_config/nvim/lua/plugins/lang/just.lua similarity index 100% rename from tools/nvim/lua/plugins/lang/just.lua rename to dot_config/nvim/lua/plugins/lang/just.lua diff --git a/tools/nvim/lua/plugins/lang/lua.lua b/dot_config/nvim/lua/plugins/lang/lua.lua similarity index 100% rename from tools/nvim/lua/plugins/lang/lua.lua rename to dot_config/nvim/lua/plugins/lang/lua.lua diff --git a/tools/nvim/lua/plugins/lang/markdown/init.lua b/dot_config/nvim/lua/plugins/lang/markdown/init.lua similarity index 100% rename from tools/nvim/lua/plugins/lang/markdown/init.lua rename to dot_config/nvim/lua/plugins/lang/markdown/init.lua diff --git a/tools/nvim/lua/plugins/lang/markdown/markview.lua.bak b/dot_config/nvim/lua/plugins/lang/markdown/markview.lua.bak similarity index 100% rename from tools/nvim/lua/plugins/lang/markdown/markview.lua.bak rename to dot_config/nvim/lua/plugins/lang/markdown/markview.lua.bak diff --git a/tools/nvim/lua/plugins/lang/markdown/obsidian-nvim.lua b/dot_config/nvim/lua/plugins/lang/markdown/obsidian-nvim.lua similarity index 100% rename from tools/nvim/lua/plugins/lang/markdown/obsidian-nvim.lua rename to dot_config/nvim/lua/plugins/lang/markdown/obsidian-nvim.lua diff --git a/tools/nvim/lua/plugins/lang/markdown/render-markdown.lua b/dot_config/nvim/lua/plugins/lang/markdown/render-markdown.lua similarity index 100% rename from tools/nvim/lua/plugins/lang/markdown/render-markdown.lua rename to dot_config/nvim/lua/plugins/lang/markdown/render-markdown.lua diff --git a/tools/nvim/lua/plugins/lang/org.lua b/dot_config/nvim/lua/plugins/lang/org.lua similarity index 100% rename from tools/nvim/lua/plugins/lang/org.lua rename to dot_config/nvim/lua/plugins/lang/org.lua diff --git a/tools/nvim/lua/plugins/lang/tex.lua b/dot_config/nvim/lua/plugins/lang/tex.lua similarity index 100% rename from tools/nvim/lua/plugins/lang/tex.lua rename to dot_config/nvim/lua/plugins/lang/tex.lua diff --git a/tools/nvim/lua/plugins/lang/treesitter.lua b/dot_config/nvim/lua/plugins/lang/treesitter.lua similarity index 100% rename from tools/nvim/lua/plugins/lang/treesitter.lua rename to dot_config/nvim/lua/plugins/lang/treesitter.lua diff --git a/tools/nvim/lua/plugins/lang/typst.lua b/dot_config/nvim/lua/plugins/lang/typst.lua similarity index 100% rename from tools/nvim/lua/plugins/lang/typst.lua rename to dot_config/nvim/lua/plugins/lang/typst.lua diff --git a/tools/nvim/lua/plugins/lazy-nvim.lua b/dot_config/nvim/lua/plugins/lazy-nvim.lua similarity index 100% rename from tools/nvim/lua/plugins/lazy-nvim.lua rename to dot_config/nvim/lua/plugins/lazy-nvim.lua diff --git a/tools/nvim/lua/plugins/misc.lua b/dot_config/nvim/lua/plugins/misc.lua similarity index 100% rename from tools/nvim/lua/plugins/misc.lua rename to dot_config/nvim/lua/plugins/misc.lua diff --git a/tools/nvim/lua/plugins/mod/alpha-nvim.lua b/dot_config/nvim/lua/plugins/mod/alpha-nvim.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/alpha-nvim.lua rename to dot_config/nvim/lua/plugins/mod/alpha-nvim.lua diff --git a/tools/nvim/lua/plugins/mod/autopairs.lua b/dot_config/nvim/lua/plugins/mod/autopairs.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/autopairs.lua rename to dot_config/nvim/lua/plugins/mod/autopairs.lua diff --git a/tools/nvim/lua/plugins/mod/avante-nvim.lua b/dot_config/nvim/lua/plugins/mod/avante-nvim.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/avante-nvim.lua rename to dot_config/nvim/lua/plugins/mod/avante-nvim.lua diff --git a/tools/nvim/lua/plugins/mod/blink-cmp.lua b/dot_config/nvim/lua/plugins/mod/blink-cmp.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/blink-cmp.lua rename to dot_config/nvim/lua/plugins/mod/blink-cmp.lua diff --git a/tools/nvim/lua/plugins/mod/bufferline.lua b/dot_config/nvim/lua/plugins/mod/bufferline.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/bufferline.lua rename to dot_config/nvim/lua/plugins/mod/bufferline.lua diff --git a/tools/nvim/lua/plugins/mod/conform-nvim.lua b/dot_config/nvim/lua/plugins/mod/conform-nvim.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/conform-nvim.lua rename to dot_config/nvim/lua/plugins/mod/conform-nvim.lua diff --git a/tools/nvim/lua/plugins/mod/copilot-lua.lua b/dot_config/nvim/lua/plugins/mod/copilot-lua.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/copilot-lua.lua rename to dot_config/nvim/lua/plugins/mod/copilot-lua.lua diff --git a/tools/nvim/lua/plugins/mod/fzf.lua b/dot_config/nvim/lua/plugins/mod/fzf.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/fzf.lua rename to dot_config/nvim/lua/plugins/mod/fzf.lua diff --git a/tools/nvim/lua/plugins/mod/hover-nvim.lua b/dot_config/nvim/lua/plugins/mod/hover-nvim.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/hover-nvim.lua rename to dot_config/nvim/lua/plugins/mod/hover-nvim.lua diff --git a/tools/nvim/lua/plugins/mod/image-nvim.lua b/dot_config/nvim/lua/plugins/mod/image-nvim.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/image-nvim.lua rename to dot_config/nvim/lua/plugins/mod/image-nvim.lua diff --git a/tools/nvim/lua/plugins/mod/img-clip.lua b/dot_config/nvim/lua/plugins/mod/img-clip.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/img-clip.lua rename to dot_config/nvim/lua/plugins/mod/img-clip.lua diff --git a/tools/nvim/lua/plugins/mod/lualine/components.lua b/dot_config/nvim/lua/plugins/mod/lualine/components.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/lualine/components.lua rename to dot_config/nvim/lua/plugins/mod/lualine/components.lua diff --git a/tools/nvim/lua/plugins/mod/lualine/init.lua b/dot_config/nvim/lua/plugins/mod/lualine/init.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/lualine/init.lua rename to dot_config/nvim/lua/plugins/mod/lualine/init.lua diff --git a/tools/nvim/lua/plugins/mod/mc.lua b/dot_config/nvim/lua/plugins/mod/mc.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/mc.lua rename to dot_config/nvim/lua/plugins/mod/mc.lua diff --git a/tools/nvim/lua/plugins/mod/neo-tree.lua b/dot_config/nvim/lua/plugins/mod/neo-tree.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/neo-tree.lua rename to dot_config/nvim/lua/plugins/mod/neo-tree.lua diff --git a/tools/nvim/lua/plugins/mod/nvim-cmp.lua b/dot_config/nvim/lua/plugins/mod/nvim-cmp.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/nvim-cmp.lua rename to dot_config/nvim/lua/plugins/mod/nvim-cmp.lua diff --git a/tools/nvim/lua/plugins/mod/nvim-lspconfig.lua b/dot_config/nvim/lua/plugins/mod/nvim-lspconfig.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/nvim-lspconfig.lua rename to dot_config/nvim/lua/plugins/mod/nvim-lspconfig.lua diff --git a/tools/nvim/lua/plugins/mod/nvim-tree.lua b/dot_config/nvim/lua/plugins/mod/nvim-tree.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/nvim-tree.lua rename to dot_config/nvim/lua/plugins/mod/nvim-tree.lua diff --git a/tools/nvim/lua/plugins/mod/snacks-nvim.lua b/dot_config/nvim/lua/plugins/mod/snacks-nvim.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/snacks-nvim.lua rename to dot_config/nvim/lua/plugins/mod/snacks-nvim.lua diff --git a/tools/nvim/lua/plugins/mod/telescope.lua b/dot_config/nvim/lua/plugins/mod/telescope.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/telescope.lua rename to dot_config/nvim/lua/plugins/mod/telescope.lua diff --git a/tools/nvim/lua/plugins/mod/toggleterm.lua b/dot_config/nvim/lua/plugins/mod/toggleterm.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/toggleterm.lua rename to dot_config/nvim/lua/plugins/mod/toggleterm.lua diff --git a/tools/nvim/lua/plugins/mod/trouble-nvim.lua b/dot_config/nvim/lua/plugins/mod/trouble-nvim.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/trouble-nvim.lua rename to dot_config/nvim/lua/plugins/mod/trouble-nvim.lua diff --git a/tools/nvim/lua/plugins/mod/which-keys-nvim.lua b/dot_config/nvim/lua/plugins/mod/which-keys-nvim.lua similarity index 100% rename from tools/nvim/lua/plugins/mod/which-keys-nvim.lua rename to dot_config/nvim/lua/plugins/mod/which-keys-nvim.lua diff --git a/tools/nvim/readme.md b/dot_config/nvim/readme.md similarity index 100% rename from tools/nvim/readme.md rename to dot_config/nvim/readme.md diff --git a/tools/nvim/stylua.toml b/dot_config/nvim/stylua.toml similarity index 100% rename from tools/nvim/stylua.toml rename to dot_config/nvim/stylua.toml diff --git a/common/rtorrent.rc b/dot_config/rtorrent/rtorrent.rc similarity index 100% rename from common/rtorrent.rc rename to dot_config/rtorrent/rtorrent.rc diff --git a/tools/tmux/+colemak.tmux b/dot_config/tmux/+colemak.tmux similarity index 100% rename from tools/tmux/+colemak.tmux rename to dot_config/tmux/+colemak.tmux diff --git a/tools/tmux/+qwerty.tmux b/dot_config/tmux/+qwerty.tmux similarity index 100% rename from tools/tmux/+qwerty.tmux rename to dot_config/tmux/+qwerty.tmux diff --git a/tools/tmux/tmux.conf b/dot_config/tmux/tmux.conf similarity index 100% rename from tools/tmux/tmux.conf rename to dot_config/tmux/tmux.conf diff --git a/tools/emacs.d/.gitignore b/tools/emacs.d/.gitignore deleted file mode 100644 index 62c7ec6..0000000 --- a/tools/emacs.d/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -# 自动生成的目录 -/auto-save-list/ -/elpa/ -/eshell/ -/server/ -/url/ -transient/ - -# 临时文件 -tutorial -*~ -\#*\# -.#* -*.elc - -# 自动保存的文件 -auto-save-list -tramp - -recentf -custom.el -.custom.el - -.org-id-locations -bookmarks -.cache -eln-cache -org-persist - -local.el diff --git a/tools/emacs.d/early-init.el b/tools/emacs.d/early-init.el deleted file mode 100644 index 512068a..0000000 --- a/tools/emacs.d/early-init.el +++ /dev/null @@ -1 +0,0 @@ -(setq package-enable-at-startup nil) diff --git a/tools/emacs.d/init.el b/tools/emacs.d/init.el deleted file mode 100644 index 14c0f56..0000000 --- a/tools/emacs.d/init.el +++ /dev/null @@ -1,65 +0,0 @@ -;;; init.el --- Entry point of GNU/Emacs configuration -;;; First edit date 2025/01/27 - -;;; Organised by such directory structure -;;; init.el -- This file, entry point -;;; lisp/ -;;; init-*.el -;;; custom.el -- Auto Generated -;;; local.el -- Local variables - -;; All elisp files under emacs.d/lisp will be loaded -(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory)) - -;; Store the auto-generated custom config to `custom.el` -(setq custom-file (expand-file-name ".custom.el" user-emacs-directory)) - - -(defvar xdg-data-home - (or (getenv "XDG_DATA_HOME") - (expand-file-name "~/.local/share"))) - -(defvar xdg-cache-home - (or (getenv "XDG_CACHE_HOME") - (expand-file-name "~/.cache"))) - -(defvar xdg-state-home - (or (getenv "XDG_STATE_HOME") - (expand-file-name "~/.local/state/"))) - -(defvar user-emacs-data (expand-file-name "emacs" xdg-data-home)) -(defvar user-emacs-cache (expand-file-name "emacs" xdg-cache-home)) -(defvar user-emacs-state (expand-file-name "emacs" xdg-state-home)) - -;; Load each modules -(require 'init-package) ; package manager should be loaded first -(require 'init-basic) -(require 'init-appearance) -(require 'init-wayland) -(require 'init-keymaps) -(require 'init-evil) -(require 'init-counsel) -(require 'init-file) -(require 'init-edit) -(require 'init-calendar) -(require 'init-writer) -(require 'init-org) -(require 'init-markdown) -(require 'init-latex) -(require 'init-beancount) -(require 'init-treesitter) -(require 'init-scratch) -(require 'init-ai) - - -;; Load `custom` file -(when (file-exists-p custom-file) - (load custom-file)) - - -(when (file-exists-p (expand-file-name "local.el" user-emacs-directory)) - (load (expand-file-name "local.el" user-emacs-directory))) - - - -;;; init.el end diff --git a/tools/emacs.d/lisp/init-ai.el b/tools/emacs.d/lisp/init-ai.el deleted file mode 100644 index 2945fc6..0000000 --- a/tools/emacs.d/lisp/init-ai.el +++ /dev/null @@ -1,14 +0,0 @@ - -;; (use-package copilot -;; :vc (:url "https://github.com/copilot-emacs/copilot.el" -;; :rev :newest -;; :branch "main") -;; :hook (prog-mode . copilot-mode) -;; :config -;; (define-key copilot-completion-map (kbd "") 'copilot-accept-completion) -;; (define-key copilot-completion-map (kbd "TAB") 'copilot-accept-completion)) - - -(provide 'init-ai) - -;;; init-ai.el ends here diff --git a/tools/emacs.d/lisp/init-appearance.el b/tools/emacs.d/lisp/init-appearance.el deleted file mode 100644 index 85a620e..0000000 --- a/tools/emacs.d/lisp/init-appearance.el +++ /dev/null @@ -1,110 +0,0 @@ -;;; init-appearance.el - -;; Always set frame font -;; If don't set this, `emacs --daemon' will not set the font -;; for new graphical frames. -(add-to-list 'default-frame-alist '(font . "Maple Mono NF CN")) - -;; Set CJK Display Font -(dolist (charset '(kana han cjk-misc bopomofo)) - (set-fontset-font t charset (font-spec :family "Maple Mono NF CN"))) - - -;; Variable Pitch Font -;; Used in `variable-pitch-mode' -(set-face-attribute 'variable-pitch nil - :family "LXGW WenKai Screen" - :height 140 - :weight 'regular) - - -;; Icon Support -;; Once installed, Manually install the fonts required: -;; M-x all-the-icons-install-fonts -;; If under Microsoft Windows, the Installation Directory should be chosen -;; and right-click them to install the fonts -(use-package all-the-icons - :if (display-graphic-p)) - - -(defun js0ny/get-system-theme () - " Get the current system theme. Returns 'light' or 'dark'." - ;; Default - (let ((background 'dark)) - (if (string= system-type "darwin") - (progn - ;; Check if 'defaults' command is available - (when (executable-find "defaults") - ;; Check if the system is in dark mode - (let ((apple-interface-style - (shell-command-to-string "defaults read -g AppleInterfaceStyle"))) - (when (string-match-p "Light" apple-interface-style) - (setq background 'light))))) - ;; Using systemd to check the current theme - (when (executable-find "busctl") - (let ((result - (shell-command-to-string - (concat "busctl --user call org.freedesktop.portal.Desktop " - "/org/freedesktop/portal/desktop " - "org.freedesktop.portal.Settings ReadOne ss " - "org.freedesktop.appearance color-scheme")))) - ;; 结果格式为浅色模式是 "v u 0",暗色模式是 "v u 1" - ;; v u 0 -> light, v u 1 -> dark - (when (string-match "u\\s+\\([0-9]\\)" result) - (let ((color-scheme (match-string 1 result))) - (when (string= color-scheme "0") - (setq background 'light))))))) - background)) - -(use-package catppuccin-theme - :custom - (catppuccin-flavor 'mocha) - :config - (if (string-equal (js0ny/get-system-theme) "light") - (setq catppuccin-flavor 'latte) - (setq catppuccin-flavor 'mocha)) - (load-theme 'catppuccin t)) - - - -;; (use-package doom-themes -;; :ensure t -;; :config -;; ;; Global settings (defaults) -;; :custom -;; (doom-themes-enable-bold t) ; if nil, bold is universally disabled -;; (doom-themes-enable-italic t) ; if nil, italics is universally disabled -;; ; (doom-themes-treemacs-theme "doom-nord-aurora") ; use "doom-colors" for less minimal icon theme -;; :config -;; (load-theme 'doom-nord-aurora t) - -;; ;; Enable flashing mode-line on errors -;; (doom-themes-visual-bell-config) - -;; ;; Enable custom neotree theme (nerd-icons must be installed!) -;; ;; (doom-themes-neotree-config) - -;; ;; or for treemacs users -;; (doom-themes-treemacs-config) -;; ;; Corrects (and improves) org-mode's native fontification. -;; (doom-themes-org-config)) - - -;; Better mode line, see (L11) for Icon install -;; M-x nerd-icons-install-fonts -(use-package doom-modeline - :ensure t - :init (doom-modeline-mode 1)) - -(global-tab-line-mode) ; bufferline - -(use-package highlight-indent-guides - :hook ((prog-mode yaml-mode org-mode) . highlight-indent-guides-mode) - :init - (setq highlight-indent-guides-method 'column) - (setq highlight-indent-guides-responsive 'top) - (setq highlight-indent-guides-auto-character-face-perc 1)) - - - -(provide 'init-appearance) diff --git a/tools/emacs.d/lisp/init-basic.el b/tools/emacs.d/lisp/init-basic.el deleted file mode 100644 index ef4e93c..0000000 --- a/tools/emacs.d/lisp/init-basic.el +++ /dev/null @@ -1,81 +0,0 @@ -;;; init-basic.el - -;; Disable startup message -(setq inhibit-startup-message t) - -;; Use line number by default -(global-display-line-numbers-mode 1) -;; Vim-like relativenumber -;; fix: work for folded region (visual relative line instead of physical) -(use-package display-line-numbers - :custom - (display-line-numbers-type 'visual) - (display-line-numbers-current-absolute t) - :hook - (prog-mode . display-line-numbers-mode)) - -(when (eq system-type 'darwin) - (setq mac-option-modifier 'meta) - (setq mac-command-modifier 'super)) - - -;; https://book.emacs-china.org/#orgcfd105e Open with Emacs -;; (server-mode 1) - -(setq use-short-answers t) - -(require 'recentf) -(setq recentf-save-file (expand-file-name "recentf" user-emacs-data)) -(recentf-mode 1) - -;; Disable topbars -(tool-bar-mode -1) -(scroll-bar-mode -1) -(menu-bar-mode -1) - -(use-package alert - :commands (alert) - :config - (setq alert-default-style 'libnotify)) - -;; 设置 Emacs 备份和自动保存目录 -(defvar user-backup-directory (expand-file-name "backups" user-emacs-data)) -(defvar user-autosaves-directory (expand-file-name "autosaves" user-emacs-cache)) - -;; 创建目录(如果不存在) -(dolist (dir (list user-backup-directory user-autosaves-directory)) - (unless (file-exists-p dir) - (make-directory dir t) - (message "Creating directory: %s" dir))) - -;; 配置备份文件目录 -(setq backup-directory-alist `(("." . ,user-backup-directory))) - -(setq project-list-file (expand-file-name "projects-list" user-emacs-data)) - -;; 配置自动保存文件目录 -(setq auto-save-file-name-transforms - `((".*" ,user-autosaves-directory t))) - -;; 配置自动保存列表文件前缀 -(setq auto-save-list-file-prefix - (expand-file-name "auto-save-list/.saves-" user-autosaves-directory)) - -;; TRAMP 远程文件的备份设置 -(setq tramp-backup-directory-alist (copy-tree backup-directory-alist)) -(setq tramp-persistency-file-name (expand-file-name "tramp" user-emacs-state)) - - -;; 备份设置(可选) -(setq backup-by-copying t ; 使用复制而非重命名 - delete-old-versions t ; 自动删除旧版本 - kept-new-versions 6 ; 保留的新版本数量 - kept-old-versions 2 ; 保留的旧版本数量 - version-control t) ; 使用版本号 - -(setq transient-history-file (expand-file-name "transient/history.el" user-emacs-data)) -(setq transient-values-file (expand-file-name "transient/values.el" user-emacs-data)) -(setq transient-levels-file (expand-file-name "transient/levels.el" user-emacs-data)) - -;; Export module -(provide 'init-basic) diff --git a/tools/emacs.d/lisp/init-beancount.el b/tools/emacs.d/lisp/init-beancount.el deleted file mode 100644 index 33cee8a..0000000 --- a/tools/emacs.d/lisp/init-beancount.el +++ /dev/null @@ -1,39 +0,0 @@ -;; (straight-use-package -;; '(beancount -;; :host github -;; :repo "beancount/beancount-mode" -;; :files ("*.el"))) - -(use-package beancount - :mode (("\\.beancount\\'" . beancount-mode) - ("\\.bean\\'" . beancount-mode)) - :init - (add-hook 'beancount-mode-hook #'outline-minor-mode) - (define-key beancount-mode-map (kbd "C-c C-n") #'outline-next-visible-heading) - (define-key beancount-mode-map (kbd "C-c C-p") #'outline-previous-visible-heading) - - (defvar beancount-accounts-files nil "List of account files.") - (setq beancount-accounts-files - (directory-files "~/Dropbox/beancount/accounts/" 'full (rx ".beancount" eos))) - - (defun w/beancount--collect-accounts-from-files (oldfun regex n) - "Collect all accounts from files." - (let ((keys (funcall oldfun regex n)) - (hash (make-hash-table :test 'equal))) - (dolist (key keys) - (puthash key nil hash)) - ;; collect accounts from files - (save-excursion - (dolist (f beancount-accounts-files) - (with-current-buffer (find-file-noselect f) - (goto-char (point-min)) - (while (re-search-forward beancount-account-regexp nil t) - (puthash (match-string-no-properties n) nil hash))))) - (hash-table-keys hash))) - - (advice-add #'beancount-collect - :around #'w/beancount--collect-accounts-from-files - '((name . "collect accounts from files as well")))) - - -(provide 'init-beancount) diff --git a/tools/emacs.d/lisp/init-calendar.el b/tools/emacs.d/lisp/init-calendar.el deleted file mode 100644 index f3ac6bd..0000000 --- a/tools/emacs.d/lisp/init-calendar.el +++ /dev/null @@ -1,99 +0,0 @@ -;;; init-calendar.el - -(setq calendar-date-style 'iso) -(setq diary-date-forms '((year "年" month "月" day "日" " 星期[" "日一二三四五六" "]") ;; Chinese - (year "-" month "-" day) ;; ISO - (month "[-/]" day "[^-/0-9]") (year "[-/]" month "[-/]" day "[^0-9]") - (monthname " *" day "[^-0-9]") (year " *" monthname " *" day "[^0-9]") - (dayname "\\W"))) - -(setq calendar-mark-holidays-flag t - calendar-week-start-day 1) - - -(use-package cal-china-x - :ensure t - :custom - (cal-china-x-important-holidays '((holiday-chinese-new-year) - (holiday-lunar 12 23 "小年(北)" 1) - (holiday-lunar 12 24 "小年(南)" 1) - (holiday-lunar 12 30 "除夕" 1) - (holiday-lunar 1 1 "春节" 0) - (holiday-lunar 1 2 "春节" 0) - (holiday-lunar 1 3 "春节" 0) - (holiday-lunar 1 4 "春节" 0) - (holiday-lunar 1 5 "春节(破五)" 0) - (holiday-lunar 1 15 "元宵节" 0) - (holiday-lunar 2 2 "龙抬头" 0) - (holiday-solar-term "清明" "清明节") - (holiday-fixed 5 1 "劳动节") - (holiday-lunar 5 5 "端午节" 0) - (holiday-lunar 7 7 "七夕节" 0) - (holiday-lunar 7 15 "中元节" 0) - (holiday-lunar 8 15 "中秋节" 0) - (holiday-fixed 10 1 "国庆节") - (holiday-fixed 10 2 "国庆节") - (holiday-fixed 10 3 "国庆节") - (holiday-lunar 9 9 "重阳节" 0) - (holiday-lunar 10 1 "寒衣节" 0) - (holiday-lunar 12 8 "腊八" 1) - (holiday-solar-term "立春" "立春") - (holiday-solar-term "立夏" "立夏") - (holiday-solar-term "立秋" "立秋") - (holiday-solar-term "立冬" "立冬") - (holiday-solar-term "春分" "春分") - (holiday-solar-term "夏至" "夏至") - (holiday-solar-term "秋分" "秋分") - (holiday-solar-term "冬至" "冬至"))) - (cal-china-x-general-holidays '((holiday-fixed 1 1 "元旦") - (holiday-fixed 2 14 "情人节") - (holiday-fixed 3 8 "妇女节") - (holiday-fixed 4 1 "愚人节") - (holiday-fixed 5 4 "青年节") - (holiday-float 5 0 2 "母亲节") - (holiday-fixed 6 1 "儿童节") - (holiday-float 6 0 3 "父亲节") - (holiday-fixed 9 10 "教师节") - (holiday-float 11 4 4 "感恩节") - (holiday-fixed 12 25 "圣诞节"))) - :config - (setq calendar-holidays (append cal-china-x-important-holidays - cal-china-x-general-holidays))) - -;; https://github.com/AbstProcDo/Master-Emacs-From-Scratch-with-Solid-Procedures/blob/master/06.Emacs-as-Agenda-by-Org.org -;;Sunrise and Sunset -;;日出而作, 日落而息 -(defun js0ny/diary-sunrise () - (let ((dss (diary-sunrise-sunset))) - (with-temp-buffer - (insert dss) - (goto-char (point-min)) - (while (re-search-forward " ([^)]*)" nil t) - (replace-match "" nil nil)) - (goto-char (point-min)) - (search-forward ",") - (buffer-substring (point-min) (match-beginning 0))))) - -(defun js0ny/diary-sunset () - (let ((dss (diary-sunrise-sunset)) - start end) - (with-temp-buffer - (insert dss) - (goto-char (point-min)) - (while (re-search-forward " ([^)]*)" nil t) - (replace-match "" nil nil)) - (goto-char (point-min)) - (search-forward ", ") - (setq start (match-end 0)) - (search-forward " at") - (setq end (match-beginning 0)) - (goto-char start) - (capitalize-word 1) - (buffer-substring start end)))) - - - -(setq diary-file "~/.local/js0ny/diary") - - -(provide 'init-calendar) diff --git a/tools/emacs.d/lisp/init-counsel.el b/tools/emacs.d/lisp/init-counsel.el deleted file mode 100644 index cf0fe3e..0000000 --- a/tools/emacs.d/lisp/init-counsel.el +++ /dev/null @@ -1,31 +0,0 @@ -;;; init-counsel.el -(defun js0ny/open-config-directory () - "Open `user-emacs-directory` using `counsel-find-file`." - (interactive) - (let ((default-directory user-emacs-directory)) - (counsel-file-jump))) - - -(use-package counsel - :demand t - :init - (counsel-mode 1) - :config - (global-set-key (kbd "C-x C-f") #'counsel-find-file) - (global-set-key (kbd "M-x") #'counsel-M-x) - (evil-leader/set-key - "SPC" #'counsel-file-jump - "/" #'counsel-rg - ";" #'counsel-M-x - "fc" #'js0ny/open-config-directory - "fh" #'counsel-recentf)) - -;; Replace `cd' with `counsel-cd' -(defun cd () - "Change currend default directory" - (interactive) - (counsel-cd)) - -(provide 'init-counsel) - -;;; init-counsel.el ends diff --git a/tools/emacs.d/lisp/init-edit.el b/tools/emacs.d/lisp/init-edit.el deleted file mode 100644 index c5e8191..0000000 --- a/tools/emacs.d/lisp/init-edit.el +++ /dev/null @@ -1,102 +0,0 @@ -;;; init-edit.el - -;; Use UTF-8 & LF -(setq-default buffer-file-coding-system 'utf-8-unix) - -;; Auto input pairred brackets -(electric-pair-mode 1) - -;; Enable Folding -(add-hook 'prog-mode-hook #'hs-minor-mode) - -;; Company - Complete Anything -(use-package company - :ensure t - :hook (after-init . global-company-mode) ; 在启动后自动启用 global-company-mode - :bind (:map company-active-map - ("C-n" . company-select-next) - ("C-p" . company-select-previous)) - :custom - (company-minimum-prefix-length 1) ; 设置最短补全前缀 - (company-idle-delay 0.2)) ; 设置补全延迟(秒) - -;; minibuffer 补全增强 -(use-package vertico - :init - (vertico-mode)) - -;; 提供补全注解 -(use-package marginalia - :init - (marginalia-mode)) - - -;; (set-language-environment "UTF-8") -(set-default-coding-systems 'utf-8) -;; (prefer-coding-system 'utf-8) - -;;; 设置语言环境为 UTF-8 -; -;;; 强制使用 UTF-8 -;(set-terminal-coding-system 'utf-8) -;(set-keyboard-coding-system 'utf-8) -; -;;; Windows 系统特殊设置 -;(when (eq system-type 'windows-nt) -; (set-file-name-coding-system 'gbk) ;; 文件名使用 GBK -; (set-clipboard-coding-system 'utf-16le)) ;; 剪贴板使用 UTF-16LE -; -;(setq-default buffer-file-coding-system 'utf-8-unix) -; -;;; 设置行尾为 Unix 风格 -;(add-hook 'find-file-hook 'find-file-check-line-endings) -; -;(defun dos-file-endings-p () -; (string-match "dos" (symbol-name buffer-file-coding-system))) -; -;(defun find-file-check-line-endings () -; (when (dos-file-endings-p) -; (set-buffer-file-coding-system 'undecided-unix) -; (set-buffer-modified-p nil))) - -(setq-default buffer-file-coding-system 'utf-8-unix) - -;; Avy - act like Vim Easymotion -(use-package avy - :ensure t - :config - (evil-define-key '(normal) 'global (kbd "T") 'avy-goto-char) - (evil-define-key '(normal) 'global (kbd "s") 'avy-goto-char-2) - (evil-define-key '(normal) 'global (kbd "s") 'avy-goto-char-2-above)) - -(use-package yasnippet - :ensure t - :defer t - :commands yas-minor-mode - :hook ((prog-mode . yas-minor-mode) - (org-mode . yas-minor-mode)) - :config - (setq yas-indent-line 'fixed) ;; 让 snippet 展开时不影响缩进 - (setq yas-wrap-around-region nil) ;; 关闭自动包裹选中区域 - (advice-add 'yas-expand-snippet :around - (lambda (orig-fn &rest args) - (let ((inhibit-field-text-motion t)) ;; 禁止字段自动换行 - (apply orig-fn args)))) - ;; (setq yas-snippet-dirs '("~/.dotfiles/tools/doom/snippets/")) - (add-to-list 'yas-snippet-dirs "~/.dotfiles/tools/doom/snippets/" t) - - (yas-reload-all) - ) - -(use-package diff-hl - :straight t - :hook ((prog-mode . diff-hl-mode) - (vc-dir-mode . diff-hl-dir-mode) - (magit-post-refresh . diff-hl-magit-post-refresh)) - :config - (setq diff-hl-margin-mode nil) - (diff-hl-flydiff-mode)) - -(global-font-lock-mode t) - -(provide 'init-edit) diff --git a/tools/emacs.d/lisp/init-evil.el b/tools/emacs.d/lisp/init-evil.el deleted file mode 100644 index c4c239b..0000000 --- a/tools/emacs.d/lisp/init-evil.el +++ /dev/null @@ -1,93 +0,0 @@ -;;; init-evil.el - -;; Evil - Extensible VI Layer -;; (defvar evil-colemak-state-map (make-sparse-keymap)) - - - -(use-package evil - :ensure t - :config - (evil-mode 1) - ; Colemak Vim Arrow - ; Motion - Emacs built-in read-only mode - (evil-define-key '(normal visual operator motion) 'global - ;; To see the keybindings, use k then type the key - ; "n" 'evil-next-line - ; "e" 'evil-previous-line - ; "i" 'evil-forward-char - ; ;"l" 'evil-insert - ; ;"L" 'evil-insert-0-line - ; "k" 'evil-search-next - ; "K" 'evil-search-previous - ; "j" 'evil-forward-word-end - ; "J" 'evil-forward-WORD-end - "J" '(lambda () (interactive) (evil-next-line 5)) ; 5n - "K" '(lambda () (interactive) (evil-previous-line 5)) ; 5e - ; (kbd "C-w n") 'evil-window-down - ; (kbd "C-w e") 'evil-window-up - ; (kbd "C-w i") 'evil-window-right - ; (kbd "C-w C-n") 'evil-window-down - ; (kbd "C-w C-e") 'evil-window-up - ; (kbd "C-w C-i") 'evil-window-right) - ; (evil-define-key '(normal visual) 'global - ; "l" 'evil-insert - ; "L" 'evil-insert-0-line) - (evil-define-key '(normal motion) 'global - "H" #'tab-line-switch-to-prev-tab - "L" #'tab-line-switch-to-next-tab) - (evil-define-key '(visual operator) 'global - "H" #'evil-beginning-of-line - "L" #'evil-end-of-line) - (evil-ex-define-cmd "bn" #'tab-line-switch-to-next-tab) - (evil-ex-define-cmd "bp" #'tab-line-switch-to-prev-tab))) - -;; Text Objects Keymap - Use `l` for inner (swap i and l) -;; https://github.com/emacs-evil/evil/blob/master/evil-maps.el#L398-L421 -(define-key evil-visual-state-map "l" evil-inner-text-objects-map) -(define-key evil-operator-state-map "l" evil-inner-text-objects-map) - - -;; Provides Vim-like Leader key -(use-package evil-leader - :after evil - :config - (global-evil-leader-mode) - (evil-leader/set-leader "") - (evil-leader/set-key - "ft" #'treemacs - "bb" #'buffer-menu)) - -;; Evil Commentary: Use gc to toggle comments -(use-package evil-commentary - :after evil - :config - (evil-commentary-mode)) - -;; Evil Surround: Vim-surround Evil fork -(use-package evil-surround - :after evil - :config - (global-evil-surround-mode 1)) - -(use-package evil-mc - :config - (global-evil-mc-mode 1)) - - -;; Evil-goggles: Highlight-yank (and more) -(use-package evil-goggles - :ensure t - :config - (evil-goggles-mode) - - ;; optionally use diff-mode's faces; as a result, deleted text - ;; will be highlighed with `diff-removed` face which is typically - ;; some red color (as defined by the color theme) - ;; other faces such as `diff-added` will be used for other actions - (evil-goggles-use-diff-faces)) - -(with-eval-after-load 'evil - (evil-set-initial-state 'org-agenda-mode 'motion)) - -(provide 'init-evil) diff --git a/tools/emacs.d/lisp/init-file.el b/tools/emacs.d/lisp/init-file.el deleted file mode 100644 index b9f1de1..0000000 --- a/tools/emacs.d/lisp/init-file.el +++ /dev/null @@ -1,87 +0,0 @@ -;;; init-file.el -- File Management configuration -;;; First edit at 2025/01/29 - -;; Dired - -;; Dired Configuration -(with-eval-after-load 'dired - (setq dired-recursive-deletes 'top) ;; Ask Before Delete Dir - (setq dired-recursive-copies 'always) ;; Always Copy Dir - (setq dired-dwim-target t)) ;; dwim for Do What I Mean - 当分屏显示两个 Buffer 时,复制或移动文件会自动将另一个 dired buffer 作为目标目录 - -;; Dired Keybindings - Colemak -(evil-define-key 'normal dired-mode-map - "h" 'dired-up-directory - "i" 'dired-find-file - "n" 'dired-next-line - "e" 'dired-previous-line) - -;; This prevents Dired from opening more buffers -;; https://stackoverflow.com/q/1839313 -(setq dired-kill-when-opening-new-dired-buffer t) - -;; Treemacs - Sidebar File Tree -(use-package treemacs - :straight t - :defer t - :init - (with-eval-after-load 'winum - (define-key winum-keymap (kbd "M-0") #'treemacs-select-window)) - :bind - (:map global-map - ("M-0" . treemacs-select-window) - ("C-x t 1" . treemacs-delete-other-windows) - ;; ("C-x t t" . treemacs) - ("C-x t d" . treemacs-select-directory) - ("C-x t B" . treemacs-bookmark) - ("C-x t C-t" . treemacs-find-file) - ("C-x t M-t" . treemacs-find-tag) - ) - :config - (setq treemacs-persist-file (expand-file-name "treemacs-persist" user-emacs-data))) - - -(use-package treemacs-nerd-icons - :config - (treemacs-load-theme "nerd-icons")) - -(use-package treemacs-evil - :after (treemacs evil) - :ensure t - :config - ;; Evil treemacs state bindings - (evil-define-key '(normal motion) evil-treemacs-state-map - (kbd "n") #'treemacs-next-line - (kbd "e") #'treemacs-previous-line - (kbd "N") #'treemacs-next-neighbour - (kbd "E") #'treemacs-previous-neighbour - (kbd "H") #'treemacs-toggle-show-dotfiles - (kbd "I") #'treemacs-hide-gitignored-files-mode - (kbd "i") #'treemacs-RET-action - (kbd "a") #'treemacs-create-file - (kbd "A") #'treemacs-create-dir - (kbd "c") #'treemacs-copy-file - (kbd "x") #'treemacs-move-file - (kbd "d") #'treemacs-delete-file - (kbd "r") #'treemacs-rename-file - (kbd "q") #'treemacs-quit - (kbd "y") #'treemacs-copy-relative-path-at-point - (kbd "Y") #'treemacs-copy-absolute-path-at-point - (kbd "m") #'treemacs-mark-or-unmark-path-at-point) - - ;; Treemacs mode specific binding - (evil-define-key 'treemacs treemacs-mode-map (kbd "i") #'treemacs-RET-action)) - -(use-package dirvish) - - -;; magit - Git Client -(use-package magit - :ensure t - :after (evil-leader) - :config - (evil-leader/set-key - "g" 'magit-status) - ) - -(provide 'init-file) diff --git a/tools/emacs.d/lisp/init-keymaps.el b/tools/emacs.d/lisp/init-keymaps.el deleted file mode 100644 index ae4081f..0000000 --- a/tools/emacs.d/lisp/init-keymaps.el +++ /dev/null @@ -1,8 +0,0 @@ -;;; init-keymaps.el - -;; Once this is defined, `M-x open-init-file` will open this file -(defun open-org-config() - (interactive) ;; Mark function as `interactive` that allows user to access by M-x open-init-file RET - (find-file "~/.dotfiles/tools/emacs.d/lisp/init-org.el")) - -(provide 'init-keymaps) diff --git a/tools/emacs.d/lisp/init-latex.el b/tools/emacs.d/lisp/init-latex.el deleted file mode 100644 index 2ec40fe..0000000 --- a/tools/emacs.d/lisp/init-latex.el +++ /dev/null @@ -1,50 +0,0 @@ - -(use-package texfrag - ;; :init - ;; (texfrag-global-mode) - :config - (evil-define-key 'normal texfrag-mode-map - (kbd "zL") #'texfrag-document) - :hook (markdown-mode . texfrag-mode)) - -(use-package laas - :hook ( - (LaTeX-mode . laas-mode) - (org-mode . laas-mode)) - :config ; do whatever here - (aas-set-snippets 'laas-mode - ;; set condition! - :cond #'texmathp ; expand only while in math - "nabl" "\\nabla" - "lg" "\\lg" - "hat" "\\hat" - ;; "iint" "\\iint" - ;; "int" "\\int" - "cdot" "\\cdot" - "dif" "\\mathrm{d}" - "pm" "\\pm" - "mp" "\\mp" - "sq" "\\sqrt" - ;; bind to functions! - "mk" (lambda () (interactive) - (yas-expand-snippet "\\( $1 \\)$0")) - "ppart" (lambda () (interactive) - (yas-expand-snippet "\\frac{\\partial $2}{\\partial $1} $0")) - "rm" (lambda () (interactive) - (yas-expand-snippet "\\mathrm{$1} $0")) - "sb" (lambda () (interactive) - (yas-expand-snippet "_{$1} $0")) - "Sum" (lambda () (interactive) - (yas-expand-snippet "\\sum_{$1}^{$2} $0")) - "Span" (lambda () (interactive) - (yas-expand-snippet "\\Span($1)$0")) - ;; add accent snippets - :cond #'laas-object-on-left-condition - "qq" (lambda () (interactive) (laas-wrap-previous-object "sqrt")) - :cond #'(lambda () (and (not (texmathp)) - (looking-back "^" nil))) - "dm" '(yas "\\[\n$1\n\\]$0")) - ) - -(provide 'init-latex) -;;; init-latex.el ends diff --git a/tools/emacs.d/lisp/init-markdown.el b/tools/emacs.d/lisp/init-markdown.el deleted file mode 100644 index 81f0b0f..0000000 --- a/tools/emacs.d/lisp/init-markdown.el +++ /dev/null @@ -1,12 +0,0 @@ -(use-package yaml-mode :straight t) - -(use-package markdown-mode - :mode ("\\.md\\'" . markdown-mode) - :init - (setq markdown-fontify-code-blokcs-natively t) - :custom - (setq markdown-fontify-code-block-natively t) - :hook ((markdown-mode . visual-line-mode))) - -(provide 'init-markdown) -;;; init-markdown.el ends diff --git a/tools/emacs.d/lisp/init-org.el b/tools/emacs.d/lisp/init-org.el deleted file mode 100644 index c748133..0000000 --- a/tools/emacs.d/lisp/init-org.el +++ /dev/null @@ -1,315 +0,0 @@ -;;; init-org.el - -;; Use =M-x org-mode-restart= to take effects -;; After =M-x eval-buffer= - -;; Org General - -(use-package org - :straight (:type built-in) ;; Tell straight to not install org - :custom - (org-log-done 'time) - (org-startup-indented nil) - ;; Use inline image - (org-startup-with-inline-images t) - (org-display-remote-inline-images 'cache) ; 预览网络图片 - - ;; Use LaTeX rendering - ;; (org-startup-with-latex-preview nil) - (org-image-actual-width 600) - ;; Conceal on markup markers - (org-hide-emphasis-markers t) - (org-directory "~/OrgFiles/") - (org-agenda-files (list (concat org-directory "tasks/"))) - (org-persist-directory (expand-file-name "org-persist" user-emacs-data)) - (org-archive-location "~/OrgFiles/.archive/%s_archive::") - (org-default-notes-file "~/OrgFiles/tasks/inbox.org") - (org-id-locations-file (expand-file-name ".org-id-locations" org-directory)) - (org-startup-folded "show2levels") - (org-log-into-drawer "LOGBOOK") - (org-pretty-entities t) - (org-src-fontify-natively t) - (org-src-tab-acts-natively t) ; Use TAB to indent inside source block - (org-src-preserve-indentation t) ; Prevent from auto-indent - (org-startup-folded 'showall) - :config - (require 'org-habit) - (with-eval-after-load 'org - (define-key org-mode-map (kbd "C-j") 'org-return-indent) - (evil-define-key 'normal org-mode-map (kbd "TAB") 'org-cycle)) - (evil-define-key 'normal org-mode-map (kbd "SPC a") 'org-agenda-list) ; TODO: Here Simulates the leader - ;; (setq org-emphasis-alist - ;; '(("*" (bold :foreground "cyan" )) - ;; ("/" (italic :foreground "green")) - ;; ("_" underline) - ;; ("=" (org-verbatim verbatim :background "maroon" :foreground "white")) - ;; ("~" (org-code verbatim :background "maroon" :foreground "white")) - ;; ("+" (:strike-through t)))) - (custom-set-faces - '(org-bold ((t (:weight bold :foreground unspecified)))) - '(org-italic ((t (:slant italic :foreground unspecified)))) - '(org-underline ((t (:underline t :foreground unspecified)))) - '(org-code ((t (:inherit fixed-pitch :background unspecified :foreground unspecified)))) - '(org-verbatim ((t (:inherit fixed-pitch :background unspecified :foreground unspecified)))) - '(org-strike-through ((t (:strike-through t :foreground unspecified))))) - - - (dolist (face '((org-level-1 . 1.6) - (org-level-2 . 1.4) - (org-level-3 . 1.2) - (org-level-4 . 1.1) - (org-level-5 . 1.0) - (org-level-6 . 1.0) - (org-level-7 . 1.0) - (org-level-8 . 1.0))) - (set-face-attribute (car face) nil :height (cdr face)))) - - -;; Org Styling - -;; Set Org Styles - - -;; Org Preview - -;; Better LaTeX preview - -(setq org-latex-preview-ltxpng-directory (expand-file-name "emacs/org/latex" xdg-cache-home)) -(setq org-preview-latex-default-process 'dvisvgm) -(setq org-format-latex-options (plist-put org-format-latex-options :scale 0.8)) - -;; org-appear: Show hidden emphasis markers -;; Just like Obsidian -(use-package org-appear - :hook - (org-mode . org-appear-mode)) - - -(use-package org-latex-impatient - :defer t - :hook (org-mode . org-latex-impatient-mode) - :init - (setq org-latex-impatient-tex2svg-bin - ;; location of tex2svg executable - "~/.local/share/pnpm/tex2svg")) - -(use-package org-fragtog - :after org - :hook (org-mode . org-fragtog-mode)) - -;; Pasting Images -;; Use =M-x org-download-clipboard= to paste image -;; Additional program required: magick -;; Windows: scoop install imagemagick -;; org-download config -(use-package org-download - :ensure t - :after org - :config - ;; Hardcoding the image dir - (setq-default org-download-image-dir (expand-file-name ".attach" org-directory)) - - (setq org-download-heading-lvl nil ; don't use heading when creating files - org-download-timestamp "%Y%m%d-%H%M%S" - org-download-screenshot-method "screencapture -i %s" ; for macOS only - org-download-backend 'curl) ; use curl to `download` image - - (org-download-enable) - - :bind (:map org-mode-map - ("C-c d c" . org-download-clipboard) ; 粘贴剪贴板内容 - ("C-c d s" . org-download-screenshot))) ; 截图 - - -;; For CJK users -;; Insert zero width space around the emphasis symbols, this might be useful for -;; languages that does not rely on space -(defun js0ny/insert-emphasis-with-zws (char) - (interactive "c") - (insert ?\u200B char) - (save-excursion (insert char ?\u200B))) - -(global-set-key (kbd "C-c b") (lambda () (interactive) (js0ny/insert-emphasis-with-zws ?*))) -(global-set-key (kbd "C-c i") (lambda () (interactive) (js0ny/insert-emphasis-with-zws ?/))) - -;; Pomodoro for org clock -(use-package org-pomodoro - :straight t - :bind (:map org-mode-map - ("C-c p" . org-pomodoro))) - - -(defun js0ny/org-pomodoro-resume-last-task () - "Clock in to the last task and start Pomodoro on it." - (interactive) - (let ((marker (car org-clock-history))) - (if marker - (progn - (org-with-point-at marker - (org-clock-in)) - (org-pomodoro)) - (message "No previous clock task found.")))) - -(use-package org-modern - :ensure t - :config - ;; (setopt org-modern-star 'replace - ;; org-modern-replace-stars '("§") - ;; org-modern-hide-stars "§") - (setopt org-modern-list '((?- . "•"))) - (setopt org-modern-timestamp '(" %Y-%m-%d " . " %H:%M ")) - (setopt org-modern-block-fringe nil) - -;; https://github.com/neoheartbeats/.emacs.d/blob/main/lisp/init-org.el#L126C1-L159C47 - (defun sthenno/org-modern-spacing () - "Adjust line-spacing for `org-modern' to correct svg display." - - ;; FIXME: This may not set properly - (setq-local line-spacing (cond ((eq major-mode #'org-mode) 0.20) - (t nil)))) - (add-hook 'org-mode-hook #'sthenno/org-modern-spacing) - - - ;; Hooks - (add-hook 'org-mode-hook #'org-modern-mode)) - -;; WARNING: This package will cause infinite recursion when initialising org -;; Test on 2025-03-14 Emacs 30 and Arch Linux -;(use-package mixed-pitch -; :hook -; (text-mode . org-mode)) - -;; Org Agenda - -(with-eval-after-load 'org-agenda - (evil-define-key 'motion org-agenda-mode-map - (kbd "n") #'org-agenda-next-line - (kbd "e") #'org-agenda-previous-line - (kbd "gn") #'org-agenda-next-item - (kbd "ge") #'org-agenda-previous-item - (kbd "N") #'org-agenda-priority-up - (kbd "E") #'org-agenda-priority-down - (kbd "i") #'evil-forward-char - (kbd ",") #'org-agenda-priority - (kbd "x") #'org-agenda-todo - (kbd "t") #'org-agenda-set-tags - (kbd "w") #'org-save-all-org-buffers - (kbd "ds") #'org-agenda-schedule - (kbd "dd") #'org-agenda-deadline - (kbd "$") #'org-agenda-archive - (kbd "!") #'org-agenda-toggle-deadlines - (kbd "cp") #'org-pomodoro - (kbd "vd") #'org-agenda-day-view - (kbd "vw") #'org-agenda-week-view - (kbd "vm") #'org-agenda-month-view - (kbd "vy") #'org-agenda-year-view - (kbd "v.") #'org-agenda-reset-view)) - -(evil-leader/set-key "A" #'org-agenda) - -(setq org-agenda-prefix-format '((agenda . " %i %-12:c%?-12t% s") - (todo . " %i %-12:c %e") - (tags . " %i %-12:c %e ") - (search . " %i %-12:c %e "))) - - -;; Org Babel - -;; Run source block with C-c C-c -;; Add supports for non-elisp langs -(use-package ob-python - :straight (:type built-in) ; Part of Org Mode - :after org) - -(use-package ob-C ;; C++ support is integrated in ob-C - :straight (:type built-in) ; Part of Org Mode - :after org) - -(org-babel-do-load-languages - 'org-babel-load-languages - '( - (python . t) ; No need to declare C/C++/emacs-lisp since is integrated - (shell . t) - (dot . t) - (ditaa . t) - )) -;; Don't ask me again when running source block -;; Use clang as default C/C++ Compiler on macOS and Windows -(setq org-confirm-babel-evaluate nil) -(if (not (eq system-type 'gnu/linux)) - (setq org-babel-C-compiler "clang")) - -(setq org-babel-default-header-args:C - '((:includes . " "))) - -(setq org-babel-default-header-args:C++ - '((:includes . " "))) - -;; Org Export - -;; icalendar - -(defun my/org-icalendar-filter-out-habits (entry backend info) - "Filter out Org entries that are marked as habits when exporting to iCalendar." - (when (and (eq backend 'icalendar) - (string-match ":STYLE:.*habit" (or entry ""))) - nil)) - -(add-hook 'org-export-filter-entry-functions #'my/org-icalendar-filter-out-habits) - - -(setq org-icalendar-use-scheduled '(event-if-todo event-if-not-todo)) -(setq org-icalendar-use-deadline '(event-if-todo event-if-not-todo)) -(setq org-icalendar-combined-agenda-file "~/Dropbox/org.ics") - - -;; ;; Integrate Emacs Timer with System Notifications -;; ;; 定义通知函数 -;; (defun js0ny/org-clock-notification (title message &optional icon) -;; "发送一个系统通知" -;; (alert message -;; :title title -;; :icon icon -;; :category 'org-clock)) - -;; ;; 添加定时器检查函数 -;; (defun js0ny/org-clock-check-timer () -;; "检查当前正在运行的 clock 是否到期" -;; (when (org-clocking-p) -;; (let* ((clocked-time (org-clock-get-clocked-time)) -;; (effort (org-duration-to-minutes -;; (or (org-entry-get (org-clock-is-active) "Effort") -;; "0"))) -;; (remaining (- effort clocked-time))) -;; (when (and (> effort 0) (<= remaining 0)) -;; (js0ny/org-clock-notification -;; "Org Clock 提醒" -;; (format "任务 '%s' 的预计时间已到!" -;; (org-clock-get-clock-string))))))) - -;; ;; 设置定时器,每分钟检查一次 -;; (run-with-timer 0 60 #'js0ny/org-clock-check-timer) - -;; 在 org-clock-in-hook 中添加检查 -;; (add-hook 'org-clock-in-hook -;; (lambda () -;; (let ((effort (org-entry-get (point) "Effort"))) -;; (when effort -;; (js0ny/org-clock-notification -;; "开始计时" -;; (format "开始计时任务: %s\n预计用时: %s" -;; (org-get-heading t t t t) -;; effort)))))) -(use-package org-node - :after org - :config (org-node-cache-mode)) - - -;; ;; 执行最后一行,重新生成解析表达式 -;; (with-eval-after-load 'org -;; ;; 添加常见全角标点 -;; (setf (nth 1 org-emphasis-regexp-components) -;; " \t\r\n,.:!?:;。,!?、」』)〉》」』〕〗】})]") -;; (org-set-emph-re 'org-emphasis-regexp-components org-emphasis-regexp-components)) - -(provide 'init-org) diff --git a/tools/emacs.d/lisp/init-package.el b/tools/emacs.d/lisp/init-package.el deleted file mode 100644 index 9befe21..0000000 --- a/tools/emacs.d/lisp/init-package.el +++ /dev/null @@ -1,68 +0,0 @@ -;;; init-package.el --- Package management setup using straight.el -*- lexical-binding: t -*- - -(setq straight-base-dir user-emacs-data) - -;; Bootstrap straight.el -(defvar bootstrap-version) -(let ((bootstrap-file - (expand-file-name - "straight/repos/straight.el/bootstrap.el" - (or (bound-and-true-p straight-base-dir) - user-emacs-directory))) - (bootstrap-version 7)) - (unless (file-exists-p bootstrap-file) - (with-current-buffer - (url-retrieve-synchronously - "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" - 'silent 'inhibit-cookies) - (goto-char (point-max)) - (eval-print-last-sexp))) - (load bootstrap-file nil 'nomessage)) - -;; Use straight.el with use-package -(straight-use-package 'use-package) -(setq straight-use-package-by-default t) ;; Automatically use straight for all packages - -;; Ensure gnu-elpa-keyring-update (equivalent to your previous keyring update logic) -(use-package gnu-elpa-keyring-update) - - -;; Which Key - Prompt available commands -(use-package which-key - :ensure t - :init - (which-key-mode) - :custom - (which-key-idle-delay 0.1)) - -;; Dashboard -(use-package dashboard - ;; Open with :dashboard-open - :after evil - :bind (:map dashboard-mode-map - ;; Navigation - ("n" . dashboard-next-line) - ("e" . dashboard-previous-line) - ;; Buffer switching - ("H" . previous-buffer) - ("I" . next-buffer)) - :custom - (dashboard-center-content t) - :config - (dashboard-setup-startup-hook) - ;; Use Emacs mode to use number to navigate dashboard - ) - - -(use-package wakatime-mode - :ensure t - :custom - ;; Use expand-file-name to prevent from error parsing on windows-nt - (wakatime-cli-path (expand-file-name "~/.local/bin/wakatime")) - :config - (global-wakatime-mode) - ) - - -(provide 'init-package) -;;; init-package.el ends here diff --git a/tools/emacs.d/lisp/init-scratch.el b/tools/emacs.d/lisp/init-scratch.el deleted file mode 100644 index ec9bf2b..0000000 --- a/tools/emacs.d/lisp/init-scratch.el +++ /dev/null @@ -1,5 +0,0 @@ - -(setq initial-major-mode 'org-mode) - - -(provide 'init-scratch) diff --git a/tools/emacs.d/lisp/init-treesitter.el b/tools/emacs.d/lisp/init-treesitter.el deleted file mode 100644 index 0268024..0000000 --- a/tools/emacs.d/lisp/init-treesitter.el +++ /dev/null @@ -1,28 +0,0 @@ -;;; init-treesitter.el tree-sitter integration for emacs -;;; Reference: https://emacs.liujiacai.net/post/038-hello-treesitter/ -;;; Download: https://github.com/emacs-tree-sitter/tree-sitter-langs/releases/tag/0.12.268 - - -(add-to-list 'treesit-extra-load-path (expand-file-name "tree-sitter" user-emacs-data)) - -(setq major-mode-remap-alist - '((yaml-mode . yaml-ts-mode) - (sh-mode . bash-ts-mode) - (js-mode . js-ts-mode) - (css-mode . css-ts-mode) - (c-mode . c-ts-mode) - (c++-mode . c++-ts-mode) - (c-or-c++-mode . c-or-c++-ts-mode) - (python-mode . python-ts-mode) - (js-json-mode . json-ts-mode))) - -(add-to-list 'treesit-language-source-alist - '(hyprlang "https://github.com/tree-sitter-grammars/tree-sitter-hyprlang")) - -(use-package hyprlang-ts-mode - :ensure t - :custom - (hyprlang-ts-mode-indent-offset 4)) - - -(provide 'init-treesitter) diff --git a/tools/emacs.d/lisp/init-wayland.el b/tools/emacs.d/lisp/init-wayland.el deleted file mode 100644 index 64c6ca7..0000000 --- a/tools/emacs.d/lisp/init-wayland.el +++ /dev/null @@ -1,11 +0,0 @@ - -(when (getenv "WAYLAND_DISPLAY") - ;; Fix: Emacs nox does not have clipboard integration under wayland - (use-package xclip - :config - (setq xclip-program "wl-copy") - (setq xclip-select-enable-clipboard t) - (setq xclip-mode t) - (setq xclip-method (quote wl-copy)))) - -(provide 'init-wayland) diff --git a/tools/emacs.d/lisp/init-writer.el b/tools/emacs.d/lisp/init-writer.el deleted file mode 100644 index cbdb7b3..0000000 --- a/tools/emacs.d/lisp/init-writer.el +++ /dev/null @@ -1,8 +0,0 @@ - -;; TODO -(use-package flyspell) - -(use-package olivetti - :hook (olivetti-mode . org-mode)) - -(provide 'init-writer) diff --git a/tools/emacs.d/site-lisp b/tools/emacs.d/site-lisp deleted file mode 120000 index 4683114..0000000 --- a/tools/emacs.d/site-lisp +++ /dev/null @@ -1 +0,0 @@ -../doom/lisp/ \ No newline at end of file diff --git a/tools/emacs.d/snippets/org-mode/begin_quote b/tools/emacs.d/snippets/org-mode/begin_quote deleted file mode 100644 index 3c90e2b..0000000 --- a/tools/emacs.d/snippets/org-mode/begin_quote +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: begin_quote -# key: quote -# -- -#+BEGIN_QUOTE -$1 -#+END_QUOTE diff --git a/tools/emacs.d/snippets/org-mode/begin_src b/tools/emacs.d/snippets/org-mode/begin_src deleted file mode 100644 index 7ed1d69..0000000 --- a/tools/emacs.d/snippets/org-mode/begin_src +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# name: begin_src -# key: src -# -- -#+BEGIN_SRC $1 -$2 -#+END_SRC - diff --git a/tools/emacs.d/snippets/org-mode/begin_src_elisp b/tools/emacs.d/snippets/org-mode/begin_src_elisp deleted file mode 100644 index e0c5f57..0000000 --- a/tools/emacs.d/snippets/org-mode/begin_src_elisp +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -# name: elisp -# key: elisp -# -- - -#+BEGIN_SRC emacs-lisp -$1 -#+END_SRC diff --git a/tools/nvim/lua/plugins/mod/dap-setup.lua b/tools/nvim/lua/plugins/mod/dap-setup.lua deleted file mode 100644 index 8b13789..0000000 --- a/tools/nvim/lua/plugins/mod/dap-setup.lua +++ /dev/null @@ -1 +0,0 @@ -