├── fd ├── ignore └── setup.sh ├── sdk ├── clojure │ ├── repl-port │ ├── lein-repl.service │ ├── profiles.clj │ └── setup.sh ├── python │ ├── flake8 │ ├── pip.conf │ ├── pylintrc │ ├── install_miniconda.sh │ ├── ptpythonrc │ └── setup.sh ├── docker │ ├── daemon.json │ ├── setup.sh │ └── kubernetes.sh ├── ruby │ ├── rubocop.yml │ └── setup.sh ├── rust │ ├── config.toml │ ├── rustfmt.toml │ └── setup.sh ├── gradle │ ├── setup.sh │ └── init.gradle ├── cpp │ ├── clang-format │ ├── setup.sh │ └── ycm_extra_conf.py ├── scala │ ├── setup.sh │ └── sbtnew ├── go │ └── setup.sh └── node │ ├── setup.sh │ └── old_setup.sh ├── brew ├── .gitignore ├── Brewfile.linux ├── setup.sh └── Brewfile.darwin ├── hyprland ├── waybar │ ├── config.jsonc │ ├── top.jsonc │ └── style.css ├── chrome-flags.conf ├── chromium-flags.conf ├── hypr │ ├── hyprlock.png │ ├── frappe.conf │ ├── hypridle.conf │ └── hyprlock.conf ├── setup.sh └── fuzzel │ └── fuzzel.ini ├── zsh ├── p10k-pure.zsh ├── zsh_secret ├── starship.toml ├── zsh_misc ├── sheldon │ └── plugins.toml ├── zsh_theme ├── setup.sh └── zsh_aliases ├── LICENSE.txt ├── gpg ├── dirmngr.conf └── setup.sh ├── vim ├── nvim │ ├── after │ │ └── ftplugin │ │ │ ├── lua.lua │ │ │ ├── sh.lua │ │ │ ├── devicetree.vim │ │ │ └── go.lua │ ├── stylua.toml │ ├── .gitignore │ ├── snippets │ │ ├── native │ │ │ ├── zsh.json │ │ │ ├── sh.json │ │ │ └── lua.json │ │ └── luasnip │ │ │ ├── zsh.lua │ │ │ ├── rust.lua │ │ │ └── sh.lua │ ├── .neoconf.json │ ├── init.lua │ ├── lua │ │ ├── config │ │ │ ├── commands.lua │ │ │ ├── autocmds.lua │ │ │ ├── options.lua │ │ │ ├── lazy.lua │ │ │ └── keymaps.lua │ │ └── plugins │ │ │ ├── treesitter.lua │ │ │ ├── noice.lua │ │ │ ├── ai.lua │ │ │ └── colors.lua │ └── lazyvim.json ├── UltiSnips │ ├── tmux.snippets │ ├── vim.snippets │ ├── maven.snippets │ ├── markdown.snippets │ ├── cmake.snippets │ ├── text.snippets │ ├── python.snippets │ ├── make.snippets │ ├── zsh.snippets │ ├── gitignore.snippets │ ├── gradle.snippets │ ├── esquery.snippets │ ├── ruby.snippets │ ├── dockerfile.snippets │ ├── rust.snippets │ ├── yaml.snippets │ ├── all.snippets │ ├── go.snippets │ └── cpp.snippets ├── setup.sh ├── ideavimrc ├── gvimrc └── spell │ └── en.utf-8.add ├── libvirt ├── libvirt.conf └── setup.sh ├── yazi ├── theme.toml ├── init.lua ├── yazi.toml ├── keymap.toml └── setup.sh ├── fcitx5 ├── config │ ├── conf │ │ ├── notifications.conf │ │ ├── classicui.conf │ │ ├── cloudpinyin.conf │ │ ├── chttrans.conf │ │ ├── punctuation.conf │ │ ├── clipboard.conf │ │ └── pinyin.conf │ ├── profile │ └── config ├── punctuation │ └── punc.mb.zh_CN └── setup.sh ├── mutt ├── muttrc.pvt └── setup.sh ├── tmux ├── tmux_osx.conf └── setup.sh ├── .gitattributes ├── .gitignore ├── .gitmodules ├── bin ├── welcome_banner ├── rename_hostname ├── pbcopy ├── pbpaste ├── setup.sh ├── playground ├── pre-commit-hook-common ├── toggle-window ├── ghr-get ├── color-spaces ├── git-semver-next ├── runorraise-i3 └── semver-next ├── festival ├── setup.sh └── festivalrc ├── .git-crypt ├── keys │ └── default │ │ └── 0 │ │ └── DC6FB7FC761E848F76E98B4FCCAF35548C65530F.gpg └── .gitattributes ├── tilda ├── setup.sh └── config ├── arch ├── sddm.conf ├── paru.conf ├── setup_vm.sh ├── setup.sh ├── mirrorlist ├── yaourtrc ├── setup_core.sh ├── pacman.conf └── setup_gui.sh ├── topgrade ├── setup.sh └── topgrade.toml ├── wezterm ├── darwin.lua ├── setup.sh └── wezterm.lua ├── xorg ├── Xresources ├── setup.sh ├── xthemes │ ├── amarena │ ├── lovelace │ ├── manta │ ├── ephemeral │ └── skyfall ├── xinitrc └── xprofile ├── cron ├── crontab └── setup.sh ├── rofi ├── config.rasi └── setup.sh ├── procs └── setup.sh ├── eza ├── setup.sh └── catppuccin.yml ├── emacs ├── emacs.service ├── good-theme-spacemacs.list └── setup.sh ├── git └── git-pager ├── osx └── setup.sh ├── fastfetch ├── setup.sh └── config.jsonc ├── chrome ├── surfingkeys └── setup.sh ├── bat ├── setup.sh └── config ├── i3 ├── autostart ├── setup.sh └── autostart_always ├── README.md ├── picom ├── setup.sh └── picom.conf ├── alacritty ├── setup.sh └── alacritty.yml ├── fonts └── setup.sh ├── kitty ├── setup.sh └── kitty.conf ├── rpk ├── setup.sh └── packages.toml ├── cheat.sh └── setup.sh ├── install ├── ranger ├── setup.sh └── commands.py ├── .github └── workflows │ └── docker.yaml ├── scripts └── cpu_time_usage.sh ├── Dockerfile └── qemu └── centos7.sh /fd/ignore: -------------------------------------------------------------------------------- 1 | **/.git/ 2 | -------------------------------------------------------------------------------- /sdk/clojure/repl-port: -------------------------------------------------------------------------------- 1 | 38505 -------------------------------------------------------------------------------- /brew/.gitignore: -------------------------------------------------------------------------------- 1 | *.lock.json 2 | -------------------------------------------------------------------------------- /hyprland/waybar/config.jsonc: -------------------------------------------------------------------------------- 1 | bot.jsonc -------------------------------------------------------------------------------- /zsh/p10k-pure.zsh: -------------------------------------------------------------------------------- 1 | p10k-pure-catppuccin.zsh -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | https://wfxr.mit-license.org/2015 2 | -------------------------------------------------------------------------------- /gpg/dirmngr.conf: -------------------------------------------------------------------------------- 1 | keyserver hkps://keys.openpgp.org 2 | -------------------------------------------------------------------------------- /sdk/python/flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 120 3 | -------------------------------------------------------------------------------- /vim/nvim/after/ftplugin/lua.lua: -------------------------------------------------------------------------------- 1 | vim.opt.tabstop = 2 2 | -------------------------------------------------------------------------------- /hyprland/chrome-flags.conf: -------------------------------------------------------------------------------- 1 | --force-device-scale-factor=1.5 2 | -------------------------------------------------------------------------------- /libvirt/libvirt.conf: -------------------------------------------------------------------------------- 1 | uri_default = "qemu:///system" 2 | 3 | -------------------------------------------------------------------------------- /vim/nvim/after/ftplugin/sh.lua: -------------------------------------------------------------------------------- 1 | vim.g.autoformat = false 2 | -------------------------------------------------------------------------------- /yazi/theme.toml: -------------------------------------------------------------------------------- 1 | [flavor] 2 | dark = "catppuccin-frappe" 3 | -------------------------------------------------------------------------------- /vim/nvim/after/ftplugin/devicetree.vim: -------------------------------------------------------------------------------- 1 | hi Comment cterm=none gui=none 2 | -------------------------------------------------------------------------------- /fcitx5/config/conf/notifications.conf: -------------------------------------------------------------------------------- 1 | # 隐藏通知 2 | HiddenNotifications= 3 | 4 | -------------------------------------------------------------------------------- /zsh/zsh_secret: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wfxr/dotfiles/HEAD/zsh/zsh_secret -------------------------------------------------------------------------------- /mutt/muttrc.pvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wfxr/dotfiles/HEAD/mutt/muttrc.pvt -------------------------------------------------------------------------------- /tmux/tmux_osx.conf: -------------------------------------------------------------------------------- 1 | set -g default-command "reattach-to-user-namespace -l ${SHELL}" 2 | -------------------------------------------------------------------------------- /vim/nvim/stylua.toml: -------------------------------------------------------------------------------- 1 | indent_type = "Spaces" 2 | indent_width = 2 3 | column_width = 120 -------------------------------------------------------------------------------- /hyprland/chromium-flags.conf: -------------------------------------------------------------------------------- 1 | --force-device-scale-factor=1.5 2 | --enable-webrtc-pipewire-capturer 3 | -------------------------------------------------------------------------------- /hyprland/hypr/hyprlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wfxr/dotfiles/HEAD/hyprland/hypr/hyprlock.png -------------------------------------------------------------------------------- /vim/nvim/.gitignore: -------------------------------------------------------------------------------- 1 | tt.* 2 | .tests 3 | doc/tags 4 | debug 5 | .repro 6 | foo.* 7 | *.log 8 | data 9 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pvt filter=git-crypt diff=git-crypt 2 | /zsh/zsh_secret filter=git-crypt diff=git-crypt 3 | -------------------------------------------------------------------------------- /sdk/docker/daemon.json: -------------------------------------------------------------------------------- 1 | { 2 | "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"] 3 | } 4 | 5 | -------------------------------------------------------------------------------- /vim/nvim/after/ftplugin/go.lua: -------------------------------------------------------------------------------- 1 | vim.opt.listchars:append({ tab = " " }) 2 | vim.opt.expandtab = false 3 | -------------------------------------------------------------------------------- /sdk/ruby/rubocop.yml: -------------------------------------------------------------------------------- 1 | AllCops: 2 | TargetRubyVersion: 2.3 3 | 4 | Layout/IndentationWidth: 5 | Width: 4 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | .DS_Store 3 | *.spl 4 | *.sug 5 | .gdb_history 6 | *.zip 7 | *.tgz 8 | *.tar.gz 9 | .luarc.json 10 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "awesomewm"] 2 | path = awesomewm 3 | url = https://github.com/wfxr/awm.config 4 | branch = main 5 | -------------------------------------------------------------------------------- /bin/welcome_banner: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | figlet -f standard "$(hostname)" | lolcat -f --spread 8 | sudo tee /etc/motd 4 | -------------------------------------------------------------------------------- /vim/UltiSnips/tmux.snippets: -------------------------------------------------------------------------------- 1 | snippet plug "set -g @plugin 'awesome-plugin'" b 2 | set -g @plugin '${1:${VISUAL}}' 3 | endsnippet 4 | -------------------------------------------------------------------------------- /sdk/python/pip.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | index-url = https://pypi.tuna.tsinghua.edu.cn/simple 3 | [install] 4 | trusted-host=pypi.tuna.tsinghua.edu.cn 5 | -------------------------------------------------------------------------------- /vim/UltiSnips/vim.snippets: -------------------------------------------------------------------------------- 1 | snippet hasplug "if has_key(g:plugs, '...')" b 2 | if has_key(g:plugs, '$1') 3 | ${VISUAL}$2 4 | endif 5 | endsnippet 6 | -------------------------------------------------------------------------------- /festival/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) 4 | 5 | ln -sf "$SCRIPT_DIR/festivalrc" ~/.festivalrc 6 | -------------------------------------------------------------------------------- /fcitx5/config/conf/classicui.conf: -------------------------------------------------------------------------------- 1 | Theme=catppuccin-frappe-sky 2 | # Theme=Material-Color-Teal 3 | # Theme=green 4 | 5 | PerScreenDPI=true 6 | Font="Noto Sans Regular 12" 7 | -------------------------------------------------------------------------------- /vim/nvim/snippets/native/zsh.json: -------------------------------------------------------------------------------- 1 | { 2 | "hascmd": { 3 | "prefix": "hascmd", 4 | "body": [ 5 | "(( \\$+commands[${1:cmd}] )) ${2:&&} $3" 6 | ] 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /yazi/init.lua: -------------------------------------------------------------------------------- 1 | require("full-border"):setup({ 2 | -- Available values: ui.Border.PLAIN, ui.Border.ROUNDED 3 | -- type = ui.Border.ROUNDED, 4 | }) 5 | 6 | require("git"):setup() 7 | -------------------------------------------------------------------------------- /.git-crypt/keys/default/0/DC6FB7FC761E848F76E98B4FCCAF35548C65530F.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wfxr/dotfiles/HEAD/.git-crypt/keys/default/0/DC6FB7FC761E848F76E98B4FCCAF35548C65530F.gpg -------------------------------------------------------------------------------- /tilda/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) 4 | 5 | mkdir -p ~/.config/tilda 6 | 7 | ln -sf "$SCRIPT_DIR/config" ~/.config/tilda/config_0 8 | -------------------------------------------------------------------------------- /arch/sddm.conf: -------------------------------------------------------------------------------- 1 | [Theme] 2 | Current=sugar-candy 3 | CursorTheme= 4 | 5 | [Wayland] 6 | EnableHiDPI=true 7 | 8 | [X11] 9 | EnableHiDPI=true 10 | ServerArguments=-nolisten tcp -dpi 192 11 | -------------------------------------------------------------------------------- /.git-crypt/.gitattributes: -------------------------------------------------------------------------------- 1 | # Do not edit this file. To specify the files to encrypt, create your own 2 | # .gitattributes file in the directory where your files are. 3 | * !filter !diff 4 | *.gpg binary 5 | -------------------------------------------------------------------------------- /fcitx5/config/conf/cloudpinyin.conf: -------------------------------------------------------------------------------- 1 | # Minimum Pinyin Length 2 | MinimumPinyinLength=4 3 | # Backend 4 | Backend=Baidu 5 | # Proxy 6 | Proxy= 7 | 8 | [Toggle Key] 9 | 0=Control+Alt+Shift+C 10 | 11 | -------------------------------------------------------------------------------- /vim/UltiSnips/maven.snippets: -------------------------------------------------------------------------------- 1 | snippet aliyun "aliyun mirror" b 2 | 3 | aliyun 4 | http://maven.aliyun.com/nexus/content/groups/public/ 5 | 6 | endsnippet 7 | -------------------------------------------------------------------------------- /festival/festivalrc: -------------------------------------------------------------------------------- 1 | (Parameter.set 'Audio_Required_Format 'aiff) 2 | (Parameter.set 'Audio_Method 'Audio_Command) 3 | (Parameter.set 'Audio_Command "paplay $FILE --client-name=Festival --stream-name=Speech") 4 | -------------------------------------------------------------------------------- /sdk/python/pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | disable= 3 | C0114, # missing-module-docstring 4 | C0115, # missing-class-docstring 5 | C0116, # missing-function-docstring 6 | C0103, # short variable naming 7 | -------------------------------------------------------------------------------- /topgrade/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || exit 1 5 | 6 | ln -sf "$SDIR/topgrade.toml" ~/.config/topgrade.toml 7 | -------------------------------------------------------------------------------- /wezterm/darwin.lua: -------------------------------------------------------------------------------- 1 | return { 2 | native_macos_fullscreen_mode = false, 3 | font_size = 16, 4 | keys = { 5 | { key = "f", mods = "CTRL|SUPER", action = "ToggleFullScreen" }, 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fd/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || exit 1 5 | 6 | mkdir -p ~/.config/fd 7 | ln -sf "$SDIR/ignore" ~/.config/fd/ignore 8 | -------------------------------------------------------------------------------- /sdk/rust/config.toml: -------------------------------------------------------------------------------- 1 | # [source.crates-io] 2 | # registry = "https://github.com/rust-lang/crates.io-index" 3 | # replace-with = 'ustc' 4 | # [source.ustc] 5 | # registry = "git://mirrors.ustc.edu.cn/crates.io-index" 6 | -------------------------------------------------------------------------------- /xorg/Xresources: -------------------------------------------------------------------------------- 1 | Xft.dpi: 168 2 | Xft.autohint: 0 3 | Xft.lcdfilter: lcddefault 4 | Xft.hintstyle: hintfull 5 | Xft.hinting: 1 6 | Xft.antialias: 1 7 | Xft.rgba: rgb 8 | Xcursor.theme: Graphite-light-nord-cursors 9 | -------------------------------------------------------------------------------- /fcitx5/config/conf/chttrans.conf: -------------------------------------------------------------------------------- 1 | # 转换引擎 2 | Engine=OpenCC 3 | # 启用的输入法 4 | EnabledIM= 5 | # 简转繁的 OpenCC 配置 6 | OpenCCS2TProfile= 7 | # 繁转简的 OpenCC 配置 8 | OpenCCT2SProfile= 9 | 10 | [Hotkey] 11 | 0=Control+Shift+F 12 | 13 | -------------------------------------------------------------------------------- /fcitx5/config/conf/punctuation.conf: -------------------------------------------------------------------------------- 1 | # 字母或者数字之后输入半角标点 2 | HalfWidthPuncAfterLetterOrNumber=True 3 | # 同时输入成对标点 (例如引号) 4 | TypePairedPunctuationsTogether=False 5 | # Enabled 6 | Enabled=True 7 | 8 | [Hotkey] 9 | 0=Control+period 10 | 11 | -------------------------------------------------------------------------------- /fcitx5/punctuation/punc.mb.zh_CN: -------------------------------------------------------------------------------- 1 | . 。 2 | , , 3 | ? ? 4 | " “ ” 5 | : : 6 | ; ; 7 | ' ‘ ’ 8 | < 《 9 | > 》 10 | \ 、 11 | ! ! 12 | $ ¥ 13 | * × 14 | _ —— 15 | ^ …… 16 | ( ( 17 | ) ) 18 | { 「 19 | } 」 20 | [ 【 21 | ] 】 22 | ~ ~ 23 | ` · 24 | -------------------------------------------------------------------------------- /cron/crontab: -------------------------------------------------------------------------------- 1 | @reboot cd $HOME/screenshots && /usr/sbin/fd --changed-before 30d -x rm -rf 2 | @reboot cd $HOME/downloads && mkdir -p old && /usr/sbin/fd --changed-before 30d -x mv {} old 3 | @reboot docker image prune -a -f --filter "until=480h" 4 | -------------------------------------------------------------------------------- /sdk/clojure/lein-repl.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Lein Repl Daemon 3 | 4 | [Service] 5 | Type=simple 6 | ExecStart=/home/wenxuan/bin/lein repl :headless :port 59237 7 | Restart=always 8 | 9 | [Install] 10 | WantedBy=default.target 11 | -------------------------------------------------------------------------------- /sdk/python/install_miniconda.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | cd /tmp 6 | wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh 7 | bash Miniconda3-latest-Linux-x86_64.sh -b -p ~/miniconda3 8 | -------------------------------------------------------------------------------- /vim/UltiSnips/markdown.snippets: -------------------------------------------------------------------------------- 1 | priority 1 2 | 3 | snippet mit "MIT license" b 4 | The MIT License ([MIT](https://${1:`git config github.user`}.mit-license.org/${2:`date +%Y`})) 5 | 6 | Copyright (c) ${3:`git config user.name`} 7 | endsnippet 8 | 9 | -------------------------------------------------------------------------------- /rofi/config.rasi: -------------------------------------------------------------------------------- 1 | configuration { 2 | dpi: 192; 3 | } 4 | 5 | /* @theme "lb" */ 6 | @theme "glue_pro_blue" 7 | /* @theme "Pop-Dark" */ 8 | /* @theme "gruvbox-dark" */ 9 | 10 | window { 11 | border: 0; 12 | } 13 | 14 | /* vim:ft=css 15 | -------------------------------------------------------------------------------- /sdk/gradle/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) 4 | 5 | # -p says to create the dir if it doesn't exist already. 6 | mkdir -p ~/.gradle 7 | ln -sf "$SCRIPT_DIR/init.gradle" ~/.gradle/init.gradle 8 | -------------------------------------------------------------------------------- /procs/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || return 1 6 | 7 | mkdir -p ~/.config/procs 8 | 9 | ln -sf "$SDIR/config.toml" ~/.config/procs/ 10 | -------------------------------------------------------------------------------- /eza/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || return 1 6 | 7 | mkdir -p ~/.config/eza 8 | 9 | ln -sf "$SDIR/catppuccin.yml" ~/.config/eza/theme.yml 10 | -------------------------------------------------------------------------------- /libvirt/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || return 1 6 | 7 | mkdir -p ~/.config/libvirt 8 | 9 | ln -sf "$SDIR/libvirt.conf" ~/.config/libvirt 10 | -------------------------------------------------------------------------------- /vim/nvim/.neoconf.json: -------------------------------------------------------------------------------- 1 | { 2 | "neodev": { 3 | "library": { 4 | "enabled": true, 5 | "plugins": true 6 | } 7 | }, 8 | "neoconf": { 9 | "plugins": { 10 | "lua_ls": { 11 | "enabled": true 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vim/UltiSnips/cmake.snippets: -------------------------------------------------------------------------------- 1 | snippet demo "Description" b 2 | cmake_minimum_required (VERSION 3.1.0) 3 | project (${1:demo}) 4 | 5 | set (CMAKE_CXX_STANDARD ${2:14}) 6 | 7 | add_executable ($1 $1.cpp) 8 | ${3:target_link_libraries ($1 pthread rt)} 9 | endsnippet 10 | 11 | -------------------------------------------------------------------------------- /fcitx5/config/conf/clipboard.conf: -------------------------------------------------------------------------------- 1 | # 触发键 2 | TriggerKey= 3 | # 粘贴主选区 4 | PastePrimaryKey= 5 | # 项目个数 6 | Number of entries=5 7 | # 不要显示密码管理工具中的密码 8 | IgnorePasswordFromPasswordManager=False 9 | # 隐藏剪贴板中包含密码的内容 10 | ShowPassword=False 11 | # 自动清除密码的秒数 12 | ClearPasswordAfter=30 13 | 14 | -------------------------------------------------------------------------------- /sdk/clojure/profiles.clj: -------------------------------------------------------------------------------- 1 | {:user {:plugins [[lein-pprint "1.2.0"] 2 | [lein-exec "0.3.7"] 3 | [lein-kibit "0.1.6"] 4 | [lein-cljfmt "0.5.7"] 5 | [cider/cider-nrepl "0.17.0"] 6 | [mvxcvi/whidbey "1.3.2"]]}} 7 | -------------------------------------------------------------------------------- /emacs/emacs.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Emacs Daemon 3 | 4 | [Service] 5 | Type=simple 6 | ExecStart=/usr/bin/emacs --fg-daemon 7 | ExecStop=/usr/bin/emacsclient --eval "(progn (setq kill-emacs-hook 'nil) (kill-emacs))" 8 | Restart=always 9 | 10 | [Install] 11 | WantedBy=default.target 12 | -------------------------------------------------------------------------------- /vim/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || return 1 5 | 6 | mkdir -p ~/.config 7 | 8 | ln -snf "$SDIR/nvim" ~/.config/nvim 9 | ln -sf "$SDIR/ideavimrc" ~/.ideavimrc 10 | 11 | nvim --headless "+Lazy! sync" +qa || true 12 | -------------------------------------------------------------------------------- /wezterm/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" 5 | 6 | mkdir -p ~/.config/wezterm/ 7 | ln -sf "$SDIR/wezterm.lua" ~/.config/wezterm/wezterm.lua 8 | 9 | [[ $OSTYPE =~ darwin ]] && ln -sf "$SDIR/darwin.lua" ~/.config/wezterm/darwin.lua 10 | -------------------------------------------------------------------------------- /git/git-pager: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | COLUMNS=$(tput cols); 4 | if [ "$COLUMNS" -ge 80 ] && [ -z "$FZF_PREVIEW_COLUMNS" ]; then 5 | delta --side-by-side -w "$COLUMNS"; 6 | elif [ "$COLUMNS" -ge 160 ] && [ -n "$FZF_PREVIEW_COLUMNS" ]; then 7 | delta --side-by-side -w "$FZF_PREVIEW_COLUMNS"; 8 | else 9 | delta; 10 | fi 11 | -------------------------------------------------------------------------------- /sdk/cpp/clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle : LLVM 3 | IndentWidth : 4 4 | ColumnLimit : 100 5 | Standard : Auto 6 | AccessModifierOffset : -4 7 | AllowShortFunctionsOnASingleLine : All 8 | AllowShortIfStatementsOnASingleLine : true 9 | AlwaysBreakTemplateDeclarations : true 10 | AlignConsecutiveAssignments : true 11 | ReflowComments: false 12 | -------------------------------------------------------------------------------- /xorg/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" && cd "$SDIR" 6 | 7 | ln -sf "$SDIR/xprofile" ~/.xprofile 8 | ln -sf "$SDIR/xinitrc" ~/.xinitrc 9 | ln -sf "$SDIR/Xresources" ~/.Xresources 10 | ln -snf "$SDIR/xthemes" ~/.xthemes 11 | -------------------------------------------------------------------------------- /sdk/cpp/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) 4 | 5 | ln -sf "$SCRIPT_DIR/ycm_extra_conf.py" ~/.ycm_extra_conf.py 6 | ln -sf "$SCRIPT_DIR/clang-format" ~/.clang-format 7 | [[ -f ~/.gdbinit ]] || wget -P ~ git.io/.gdbinit 8 | 9 | # CLI cpp reference 10 | sudo -H pip install --upgrade cppman 11 | -------------------------------------------------------------------------------- /vim/nvim/init.lua: -------------------------------------------------------------------------------- 1 | _G.dd = function(...) 2 | require("snacks.debug").inspect(...) 3 | end 4 | _G.bt = function(...) 5 | require("snacks.debug").backtrace() 6 | end 7 | _G.p = function(...) 8 | require("snacks.debug").profile(...) 9 | end 10 | vim.print = _G.dd 11 | 12 | -- bootstrap lazy.nvim, LazyVim and your plugins 13 | require("config.lazy") 14 | -------------------------------------------------------------------------------- /emacs/good-theme-spacemacs.list: -------------------------------------------------------------------------------- 1 | zen-and-art 2 | ujelly 3 | tangotango 4 | soft-charcoal 5 | smyx 6 | omtose-darker 7 | occidental # light 8 | noctilux 9 | naquadah 10 | monokai 11 | lush 12 | hemisu-dark 13 | darktooth 14 | dakrone 15 | sanityinc-tomorrow-bright 16 | sanityinc-tomorrow-eighties 17 | apropospriate-dark 18 | ample 19 | spacemacs-dark 20 | 21 | -------------------------------------------------------------------------------- /vim/UltiSnips/text.snippets: -------------------------------------------------------------------------------- 1 | snippet t "A simple HTML tag" b 2 | <${1:div}> 3 | Hello World 4 | 5 | endsnippet 6 | 7 | snippet todo "This is a TODO reminder" b 8 | 9 | endsnippet 10 | 11 | snippet mit "Insert my mit license" b 12 | MIT (c) Wenxuan Zhang 13 | https://wfxr.mit-license.org 14 | endsnippet 15 | -------------------------------------------------------------------------------- /vim/UltiSnips/python.snippets: -------------------------------------------------------------------------------- 1 | snippet py "#!/usr/bin/env python" b 2 | #!/usr/bin/env python 3 | endsnippet 4 | 5 | snippet py3 "#!/usr/bin/env python3" b 6 | #!/usr/bin/env python3 7 | endsnippet 8 | 9 | snippet py2 "#!/usr/bin/env python2" b 10 | #!/usr/bin/env python2 11 | endsnippet 12 | 13 | snippet pr "print('...')" b 14 | print('$1') 15 | endsnippet 16 | -------------------------------------------------------------------------------- /yazi/yazi.toml: -------------------------------------------------------------------------------- 1 | [preview] 2 | max_width = 3200 3 | max_height = 1800 4 | 5 | [[plugin.prepend_fetchers]] 6 | id = "git" 7 | name = "*" 8 | run = "git" 9 | 10 | [[plugin.prepend_fetchers]] 11 | id = "git" 12 | name = "*/" 13 | run = "git" 14 | 15 | [[manager.prepend_keymap]] 16 | on = "F" 17 | run = "plugin smart-filter" 18 | desc = "Smart filter" 19 | -------------------------------------------------------------------------------- /fcitx5/config/profile: -------------------------------------------------------------------------------- 1 | [Groups/0] 2 | # Group Name 3 | Name=默认 4 | # Layout 5 | Default Layout=us 6 | # Default Input Method 7 | DefaultIM=shuangpin 8 | 9 | [Groups/0/Items/0] 10 | # Name 11 | Name=keyboard-us 12 | # Layout 13 | Layout= 14 | 15 | [Groups/0/Items/1] 16 | # Name 17 | Name=shuangpin 18 | # Layout 19 | Layout= 20 | 21 | [GroupOrder] 22 | 0=默认 23 | 24 | -------------------------------------------------------------------------------- /sdk/rust/rustfmt.toml: -------------------------------------------------------------------------------- 1 | edition = "2021" 2 | struct_field_align_threshold = 40 3 | max_width = 120 4 | comment_width = 120 5 | reorder_imports = true 6 | fn_single_line = false 7 | imports_layout = "HorizontalVertical" 8 | match_arm_blocks = false 9 | overflow_delimited_expr = true 10 | imports_granularity = "Crate" 11 | struct_lit_width = 60 12 | struct_variant_width = 60 13 | -------------------------------------------------------------------------------- /osx/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || exit 1 6 | 7 | mkdir -p "$HOME/.config/karabiner" 8 | ln -sf "$SDIR/karabiner.json" "$HOME/.config/karabiner/karabiner.json" 9 | 10 | # disable mouse acceleration 11 | defaults write .GlobalPreferences com.apple.mouse.scaling -1 12 | -------------------------------------------------------------------------------- /vim/ideavimrc: -------------------------------------------------------------------------------- 1 | source ~/.vim_base 2 | source ~/.vim_map 3 | set surround 4 | " idea会自动补全{},需要重新映射"{"使其不产生多余的"}" 5 | inoremap { { 6 | set ideajoin 7 | set textobj-entire 8 | 9 | set highlightedyank 10 | let g:highlightedyank_highlight_color = 'rgba(251, 73, 52, 200)' 11 | let g:highlightedyank_highlight_duration = '100' 12 | set multiple-cursors 13 | -------------------------------------------------------------------------------- /vim/nvim/lua/config/commands.lua: -------------------------------------------------------------------------------- 1 | -- Function to remove trailing spaces 2 | local function strip_trailing_spaces() 3 | -- Save the current position of the cursor 4 | local pos = vim.fn.getpos(".") 5 | 6 | vim.cmd([[%s/\s\+$//e]]) 7 | 8 | -- Restore the cursor position 9 | vim.fn.setpos(".", pos) 10 | end 11 | vim.api.nvim_create_user_command("StripTrailingSpaces", strip_trailing_spaces, {}) 12 | -------------------------------------------------------------------------------- /vim/UltiSnips/make.snippets: -------------------------------------------------------------------------------- 1 | snippet list "list targets" b 2 | `!p 3 | snip.rv += """ 4 | list: 5 | @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' 6 | """ 7 | ` 8 | endsnippet 9 | 10 | snippet ph ".PHONY ..." b 11 | .PHONY: $1 12 | $1: ${2:do sth} 13 | endsnippet 14 | -------------------------------------------------------------------------------- /bin/rename_hostname: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | [ "$(whoami)" != "root" ] && exec sudo -- "$0" "$@" 5 | 6 | usage() { 7 | echo "Usage: $0 " >&2 8 | exit 1 9 | } 10 | if [[ $# -ne 1 ]]; then 11 | usage 12 | exit 13 | fi 14 | 15 | cp /etc/hostname /etc/hostname.bak 16 | cp /etc/hosts /etc/hosts.bak 17 | sed -i "s/$(hostname)/$1/g" /etc/hostname /etc/hosts 18 | hostname "$1" 19 | -------------------------------------------------------------------------------- /xorg/xthemes/amarena: -------------------------------------------------------------------------------- 1 | *background: #1A2026 2 | *foreground: #FFFFFF 3 | *cursorColor: #FFFFFF 4 | *color0: #242D35 5 | *color1: #FB6396 6 | *color2: #94CF95 7 | *color3: #F692B2 8 | *color4: #6EC1D6 9 | *color5: #CD84C8 10 | *color6: #7FE4D2 11 | *color7: #FFFFFF 12 | *color8: #526170 13 | *color9: #F92D72 14 | *color10: #6CCB6E 15 | *color11: #F26190 16 | *color12: #4CB9D6 17 | *color13: #C269BC 18 | *color14: #58D6BF 19 | *color15: #F4F5F2 20 | -------------------------------------------------------------------------------- /xorg/xthemes/lovelace: -------------------------------------------------------------------------------- 1 | *background: #1D1F28 2 | *foreground: #FDFDFD 3 | *cursorColor: #C574DD 4 | *color0: #282A36 5 | *color1: #F37F97 6 | *color2: #5ADECD 7 | *color3: #F2A272 8 | *color4: #8897F4 9 | *color5: #C574DD 10 | *color6: #79E6F3 11 | *color7: #FDFDFD 12 | *color8: #414458 13 | *color9: #FF4971 14 | *color10: #18E3C8 15 | *color11: #FF8037 16 | *color12: #556FFF 17 | *color13: #B043D1 18 | *color14: #3FDCEE 19 | *color15: #BEBEC1 20 | -------------------------------------------------------------------------------- /xorg/xthemes/manta: -------------------------------------------------------------------------------- 1 | *background: #1E2541 2 | *foreground: #EEFFFF 3 | *cursorColor: #EEFFFF 4 | *color0: #1E2541 5 | *color1: #F0719B 6 | *color2: #5AF7B0 7 | *color3: #FFA56B 8 | *color4: #57C7FF 9 | *color5: #C792EA 10 | *color6: #89DDFF 11 | *color7: #EEFFFF 12 | *color8: #354274 13 | *color9: #F02E6E 14 | *color10: #2CE592 15 | *color11: #FF8537 16 | *color12: #1DA0E2 17 | *color13: #A742EA 18 | *color14: #47BAE8 19 | *color15: #DEE6E7 20 | *color16: #2A335A 21 | -------------------------------------------------------------------------------- /xorg/xthemes/ephemeral: -------------------------------------------------------------------------------- 1 | *background: #323F4E 2 | *foreground: #F8F8F2 3 | *cursorColor: #F8F8F2 4 | *color0: #3D4C5F 5 | *color1: #F48FB1 6 | *color2: #A1EFD3 7 | *color3: #F1FA8C 8 | *color4: #92B6F4 9 | *color5: #BD99FF 10 | *color6: #87DFEB 11 | *color7: #F8F8F2 12 | *color8: #56687E 13 | *color9: #EE4F84 14 | *color10: #53E2AE 15 | *color11: #F1FF52 16 | *color12: #6498EF 17 | *color13: #985EFF 18 | *color14: #24D1E7 19 | *color15: #E5E5E5 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /tmux/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SCRIPT_DIR" || return 1 4 | 5 | ln -sf "$SCRIPT_DIR/tmux.conf" ~/.tmux.conf 6 | 7 | [[ $(uname) == *Darwin* ]] && ln -sf "$SCRIPT_DIR/tmux_osx.conf" ~/.tmux_osx.conf 8 | 9 | # tpm 10 | [[ ! -a ~/.tmux/plugins/tpm ]] && git clone --depth=1 https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm 11 | 12 | # install plugins 13 | ~/.tmux/plugins/tpm/scripts/install_plugins.sh 14 | -------------------------------------------------------------------------------- /fastfetch/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || return 1 6 | 7 | info() { printf "%b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$*" >&2; } 8 | warn() { printf "%b[warn]%b %s\n" '\e[0;33m\033[1m' '\e[0m' "$*" >&2; } 9 | erro() { printf "%b[erro]%b %s\n" '\e[0;31m\033[1m' '\e[0m' "$*" >&2; } 10 | 11 | mkdir -p ~/.config/fastfetch 12 | 13 | ln -sf "$SDIR/config.jsonc" ~/.config/fastfetch/ 14 | -------------------------------------------------------------------------------- /chrome/surfingkeys: -------------------------------------------------------------------------------- 1 | // vim: set ft=javascript: 2 | 3 | settings.tabsMRUOrder = false; 4 | 5 | map('h', 'E'); 6 | map('l', 'R'); 7 | 8 | map('H', 'S'); 9 | map('L', 'D'); 10 | 11 | mapkey('T', 'Choose a tab with omnibar', function() { 12 | Front.openOmnibar({type: "Tabs"}); 13 | }); 14 | 15 | mapkey('gt', '#8Open a URL', function() { 16 | Front.openOmnibar({type: "URLs", extra: "getAllSites"}); 17 | }); 18 | 19 | mapkey('t', '#3Choose a tab', function() { 20 | Front.chooseTab(); 21 | }); 22 | -------------------------------------------------------------------------------- /xorg/xthemes/skyfall: -------------------------------------------------------------------------------- 1 | *background: #282F37 2 | *foreground: #F1FCF9 3 | *cursorColor: #F1FCF9 4 | *color0: #20262C 5 | *color1: #DB86BA 6 | *color2: #74DD91 7 | *color3: #E49186 8 | *color4: #75DBE1 9 | *color5: #B4A1DB 10 | *color6: #9EE9EA 11 | *color7: #F1FCF9 12 | *color8: #465463 13 | *color9: #D04E9D 14 | *color10: #4BC66D 15 | *color11: #DB695B 16 | *color12: #3DBAC2 17 | *color13: #825ECE 18 | *color14: #62CDCD 19 | *color15: #E0E5E5 20 | -------------------------------------------------------------------------------- /bat/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" 6 | 7 | cfgdir="$(bat --config-dir)" 8 | 9 | mkdir -p "$cfgdir" 10 | ln -sf "$SDIR/config" "$cfgdir/config" 11 | 12 | # Themes 13 | mkdir -p "$cfgdir/themes" 14 | cd "$cfgdir/themes" 15 | 16 | theme="Catppuccin Frappe" 17 | file="Catppuccin Frappe.tmTheme" 18 | test -f "$file" || 19 | wget "https://github.com/catppuccin/bat/raw/main/themes/$theme.tmTheme" 20 | 21 | bat cache --build 22 | -------------------------------------------------------------------------------- /sdk/docker/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #=============================================================================== 3 | # Author: Wenxuan 4 | # Email: wenxuangm@gmail.com 5 | # Created: 2018-03-31 11:53 6 | #=============================================================================== 7 | [ "$(whoami)" != "root" ] && exec sudo -- "$0" "$@" 8 | SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SCRIPT_DIR" || return 1 9 | 10 | mkdir -p /etc/docker 11 | ln -snf "$SCRIPT_DIR/daemon.json" /etc/docker/daemon.json 12 | -------------------------------------------------------------------------------- /i3/autostart: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ################################################################################ 3 | # Author: Wenxuan Zhang # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2019-11-30 17:16 # 6 | ################################################################################ 7 | 8 | main() { 9 | variety &>/tmp/variety.log & 10 | return 0 11 | } 12 | 13 | main 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Gallery 2 | 3 | ![screenshot-1](https://raw.githubusercontent.com/wfxr/i/master/archlinux-1.png) 4 | 5 | ![screenshot-2](https://raw.githubusercontent.com/wfxr/i/master/archlinux-2.png) 6 | 7 | ![screenshot-3](https://raw.githubusercontent.com/wfxr/i/master/archlinux-3.png) 8 | 9 | ## Usage 10 | 11 | ``` bash 12 | git clone https://github.com/wfxr/dotfiles 13 | # eg: install vim and tmux configurations 14 | dotfiles/install vim tmux 15 | ``` 16 | 17 | ## License 18 | 19 | [MIT](https://wfxr.mit-license.org/2015) (c) Wenxuan Zhang 20 | -------------------------------------------------------------------------------- /brew/Brewfile.linux: -------------------------------------------------------------------------------- 1 | tap "homebrew/bundle" 2 | tap "homebrew/core" 3 | brew "bat" 4 | brew "bottom" 5 | brew "code-minimap" 6 | brew "csview" 7 | brew "dua-cli" 8 | brew "duf" 9 | brew "eza" 10 | brew "fd" 11 | brew "fzf" 12 | brew "git-delta" 13 | brew "go" 14 | brew "htop" 15 | brew "hyperfine" 16 | brew "neovim" 17 | brew "python@3.9" 18 | brew "ripgrep" 19 | brew "sd" 20 | brew "sheldon" 21 | brew "starship" 22 | brew "tmux" 23 | brew "tokei" 24 | brew "topgrade" 25 | brew "wget" 26 | brew "zoxide" 27 | brew "zsh" 28 | brew "jq" 29 | brew "difftastic" 30 | -------------------------------------------------------------------------------- /vim/nvim/lazyvim.json: -------------------------------------------------------------------------------- 1 | { 2 | "extras": [ 3 | "lazyvim.plugins.extras.ai.copilot", 4 | "lazyvim.plugins.extras.coding.yanky", 5 | "lazyvim.plugins.extras.dap.core", 6 | "lazyvim.plugins.extras.dap.nlua", 7 | "lazyvim.plugins.extras.editor.outline", 8 | "lazyvim.plugins.extras.lang.markdown", 9 | "lazyvim.plugins.extras.lang.tex", 10 | "lazyvim.plugins.extras.lang.toml", 11 | "lazyvim.plugins.extras.vscode" 12 | ], 13 | "install_version": 7, 14 | "news": { 15 | "NEWS.md": "11866" 16 | }, 17 | "version": 8 18 | } -------------------------------------------------------------------------------- /bin/pbcopy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$XDG_SESSION_TYPE" = "x11" ]; then 4 | if hash xsel &>/dev/null; then 5 | xsel --clipboard --input "$@" 6 | elif hash xclip &>/dev/null; then 7 | xclip -selection clipboard "$@" 8 | else 9 | echo "xsel or xclip is required" >&2 10 | exit 1 11 | fi 12 | elif [ "$XDG_SESSION_TYPE" = "wayland" ]; then 13 | if hash wl-copy &>/dev/null; then 14 | wl-copy "$@" 15 | else 16 | echo "wl-clipboard is required" >&2 17 | exit 1 18 | fi 19 | fi 20 | -------------------------------------------------------------------------------- /bin/pbpaste: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$XDG_SESSION_TYPE" = "x11" ]; then 4 | if hash xsel &>/dev/null; then 5 | xsel --clipboard --output "$@" 6 | elif hash xclip &>/dev/null; then 7 | xclip -selection clipboard -o "$@" 8 | else 9 | echo "xsel or xclip is required" >&2 10 | exit 1 11 | fi 12 | elif [ "$XDG_SESSION_TYPE" = "wayland" ]; then 13 | if hash wl-paste &>/dev/null; then 14 | wl-paste "$@" 15 | else 16 | echo "wl-clipboard is required" >&2 17 | exit 1 18 | fi 19 | fi 20 | -------------------------------------------------------------------------------- /sdk/scala/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || exit 1 6 | 7 | # Install coursier 8 | if ! hash cs &>/dev/null; then 9 | mkdir -p ~/bin 10 | curl -fLo ~/bin/cs https://git.io/coursier-cli-"$(uname | tr LD ld)" 11 | chmod +x ~/bin/cs 12 | fi 13 | 14 | # Install tools from coursier 15 | for cmd in scalafmt scalafix; do 16 | hash $cmd &>/dev/null || cs install $cmd 17 | done 18 | 19 | # Install util scripts 20 | mkdir -p ~/bin 21 | ln -sf "$SDIR/sbtnew" ~/bin/sbtnew 22 | -------------------------------------------------------------------------------- /vim/gvimrc: -------------------------------------------------------------------------------- 1 | scriptencoding utf-8 2 | set guioptions-=T 3 | set guioptions-=m 4 | set guioptions-=r 5 | set guioptions-=L 6 | set guitablabel=%M\ %t 7 | 8 | if has('win32') || has('win64') 9 | let g:is_win = 1 10 | else 11 | let g:is_win = 0 12 | endif 13 | 14 | if g:is_win 15 | " set guifont=JetBrains\ Mono:h12:cANSI 16 | " Request after changing the version of language 17 | source $VIMRUNTIME/delmenu.vim 18 | source $VIMRUNTIME/menu.vim 19 | " Avoid messy code under console 20 | language messages en_US 21 | endif 22 | 23 | set guifont=JetBrains\ Mono\ 12 24 | -------------------------------------------------------------------------------- /emacs/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) 4 | 5 | if [[ ! -a ~/.emacs.d || ! -a ~/.emacs.d/spacemacs.mk ]]; then 6 | git clone --depth=1 https://github.com/syl20bnr/spacemacs ~/.emacs.d 7 | fi 8 | 9 | ln -sf "$SCRIPT_DIR/spacemacs" ~/.spacemacs 10 | 11 | # Systemd service 12 | [[ -f ~/.config/systemd/user/emacs.service ]] && exit 0 13 | mkdir -p ~/.config/systemd/user 14 | ln -sf "$SCRIPT_DIR/emacs.service" ~/.config/systemd/user/emacs.service 15 | systemctl --user daemon-reload 16 | systemctl --user enable emacs 17 | systemctl --user start emacs 18 | -------------------------------------------------------------------------------- /sdk/gradle/init.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | // maven { 4 | // name "aliyunRepo" 5 | // url "http://maven.aliyun.com/nexus/content/groups/public/" 6 | // } 7 | maven { 8 | name "kotlinRepo" 9 | url "https://dl.bintray.com/kotlin/exposed/" 10 | } 11 | maven { 12 | name "jcenterRepo" 13 | url "http://jcenter.bintray.com" 14 | } 15 | maven { 16 | name "jitpackRepo" 17 | url "https://jitpack.io" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /arch/paru.conf: -------------------------------------------------------------------------------- 1 | # 2 | # $PARU_CONF 3 | # /etc/paru.conf 4 | # ~/.config/paru/paru.conf 5 | # 6 | # See the paru.conf(5) manpage for options 7 | 8 | # 9 | # GENERAL OPTIONS 10 | # 11 | [options] 12 | PgpFetch 13 | Devel 14 | Provides 15 | DevelSuffixes = -git -cvs -svn -bzr -darcs -always 16 | #AurOnly 17 | BottomUp 18 | #RemoveMake 19 | #SudoLoop 20 | #UseAsk 21 | #CombinedUpgrade 22 | #CleanAfter 23 | #UpgradeMenu 24 | #NewsOnUpgrade 25 | 26 | #LocalRepo 27 | #Chroot 28 | #Sign 29 | #SignDb 30 | 31 | # 32 | # Binary OPTIONS 33 | # 34 | #[bin] 35 | #FileManager = vifm 36 | #MFlags = --skippgpcheck 37 | #Sudo = doas 38 | -------------------------------------------------------------------------------- /arch/setup_vm.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || exit 1 6 | 7 | info() { printf "$(date -Is) %b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$*" >&2; } 8 | warn() { printf "$(date -Is) %b[warn]%b %s\n" '\e[0;33m\033[1m' '\e[0m' "$*" >&2; } 9 | erro() { printf "$(date -Is) %b[erro]%b %s\n" '\e[0;31m\033[1m' '\e[0m' "$*" >&2; } 10 | 11 | paru --noconfirm -S qemu 12 | paru --noconfirm -S virt-manager dnsmasq ebtables dmidecode 13 | 14 | sudo systemctl enable libvirtd.service 15 | sudo systemctl start libvirtd.service 16 | -------------------------------------------------------------------------------- /bin/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || return 1 6 | 7 | info() { printf "%b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$*" >&2; } 8 | warn() { printf "%b[warn]%b %s\n" '\e[0;33m\033[1m' '\e[0m' "$*" >&2; } 9 | erro() { printf "%b[erro]%b %s\n" '\e[0;31m\033[1m' '\e[0m' "$*" >&2; } 10 | 11 | mkdir -p ~/bin 12 | 13 | ln -sf "$SDIR/playground" "$HOME/bin/playground" 14 | 15 | [[ $OSTYPE =~ linux ]] && { 16 | ln -sf "$SDIR/pbcopy" "$HOME/bin/pbcopy" 17 | ln -sf "$SDIR/pbpaste" "$HOME/bin/pbpaste" 18 | } 19 | -------------------------------------------------------------------------------- /arch/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || exit 1 6 | 7 | mkdir -p "$HOME/.config" 8 | mkdir -p "$HOME/tmp" 9 | mkdir -p "$HOME/bin" 10 | mkdir -p "$HOME/dev" 11 | 12 | mkdir -p ~/.config/paru 13 | ln -sf "$SDIR/paru.conf" ~/.config/paru/paru.conf 14 | 15 | ../gpg/setup.sh 16 | 17 | ./setup_core.sh 18 | 19 | git submodule update --init --recursive 20 | 21 | ../zsh/setup.sh 22 | ../tmux/setup.sh 23 | 24 | ../sdk/python/setup.sh 25 | ../sdk/node/setup.sh 26 | 27 | ../vim/setup.sh 28 | 29 | ../git/setup.sh 30 | 31 | ./setup_gui.sh 32 | -------------------------------------------------------------------------------- /bat/config: -------------------------------------------------------------------------------- 1 | # --theme="zenburn" 2 | --theme="Catppuccin Frappe" 3 | 4 | # Show line numbers, Git modifications and file header (but no grid) 5 | # --style="numbers,changes" 6 | --style="plain" 7 | 8 | # Use italic text on the terminal (not supported on all terminals) 9 | --italic-text=always 10 | 11 | # Add mouse scrolling support in less (does not work with older 12 | # versions of "less") 13 | --pager="less -FRS" 14 | 15 | # Use C++ syntax (instead of C) for .h header files 16 | --map-syntax h:cpp 17 | 18 | # Use "gitignore" highlighting for ".ignore" files 19 | --map-syntax .ignore:.gitignore 20 | 21 | # Show line numbers 22 | --number 23 | -------------------------------------------------------------------------------- /brew/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || exit 1 6 | 7 | if ! hash brew &>/dev/null; then 8 | bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" 9 | fi 10 | 11 | if [[ $OSTYPE =~ darwin ]]; then 12 | export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:$PATH" 13 | brew bundle install --file Brewfile.darwin 14 | elif [[ -x /home/linuxbrew/.linuxbrew/bin/brew ]]; then 15 | eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" 16 | brew bundle install --file Brewfile.linux 17 | fi 18 | -------------------------------------------------------------------------------- /sdk/docker/kubernetes.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #=============================================================================== 3 | # Author: Wenxuan 4 | # Email: wenxuangm@gmail.com 5 | # Created: 2018-04-05 10:28 6 | #=============================================================================== 7 | 8 | release="$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/$(uname | tr 'A-Z' 'a-z')/amd64/kubectl" 9 | hash kubectl &>/dev/null || 10 | curl -LO "https://storage.googleapis.com/kubernetes-release/release/$release" && 11 | chmod +x kubectl && 12 | mkdir -p ~/bin && 13 | mv kubectl ~/bin 14 | -------------------------------------------------------------------------------- /fcitx5/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | SDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" && cd "$SDIR" || return 1 5 | 6 | rm -rf ~/.config/fcitx5 7 | ln -sf "$SDIR/config" ~/.config/fcitx5 8 | 9 | mkdir -p ~/.local/share/fcitx5/punctuation/ 10 | for f in "$SDIR"/punctuation/*; do 11 | ln -sf "$f" ~/.local/share/fcitx5/punctuation/ 12 | done 13 | 14 | mkdir -p ~/.local/share/fcitx5/themes 15 | cd ~/.local/share/fcitx5/themes 16 | if [ ! -d .catppuccin ]; then 17 | git clone --depth 1 https://github.com/catppuccin/fcitx5.git .catppuccin 18 | cp -r .catppuccin/src/* ~/.local/share/fcitx5/themes 19 | fi 20 | -------------------------------------------------------------------------------- /mutt/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ################################################################################ 3 | # Author: Wenxuan # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2019-01-23 18:46 # 6 | ################################################################################ 7 | SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) 8 | 9 | ln -sf "$SCRIPT_DIR/mutt_theme" ~/.mutt_theme 10 | ln -sf "$SCRIPT_DIR/mutt_binds" ~/.mutt_binds 11 | ln -sf "$SCRIPT_DIR/muttrc.pvt" ~/.muttrc 12 | -------------------------------------------------------------------------------- /vim/UltiSnips/zsh.snippets: -------------------------------------------------------------------------------- 1 | priority 1 2 | 3 | snippet hascmd "If command exists..." 4 | (( $+commands[${1:cmd}] )) && ${2:Do something $1} 5 | endsnippet 6 | 7 | snippet hasvar "If variable exists..." 8 | (( ${+${1:variable}} )) && ${2:Do something $1} 9 | endsnippet 10 | 11 | snippet better_ll "Create common header" b 12 | (( $+commands[eza] )) && ll='eza -lbhg --git ${1:--time-style long-iso} ${2:--color=always}' || ll='ls -l $1 $2' 13 | endsnippet 14 | 15 | snippet default "Set default program" b 16 | export ${1:EDITOR}="\${commands[${2:vim}]:-\$$1}" 17 | endsnippet 18 | 19 | snippet #! "#!/usr/bin/env zsh" b 20 | #!/usr/bin/env zsh 21 | $0 22 | endsnippet 23 | -------------------------------------------------------------------------------- /yazi/keymap.toml: -------------------------------------------------------------------------------- 1 | "$schema" = "https://yazi-rs.github.io/schemas/keymap.json" 2 | 3 | [manager] 4 | append_keymap = [ 5 | { on = "", run = "arrow -1", desc = "Move cursor up" }, 6 | { on = "", run = "arrow 1", desc = "Move cursor down" }, 7 | ] 8 | 9 | [input] 10 | prepend_keymap = [ 11 | { on = "", run = "close", desc = "Cancel input" }, 12 | ] 13 | 14 | # Plugin keymap 15 | [[manager.prepend_keymap]] 16 | on = "T" 17 | run = "plugin max-preview" 18 | desc = "Maximize or restore preview" 19 | 20 | [[manager.prepend_keymap]] 21 | on = "l" 22 | run = "plugin smart-enter" 23 | desc = "Enter the child directory, or open the file" 24 | -------------------------------------------------------------------------------- /picom/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ############################################################################ 3 | # Author: Wenxuan Zhang # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2020-10-28 14:35 # 6 | ############################################################################ 7 | set -euo pipefail 8 | IFS=$'\n\t' 9 | 10 | SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SCRIPT_DIR" || return 1 11 | 12 | mkdir -p ~/.config/picom 13 | ln -sf "$SCRIPT_DIR/picom.conf" ~/.config/picom/picom.conf 14 | -------------------------------------------------------------------------------- /zsh/starship.toml: -------------------------------------------------------------------------------- 1 | [line_break] 2 | disabled = false 3 | 4 | [time] 5 | disabled = true 6 | 7 | [directory] 8 | disabled = false 9 | fish_style_pwd_dir_length = 1 10 | truncation_length = 5 11 | truncate_to_repo = false 12 | 13 | [memory_usage] 14 | disabled = false 15 | threshold = 75 16 | symbol = "" 17 | style = 'bold dimmed yellow' 18 | format = '$symbol[$ram( | $swap)]($style) ' 19 | 20 | [git_branch] 21 | format = "[$symbol $branch]($style) " 22 | symbol = "" 23 | 24 | [git_metrics] 25 | disabled = false 26 | 27 | [package] 28 | format = '[$symbol$version]($style) ' 29 | 30 | [container] 31 | format = "[🐳]($style) " 32 | 33 | [golang] 34 | symbol = " " 35 | -------------------------------------------------------------------------------- /vim/UltiSnips/gitignore.snippets: -------------------------------------------------------------------------------- 1 | # TODO : Auto detect project type and append corresponding gitignore content <18-05-13 19:37, Wenxuan> # 2 | snippet idea "for idea" b 3 | # For intellij idea 4 | .idea/* 5 | !.idea/dictionaries/ 6 | /target 7 | /out 8 | *.iml 9 | 10 | endsnippet 11 | 12 | snippet gradle "for gralde" b 13 | # For gradle 14 | .gradle 15 | build/ 16 | 17 | endsnippet 18 | 19 | snippet maven "for maven" b 20 | # For gradle 21 | target/ 22 | 23 | endsnippet 24 | 25 | snippet k8s "for k8s" b 26 | # For k8s 27 | k8s/.* 28 | endsnippet 29 | 30 | snippet metals "for coc-metals" b 31 | .metals/ 32 | .bloop/ 33 | project/metals.sbt 34 | .ammonite/ 35 | endsnippet 36 | -------------------------------------------------------------------------------- /rofi/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" && cd "$SDIR" 6 | 7 | mkdir -p ~/.config/rofi/ 8 | ln -sf "$SDIR/config.rasi" ~/.config/rofi/config.rasi 9 | 10 | # setup greenclip config 11 | cat <<-EOF >~/.config/greenclip.toml 12 | [greenclip] 13 | blacklisted_applications = [] 14 | enable_image_support = true 15 | max_history_length = 500 16 | history_file = "$HOME/.cache/greenclip.history" 17 | image_cache_directory = "/tmp/greenclip" 18 | max_selection_size_bytes = 0 19 | trim_space_from_selection = true 20 | use_primary_selection_as_input = false 21 | static_history = [] 22 | EOF 23 | -------------------------------------------------------------------------------- /vim/nvim/lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter/nvim-treesitter", 4 | opts = function(_, opts) 5 | vim.list_extend(opts.ensure_installed, { 6 | "cmake", 7 | "c", 8 | "cpp", 9 | "go", 10 | "rust", 11 | "bash", 12 | "css", 13 | "devicetree", 14 | "gitcommit", 15 | "gitignore", 16 | "glsl", 17 | "graphql", 18 | "http", 19 | "meson", 20 | "ninja", 21 | "nix", 22 | "sql", 23 | "dockerfile", 24 | -- "comment", -- comments are slowing down TS bigtime, so disable for now 25 | }) 26 | end, 27 | }, 28 | } 29 | -------------------------------------------------------------------------------- /alacritty/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ################################################################################ 3 | # Author: Wenxuan Zhang # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2019-12-01 10:33 # 6 | ################################################################################ 7 | set -euo pipefail 8 | IFS=$'\n\t' 9 | 10 | SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SCRIPT_DIR" || return 1 11 | 12 | mkdir -p ~/.config/alacritty 13 | ln -sf "$SCRIPT_DIR/alacritty.yml" ~/.config/alacritty/alacritty.yml 14 | -------------------------------------------------------------------------------- /fonts/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ################################################################################ 3 | # Author: Wenxuan Zhang # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2019-12-01 10:33 # 6 | ################################################################################ 7 | set -euo pipefail 8 | IFS=$'\n\t' 9 | 10 | SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SCRIPT_DIR" || return 1 11 | 12 | mkdir -p ~/.config/fontconfig 13 | ln -sf "$SCRIPT_DIR/fonts.conf" ~/.config/fontconfig/fonts.conf 14 | fc-cache --force --verbose 15 | -------------------------------------------------------------------------------- /chrome/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ################################################################################ 3 | # Author: Wenxuan # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2018-06-08 12:46 # 6 | ################################################################################ 7 | 8 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || exit 1 9 | 10 | mkdir -p ~/.config 11 | 12 | [ -f ~/.config/chrome-flags.conf ] || echo '--force-device-scale-factor=1' > ~/.config/chrome-flags.conf 13 | 14 | ln -sf "$SDIR/surfingkeys" ~/.surfingkeys 15 | -------------------------------------------------------------------------------- /hyprland/waybar/top.jsonc: -------------------------------------------------------------------------------- 1 | { 2 | "id": "topbar", 3 | "name": "topbar", 4 | "layer": "top", 5 | "position": "top", 6 | "mod": "dock", 7 | "exclusive": true, 8 | "passthrough": false, 9 | "gtk-layer-shell": true, 10 | "modules-center": [ 11 | "hyprland/workspaces" 12 | ], 13 | "hyprland/workspaces": { 14 | "format": "", 15 | "disable-scroll": true, 16 | "active-only": false, 17 | "all-outputs": true, 18 | "on-click": "activate", 19 | "persistent-workspaces": { 20 | "*": [ 21 | 1, 22 | 2, 23 | 3, 24 | 4, 25 | 5 26 | ] 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /kitty/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ############################################################################ 3 | # Author: Wenxuan Zhang # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2021-03-31 15:50 # 6 | ############################################################################ 7 | set -euo pipefail 8 | IFS=$'\n\t' 9 | 10 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || return 1 11 | 12 | rm -rf ~/.config/kitty 13 | 14 | mkdir -p ~/.config/kitty 15 | 16 | ln -sf "$SDIR/kitty.conf" ~/.config/kitty 17 | 18 | kitty +kitten themes --reload-in=all 'Catppuccin-Frappe' 19 | -------------------------------------------------------------------------------- /vim/spell/en.utf-8.add: -------------------------------------------------------------------------------- 1 | app 2 | async 3 | autokey 4 | cd 5 | clojure 6 | cmake 7 | config 8 | ctrl 9 | cxx 10 | dat 11 | diff 12 | dir 13 | dotfiles 14 | dsp 15 | eof 16 | filename 17 | fn 18 | fzf 19 | github 20 | gmail 21 | google 22 | gui 23 | handler 24 | HomePage 25 | htop 26 | in 27 | io 28 | ip 29 | lhs 30 | localhost 31 | mongodb 32 | mul 33 | nullptr 34 | nvim 35 | offline 36 | ok 37 | path 38 | plugin 39 | plugins 40 | println 41 | rcv 42 | refactor 43 | rhs 44 | solarized 45 | sql 46 | sudo 47 | timestamp 48 | tmux 49 | ubuntu 50 | vim 51 | wenxuan 52 | wenxuangm 53 | win32 54 | win64 55 | windows 56 | zh 57 | Zhang 58 | zh_CN 59 | zsh 60 | gps 61 | kotlin 62 | fallback 63 | leetcode 64 | k8s 65 | v1 66 | api 67 | bfs 68 | wfxr 69 | repo 70 | -------------------------------------------------------------------------------- /cron/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ############################################################################ 3 | # Author: Wenxuan Zhang # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2020-07-14 16:03 # 6 | ############################################################################ 7 | set -euo pipefail 8 | IFS=$'\n\t' 9 | 10 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || exit 1 11 | 12 | trap 'command rm -rf $TEMP' EXIT INT TERM HUP 13 | TEMP="$(mktemp -td --suffix=.tmp "$(basename "$0")".XXXXXX)" 14 | 15 | cat <<-EOF | sort -u | crontab - 16 | $(crontab -l) 17 | $(<./crontab) 18 | EOF 19 | -------------------------------------------------------------------------------- /sdk/go/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #=============================================================================== 3 | # Author: Wenxuan 4 | # Email: wenxuangm@gmail.com 5 | # Created: 2017-12-22 12:40 6 | #=============================================================================== 7 | 8 | # Ported from https://github.com/Xuyuanp/dotfiles/blob/master/gotools.sh 9 | 10 | base=$GOPATH/src/golang.org/x 11 | mkdir -p "$base" && cd "$base" || exit 1 12 | 13 | repos=(crypto net sys text tools sync) 14 | 15 | for repo in "${repos[@]}"; do 16 | test -d "$base/$repo" || git clone --depth=1 "https://github.com/golang/$repo" 17 | done 18 | 19 | for repo in "${repos[@]}"; do 20 | cd "$base/$repo" && go install ./... && echo "$repo installed." 21 | done 22 | -------------------------------------------------------------------------------- /rpk/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || return 1 6 | 7 | info() { printf "%b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$*" >&2; } 8 | warn() { printf "%b[warn]%b %s\n" '\e[0;33m\033[1m' '\e[0m' "$*" >&2; } 9 | erro() { printf "%b[erro]%b %s\n" '\e[0;31m\033[1m' '\e[0m' "$*" >&2; } 10 | 11 | mkdir -p ~/bin 12 | 13 | if ! hash rpk &>/dev/null; then 14 | curl -fsSL https://raw.githubusercontent.com/wfxr/rpk/main/scripts/install \ 15 | | bash -s -- --to ~/bin 16 | fi 17 | 18 | mkdir -p ~/.config/rpk 19 | 20 | ln -sf "$SDIR/packages.toml" ~/.config/rpk/packages.toml 21 | 22 | [[ -v _GITHUB_TOKEN ]] && export GITHUB_TOKEN=$_GITHUB_TOKEN 23 | 24 | rpk sync 25 | -------------------------------------------------------------------------------- /bin/playground: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # https://www.reddit.com/r/rust/comments/m3taw6/rust_playground_at_your_fingertips/ 4 | PLAYGROUNDS_DIR="/tmp/rust-playgrounds" 5 | TIMESTAMP=$(date +"%Y%m%d%H%M%S") 6 | PROJECT_DIR="${PLAYGROUNDS_DIR}/playground${TIMESTAMP}" 7 | 8 | cargo new "$PROJECT_DIR" && cd "$PROJECT_DIR" || exit 1 9 | 10 | # Add dependencies to Cargo.toml 11 | for CRATE in "$@"; do 12 | sed "/^\[dependencies\]/a $CRATE = \"*\"" -i Cargo.toml 13 | done 14 | 15 | if [ -z "${TMUX}" ] 16 | then 17 | tmux new-session -s playground -n playground 18 | else 19 | tmux new-window -n playground -c "${PROJECT_DIR}" 20 | fi 21 | 22 | tmux send-keys "nvim +2 ./src/main.rs" C-m \; \ 23 | split-window -v "cargo watch -s 'clear && cargo run -q'" \; \ 24 | select-pane -U \; \ 25 | -------------------------------------------------------------------------------- /xorg/xinitrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | userresources=$HOME/.Xresources 4 | usermodmap=$HOME/.Xmodmap 5 | sysresources=/etc/X11/xinit/.Xresources 6 | sysmodmap=/etc/X11/xinit/.Xmodmap 7 | 8 | # merge in defaults and keymaps 9 | 10 | if [ -f $sysresources ]; then 11 | xrdb -merge $sysresources 12 | fi 13 | 14 | if [ -f $sysmodmap ]; then 15 | xmodmap $sysmodmap 16 | fi 17 | 18 | if [ -f "$userresources" ]; then 19 | xrdb -merge "$userresources" 20 | fi 21 | 22 | if [ -f "$usermodmap" ]; then 23 | xmodmap "$usermodmap" 24 | fi 25 | 26 | # start some nice programs 27 | 28 | if [ -d /etc/X11/xinit/xinitrc.d ] ; then 29 | for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do 30 | [ -x "$f" ] && . "$f" 31 | done 32 | unset f 33 | fi 34 | 35 | # no necessary when using sddm 36 | # exec i3 -V >/tmp/i3.log 2>&1 37 | -------------------------------------------------------------------------------- /hyprland/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || return 1 6 | 7 | info() { printf "%b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$*" >&2; } 8 | warn() { printf "%b[warn]%b %s\n" '\e[0;33m\033[1m' '\e[0m' "$*" >&2; } 9 | erro() { printf "%b[erro]%b %s\n" '\e[0;31m\033[1m' '\e[0m' "$*" >&2; } 10 | 11 | mkdir -p ~/.config 12 | 13 | for cfg in hypr fuzzel waybar; do 14 | rm -rf "$HOME/.config/$cfg" 15 | ln -sf "$SDIR/$cfg" ~/.config/ 16 | done 17 | 18 | ln -sf "$SDIR/chrome-flags.conf" ~/.config/ 19 | ln -sf "$SDIR/chromium-flags.conf" ~/.config/ 20 | 21 | pkgs=(fuzzel waybar hyprlock swaync hyprpicker hypridle hyprland-qtutils wlogout) 22 | 23 | pkgs+=(grimblast-git ) # screenshot 24 | 25 | paru -S --needed --noconfirm "${pkgs[@]}" 26 | -------------------------------------------------------------------------------- /i3/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ################################################################################ 3 | # Author: Wenxuan Zhang # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2019-12-01 10:33 # 6 | ################################################################################ 7 | set -euo pipefail 8 | IFS=$'\n\t' 9 | 10 | SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SCRIPT_DIR" || return 1 11 | 12 | TARGET_DIR=$HOME/.config/i3 13 | mkdir -p "$TARGET_DIR" 14 | 15 | ln -sf "$SCRIPT_DIR/autostart" "$TARGET_DIR/autostart" 16 | ln -sf "$SCRIPT_DIR/autostart_always" "$TARGET_DIR/autostart_always" 17 | ln -sf "$SCRIPT_DIR/config" "$TARGET_DIR/config" 18 | -------------------------------------------------------------------------------- /cheat.sh/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ################################################################################ 3 | # Author: Wenxuan Zhang # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2019-12-31 14:28 # 6 | ################################################################################ 7 | set -euo pipefail 8 | IFS=$'\n\t' 9 | 10 | SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SCRIPT_DIR" || return 1 11 | 12 | bin_file=~/bin/cht.sh 13 | comp_file=~/.zsh_completions/_cht 14 | 15 | # cheat sheet: https://github.com/chubin/cheat.sh 16 | [ -f $bin_file ] || curl -sSL https://cht.sh/:cht.sh >$bin_file && chmod +x $bin_file 17 | [ -f $comp_file ] || curl -sSL https://cht.sh/:zsh >$comp_file 18 | -------------------------------------------------------------------------------- /sdk/node/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" 6 | 7 | info() { printf "$(date +%FT%T) %b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$*" >&2; } 8 | warn() { printf "$(date +%FT%T) %b[warn]%b %s\n" '\e[0;33m\033[1m' '\e[0m' "$*" >&2; } 9 | erro() { printf "$(date +%FT%T) %b[erro]%b %s\n" '\e[0;31m\033[1m' '\e[0m' "$*" >&2; } 10 | 11 | export PATH="$HOME/bin:$PATH" 12 | 13 | if ! command -v fnm &>/dev/null; then 14 | info "install nodenv..." 15 | mkdir -p "$HOME/bin" 16 | curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "$HOME/bin" --skip-shell 17 | 18 | mkdir -p "$HOME/.config/zsh/completions" 19 | fnm completions --shell zsh > "$HOME/.config/zsh/completions/_fnm" 20 | fi 21 | 22 | info "install node..." 23 | fnm install v22.4.1 24 | fnm use v22.4.1 25 | -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # get dir of the current script and cd in it 4 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || exit 1 5 | 6 | # show usage 7 | usage() { echo "Usage: $(basename "$0") [module]..." >&2; } 8 | 9 | # simple log printer 10 | loginfo() { printf "%b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$@" >&2; } 11 | logerro() { printf "%b[erro]%b %s\n" '\e[0;31m\033[1m' '\e[0m' "$@" >&2; } 12 | 13 | [[ "$#" -lt 1 ]] && usage && exit 1 14 | 15 | # install a module 16 | install_module() { 17 | local module="$1" 18 | loginfo "install $module config ..." 19 | [[ ! -f "$module/setup.sh" ]] && logerro "$module config not found!" && return 2 20 | "$module/setup.sh" && loginfo "$module config installed successfully!" 21 | } 22 | 23 | # install every specified modules 24 | for module in "$@"; do 25 | install_module "${module%/}" 26 | done 27 | -------------------------------------------------------------------------------- /xorg/xprofile: -------------------------------------------------------------------------------- 1 | # vim: ft=sh: 2 | export LANG=en_US.UTF-8 3 | export LANGUAGE=en_US:zh_CN 4 | export LC_CTYPE=en_US.UTF-8 5 | 6 | export INPUT_METHOD=fcitx5 7 | export GTK_IM_MODULE=fcitx 8 | export XMODIFIERS=@im=fcitx 9 | export QT_IM_MODULE=fcitx 10 | export SDL_IM_MODULE=fcitx 11 | export GLFW_IM_MODULE=ibus 12 | 13 | [ -f ~/.xprofile.local ] && . ~/.xprofile.local 14 | 15 | xrdb -load ~/.Xresources 16 | xrdb -merge ~/.Xresources.local 17 | 18 | xrdb -merge ~/.xthemes/amarena 19 | 20 | # ~/.fehbg 21 | nitrogen --restore 22 | 23 | fcitx5 -d -r 24 | picom -b 25 | if hash greenclip &>/dev/null; then 26 | killall greenclip; 27 | greenclip daemon & 28 | fi 29 | 30 | # disable beep bell 31 | xset -b 32 | 33 | # screen lock 34 | xset s off 35 | # xset s on 36 | # xset s 300 37 | 38 | # dpms - Display Power Management Signaling 39 | xset -dpms 40 | # xset +dpms && xset dpms 1800 1801 1802 41 | 42 | # xss-lock -- awesome-client "lock_screen_show()" & 43 | -------------------------------------------------------------------------------- /bin/pre-commit-hook-common: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | ROOT=$(git rev-parse --show-toplevel) && cd "$ROOT" 6 | 7 | VER=$(head -n 1 version) 8 | VER_RE='^([0-9]+)\.([0-9]+)\.([0-9]+)(-(alpha|beta|rc)\.([0-9]+))?$' 9 | if [[ $VER =~ $VER_RE ]]; then 10 | MAJOR=${BASH_REMATCH[1]} 11 | MINOR=${BASH_REMATCH[2]} 12 | PATCH=${BASH_REMATCH[3]} 13 | STAGE=${BASH_REMATCH[5]} 14 | STAGE_NO=${BASH_REMATCH[6]} 15 | 16 | if [[ -z $STAGE ]]; then 17 | PATCH=$((PATCH + 1)) 18 | STAGE=alpha 19 | STAGE_NO=1 20 | else 21 | STAGE_NO=$((STAGE_NO + 1)) 22 | fi 23 | 24 | echo "$MAJOR.$MINOR.$PATCH-$STAGE.$STAGE_NO" |tee version 25 | git add version 26 | else 27 | echo 'Invalid version detected. Should be format like "MAJOR.MINOR.PATCH[-STAGE.STAGE_NO]".' >&2 28 | echo 'MAJOR, MINOR, PATCH, STAGE_NO should be number and Stage should be one of alpha, beta, rc.' >&2 29 | exit 1 30 | fi 31 | -------------------------------------------------------------------------------- /gpg/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ################################################################################ 3 | # Author: Wenxuan Zhang # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2019-04-22 15:23 # 6 | ################################################################################ 7 | set -euo pipefail 8 | IFS=$'\n\t' 9 | 10 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" 11 | 12 | mkdir -p ~/.gnupg 13 | chmod 700 ~/.gnupg 14 | 15 | ln -sf "$SDIR/dirmngr.conf" ~/.gnupg/ 16 | pkill dirmngr || true # restart to reload dirmngr.conf 17 | 18 | # import public key 19 | # gpg --recv-keys CCAF35548C65530F 20 | 21 | # import public key from keyserver: keys.gnupg.net 22 | # gpg --keyserver keys.gnupg.net --recv-keys CCAF35548C65530F 23 | 24 | gpg --allow-secret-key-import --import ./secring.gpg 25 | -------------------------------------------------------------------------------- /sdk/clojure/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SCRIPT_DIR" || exit 1 3 | 4 | [[ ! -a ~/bin/lein ]] && 5 | wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -O ~/bin/lein && 6 | chmod +x ~/bin/lein && lein 7 | 8 | [[ ! -a ~/bin/drip ]] && 9 | curl -L https://raw.githubusercontent.com/ninjudd/drip/master/bin/drip > ~/bin/drip && 10 | chmod +x ~/bin/drip && drip 11 | 12 | mkdir -p ~/.lein 13 | ln -sf "$SCRIPT_DIR/profiles.clj" ~/.lein/profiles.clj 14 | ln -sf "$SCRIPT_DIR/profiles.clj" ~/.lein/profiles.clj 15 | ln -sf "$SCRIPT_DIR/repl-port" ~/.lein/repl-port 16 | 17 | # Systemd service 18 | [[ -f ~/.config/systemd/user/lein-repl.service ]] && exit 0 19 | mkdir -p ~/.config/systemd/user 20 | ln -sf "$SCRIPT_DIR/lein-repl.service" ~/.config/systemd/user/lein-repl.service 21 | systemctl --user daemon-reload 22 | systemctl --user enable lein-repl 23 | systemctl --user start lein-repl 24 | -------------------------------------------------------------------------------- /vim/UltiSnips/gradle.snippets: -------------------------------------------------------------------------------- 1 | snippet aliyun "aliyun maven repository mirror" b 2 | maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } 3 | endsnippet 4 | 5 | snippet repos "common repositories list" b 6 | repositories { 7 | maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } 8 | mavenCentral() 9 | jcenter() 10 | } 11 | endsnippet 12 | 13 | snippet jdk "set sourceCompatibility" b 14 | sourceCompatibility = ${1:1.8} 15 | endsnippet 16 | 17 | snippet version_from_git "use version from git tag" b 18 | def getVersion = { -> 19 | def p = 'git describe --tags'.execute(); p.waitFor() 20 | def version = p.exitValue() == 0 ? p.text.trim() : '0.0.0' 21 | def dirty = 'git status -s'.execute().text.trim() 22 | return dirty ? "${version}-SNAPSHOT" : version 23 | } 24 | endsnippet 25 | 26 | snippet version_from_file "use version from file" b 27 | version = { -> 28 | try { 29 | rootProject.file('version').text.trim() 30 | } catch (ignored) { 31 | "SANPSHOT" 32 | } 33 | }.call() 34 | endsnippet 35 | -------------------------------------------------------------------------------- /ranger/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ############################################################################ 3 | # Author: Wenxuan Zhang # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2020-01-20 17:36 # 6 | ############################################################################ 7 | set -euo pipefail 8 | 9 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || return 1 10 | 11 | TDIR=~/.config/ranger 12 | mkdir -p "$TDIR" 13 | ln -sf "$SDIR/rc.conf" "$TDIR" 14 | ln -sf "$SDIR/scope.sh" "$TDIR" 15 | ln -sf "$SDIR/rifle.conf" "$TDIR" 16 | ln -sf "$SDIR/commands.py" "$TDIR" 17 | ln -sf "$SDIR/commands_full.py" "$TDIR" 18 | 19 | PDIR="$TDIR/plugins" 20 | mkdir -p "$PDIR" 21 | if ! [ -d "$PDIR/ranger_devicons" ]; then 22 | git clone --depth=1 https://github.com/alexanderjeurissen/ranger_devicons "$PDIR/ranger_devicons" 23 | (cd "$PDIR/ranger_devicons" && make install) 24 | fi 25 | -------------------------------------------------------------------------------- /.github/workflows/docker.yaml: -------------------------------------------------------------------------------- 1 | name: Build and Push Docker Image 2 | 3 | on: 4 | push: 5 | paths: 6 | - 'Dockerfile' 7 | schedule: 8 | - cron: "0 0 */3 * *" 9 | workflow_dispatch: 10 | inputs: 11 | version: 12 | description: 'image version' 13 | required: true 14 | default: 'latest' 15 | 16 | jobs: 17 | docker: 18 | runs-on: ubuntu-latest 19 | steps: 20 | - name: Check out the repo 21 | uses: actions/checkout@v3 22 | 23 | - name: Set up QEMU 24 | uses: docker/setup-qemu-action@v2 25 | 26 | - name: Set up Docker Buildx 27 | uses: docker/setup-buildx-action@v2 28 | 29 | - name: Log in to Docker Hub 30 | uses: docker/login-action@v2 31 | with: 32 | username: ${{ secrets.DOCKERHUB_USERNAME }} 33 | password: ${{ secrets.DOCKERHUB_TOKEN }} 34 | 35 | - name: Build and push 36 | uses: docker/build-push-action@v3 37 | with: 38 | push: true 39 | tags: wfxr/dotfiles:${{ github.event.inputs.version || 'latest' }} 40 | -------------------------------------------------------------------------------- /vim/UltiSnips/esquery.snippets: -------------------------------------------------------------------------------- 1 | snippet sz "size" b 2 | "size": ${1:1} 3 | endsnippet 4 | 5 | snippet q "query" b 6 | "query": { 7 | $2 8 | } 9 | endsnippet 10 | 11 | snippet tm "term" b 12 | "term": { 13 | "${1:field}": { 14 | "value": "${2:value}" 15 | } 16 | } 17 | endsnippet 18 | 19 | snippet aggs "aggs" b 20 | "aggs": { 21 | "${1:agg}": { 22 | $2 23 | } 24 | } 25 | endsnippet 26 | 27 | 28 | snippet sum "aggs" b 29 | "sum": { 30 | "field": "$1" 31 | } 32 | endsnippet 33 | 34 | snippet dateRange "description" 35 | "range": { 36 | "${1:date}": { 37 | "${2:gte}": "${3:`date -Iseconds -d $(date -I -d yesterday)`}", 38 | "${4:lt}": "${4:`date -Iseconds -d $(date -I -d today)`}", 39 | "format": "${5:yyyy-MM-dd'T'HH:mm:ssZ}" 40 | } 41 | } 42 | endsnippet 43 | 44 | snippet tms "terms" b 45 | "terms": { 46 | "field": "${1}", 47 | "size": "${2:10}" 48 | } 49 | endsnippet 50 | 51 | snippet bool "bool query" b 52 | "bool": { 53 | ${VISUAL} 54 | } 55 | endsnippet 56 | 57 | snippet must "must query" b 58 | "must": [ 59 | { 60 | ${VISUAL}$1 61 | } 62 | ] 63 | endsnippet 64 | -------------------------------------------------------------------------------- /vim/nvim/snippets/luasnip/zsh.lua: -------------------------------------------------------------------------------- 1 | ---@diagnostic disable: unused-local 2 | --# selene: allow(unused_variable) 3 | local ls = require("luasnip") 4 | -- some shorthands... 5 | local s = ls.snippet 6 | local sn = ls.snippet_node 7 | local t = ls.text_node 8 | local i = ls.insert_node 9 | local f = ls.function_node 10 | local c = ls.choice_node 11 | local d = ls.dynamic_node 12 | local r = ls.restore_node 13 | local l = require("luasnip.extras").lambda 14 | local rep = require("luasnip.extras").rep 15 | local p = require("luasnip.extras").partial 16 | local m = require("luasnip.extras").match 17 | local n = require("luasnip.extras").nonempty 18 | local dl = require("luasnip.extras").dynamic_lambda 19 | local fmt = require("luasnip.extras.fmt").fmt 20 | local fmta = require("luasnip.extras.fmt").fmta 21 | local types = require("luasnip.util.types") 22 | local conds = require("luasnip.extras.conditions") 23 | local conds_expand = require("luasnip.extras.conditions.expand") 24 | 25 | -- stylua: ignore 26 | return { 27 | s("hascmd", { 28 | t { '(( $+commands[' }, i(1, "cmd"), t { '] )) ' }, i(2, "&&"), 29 | }), 30 | } 31 | -------------------------------------------------------------------------------- /vim/UltiSnips/ruby.snippets: -------------------------------------------------------------------------------- 1 | snippet sdir "script dir" b 2 | sdir = __dir__ 3 | endsnippet 4 | 5 | snippet spath "script path" b 6 | spath = Pathname.new(__dir__) 7 | endsnippet 8 | 9 | snippet var "#{variable}" 10 | #{${VISUAL}}$0 11 | endsnippet 12 | 13 | snippet Var "#{variable} with quote" 14 | "#{${VISUAL}}"$0 15 | endsnippet 16 | 17 | snippet backtrace "log backtrace..." b 18 | $logger.error "#{e.class} (#{e.message}):" + e.backtrace.reduce(''){ |trace, line| trace + "\n\t[Backtrace] -- #{line}" } 19 | endsnippet 20 | 21 | snippet rubychina "source 'https://gems.ruby-china.org/'" b 22 | source 'https://gems.ruby-china.org/' 23 | 24 | endsnippet 25 | 26 | # m - strip whitespace from right 27 | snippet Enum "Include Enumerable" b,m 28 | include Enumerable 29 | 30 | def each(&block) 31 | $1 32 | end 33 | endsnippet 34 | 35 | snippet with_filter "Description" b 36 | def with_filter(command) 37 | io = IO.popen(command, 'r+') 38 | begin 39 | stdout, $stdout = $stdout, io 40 | yield rescue nil 41 | ensure 42 | $stdout = stdout 43 | end 44 | io.close_write 45 | io.readlines.map(&:chomp) 46 | end 47 | endsnippet 48 | -------------------------------------------------------------------------------- /yazi/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || return 1 6 | 7 | info() { printf "%b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$*" >&2; } 8 | warn() { printf "%b[warn]%b %s\n" '\e[0;33m\033[1m' '\e[0m' "$*" >&2; } 9 | erro() { printf "%b[erro]%b %s\n" '\e[0;31m\033[1m' '\e[0m' "$*" >&2; } 10 | 11 | mkdir -p ~/.config/yazi 12 | 13 | ln -sf "$SDIR/yazi.toml" ~/.config/yazi/ 14 | ln -sf "$SDIR/keymap.toml" ~/.config/yazi/ 15 | ln -sf "$SDIR/theme.toml" ~/.config/yazi/ 16 | ln -sf "$SDIR/init.lua" ~/.config/yazi/ 17 | 18 | instal_plugin_if_not_exists() { 19 | ya pack --list | grep -q "$1" || ya pack -a "$1" 20 | } 21 | 22 | # instal_plugin_if_not_exists Chromium-3-Oxide/everforest-medium 23 | instal_plugin_if_not_exists yazi-rs/flavors:catppuccin-frappe 24 | instal_plugin_if_not_exists yazi-rs/plugins:git 25 | instal_plugin_if_not_exists yazi-rs/plugins:smart-enter 26 | instal_plugin_if_not_exists yazi-rs/plugins:full-border 27 | instal_plugin_if_not_exists yazi-rs/plugins:max-preview 28 | # instal_plugin_if_not_exists yazi-rs/plugins:smart-filter 29 | -------------------------------------------------------------------------------- /bin/toggle-window: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ################################################################################ 3 | # Author: Wenxuan # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2019-01-17 12:43 # 6 | ################################################################################ 7 | 8 | usage() { 9 | echo "Usage: $(basename "$0") " >&2 10 | echo " eg: $(basename "$0") google-chrome-stable google-chrome" >&2 11 | echo " $(basename "$0") mailspring mailspring" >&2 12 | } 13 | 14 | if [[ $# -ne 2 ]]; then 15 | usage && exit 2 16 | fi 17 | 18 | command="$1" 19 | class="$2" 20 | 21 | if ! target_wid=$(xdotool search --desktop "$(xdotool get_desktop)" --class "$class"); then 22 | nohup "$command" &>/dev/null & 23 | exit 0 24 | fi 25 | 26 | if [[ "$(xdotool getactivewindow)" != "$target_wid" ]]; then 27 | xdotool windowactivate "$target_wid" 28 | else 29 | xdotool windowminimize "$target_wid" 30 | fi 31 | -------------------------------------------------------------------------------- /i3/autostart_always: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ################################################################################ 3 | # Author: Wenxuan Zhang # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2019-11-30 17:16 # 6 | ################################################################################ 7 | 8 | start_polybar() { 9 | # Terminate already running bar instances 10 | killall -q polybar 11 | 12 | # Wait until the processes have been shut down 13 | while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done 14 | 15 | # Launch bar 16 | polybar top &>/tmp/polybar-top.log & 17 | } 18 | 19 | start_tmux() { 20 | # we cant not keep a tmux server without any session by using `tmux start-server` 21 | # https://github.com/tmux/tmux/issues/182 22 | # tmux start-server & 23 | if ! tmux has-session -t 'default'; then 24 | tmux new-session -d -s 'default' & 25 | fi 26 | } 27 | 28 | 29 | main() { 30 | start_polybar 31 | start_tmux 32 | } 33 | 34 | main 35 | -------------------------------------------------------------------------------- /sdk/rust/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # get the dir of the current script 4 | SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) 5 | 6 | mkdir -p ~/.cargo 7 | ln -snf "$SCRIPT_DIR/config.toml" ~/.cargo/config.toml 8 | ln -snf "$SCRIPT_DIR/rustfmt.toml" ~/.rustfmt.toml 9 | 10 | if hash rustup &>/dev/null; then 11 | rustup update 12 | else 13 | curl https://sh.rustup.rs -sSf | 14 | sh -s -- -y --no-modify-path --profile default --default-toolchain nightly || exit 1 15 | fi 16 | 17 | mkdir -p ~/.config/zsh/completions/ 18 | rustup completions zsh > ~/.config/zsh/completions/_rustup 19 | rustup completions zsh cargo > ~/.config/zsh/completions/_cargo 20 | 21 | # cargo install --locked cargo-update # for checking and applying updates to installed executables 22 | cargo install --locked cargo-expand 23 | cargo install --locked cargo-udeps 24 | cargo install --locked bacon --features "clipboard sound" 25 | 26 | # perf binary size 27 | cargo install --locked cargo-bloat 28 | 29 | cargo install --locked flamegraph 30 | hash perf &>/dev/null || { 31 | echo "You may need to install the following dependencies on arch:" 32 | echo "linux-tools-meta" 33 | } 34 | -------------------------------------------------------------------------------- /zsh/zsh_misc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | # Important 3 | zstyle ':completion:*:default' menu select=2 4 | 5 | # Completing Groping 6 | # zstyle ':completion:*:options' description 'yes' 7 | # zstyle ':completion:*:descriptions' format '%F{yellow}Completing %B%d%b%f' 8 | zstyle ':completion:complete:*:options' sort false 9 | zstyle ':completion:*' group-name '' 10 | 11 | # Completing misc 12 | zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 13 | zstyle ':completion:*' verbose yes 14 | zstyle ':completion:*' completer _expand _complete _match _prefix _approximate _list 15 | zstyle ':completion:*:*files' ignored-patterns '*?.o' '*?~' '*\#' 16 | zstyle ':completion:*' use-cache true 17 | zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters 18 | 19 | # Directory 20 | zstyle ':completion:*:cd:*' ignore-parents parent pwd 21 | zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} 22 | 23 | # default: -- 24 | zstyle ':completion:*' list-separator '->' 25 | zstyle ':completion:*:manuals' separate-sections true 26 | 27 | # Menu select 28 | zmodload -i zsh/complist 29 | 30 | # Keybinds 31 | bindkey '^U' backward-kill-line 32 | 33 | # Enable comment in interactive shell 34 | setopt interactivecomments 35 | -------------------------------------------------------------------------------- /sdk/cpp/ycm_extra_conf.py: -------------------------------------------------------------------------------- 1 | import subprocess as sp 2 | from sys import version_info 3 | 4 | if version_info > (3, 0): 5 | gcc_version = sp.run(['gcc', '-dumpversion'], stdout=sp.PIPE).stdout.decode('utf-8').strip() 6 | else: 7 | gcc_version = sp.check_output(['gcc', '-dumpversion']).strip() 8 | 9 | FLAGS = [ 10 | '-Wall', 11 | '-Wextra', 12 | '-Wno-long-long', 13 | '-Wno-variadic-macros', 14 | '-fexceptions', 15 | '-DNDEBUG', 16 | '-std=c++17', 17 | '-xc++', 18 | 19 | # For linux libc++ 20 | '-isystem', '/usr/include/c++/v1', 21 | # For linux stdlibc++ 22 | '-isystem', '/usr/include/c++/{}'.format(gcc_version), 23 | # For windows 24 | # '-isystem', 'c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include', 25 | 26 | # Project include folder 27 | '-I', 'include', 28 | 29 | # C headers 30 | '-isystem', '/usr/include', 31 | '-isystem', '/usr/local/include', 32 | 33 | # Use libc++/libstdc++ 34 | # '-stdlib=libc++', 35 | # '-stdlib=libstdc++', 36 | ] 37 | 38 | def FlagsForFile( filename, **kwargs ): 39 | return { 'flags': FLAGS, } 40 | -------------------------------------------------------------------------------- /brew/Brewfile.darwin: -------------------------------------------------------------------------------- 1 | tap "homebrew/bundle" 2 | tap "homebrew/cask" 3 | tap "homebrew/cask-fonts" 4 | tap "homebrew/core" 5 | brew "bash" 6 | brew "coreutils" 7 | brew "bat" 8 | brew "bottom" 9 | brew "code-minimap" 10 | brew "csview" 11 | brew "dua-cli" 12 | brew "duf" 13 | brew "efm-langserver" 14 | brew "eza" 15 | brew "fd" 16 | brew "fzf" 17 | brew "gh" 18 | brew "jq" 19 | brew "difftastic" 20 | brew "git" 21 | brew "git-crypt" 22 | brew "git-delta" 23 | brew "gnu-sed" 24 | brew "gnupg" 25 | brew "go" 26 | brew "htop" 27 | brew "hyperfine" 28 | brew "kubernetes-cli" 29 | brew "less" 30 | brew "fastfetch" 31 | brew "neovim" 32 | brew "node" 33 | brew "pyenv" 34 | brew "ripgrep" 35 | brew "rust-analyzer" 36 | brew "sd" 37 | brew "sheldon" 38 | brew "starship" 39 | brew "tmux" 40 | brew "tokei" 41 | brew "topgrade" 42 | brew "universal-ctags" 43 | brew "wget" 44 | brew "yarn" 45 | brew "zoxide" 46 | brew "zsh" 47 | brew "sqlite" 48 | brew "shellcheck" 49 | brew "bear" 50 | cask "alacritty" 51 | cask "alfred" 52 | cask "docker" 53 | cask "font-jetbrains-mono" 54 | cask "font-jetbrains-mono-nerd-font" 55 | cask "hiddenbar" 56 | cask "keycastr" 57 | cask "kitty" 58 | cask "motrix" 59 | cask "stats" 60 | cask "wechat" 61 | cask "karabiner-elements" 62 | -------------------------------------------------------------------------------- /scripts/cpu_time_usage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -ne 1 ]; then 4 | echo "Usage: $0 " 5 | exit 1 6 | fi 7 | 8 | PID=$1 9 | 10 | if [ ! -d /proc/$PID ]; then 11 | echo "Process $PID does not exist." 12 | exit 1 13 | fi 14 | 15 | CLK_TCK=$(getconf CLK_TCK) 16 | 17 | function get_cpu_times() { 18 | if [ ! -r /proc/$PID/stat ]; then 19 | echo "0 0" 20 | return 21 | fi 22 | STAT=($(cat /proc/$PID/stat)) 23 | UTIME=${STAT[13]} 24 | STIME=${STAT[14]} 25 | echo "$UTIME $STIME" 26 | } 27 | 28 | read UTIME1 STIME1 < <(get_cpu_times) 29 | START_TIME=$(date +%s) 30 | 31 | sleep 30 32 | 33 | read UTIME2 STIME2 < <(get_cpu_times) 34 | END_TIME=$(date +%s) 35 | 36 | DELTA_UTIME=$((UTIME2 - UTIME1)) 37 | DELTA_STIME=$((STIME2 - STIME1)) 38 | DELTA_TOTAL=$((DELTA_UTIME + DELTA_STIME)) 39 | DURATION=$((END_TIME - START_TIME)) 40 | 41 | USER_SECONDS=$(echo "scale=2; $DELTA_UTIME/$CLK_TCK" | bc) 42 | SYS_SECONDS=$(echo "scale=2; $DELTA_STIME/$CLK_TCK" | bc) 43 | TOTAL_SECONDS=$(echo "scale=2; $DELTA_TOTAL/$CLK_TCK" | bc) 44 | 45 | echo "PID: $PID" 46 | echo "Duration: $DURATION seconds" 47 | echo "User CPU Time: $USER_SECONDS seconds" 48 | echo "System CPU Time: $SYS_SECONDS seconds" 49 | echo "Total CPU Time: $TOTAL_SECONDS seconds" 50 | -------------------------------------------------------------------------------- /vim/nvim/snippets/luasnip/rust.lua: -------------------------------------------------------------------------------- 1 | ---@diagnostic disable: unused-local 2 | --# selene: allow(unused_variable) 3 | local ls = require("luasnip") 4 | -- some shorthands... 5 | local s = ls.snippet 6 | local sn = ls.snippet_node 7 | local t = ls.text_node 8 | local i = ls.insert_node 9 | local f = ls.function_node 10 | local c = ls.choice_node 11 | local d = ls.dynamic_node 12 | local r = ls.restore_node 13 | local l = require("luasnip.extras").lambda 14 | local rep = require("luasnip.extras").rep 15 | local p = require("luasnip.extras").partial 16 | local m = require("luasnip.extras").match 17 | local n = require("luasnip.extras").nonempty 18 | local dl = require("luasnip.extras").dynamic_lambda 19 | local fmt = require("luasnip.extras.fmt").fmt 20 | local fmta = require("luasnip.extras.fmt").fmta 21 | local types = require("luasnip.util.types") 22 | local conds = require("luasnip.extras.conditions") 23 | local conds_expand = require("luasnip.extras.conditions.expand") 24 | 25 | -- stylua: ignore 26 | return { 27 | s('rustfmt', t '#[rustfmt::skip]'), 28 | s('deadcode', t '#[allow(dead_code)]'), 29 | s('ddbg', t '#[derive(Debug)]'), 30 | s('clippypedantic', t '#![warn(clippy::all, clippy::pedantic)]'), 31 | 32 | s(':turbofish', { t {'::<'}, i(1), t {'>'}, i(2) }), 33 | } 34 | -------------------------------------------------------------------------------- /arch/mirrorlist: -------------------------------------------------------------------------------- 1 | ## 2 | ## Arch Linux repository mirrorlist 3 | ## Generated on 2017-12-18 4 | ## 5 | 6 | Server = https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch 7 | Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch 8 | Server = http://mirrors.163.com/archlinux/$repo/os/$arch 9 | 10 | ## China 11 | #Server = http://mirrors.163.com/archlinux/$repo/os/$arch 12 | #Server = http://mirror.bjtu.edu.cn/archlinux/$repo/os/$arch 13 | #Server = http://mirror.lzu.edu.cn/archlinux/$repo/os/$arch 14 | #Server = http://mirrors.neusoft.edu.cn/archlinux/$repo/os/$arch 15 | #Server = https://mirrors.neusoft.edu.cn/archlinux/$repo/os/$arch 16 | #Server = http://mirrors.shuosc.org/archlinux/$repo/os/$arch 17 | #Server = https://mirrors.shuosc.org/archlinux/$repo/os/$arch 18 | #Server = https://mirrors.skyshe.cn/archlinux/$repo/os/$arch 19 | #Server = http://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch 20 | #Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch 21 | #Server = http://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch 22 | #Server = https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch 23 | #Server = http://mirrors.xjtu.edu.cn/archlinux/$repo/os/$arch 24 | #Server = https://mirrors.xjtu.edu.cn/archlinux/$repo/os/$arch 25 | #Server = http://mirrors.zju.edu.cn/archlinux/$repo/os/$arch 26 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM archlinux:latest 2 | 3 | RUN echo -e '[archlinuxcn]\nServer = https://repo.archlinuxcn.org/$arch' >> /etc/pacman.conf && \ 4 | ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ 5 | pacman-key --init && \ 6 | # workaround https://bbs.archlinuxcn.org/viewtopic.php?id=13906 7 | pacman-key --lsign farseerfc@archlinux.org && \ 8 | pacman --noconfirm -Sy && \ 9 | pacman --noconfirm -S archlinuxcn-keyring && \ 10 | pacman --noconfirm -S sudo paru && \ 11 | paru -Syu --noconfirm 12 | 13 | RUN paru --noconfirm -S \ 14 | base-devel \ 15 | git python-pre-commit git-delta git-crypt \ 16 | wget curl axel \ 17 | neovim \ 18 | zsh sheldon starship \ 19 | tmux \ 20 | fd \ 21 | jq \ 22 | fzf \ 23 | zoxide \ 24 | sd \ 25 | ripgrep \ 26 | eza \ 27 | bat \ 28 | net-tools 29 | 30 | RUN paru --noconfirm -S \ 31 | linux-tools-meta \ 32 | go \ 33 | nodejs npm \ 34 | duf \ 35 | dua-cli \ 36 | hyperfine \ 37 | fastfetch \ 38 | onefetch \ 39 | bottom \ 40 | csview-git \ 41 | code-minimap-git \ 42 | yazi 43 | 44 | # dotfiles 45 | COPY . /root/dotfiles 46 | RUN ~/dotfiles/install zsh 47 | SHELL ["/usr/bin/zsh", "-c"] 48 | RUN ~/dotfiles/install bin git vim tmux bat fd sdk/rust 49 | 50 | # Post-install 51 | RUN paru -Sc --noconfirm && \ 52 | rm -rf ~/.cache/* ~/.cargo/git ~/.cargo/registry && \ 53 | mkdir ~/work 54 | 55 | WORKDIR /root/work 56 | -------------------------------------------------------------------------------- /vim/nvim/snippets/native/sh.json: -------------------------------------------------------------------------------- 1 | { 2 | "bash": { 3 | "prefix": "bash", 4 | "body": [ 5 | "#!/usr/bin/env bash" 6 | ] 7 | }, 8 | "sbash": { 9 | "prefix": "sbash", 10 | "body": [ 11 | "#!/usr/bin/env bash", 12 | "set -euo pipefail", 13 | "IFS=\\$'\\n\\t'", 14 | "" 15 | ] 16 | }, 17 | "usage": { 18 | "prefix": "usage", 19 | "body": [ 20 | "usage() { echo \"Usage: \\$(basename \"\\$0\") <${1:param}>\" >&2; }" 21 | ] 22 | }, 23 | "sdir": { 24 | "prefix": "sdir", 25 | "body": [ 26 | "SDIR=\\$(cd \"\\$(dirname \"\\${BASH_SOURCE[0]}\")\" && pwd) && cd \"\\$SDIR\"" 27 | ] 28 | }, 29 | "hascmd": { 30 | "prefix": "hascmd", 31 | "body": [ 32 | "hash $1 &>/dev/null $2" 33 | ] 34 | }, 35 | "temp": { 36 | "prefix": "temp", 37 | "body": [ 38 | "trap 'command rm -rf \\$${TEMP:1}' ${2:EXIT INT TERM HUP}", 39 | "$1=\\$(mktemp -${3:d}t ${4:\\$(basename \"\\$0\")}.XXXXXX)\"" 40 | ] 41 | }, 42 | "log": { 43 | "prefix": "log", 44 | "body": [ 45 | "info() { printf \"%b[info]%b %s\\n\" '\\e[0;32m\\033[1m' '\\e[0m' \"\\$*\" >&2; }", 46 | "warn() { printf \"%b[warn]%b %s\\n\" '\\e[0;33m\\033[1m' '\\e[0m' \"\\$*\" >&2; }", 47 | "erro() { printf \"%b[erro]%b %s\\n\" '\\e[0;31m\\033[1m' '\\e[0m' \"\\$*\" >&2; }" 48 | ] 49 | }, 50 | "shellcheck": { 51 | "prefix": "shellcheck", 52 | "body": [ 53 | "# shellcheck disable=SC$1" 54 | ] 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /bin/ghr-get: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | usage() { 3 | echo "Usage: $(basename "$0") " >&2 4 | } 5 | 6 | [[ "$#" -ne 1 ]] && usage && exit 1 7 | repo="$1" 8 | 9 | detect_platform() { 10 | local platform 11 | platform="$(uname -s | tr '[:upper:]' '[:lower:]')" 12 | 13 | # check for MUSL 14 | if [ "${platform}" = "linux" ]; then 15 | if ldd /bin/sh | grep -i musl >/dev/null; then 16 | platform=unknown-linux-musl 17 | fi 18 | fi 19 | 20 | # mingw is Git-Bash 21 | if echo "${platform}" | grep -i mingw >/dev/null; then 22 | platform=pc-windows-msvc 23 | fi 24 | 25 | if [ "${platform}" = "linux" ]; then 26 | platform=unknown-linux-gnu 27 | fi 28 | 29 | if [ "${platform}" = "darwin" ]; then 30 | platform=apple-darwin 31 | fi 32 | 33 | echo "${platform}" 34 | } 35 | 36 | detect_arch() { 37 | local arch 38 | arch="$(uname -m | tr '[:upper:]' '[:lower:]')" 39 | 40 | # `uname -m` in some cases mis-reports 32-bit OS as 64-bit, so double check 41 | if [ "${arch}" = "x64" ] && [ "$(getconf LONG_BIT)" -eq 32 ]; then 42 | arch=i386 43 | fi 44 | 45 | echo "${arch}" 46 | } 47 | 48 | platform=$(detect_platform) 49 | arch=$(detect_arch) 50 | 51 | curl -sS "https://api.github.com/repos/$repo/releases/latest" | 52 | grep browser_download_url | 53 | cut -d'"' -f4 | 54 | grep "$platform" | 55 | grep "$arch" | 56 | fzf -m | 57 | xargs -i{} curl -LO --proto-redir -all,https {} 58 | -------------------------------------------------------------------------------- /vim/UltiSnips/dockerfile.snippets: -------------------------------------------------------------------------------- 1 | snippet tzdata "apk add tzdata ..." b 2 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \ 3 | apk add --no-cache tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 4 | endsnippet 5 | 6 | snippet gobuilder "go server builder template" b 7 | `!p 8 | snip.rv += """ 9 | FROM golang:1.14-alpine AS builder 10 | 11 | WORKDIR /app 12 | 13 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \ 14 | apk add --no-cache upx ca-certificates tzdata && \ 15 | cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 16 | 17 | # cache dependencies 18 | ARG GOPROXY 19 | ENV GOPROXY=${GOPROXY} 20 | COPY ./go.mod ./ 21 | COPY ./go.sum ./ 22 | RUN go mod download 23 | 24 | ARG RELEASE 25 | ARG COMMIT 26 | COPY . . 27 | RUN CGO_ENABLED=0 PROJECT=$(go list -m) && \ 28 | go build -o server \ 29 | -ldflags "-s -w \ 30 | -X ${PROJECT}/version.Release=${RELEASE} \ 31 | -X ${PROJECT}/version.Commit=${COMMIT} \ 32 | -X ${PROJECT}/version.Build=$(date -Iseconds)" && \ 33 | upx -1 server 34 | 35 | FROM alpine:3 36 | 37 | LABEL maintainer="Wenxuan Zhang " 38 | 39 | COPY --from=builder /etc/apk/repositories /etc/apk/repositories 40 | COPY --from=builder /etc/localtime /etc/localtime 41 | COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ 42 | COPY --from=builder /app/server /app/ 43 | 44 | ENTRYPOINT ["/app/server"] 45 | """ 46 | ` 47 | endsnippet 48 | -------------------------------------------------------------------------------- /hyprland/hypr/frappe.conf: -------------------------------------------------------------------------------- 1 | $rosewater = rgb(f2d5cf) 2 | $rosewaterAlpha = f2d5cf 3 | 4 | $flamingo = rgb(eebebe) 5 | $flamingoAlpha = eebebe 6 | 7 | $pink = rgb(f4b8e4) 8 | $pinkAlpha = f4b8e4 9 | 10 | $mauve = rgb(ca9ee6) 11 | $mauveAlpha = ca9ee6 12 | 13 | $red = rgb(e78284) 14 | $redAlpha = e78284 15 | 16 | $maroon = rgb(ea999c) 17 | $maroonAlpha = ea999c 18 | 19 | $peach = rgb(ef9f76) 20 | $peachAlpha = ef9f76 21 | 22 | $yellow = rgb(e5c890) 23 | $yellowAlpha = e5c890 24 | 25 | $green = rgb(a6d189) 26 | $greenAlpha = a6d189 27 | 28 | $teal = rgb(81c8be) 29 | $tealAlpha = 81c8be 30 | 31 | $sky = rgb(99d1db) 32 | $skyAlpha = 99d1db 33 | 34 | $sapphire = rgb(85c1dc) 35 | $sapphireAlpha = 85c1dc 36 | 37 | $blue = rgb(8caaee) 38 | $blueAlpha = 8caaee 39 | 40 | $lavender = rgb(babbf1) 41 | $lavenderAlpha = babbf1 42 | 43 | $text = rgb(c6d0f5) 44 | $textAlpha = c6d0f5 45 | 46 | $subtext1 = rgb(b5bfe2) 47 | $subtext1Alpha = b5bfe2 48 | 49 | $subtext0 = rgb(a5adce) 50 | $subtext0Alpha = a5adce 51 | 52 | $overlay2 = rgb(949cbb) 53 | $overlay2Alpha = 949cbb 54 | 55 | $overlay1 = rgb(838ba7) 56 | $overlay1Alpha = 838ba7 57 | 58 | $overlay0 = rgb(737994) 59 | $overlay0Alpha = 737994 60 | 61 | $surface2 = rgb(626880) 62 | $surface2Alpha = 626880 63 | 64 | $surface1 = rgb(51576d) 65 | $surface1Alpha = 51576d 66 | 67 | $surface0 = rgb(414559) 68 | $surface0Alpha = 414559 69 | 70 | $base = rgb(303446) 71 | $baseAlpha = 303446 72 | 73 | $mantle = rgb(292c3c) 74 | $mantleAlpha = 292c3c 75 | 76 | $crust = rgb(232634) 77 | $crustAlpha = 232634 78 | -------------------------------------------------------------------------------- /arch/yaourtrc: -------------------------------------------------------------------------------- 1 | # yaourtrc - Configuration for yaourt 2 | # 3 | # See yaourtrc(5) for more information 4 | # 5 | # 6 | 7 | # General 8 | #AUTOSAVEBACKUPFILE=0 9 | #DEVEL=0 10 | #DEVELSRCDIR="" 11 | #FORCE=0 12 | #NO_TESTDB=0 13 | 14 | # Environment variables 15 | #EDITOR="$EDITOR" 16 | #TMPDIR="/tmp" 17 | #VISUAL="$VISUAL" 18 | 19 | # SUDO 20 | #SUDONOVERIF=0 # Avoid multiple sudo checks when timestamp_timeout=0 21 | #SUDOREDIRECT=1 # Define to 0 in case you use a fingerprint device 22 | 23 | # AUR 24 | #AURURL="https://aur.archlinux.org" 25 | #AURCOMMENT=5 26 | #AURDEVELONLY=0 27 | #AURSEARCH=1 28 | #AURSHOWDIFF=0 29 | #AURUPGRADE=0 30 | #AURVOTE=1 31 | #AURUSEGIT=0 32 | 33 | # Build 34 | #EXPORT=0 # Export to 1: EXPORTDIR or PKGDEST 35 | # 2: pacman cache (as root) 36 | #EXPORTSRC=0 # Need EXPORT>0 to be used 37 | #EXPORTDIR="" # If empty, use makepkg's configuration (see makepkg.conf) 38 | 39 | # Prompt 40 | #NOCONFIRM=0 41 | #UP_NOCONFIRM=0 # No prompt while build upgrades (including -Sbu) 42 | #BUILD_NOCONFIRM=0 # Only prompt for editing files 43 | #PU_NOCONFIRM=0 # Add --noconfirm to $PACMAN -U 44 | #EDITFILES=1 45 | #NOENTER=1 46 | 47 | # Output 48 | USECOLOR=1 49 | USEPAGER=0 50 | #DETAILUPGRADE=1 51 | #SHOWORPHANS=1 52 | #TERMINALTITLE=1 53 | 54 | # Command 55 | #PACMAN="pacman" 56 | #MAKEPKG="makepkg" 57 | #DIFFEDITCMD="vimdiff" 58 | 59 | # pacdiffviewer 60 | #P_LOCATE=0 # Use locate instead of find 61 | #P_SEARCHDIR=(/etc/ /boot/) 62 | #P_SAVEDIR='/var/lib/yaourt/backupfiles' 63 | -------------------------------------------------------------------------------- /vim/nvim/lua/plugins/noice.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/noice.nvim", 3 | enabled = true, 4 | opts = function(_, opts) 5 | table.insert(opts.routes, { 6 | filter = { 7 | event = "notify", 8 | find = "No information available", 9 | }, 10 | opts = { skip = true }, 11 | }) 12 | local focused = true 13 | vim.api.nvim_create_autocmd("FocusGained", { 14 | callback = function() 15 | focused = true 16 | end, 17 | }) 18 | vim.api.nvim_create_autocmd("FocusLost", { 19 | callback = function() 20 | focused = false 21 | end, 22 | }) 23 | table.insert(opts.routes, 1, { 24 | filter = { 25 | ["not"] = { 26 | event = "lsp", 27 | kind = "progress", 28 | }, 29 | cond = function() 30 | return not focused 31 | end, 32 | }, 33 | view = "notify_send", 34 | opts = { stop = false }, 35 | }) 36 | 37 | opts.commands = { 38 | all = { 39 | -- options for the message history that you get with `:Noice` 40 | view = "split", 41 | opts = { enter = true, format = "details" }, 42 | filter = {}, 43 | }, 44 | } 45 | -- opts.status = { lsp_progress = { event = "lsp", kind = "progress" } } 46 | 47 | vim.api.nvim_create_autocmd("FileType", { 48 | pattern = "markdown", 49 | callback = function(event) 50 | vim.schedule(function() 51 | require("noice.text.markdown").keys(event.buf) 52 | end) 53 | end, 54 | }) 55 | end, 56 | } 57 | -------------------------------------------------------------------------------- /vim/UltiSnips/rust.snippets: -------------------------------------------------------------------------------- 1 | priority 100 2 | 3 | snippet pn "println!(...)" 4 | println!(${1:"$2\{\}", $3}); 5 | endsnippet 6 | 7 | snippet main "fu main() ..." b 8 | fn main() { 9 | $0 10 | } 11 | endsnippet 12 | 13 | snippet fn "fn foo() ..." b 14 | fn ${1:foo}($2)$3 { 15 | $4 16 | } 17 | endsnippet 18 | 19 | snippet aeq "assert_eq!(...)" b 20 | assert_eq!(${1:expected}, ${2:actual}); 21 | endsnippet 22 | 23 | snippet pln "println!" b 24 | println!("$1"); 25 | endsnippet 26 | 27 | snippet clippy "clippy ignore rule" b 28 | #[allow(clippy::$1)] 29 | endsnippet 30 | 31 | snippet rustfmt "rustfmt skip" b 32 | #[rustfmt::skip] 33 | endsnippet 34 | 35 | snippet ui "unimplemented!" 36 | unimplemented!() 37 | endsnippet 38 | 39 | snippet ur "unimplemented!" 40 | unreachable!() 41 | endsnippet 42 | 43 | snippet res "Result<...>" 44 | Result<${VISUAL:1}$2> 45 | endsnippet 46 | 47 | snippet impl "impl ... { ... }" b 48 | impl $1 { 49 | $2 50 | } 51 | endsnippet 52 | 53 | snippet mtests "mod tests..." b 54 | #[cfg(test)] 55 | mod tests { 56 | use super::*; 57 | 58 | #[test] 59 | fn ${1:it_works}() { 60 | $2 61 | } 62 | } 63 | endsnippet 64 | 65 | snippet test "#[test] fn ..." b 66 | #[test] 67 | fn ${1:it_works}() { 68 | $2 69 | } 70 | endsnippet 71 | 72 | snippet svec "macro to create a string vector" b 73 | macro_rules! svec { ($($part:expr),* $(,)?) => {{ vec![$($part.to_string(),)*] }} } 74 | endsnippet 75 | 76 | snippet err_macro "error macro" b 77 | #[macro_export] 78 | macro_rules! err { 79 | ($($tt:tt)*) => { Err(format!($($tt)*).into()) }; 80 | } 81 | endsnippet 82 | -------------------------------------------------------------------------------- /vim/UltiSnips/yaml.snippets: -------------------------------------------------------------------------------- 1 | snippet go "go pre-commit-config" b 2 | `!p snip.rv += """ 3 | # See https://pre-commit.com for more information 4 | # See https://pre-commit.com/hooks.html for more hooks 5 | exclude: > 6 | (?x)^( 7 | third_party/.*| 8 | .*\.pb.*\.go 9 | )$ 10 | repos: 11 | - repo: https://github.com/pre-commit/pre-commit-hooks 12 | rev: v3.1.0 13 | hooks: 14 | - id: trailing-whitespace 15 | - id: end-of-file-fixer 16 | - id: check-yaml 17 | - id: check-added-large-files 18 | - id: mixed-line-ending 19 | - repo: git://github.com/dnephin/pre-commit-golang 20 | rev: master 21 | hooks: 22 | - id: go-fmt 23 | - id: go-imports 24 | - id: go-unit-tests 25 | - id: go-mod-tidy 26 | - id: golangci-lint 27 | # - id: go-cyclo 28 | # args: [-over=20] 29 | - repo: local 30 | hooks: 31 | - id: dockerfile-gen 32 | name: dockerfile-gen 33 | pass_filenames: false 34 | always_run: true 35 | language: system 36 | entry: sh -c 'make dockerfile && git add Dockerfile' 37 | - id: versino-update 38 | name: version-update 39 | pass_filenames: false 40 | always_run: true 41 | language: system 42 | entry: > 43 | sh -c ' 44 | [ -f VERSION ] || echo 0.0.0 > VERSION 45 | git diff --cached --name-only | grep VERSION &>/dev/null && exit 46 | if git rev-parse --abbrev-ref HEAD | grep master &>/dev/null; then 47 | semver --preid rc -i prerelease "$(head -1 VERSION)" > VERSION 48 | git add VERSION 49 | fi 50 | ' 51 | additional_dependencies: ['semver'] 52 | """.lstrip() 53 | ` 54 | endsnippet 55 | -------------------------------------------------------------------------------- /hyprland/hypr/hypridle.conf: -------------------------------------------------------------------------------- 1 | general { 2 | lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances. 3 | before_sleep_cmd = loginctl lock-session # lock before suspend. 4 | after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display. 5 | } 6 | 7 | listener { 8 | timeout = 150 # 2.5min. 9 | on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor. 10 | on-resume = brightnessctl -r # monitor backlight restore. 11 | } 12 | 13 | # turn off keyboard backlight, comment out this section if you dont have a keyboard backlight. 14 | # listener { 15 | # timeout = 150 # 2.5min. 16 | # on-timeout = brightnessctl -sd rgb:kbd_backlight set 0 # turn off keyboard backlight. 17 | # on-resume = brightnessctl -rd rgb:kbd_backlight # turn on keyboard backlight. 18 | # } 19 | 20 | listener { 21 | timeout = 1800 # 5min 22 | on-timeout = loginctl lock-session # lock screen when timeout has passed 23 | } 24 | 25 | listener { 26 | timeout = 10800 # 3h 27 | on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed 28 | on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired. 29 | } 30 | 31 | # listener { 32 | # timeout = 3600 # 60min 33 | # on-timeout = systemctl suspend # suspend pc 34 | # } 35 | -------------------------------------------------------------------------------- /fcitx5/config/config: -------------------------------------------------------------------------------- 1 | [Hotkey] 2 | # 反复按切换键时进行轮换 3 | EnumerateWithTriggerKeys=True 4 | # 向后切换输入法 5 | EnumerateBackwardKeys= 6 | # 轮换输入法时跳过第一个输入法 7 | EnumerateSkipFirst=False 8 | 9 | [Hotkey/TriggerKeys] 10 | 0= 11 | 1=Zenkaku_Hankaku 12 | 2=Hangul 13 | 14 | [Hotkey/AltTriggerKeys] 15 | 0= 16 | 17 | [Hotkey/EnumerateForwardKeys] 18 | 0=Control+space 19 | 20 | [Hotkey/EnumerateGroupForwardKeys] 21 | 0=Super+space 22 | 23 | [Hotkey/EnumerateGroupBackwardKeys] 24 | 0=Shift+Super+space 25 | 26 | [Hotkey/ActivateKeys] 27 | 0=Hangul_Hanja 28 | 29 | [Hotkey/DeactivateKeys] 30 | 0=Hangul_Romaja 31 | 32 | [Hotkey/PrevPage] 33 | 0=Up 34 | 35 | [Hotkey/NextPage] 36 | 0=Down 37 | 38 | [Hotkey/PrevCandidate] 39 | 0=Shift+Tab 40 | 41 | [Hotkey/NextCandidate] 42 | 0=Tab 43 | 44 | [Hotkey/TogglePreedit] 45 | 0=Control+Alt+P 46 | 47 | [Behavior] 48 | # 默认状态为激活 49 | ActiveByDefault=False 50 | # 重新聚焦时重置状态 51 | resetStateWhenFocusIn=No 52 | # 共享输入状态 53 | ShareInputState=No 54 | # 在程序中显示预编辑文本 55 | PreeditEnabledByDefault=True 56 | # 切换输入法时显示输入法信息 57 | ShowInputMethodInformation=True 58 | # 在焦点更改时显示输入法信息 59 | showInputMethodInformationWhenFocusIn=False 60 | # 显示紧凑的输入法信息 61 | CompactInputMethodInformation=True 62 | # 显示第一个输入法的信息 63 | ShowFirstInputMethodInformation=True 64 | # 默认页大小 65 | DefaultPageSize=5 66 | # 覆盖 Xkb 选项 67 | OverrideXkbOption=False 68 | # 自定义 Xkb 选项 69 | CustomXkbOption= 70 | # Force Enabled Addons 71 | EnabledAddons= 72 | # Preload input method to be used by default 73 | PreloadInputMethod=True 74 | # 允许在密码框中使用输入法 75 | AllowInputMethodForPassword=False 76 | # 输入密码时显示预编辑文本 77 | ShowPreeditForPassword=False 78 | # 保存用户数据的时间间隔(以分钟为单位) 79 | AutoSavePeriod=30 80 | 81 | [Behavior/DisabledAddons] 82 | 0=clipboard 83 | 84 | -------------------------------------------------------------------------------- /vim/UltiSnips/all.snippets: -------------------------------------------------------------------------------- 1 | snippet mit "MIT license" b 2 | MIT (c) ${1:`git config user.name`} 3 | ${2} 4 | endsnippet 5 | 6 | global !p 7 | from vimsnippets import get_comment_format 8 | from subprocess import check_output 9 | from datetime import datetime 10 | endglobal 11 | 12 | snippet todo "TODO comment" bw 13 | `!p snip.rv=get_comment_format()[0]` ${1:TODO}: $2${3: <`!v strftime('%y-%m-%d %H:%M')`, `git config user.name`>} `!p snip.rv=get_comment_format()[2]` 14 | endsnippet 15 | 16 | snippet today "date of today" b 17 | `date +%F` 18 | endsnippet 19 | 20 | snippet yesterday "date of today" b 21 | `[[ "$OSTYPE" =~ darwin ]] && date -v -1d +%F || date --date=yesterday +%F` 22 | endsnippet 23 | 24 | snippet modeline "# vim: set ..." b 25 | `!p 26 | beg, end = vim.eval("&commentstring").split('%s') 27 | snip.rv += beg.strip() + ' ' 28 | `vim: ${2:ft=${1:`v: &filetype`}}`!p 29 | snip.rv += (': ' + end.strip()).strip() 30 | ` 31 | endsnippet 32 | 33 | snippet H "A header box" b 34 | `!p 35 | from datetime import datetime 36 | if snip.ft in ['cpp', 'c', 'rust', 'go', 'cs']: 37 | u = '/' + '*' * 75 38 | d = '*' * 75 + '/' 39 | l = '%-4s' % '*' 40 | r = '%4s' % '*' 41 | else: 42 | c = get_comment_format()[0].strip() 43 | u = d = (c * 76)[:76] 44 | l = '%-4s' % c 45 | r = '%4s' % c 46 | 47 | username = '%-68s' % (" Author: " + check_output(['git', 'config', 'user.name']).decode('utf-8').strip()) 48 | useremail = '%-68s' % (" Email: " + check_output(['git', 'config', 'user.email']).decode('utf-8').strip()) 49 | time = '%-68s' % ("Created: " + datetime.now().strftime('%F %H:%M')) 50 | 51 | snip.rv += u 52 | snip += l + username + r 53 | snip += l + useremail + r 54 | snip += l + time + r 55 | snip += d 56 | ` 57 | $0 58 | endsnippet 59 | -------------------------------------------------------------------------------- /bin/color-spaces: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Author: Todd Larason 3 | # $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.1 1999/07/11 08:49:54 dawes Exp $ 4 | 5 | print "256 color mode\n\n"; 6 | 7 | # display back ground colors 8 | 9 | for ($fgbg = 38; $fgbg <= 48; $fgbg +=10) { 10 | 11 | # first the system ones: 12 | print "System colors:\n"; 13 | for ($color = 0; $color < 8; $color++) { 14 | print "\x1b[${fgbg};5;${color}m::"; 15 | } 16 | print "\x1b[0m\n"; 17 | for ($color = 8; $color < 16; $color++) { 18 | print "\x1b[${fgbg};5;${color}m::"; 19 | } 20 | print "\x1b[0m\n\n"; 21 | 22 | # now the color cube 23 | print "Color cube, 6x6x6:\n"; 24 | for ($green = 0; $green < 6; $green++) { 25 | for ($red = 0; $red < 6; $red++) { 26 | for ($blue = 0; $blue < 6; $blue++) { 27 | $color = 16 + ($red * 36) + ($green * 6) + $blue; 28 | print "\x1b[${fgbg};5;${color}m::"; 29 | } 30 | print "\x1b[0m "; 31 | } 32 | print "\n"; 33 | } 34 | 35 | # now the grayscale ramp 36 | print "Grayscale ramp:\n"; 37 | for ($color = 232; $color < 256; $color++) { 38 | print "\x1b[${fgbg};5;${color}m::"; 39 | } 40 | print "\x1b[0m\n\n"; 41 | 42 | } 43 | 44 | print "Examples for the 3-byte color mode\n\n"; 45 | 46 | for ($fgbg = 38; $fgbg <= 48; $fgbg +=10) { 47 | 48 | # now the color cube 49 | print "Color cube\n"; 50 | for ($green = 0; $green < 256; $green+=51) { 51 | for ($red = 0; $red < 256; $red+=51) { 52 | for ($blue = 0; $blue < 256; $blue+=51) { 53 | print "\x1b[${fgbg};2;${red};${green};${blue}m::"; 54 | } 55 | print "\x1b[0m "; 56 | } 57 | print "\n"; 58 | } 59 | 60 | # now the grayscale ramp 61 | print "Grayscale ramp:\n"; 62 | for ($gray = 8; $gray < 256; $gray+=10) { 63 | print "\x1b[${fgbg};2;${gray};${gray};${gray}m::"; 64 | } 65 | print "\x1b[0m\n\n"; 66 | 67 | } 68 | -------------------------------------------------------------------------------- /fastfetch/config.jsonc: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", 3 | "modules": [ 4 | "title", 5 | "break", 6 | { 7 | "type": "os", 8 | "key": "│ OS" 9 | }, 10 | { 11 | "type": "host", 12 | "key": "│ Host", 13 | "format": "{/2}{-}{/}{2}{?3} {3}{?}" 14 | }, 15 | { 16 | "type": "kernel", 17 | "key": "│ Kernel" 18 | }, 19 | { 20 | "type": "uptime", 21 | "key": "│ Uptime" 22 | }, 23 | { 24 | "type": "battery", 25 | "key": "│ Battery", 26 | "format": "{/4}{-}{/}{4}{?5} [{5}]{?}" 27 | }, 28 | { 29 | "type": "packages", 30 | "key": "│ Packages" 31 | }, 32 | "break", 33 | { 34 | "type": "shell", 35 | "key": "│ Shell" 36 | }, 37 | { 38 | "type": "terminal", 39 | "key": "│ Terminal" 40 | }, 41 | { 42 | "type": "display", 43 | "key": "│ Display" 44 | }, 45 | "break", 46 | { 47 | "type": "cpu", 48 | "key": "│ CPU" 49 | }, 50 | { 51 | "type": "gpu", 52 | "key": "│ GPU" 53 | }, 54 | { 55 | "type": "memory", 56 | "key": "│ Memory" 57 | }, 58 | { 59 | "type": "disk", 60 | "key": "│ Disk" 61 | }, 62 | { 63 | "type": "localip", 64 | "key": "│ Local IP", 65 | "showSpeed": true 66 | }, 67 | "break", 68 | { 69 | "type": "colors", 70 | "symbol": "circle" 71 | } 72 | ] 73 | } 74 | -------------------------------------------------------------------------------- /bin/git-semver-next: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ############################################################################ 3 | # Author: Wenxuan Zhang # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2020-03-23 20:12 # 6 | ############################################################################ 7 | set -euo pipefail 8 | IFS=$'\n\t' 9 | 10 | loginfo() { printf "%b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$@" >&2; } 11 | logwarn() { printf "%b[warn]%b %s\n" '\e[0;33m\033[1m' '\e[0m' "$@" >&2; } 12 | logerror() { printf "%b[error]%b %s\n" '\e[0;31m\033[1m' '\e[0m' "$@" >&2; } 13 | 14 | usage() { echo "Usage: $(basename "$0") [stage|patch|minor|major]" >&2; } 15 | 16 | [[ $# -gt 1 ]] && usage && exit 1 17 | 18 | [[ $# -eq 0 ]] && git tag -l --sort=v:refname && exit 0 19 | 20 | VERSION_FILE=.VERSION 21 | [[ -f version ]] && VERSION_FILE=version 22 | [[ -f VERSION ]] && VERSION_FILE=VERSION 23 | [[ -f .version ]] && VERSION_FILE=.version 24 | [[ -f .VERSION ]] && VERSION_FILE=.VERSION 25 | touch $VERSION_FILE 26 | 27 | TYPE=$1 28 | ROOT=$(git rev-parse --show-toplevel) && cd "$ROOT" 29 | 30 | CURR=$(head -1 $VERSION_FILE) 31 | if [ -z "$CURR" ]; then 32 | logwarn "current version is not set, will use 0.0.0" 33 | NEXT=0.0.0 34 | else 35 | NEXT=$(semver-next "$CURR" "$TYPE") 36 | if [ "$(git tag -l "$NEXT")" ]; then 37 | logerror "tag '$NEXT' already exists" && exit 1 38 | fi 39 | 40 | if [[ -n $(git status -s) ]]; then 41 | logerror "modified/untracked:" 42 | git status -s && exit 1 43 | fi 44 | fi 45 | 46 | echo "$NEXT" > $VERSION_FILE 47 | 48 | git add $VERSION_FILE 49 | git commit --no-verify -m "release: $NEXT" 50 | git tag "$NEXT" 51 | loginfo "new tag '$NEXT' added" 52 | -------------------------------------------------------------------------------- /sdk/scala/sbtnew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | info() { printf "$(date -Is) %b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$*" >&2; } 6 | 7 | usage() { echo "Usage: $(basename "$0") " >&2; } 8 | 9 | [ $# -ne 1 ] && usage && exit 1 10 | 11 | project_name=$1 12 | 13 | # git init 14 | info "Init VCS ..." 15 | git init "$project_name" >/dev/null && cd "$project_name" 16 | cat <<-EOF > .gitignore 17 | bin/ 18 | target/ 19 | project/target/ 20 | build/ 21 | .bloop 22 | .metals 23 | .cache 24 | .cache-main 25 | .classpath 26 | .history 27 | .project 28 | .scala_dependencies 29 | .settings 30 | .worksheet 31 | .DS_Store 32 | *.class 33 | *.log 34 | *.iml 35 | *.ipr 36 | *.iws 37 | .idea 38 | EOF 39 | 40 | 41 | # directories 42 | info "Create directories and files ..." 43 | mkdir -p src/main/scala 44 | mkdir -p src/test/scala 45 | 46 | # README.md 47 | cat <<-EOF > README.md 48 | # $project_name 49 | 50 | EOF 51 | 52 | # build.sbt 53 | cat <<-EOF > build.sbt 54 | name := "$project_name" 55 | version := "0.1" 56 | scalaVersion := "2.12.14" 57 | 58 | libraryDependencies ++= Seq( 59 | "org.scalactic" %% "scalactic" % "3.2.0", 60 | "org.scalatest" %% "scalatest" % "3.2.0" % "test", 61 | ) 62 | 63 | // see https://tpolecat.github.io/2017/04/25/scalac-flags.html for scalacOptions descriptions 64 | scalacOptions ++= Seq( 65 | "-deprecation", //emit warning and location for usages of deprecated APIs 66 | "-unchecked", //enable additional warnings where generated code depends on assumptions 67 | "-explaintypes", //explain type errors in more detail 68 | "-Ywarn-dead-code", //warn when dead code is identified 69 | "-Xfatal-warnings" //fail the compilation if there are any warnings 70 | ) 71 | EOF 72 | 73 | # scalafmt.conf 74 | cat <<-EOF > .scalafmt.conf 75 | version = $(scalafmt --version | cut -d' ' -f2) 76 | EOF 77 | -------------------------------------------------------------------------------- /sdk/node/old_setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ################################################################################ 3 | # Author: Wenxuan # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2020-01-07 14:00 # 6 | ################################################################################ 7 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || exit 1 8 | 9 | loginfo() { printf "%b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$@" >&2; } 10 | logwarn() { printf "%b[warn]%b %s\n" '\e[0;33m\033[1m' '\e[0m' "$@" >&2; } 11 | logerror() { printf "%b[error]%b %s\n" '\e[0;31m\033[1m' '\e[0m' "$@" >&2; } 12 | 13 | export PATH="$HOME/.nodenv/shims:$HOME/.nodenv/bin:$PATH" 14 | 15 | install_nodenv() { 16 | if ! hash nodenv &>/dev/null; then 17 | git clone --depth=1 https://github.com/nodenv/nodenv.git ~/.nodenv || return 1 18 | # node-build plugin 19 | mkdir -p "$(nodenv root)/plugins" 20 | git clone --depth=1 https://github.com/nodenv/node-build.git \ 21 | "$(nodenv root)/plugins/node-build" 22 | else 23 | cd ~/.nodenv || return 1 24 | git pull origin master 25 | cd "$(nodenv root)/plugins/node-build" || return 1 26 | git pull origin master 27 | cd "$(nodenv root)/plugins/nodenv-default-packages" || return 1 28 | git pull origin master 29 | fi 30 | # optional: compile dynamic bash extension to speed up nodenv 31 | cd ~/.nodenv && src/configure && make -C src 32 | source <(nodenv init -) 33 | } 34 | 35 | install_node() { 36 | v=18.14.2 37 | nodenv versions | grep $v || nodenv install $v 38 | nodenv global $v 39 | npm install -g yarn 40 | } 41 | 42 | loginfo "install nodenv..." 43 | install_nodenv || exit $? 44 | 45 | loginfo "install node..." 46 | install_node || exit $? 47 | -------------------------------------------------------------------------------- /vim/nvim/lua/plugins/ai.lua: -------------------------------------------------------------------------------- 1 | ---@diagnostic disable: undefined-doc-name, missing-fields 2 | 3 | return { 4 | "yetone/avante.nvim", 5 | event = "VeryLazy", 6 | version = false, -- Never set this value to "*"! Never! 7 | ---@module 'avante' 8 | ---@type avante.Config 9 | opts = { 10 | input = { 11 | provider = "snacks", 12 | provider_opts = { 13 | -- Additional snacks.input options 14 | title = "Avante Input", 15 | icon = " ", 16 | }, 17 | }, 18 | provider = "copilot", 19 | providers = { 20 | copilot = { 21 | -- model = "gpt-4.1", 22 | model = "claude-3.5-sonnet", 23 | proxy = nil, -- [protocol://]host[:port] Use this proxy 24 | allow_insecure = true, -- Allow insecure server connections 25 | timeout = 30000, -- Timeout in milliseconds 26 | context_window = 128000, -- Number of tokens to send to the model for context 27 | extra_request_body = { 28 | temperature = 0.75, 29 | max_tokens = 20480, 30 | }, 31 | }, 32 | deepseek = { 33 | __inherited_from = "openai", 34 | api_key_name = "DEEPSEEK_API_KEY", 35 | endpoint = "https://api.deepseek.com", 36 | model = "deepseek-coder", 37 | }, 38 | }, 39 | }, 40 | dependencies = { 41 | "nvim-lua/plenary.nvim", 42 | "MunifTanjim/nui.nvim", 43 | --- The below dependencies are optional, 44 | "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions 45 | "ibhagwan/fzf-lua", -- for file_selector provider fzf 46 | "folke/snacks.nvim", -- for input provider snacks 47 | "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons 48 | "zbirenbaum/copilot.lua", -- for providers='copilot' 49 | { 50 | -- Make sure to set this up properly if you have lazy=true 51 | "MeanderingProgrammer/render-markdown.nvim", 52 | opts = { 53 | file_types = { "markdown", "Avante" }, 54 | }, 55 | ft = { "markdown", "Avante" }, 56 | }, 57 | }, 58 | } 59 | -------------------------------------------------------------------------------- /vim/nvim/lua/config/autocmds.lua: -------------------------------------------------------------------------------- 1 | -- Autocmds are automatically loaded on the VeryLazy event 2 | -- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua 3 | -- Add any additional autocmds here 4 | 5 | local function augroup(name) 6 | return vim.api.nvim_create_augroup("my_" .. name, { clear = true }) 7 | end 8 | 9 | -- show cursor line only in active window 10 | vim.api.nvim_create_autocmd({ "InsertLeave", "WinEnter" }, { 11 | group = augroup("auto_cursorline_active"), 12 | callback = function() 13 | local ok, cl = pcall(vim.api.nvim_win_get_var, 0, "auto_cursorline") 14 | if ok and cl then 15 | vim.wo.cursorline = true 16 | vim.api.nvim_win_del_var(0, "auto_cursorline") 17 | end 18 | end, 19 | }) 20 | vim.api.nvim_create_autocmd({ "InsertEnter", "WinLeave" }, { 21 | group = augroup("auto_cursorline_deactive"), 22 | callback = function() 23 | local cl = vim.wo.cursorline 24 | if cl then 25 | vim.api.nvim_win_set_var(0, "auto_cursorline", cl) 26 | vim.wo.cursorline = false 27 | end 28 | end, 29 | }) 30 | 31 | vim.api.nvim_create_autocmd({ "FileType" }, { 32 | group = augroup("formatoptions"), 33 | callback = function() 34 | vim.opt_local.formatoptions:remove("t") -- Don't auto wrap text using textwidth 35 | vim.opt_local.formatoptions:remove("c") -- Don't auto wrap comments using textwidth 36 | vim.opt_local.formatoptions:remove("o") -- Don't continue comments with o and O 37 | end, 38 | }) 39 | 40 | -- Disable autoformat for some filetypes (Re-enable by `uf`) 41 | vim.api.nvim_create_autocmd({ "FileType" }, { 42 | group = augroup("disable_autoformat"), 43 | pattern = { "yaml", "toml" }, 44 | callback = function() 45 | vim.b.autoformat = false 46 | end, 47 | }) 48 | 49 | -- Disable diagnostics for some filetypes 50 | vim.api.nvim_create_autocmd({ "FileType" }, { 51 | group = augroup("disable_diagnostics"), 52 | pattern = { "markdown" }, 53 | callback = function() 54 | vim.diagnostic.enable(false) 55 | end, 56 | }) 57 | -------------------------------------------------------------------------------- /bin/runorraise-i3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # from: https://faq.i3wm.org/question/2473/run-or-focus-in-i3.1.html @GermainZ 3 | import json 4 | import subprocess 5 | import sys 6 | 7 | def get_output(cmd): 8 | process = subprocess.Popen(cmd, stdout=subprocess.PIPE) 9 | out = process.communicate()[0].decode() 10 | process.stdout.close() 11 | return out 12 | 13 | def get_tree(): 14 | cmd = ["i3-msg", "-t", "get_tree"] 15 | return json.loads(get_output(cmd)) 16 | 17 | def get_matching_class(): 18 | cmd = ["xdotool", "search", "--class", sys.argv[1]] 19 | return get_output(cmd).split('\n') 20 | 21 | windows = [] 22 | def walk_tree(tree): 23 | if tree['window']: 24 | windows.append({'window': str(tree['window']), 25 | 'focused': tree['focused']}) 26 | if len(tree['nodes']) > 0: 27 | for node in tree['nodes']: 28 | walk_tree(node) 29 | 30 | def get_matches(): 31 | matches = [] 32 | tree = get_tree() 33 | check = get_matching_class() 34 | walk_tree(tree) 35 | for window in windows: 36 | for winid in check: 37 | if window['window'] == winid: 38 | matches.append(window) 39 | return matches 40 | 41 | def main(): 42 | matches = get_matches() 43 | # Sort the list by window IDs 44 | matches = [(match['window'], match) for match in matches] 45 | matches.sort() 46 | matches = [match for (key, match) in matches] 47 | # Iterate over the matches to find the first focused one, then focus the 48 | # next one. 49 | for ind, match in enumerate(matches): 50 | if match['focused'] == True: 51 | subprocess.call(["i3-msg", "[id=%s] focus" % matches[(ind+1)%len(matches)]['window']]) 52 | return 53 | # No focused match was found, so focus the first one 54 | if len(matches) > 0: 55 | subprocess.call(["i3-msg", "[id=%s] focus" % matches[0]['window']]) 56 | return 57 | # No matches found, launch program 58 | subprocess.call(["i3-msg", "exec --no-startup-id %s" % sys.argv[2]]) 59 | 60 | if __name__ == '__main__': 61 | main() 62 | -------------------------------------------------------------------------------- /zsh/sheldon/plugins.toml: -------------------------------------------------------------------------------- 1 | shell = "zsh" 2 | 3 | [templates] 4 | defer = "{% for file in files %} zsh-defer source \"{{ file }}\"\n {% endfor %}" 5 | defer-more = "{% for file in files %} zsh-defer -t 0.5 source \"{{ file }}\"\n {% endfor %}" 6 | fpath-completions = 'fpath=( "{{ dir }}/completions" $fpath )' 7 | 8 | [plugins.zsh-defer] 9 | github = "romkatv/zsh-defer" 10 | 11 | [plugins.powerlevel10k] 12 | github = "romkatv/powerlevel10k" 13 | [plugins.powerlevel10k.hooks] 14 | post = ''' 15 | source ~/.config/zsh/p10k-pure.zsh 16 | ''' 17 | 18 | [plugins.zsh-autosuggestions] 19 | github = "zsh-users/zsh-autosuggestions" 20 | use = ["{{ name }}.zsh"] 21 | apply = ["defer"] 22 | 23 | [plugins.zsh-completions] 24 | github = "zsh-users/zsh-completions" 25 | apply = ["defer"] 26 | 27 | [plugins.fast-syntax-highlighting] 28 | github = "zdharma-continuum/fast-syntax-highlighting" 29 | apply = ["defer"] 30 | 31 | [plugins.zsh-autopair] 32 | github = "hlissner/zsh-autopair" 33 | apply = ["defer"] 34 | 35 | [plugins.forgit] 36 | github = "wfxr/forgit" 37 | apply = ["source", "fpath-completions"] 38 | 39 | [plugins.forepos] 40 | github = "wfxr/forepos" 41 | apply = ["defer"] 42 | 43 | [plugins.epoch-cli] 44 | github = "wfxr/epoch-cli" 45 | apply = ["defer"] 46 | 47 | [plugins.formarks] 48 | github = "wfxr/formarks" 49 | apply = ["defer"] 50 | 51 | [plugins.git] 52 | remote = "https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.zsh" 53 | apply = ["fpath"] 54 | 55 | [plugins.zsh-you-should-use] 56 | github = "MichaelAquilina/zsh-you-should-use" 57 | apply = ["defer"] 58 | 59 | [plugins.zoxide] 60 | inline = ''' 61 | (( $+commands[zoxide] )) && zsh-defer zi::cache::cmd 'zoxide init zsh' 62 | ''' 63 | 64 | [plugins.python] 65 | inline = ''' 66 | (( $+commands[pyenv] )) && zsh-defer zi::cache::cmd 'pyenv init - zsh' 67 | (( $+commands[pip] )) && zsh-defer zi::cache::cmd 'pip completion --zsh' 68 | ''' 69 | 70 | [plugins.node] 71 | inline = ''' 72 | (( $+commands[fnm] )) && zsh-defer zi::cache::cmd 'fnm env' 73 | ''' 74 | 75 | [plugins.compinit] 76 | inline = ''' 77 | autoload -Uz compinit 78 | # once a day 79 | for dump in ~/.zcompdump(N.mh+24); do 80 | compinit; return 81 | done 82 | compinit -C 83 | ''' 84 | -------------------------------------------------------------------------------- /wezterm/wezterm.lua: -------------------------------------------------------------------------------- 1 | local wezterm = require 'wezterm'; 2 | 3 | local keybinds = { 4 | { key = "=", mods = "CTRL", action = "IncreaseFontSize" }, 5 | { key = "-", mods = "CTRL", action = "DecreaseFontSize" }, 6 | { key = "0", mods = "CTRL", action = "ResetFontSize" }, 7 | { key = "c", mods = "SUPER", action = "Copy" }, 8 | { key = "v", mods = "SUPER", action = "Paste" }, 9 | } 10 | 11 | local config = { 12 | font = wezterm.font({ 13 | "JetBrainsMono Nerd Font", 14 | }), 15 | window_decorations = "NONE", 16 | disable_default_key_bindings = true, 17 | enable_tab_bar = true, 18 | hide_tab_bar_if_only_one_tab = true, 19 | allow_square_glyphs_to_overflow_width = "WhenFollowedBySpace", 20 | adjust_window_size_when_changing_font_size = false, 21 | window_padding = { 22 | left = 0, 23 | right = 0, 24 | top = 0, 25 | bottom = 0, 26 | }, 27 | 28 | keys = keybinds, 29 | 30 | color_scheme = "gruvbox_material_dark_hard", 31 | color_schemes = { 32 | gruvbox_material_dark_hard = { 33 | background = "#282828", 34 | foreground = "#D4BE98", 35 | cursor_bg = "#D4BE98", 36 | cursor_border = "#D4BE98", 37 | selection_bg = "#D4BE98" , 38 | cursor_fg = "#1D2021", 39 | selection_fg = "#3C3836", 40 | 41 | ansi = {"#665c54", "#ea6962", "#a9b665", "#e78a4e", "#7daea3", "#d3869b", "#89b482", "#d4be98"}, 42 | brights = {"#928374", "#ea6962", "#a9b665", "#e78a4e", "#7daea3", "#d3869b", "#89b482", "#d4be98"}, 43 | } 44 | }, 45 | } 46 | 47 | local function load_config(module) 48 | local m = package.searchpath(module, package.path) 49 | if m == nil then 50 | return {} 51 | end 52 | return dofile(m) 53 | end 54 | 55 | local function merge_tables(t1, t2) 56 | for k, v in pairs(t2) do 57 | if (type(v) == "table") and (type(t1[k] or false) == "table") then 58 | merge_tables(t1[k], t2[k]) 59 | else 60 | t1[k] = v 61 | end 62 | end 63 | return t1 64 | end 65 | 66 | return merge_tables(config, load_config("darwin")) 67 | -------------------------------------------------------------------------------- /zsh/zsh_theme: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | #=============================================================================== 3 | # Author: Wenxuan 4 | # Email: wenxuangm@gmail.com 5 | # Created: 2017-12-23 15:02 6 | #=============================================================================== 7 | 8 | ####################################################################### 9 | # Common # 10 | ####################################################################### 11 | 12 | [[ -n ${SSH_CLIENT} ]] && PROMPT_SYMBOL=' ' || PROMPT_SYMBOL='' 13 | TIME_FORMAT="%D{%H:%M:%S}" 14 | GITHUB_ICON='' 15 | EXECUTION_TIME_PREFIX='took' #     16 | EXECUTION_TIME_THRESHOLD=1 17 | 18 | ####################################################################### 19 | # SPACESHIP # 20 | ####################################################################### 21 | SPACESHIP_CHAR_SYMBOL=" $PROMPT_SYMBOL " 22 | 23 | SPACESHIP_TIME_SHOW=true 24 | SPACESHIP_TIME_PREFIX="" 25 | SPACESHIP_TIME_FORMAT="$TIME_FORMAT" 26 | 27 | SPACESHIP_EXEC_TIME_SHOW=true 28 | SPACESHIP_EXEC_TIME_PREFIX="$EXECUTION_TIME_PREFIX " 29 | SPACESHIP_EXEC_TIME_ELAPSED="$EXECUTION_TIME_THRESHOLD" 30 | 31 | SPACESHIP_USER_PREFIX="" 32 | 33 | SPACESHIP_DIR_TRUNC_REPO=false 34 | SPACESHIP_DIR_TRUNC=0 35 | 36 | SPACESHIP_PACKAGE_SHOW=false 37 | SPACESHIP_NODE_SHOW=false 38 | SPACESHIP_RUBY_SHOW=false 39 | SPACESHIP_ELM_SHOW=false 40 | SPACESHIP_ELIXIR_SHOW=false 41 | SPACESHIP_XCODE_SHOW_LOCAL=false 42 | SPACESHIP_XCODE_SHOW_GLOBAL=false 43 | SPACESHIP_SWIFT_SHOW_LOCAL=false 44 | SPACESHIP_SWIFT_SHOW_GLOBAL=false 45 | SPACESHIP_GOLANG_SHOW=true 46 | SPACESHIP_PHP_SHOW=false 47 | SPACESHIP_RUST_SHOW=true 48 | SPACESHIP_HASKELL_SHOW=false 49 | SPACESHIP_JULIA_SHOW=false 50 | SPACESHIP_DOCKER_SHOW=true 51 | SPACESHIP_AWS_SHOW=false 52 | SPACESHIP_VENV_SHOW=false 53 | SPACESHIP_CONDA_SHOW=false 54 | SPACESHIP_PYENV_SHOW=false 55 | SPACESHIP_DOTNET_SHOW=false 56 | SPACESHIP_EMBER_SHOW=false 57 | SPACESHIP_KUBECONTEXT_SHOW=false 58 | SPACESHIP_TERRAFORM_SHOW=false 59 | SPACESHIP_BATTERY_SHOW=false 60 | SPACESHIP_VI_MODE_SHOW=false 61 | SPACESHIP_JOBS_SHOW=true 62 | SPACESHIP_EXIT_CODE_SHOW=false 63 | -------------------------------------------------------------------------------- /vim/nvim/snippets/native/lua.json: -------------------------------------------------------------------------------- 1 | { 2 | "Create Auto Command": { 3 | "prefix": "autocmd", 4 | "body": [ 5 | "vim.api.nvim_create_autocmd(\"${1:event}\", {", 6 | " group = vim.api.nvim_create_augroup(\"${2:group}\", { clear = true }),", 7 | " callback = function(ev)", 8 | " ${0}", 9 | " end", 10 | "})" 11 | ] 12 | }, 13 | "Create Auto Command Group": { 14 | "prefix": "augroup", 15 | "body": [ 16 | "vim.api.nvim_create_augroup(\"${1:group}\", { clear = true })$0" 17 | ] 18 | }, 19 | "Current Win": { 20 | "prefix": "win", 21 | "body": "local win = vim.api.nvim_get_current_win()\n$0" 22 | }, 23 | "Current Buf": { 24 | "prefix": "buf", 25 | "body": "local buf = vim.api.nvim_get_current_buf()\n$0" 26 | }, 27 | "Buf Valid": { 28 | "prefix": "bufvalid", 29 | "body": "vim.api.nvim_buf_is_valid(${1:buf})" 30 | }, 31 | "Win Valid": { 32 | "prefix": "winvalid", 33 | "body": "vim.api.nvim_win_is_valid(${1:win})" 34 | }, 35 | "Win Call": { 36 | "prefix": "wincall", 37 | "body": [ 38 | "vim.api.nvim_win_call(${1:win}, function(win)", 39 | " ${0}", 40 | "end)" 41 | ] 42 | }, 43 | "Buf Call": { 44 | "prefix": "bufcall", 45 | "body": [ 46 | "vim.api.nvim_buf_call(${1:buf}, function(buf)", 47 | " ${0}", 48 | "end)" 49 | ] 50 | }, 51 | "Schedule": { 52 | "prefix": "schedule", 53 | "body": [ 54 | "vim.schedule(function()", 55 | " ${0}", 56 | "end)" 57 | ] 58 | }, 59 | "Table Deep Extend": { 60 | "prefix": "deepextend", 61 | "body": "vim.tbl_deep_extend(\"force\", ${1:table}, ${2:table})$0" 62 | }, 63 | "Table Filter": { 64 | "prefix": "filter", 65 | "body": [ 66 | "vim.tbl_filter(function()", 67 | " $0", 68 | "end, ${1:table})" 69 | ] 70 | }, 71 | "Table Map": { 72 | "prefix": "map", 73 | "body": [ 74 | "vim.tbl_map(function()", 75 | " $0", 76 | "end, ${1:table})" 77 | ] 78 | }, 79 | "Table Values": { 80 | "prefix": "values", 81 | "body": "vim.tbl_values(${1:table})" 82 | }, 83 | "Table Keys": { 84 | "prefix": "keys", 85 | "body": "vim.tbl_keys(${1:table})" 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /vim/UltiSnips/go.snippets: -------------------------------------------------------------------------------- 1 | priority 100 2 | 3 | snippet Imp "import ..." b 4 | import "${1:fmt}" 5 | endsnippet 6 | 7 | snippet pk "package ..." b 8 | package ${1:`!p snip.rv += os.path.basename(os.path.dirname(path))`} 9 | 10 | 11 | endsnippet 12 | 13 | snippet pm "package main" b 14 | package main 15 | 16 | 17 | endsnippet 18 | 19 | snippet imp "import (...)" b 20 | import ( 21 | "${1:fmt}"$2 22 | ) 23 | 24 | 25 | endsnippet 26 | 27 | snippet sout "fmt.Println(...)" b 28 | fmt.Println(${1:"${2:message}"}$3) 29 | endsnippet 30 | 31 | snippet af "func(...){...}" 32 | func($1) $2{ 33 | $3 34 | } 35 | endsnippet 36 | 37 | snippet forr "for item := range itmes..." b 38 | for ${1:it} := range ${2:ch} { 39 | $4 40 | } 41 | endsnippet 42 | 43 | snippet init "init function" b 44 | func init() { 45 | $1 46 | } 47 | endsnippet 48 | 49 | snippet gof "go func() { ... }()" b,m 50 | go func() { 51 | ${1:${VISUAL}} 52 | }() 53 | endsnippet 54 | 55 | snippet ife "if err != nil {...}" b,m 56 | if err != nil { 57 | ${1:${VISUAL}} 58 | } 59 | endsnippet 60 | 61 | snippet usage "show usage..." b 62 | fmt.Fprintf(os.Stderr, "Usage: %s <${1:argument}>\n", filepath.Base(os.Args[0])) 63 | endsnippet 64 | 65 | snippet f "func() {...}()" 66 | func() { 67 | ${1:${VISUAL}} 68 | }() 69 | endsnippet 70 | 71 | snippet ui "unimplemented..." b 72 | panic("unimplemented") 73 | endsnippet 74 | 75 | snippet interface "interface {}" 76 | interface {} 77 | endsnippet 78 | 79 | snippet fmax "func max(a, b int) int" b 80 | func ${1:max}(a, b ${2:int}) $2 { 81 | if a > b { 82 | return a 83 | } 84 | return b 85 | } 86 | endsnippet 87 | 88 | snippet fmin "func min(a, b int) int" b 89 | func ${1:min}(a, b ${2:int}) $2 { 90 | if a < b { 91 | return a 92 | } 93 | return b 94 | } 95 | endsnippet 96 | 97 | snippet fmaxn "func max(...) int" b 98 | func max(m int, others ...int) int { 99 | for _, x := range others { 100 | if x > m { 101 | m = x 102 | } 103 | } 104 | return m 105 | } 106 | endsnippet 107 | 108 | snippet fminn "func min(...) int" b 109 | func min(m int, others ...int) int { 110 | for _, x := range others { 111 | if x < m { 112 | m = x 113 | } 114 | } 115 | return m 116 | } 117 | endsnippet 118 | -------------------------------------------------------------------------------- /vim/nvim/lua/plugins/colors.lua: -------------------------------------------------------------------------------- 1 | ---@diagnostic disable: missing-fields 2 | 3 | return { 4 | { 5 | "LazyVim/LazyVim", 6 | opts = { 7 | colorscheme = "catppuccin", 8 | }, 9 | }, 10 | { 11 | "neanias/everforest-nvim", 12 | version = false, 13 | priority = 1000, 14 | config = function() 15 | require("everforest").setup({ 16 | background = "hard", 17 | on_highlights = function(hl, palette) 18 | -- stylua: ignore start 19 | -- Git Signs 20 | hl.GitSignsAdd = { fg = "#50FA7B" } 21 | hl.GitSignsDelete = { fg = "#FF5555" } 22 | hl.GitSignsChange = { fg = "#FFB86C" } 23 | 24 | -- Float 25 | hl.FloatBorder = { bg = palette.none } 26 | hl.FloatTitle = { bg = palette.none, bold = true } 27 | -- hl.NormalFloat = { link = "Normal" } 28 | 29 | -- NeoTree 30 | hl.NeoTreeNormal = { link = "Normal" } 31 | hl.NeoTreeFloatBorder = { link = "FloatBorder" } 32 | hl.NeoTreeFloatTitle = { link = "FloatTitle" } 33 | hl.NeoTreeFloatTitleBar = { link = "FloatBorder" } 34 | hl.NeoTreeFloatNormal = { link = "NormalFloat" } 35 | hl.NeoTreeTitleBar = { link = "FloatTitle" } 36 | hl.NeoTreeEndOfBuffer = { link = "EndOfBuffer" } 37 | 38 | hl.AlphaHeader = { bg = palette.bg, fg = palette.aqua } 39 | hl.AlphaShortcut = { bg = palette.bg, fg = palette.orange, bold = true } 40 | hl.AlphaButtons = { bg = palette.bg, fg = palette.blue } 41 | hl.AlphaFooter = { bg = palette.bg, fg = palette.aqua } 42 | 43 | hl.CurSearch = { link = "IncSearch" } 44 | hl.FlashMatch = { link = "Search" } 45 | hl.FlashLabel = { bg = "#db4b4b", fg = "#eeeeee", bold = true } 46 | 47 | hl.NeoTreeGitUntracked = { fg = palette.yellow } 48 | end, 49 | }) 50 | end, 51 | }, 52 | { 53 | "catppuccin/nvim", 54 | name = "catppuccin", 55 | priority = 1000, 56 | opts = { 57 | flavour = "frappe", -- latte, frappe, macchiato, mocha 58 | custom_highlights = function(colors) 59 | return { 60 | DiffChange = { bg = '#78766d' }, 61 | } 62 | end 63 | }, 64 | }, 65 | } 66 | -------------------------------------------------------------------------------- /sdk/ruby/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ################################################################################ 3 | # Author: Wenxuan # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2020-01-07 14:41 # 6 | ################################################################################ 7 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || exit 1 8 | 9 | loginfo() { printf "%b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$@" >&2; } 10 | logwarn() { printf "%b[warn]%b %s\n" '\e[0;33m\033[1m' '\e[0m' "$@" >&2; } 11 | logerror() { printf "%b[error]%b %s\n" '\e[0;31m\033[1m' '\e[0m' "$@" >&2; } 12 | 13 | export PATH="$HOME/.gem/bin:$HOME/.rbenv/bin:$PATH" 14 | 15 | install_rbenv() { 16 | if ! hash rbenv &>/dev/null; then 17 | git clone --depth=1 https://github.com/rbenv/rbenv.git ~/.rbenv || return 1 18 | # ruby-build plugin 19 | mkdir -p "$(rbenv root)"/plugins 20 | git clone --depth=1 https://github.com/rbenv/ruby-build.git "$(rbenv root)/plugins/ruby-build" 21 | 22 | # automatically install gems every time you install a new version of Ruby 23 | git clone --depth=1 https://github.com/rbenv/rbenv-default-gems.git "$(rbenv root)/plugins/rbenv-default-gems" 24 | 25 | # optional: compile dynamic bash extension to speed up rbenv 26 | cd ~/.rbenv && src/configure && make -C src 27 | fi 28 | source <(rbenv init -) 29 | } 30 | 31 | install_ruby() { 32 | v=2.7.0 33 | rbenv versions | grep $v || rbenv install $v 34 | rbenv global $v 35 | } 36 | 37 | install_configs() { 38 | gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/ 39 | ln -sf "$SCRIPT_DIR"/rubocop.yml ~/.rubocop.yml 40 | } 41 | 42 | install_tools() { 43 | gem install pry 44 | gem install rubocop 45 | gem install bundler && bundle config mirror.https://rubygems.org https://gems.ruby-china.com 46 | } 47 | 48 | loginfo "install rbenv..." 49 | install_rbenv || exit $? 50 | 51 | loginfo "install ruby..." 52 | install_ruby || exit $? 53 | 54 | loginfo "install configs..." 55 | install_configs || exit $? 56 | 57 | loginfo "install tools..." 58 | install_tools || exit $? 59 | -------------------------------------------------------------------------------- /bin/semver-next: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ############################################################################ 3 | # Author: Wenxuan Zhang # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2020-03-23 20:12 # 6 | ############################################################################ 7 | set -euo pipefail 8 | IFS=$'\n\t' 9 | 10 | loginfo() { printf "%b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$@" >&2; } 11 | logwarn() { printf "%b[warn]%b %s\n" '\e[0;33m\033[1m' '\e[0m' "$@" >&2; } 12 | logerror() { printf "%b[error]%b %s\n" '\e[0;31m\033[1m' '\e[0m' "$@" >&2; } 13 | 14 | usage() { echo "Usage: $(basename "$0") " >&2; } 15 | 16 | [[ $# -ne 2 ]] && logerror 'Incorrect argument number.' && usage && exit 1 17 | 18 | VER=$1 19 | TYPE=$2 20 | VER_RE='^([0-9]+)\.([0-9]+)\.([0-9]+)(-(alpha|beta|rc)\.([0-9]+))?$' 21 | if [[ $VER =~ $VER_RE ]]; then 22 | MAJOR=${BASH_REMATCH[1]} 23 | MINOR=${BASH_REMATCH[2]} 24 | PATCH=${BASH_REMATCH[3]} 25 | STAGE=${BASH_REMATCH[5]} 26 | STAGE_NO=${BASH_REMATCH[6]} 27 | case $TYPE in 28 | stage) 29 | if [[ -z $STAGE ]]; then 30 | PATCH=$((PATCH + 1)) 31 | STAGE=rc 32 | STAGE_NO=1 33 | else 34 | STAGE_NO=$((STAGE_NO + 1)) 35 | fi 36 | ;; 37 | patch) 38 | [[ -z $STAGE ]] && PATCH=$((PATCH + 1)) 39 | ;; 40 | minor) 41 | MINOR=$((MINOR + 1)) 42 | PATCH=0 43 | ;; 44 | major) 45 | MAJOR=$((MAJOR + 1)) 46 | MINOR=0 47 | PATCH=0 48 | ;; 49 | *) 50 | logerror "Invalid version type: $TYPE. Shoud be one of [major, minor, patch]" && exit 1 51 | ;; 52 | esac 53 | printf "%s.%s.%s" $MAJOR $MINOR $PATCH 54 | [[ $TYPE == stage ]] && printf -- "-%s.%s" $STAGE $STAGE_NO 55 | printf "\n" 56 | else 57 | message='Invalid version: Acceptable format is "MAJOR.MINOR.PATCH[-STAGE.STAGE_NO]".' 58 | message="$message Stage should be one of [alpha, beta, rc] and other parts should be numbers." 59 | logerror "$message" 60 | exit 1 61 | fi 62 | -------------------------------------------------------------------------------- /vim/nvim/snippets/luasnip/sh.lua: -------------------------------------------------------------------------------- 1 | ---@diagnostic disable: unused-local 2 | --# selene: allow(unused_variable) 3 | local ls = require("luasnip") 4 | -- some shorthands... 5 | local s = ls.snippet 6 | local sn = ls.snippet_node 7 | local t = ls.text_node 8 | local i = ls.insert_node 9 | local f = ls.function_node 10 | local c = ls.choice_node 11 | local d = ls.dynamic_node 12 | local r = ls.restore_node 13 | local l = require("luasnip.extras").lambda 14 | local rep = require("luasnip.extras").rep 15 | local p = require("luasnip.extras").partial 16 | local m = require("luasnip.extras").match 17 | local n = require("luasnip.extras").nonempty 18 | local dl = require("luasnip.extras").dynamic_lambda 19 | local fmt = require("luasnip.extras.fmt").fmt 20 | local fmta = require("luasnip.extras.fmt").fmta 21 | local types = require("luasnip.util.types") 22 | local conds = require("luasnip.extras.conditions") 23 | local conds_expand = require("luasnip.extras.conditions.expand") 24 | 25 | -- stylua: ignore 26 | return { 27 | s("bash", { 28 | t { "#!/usr/bin/env bash", "" }, 29 | }), 30 | s("sbash", { 31 | t { "#!/usr/bin/env bash", "" }, 32 | t { "set -euo pipefail", "" }, 33 | t { "IFS=$'\\n\\t'", "" }, 34 | }), 35 | 36 | s("usage", { 37 | t { 'usage() { echo "Usage: $(basename "$0") <' }, i(1, "param"), t { '>" >&2; }' }, 38 | }), 39 | 40 | s("sdir", { 41 | t { 'SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)' }, 42 | i(0, ' && cd "$SDIR"'), 43 | }), 44 | 45 | s("hascmd", { 46 | t { "hash " }, i(1, "cmd"), t { " &>/dev/null " }, i(2, "&&"), 47 | }), 48 | 49 | s("temp", { 50 | t { 'trap \'command rm -rf $' }, i(1, "TEMP"), t { '\' ' }, i(2, "EXIT INT TERM HUP"), t { '', '' }, 51 | rep(1), t { '="$(mktemp -' }, i(3, "d"), t { 't ' }, i(4, '"$(basename "$0")"'), t { '.XXXXXX)"', '' }, 52 | }), 53 | 54 | s("log", { 55 | t { 'info() { printf "' }, i(1, "$(date +%FT%T) "), t { [[%b[info]%b %s\n" ]] }, t { [['\e[0;32m\033[1m']] }, t { [[ '\e[0m' "$*" >&2; }]], '' }, 56 | t { 'warn() { printf "' }, rep(1), t { [[%b[warn]%b %s\n" ]] }, t { [['\e[0;33m\033[1m']] }, t { [[ '\e[0m' "$*" >&2; }]], '' }, 57 | t { 'erro() { printf "' }, rep(1), t { [[%b[erro]%b %s\n" ]] }, t { [['\e[0;31m\033[1m']] }, t { [[ '\e[0m' "$*" >&2; }]], '' }, 58 | }), 59 | 60 | s("shellcheck", { 61 | t { "# shellcheck disable=SC" }, i(1), 62 | }), 63 | } 64 | -------------------------------------------------------------------------------- /zsh/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" 4 | 5 | confdir="$HOME/.config/zsh" 6 | mkdir -p "$confdir" 7 | 8 | ln -sf "$SDIR/zshrc" ~/.zshrc 9 | ln -sf "$SDIR/zshenv" ~/.zshenv 10 | 11 | ln -sf {"$SDIR","$confdir"}/zsh_misc 12 | ln -sf {"$SDIR","$confdir"}/zsh_aliases 13 | ln -sf {"$SDIR","$confdir"}/zsh_custom 14 | ln -sf {"$SDIR","$confdir"}/zsh_fzf_extra 15 | ln -sf {"$SDIR","$confdir"}/zsh_secret 16 | 17 | for f in *.zsh; do 18 | ln -sf {"$SDIR","$confdir"}/"$f" 19 | done 20 | 21 | rm -rf ~/.config/sheldon && ln -snf "$SDIR/sheldon" ~/.config/sheldon 22 | ln -sf "$SDIR/starship.toml" ~/.config/starship.toml 23 | 24 | [[ "$SHELL" =~ "zsh" ]] || chsh -s "$(command -v zsh)" 25 | 26 | zsh -ic 'exit' 27 | 28 | # zsh source order: 29 | # https://medium.com/@rajsek/zsh-bash-startup-files-loading-order-bashrc-zshrc-etc-e30045652f2e 30 | # +----------------+-----------+-----------+------+ 31 | # | |Interactive|Interactive|Script| 32 | # | |login |non-login | | 33 | # +----------------+-----------+-----------+------+ 34 | # |/etc/zshenv | A | A | A | 35 | # +----------------+-----------+-----------+------+ 36 | # |~/.zshenv | B | B | B | 37 | # +----------------+-----------+-----------+------+ 38 | # |/etc/zprofile | C | | | 39 | # +----------------+-----------+-----------+------+ 40 | # |~/.zprofile | D | | | 41 | # +----------------+-----------+-----------+------+ 42 | # |/etc/zshrc | E | C | | 43 | # +----------------+-----------+-----------+------+ 44 | # |~/.zshrc | F | D | | 45 | # +----------------+-----------+-----------+------+ 46 | # |/etc/zlogin | G | | | 47 | # +----------------+-----------+-----------+------+ 48 | # |~/.zlogin | H | | | 49 | # +----------------+-----------+-----------+------+ 50 | # | | | | | 51 | # +----------------+-----------+-----------+------+ 52 | # | | | | | 53 | # +----------------+-----------+-----------+------+ 54 | # |~/.zlogout | I | | | 55 | # +----------------+-----------+-----------+------+ 56 | # |/etc/zlogout | J | | | 57 | # +----------------+-----------+-----------+------+ 58 | -------------------------------------------------------------------------------- /vim/nvim/lua/config/options.lua: -------------------------------------------------------------------------------- 1 | -- Options are automatically loaded before lazy.nvim startup 2 | -- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua 3 | -- Add any additional options here 4 | 5 | vim.g.mapleader = " " 6 | vim.g.maplocalleader = "," 7 | 8 | local opt = vim.opt 9 | 10 | if vim.fn.has("nvim-0.8") == 1 then 11 | opt.backup = true 12 | opt.cmdheight = 0 13 | opt.backupdir = vim.fn.stdpath("state") .. "/backup" 14 | end 15 | 16 | if vim.g.neovide then 17 | vim.o.guifont = "JetBrainsMono NFM:h34" 18 | vim.g.neovide_scale_factor = 0.3 19 | end 20 | 21 | opt.swapfile = false 22 | opt.mousescroll = "ver:2,hor:6" 23 | 24 | -- vim.g.node_host_prog = "/Users/folke/.pnpm-global/5/node_modules/neovim/bin/cli.js" 25 | vim.g.loaded_python3_provider = 0 26 | vim.g.loaded_perl_provider = 0 27 | vim.g.loaded_ruby_provider = 0 28 | vim.g.loaded_node_provider = 0 29 | 30 | -- make all keymaps silent by default 31 | local keymap_set = vim.keymap.set 32 | ---@diagnostic disable-next-line: duplicate-set-field 33 | vim.keymap.set = function(mode, lhs, rhs, opts) 34 | opts = opts or {} 35 | opts.silent = opts.silent ~= false 36 | return keymap_set(mode, lhs, rhs, opts) 37 | end 38 | 39 | opt.clipboard = "" 40 | opt.relativenumber = false 41 | 42 | -- stylua: ignore start 43 | opt.foldcolumn = "auto:1" -- '0' is not bad 44 | opt.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value 45 | opt.foldlevelstart = 99 46 | opt.foldenable = true 47 | 48 | -- stylua: ignore 49 | opt.fillchars = { 50 | eob = " ", 51 | fold = " ", 52 | foldopen = "", --   53 | foldsep = " ", 54 | foldclose = "›", --  › 55 | } 56 | 57 | -- stylua: ignore 58 | opt.listchars = { 59 | tab = " ", 60 | nbsp = "+", 61 | trail = "·", 62 | extends = "»", 63 | precedes = "«", 64 | } 65 | 66 | -- stylua: ignore start 67 | opt.tabstop = 4 68 | opt.expandtab = true 69 | opt.smarttab = true 70 | opt.softtabstop = -1 71 | opt.shiftwidth = 0 72 | 73 | -- views can only be fully collapsed with the global statusline 74 | opt.laststatus = 3 75 | -- Default splitting will cause your main splits to jump when opening an edgebar. 76 | -- To prevent this, set `splitkeep` to either `screen` or `topline`. 77 | opt.splitkeep = "screen" 78 | 79 | -- make startup faster 80 | vim.g.loaded_python3_provider = 0 81 | vim.g.loaded_perl_provider = 0 82 | vim.g.loaded_ruby_provider = 0 83 | vim.g.loaded_node_provider = 0 84 | -------------------------------------------------------------------------------- /alacritty/alacritty.yml: -------------------------------------------------------------------------------- 1 | # Configuration for Alacritty, the GPU enhanced terminal emulator. 2 | # Latest config template: https://github.com/alacritty/alacritty/releases 3 | font: 4 | normal: 5 | family: JetBrainsMono Nerd Font Mono 6 | style: Regular 7 | bold: 8 | family: JetBrainsMono Nerd Font Mono 9 | style: Bold 10 | italic: 11 | family: JetBrainsMono Nerd Font Mono 12 | style: Italic 13 | bold_italic: 14 | family: JetBrainsMono Nerd Font Mono 15 | style: Bold Italic 16 | size: 10 17 | # use_thin_strokes: true 18 | offset: 19 | x: 0 20 | y: 0 21 | glyph_offset: 22 | x: 0 23 | y: 0 24 | 25 | # If `true`, bold text is drawn using the bright color variants. 26 | draw_bold_text_with_bright_colors: true 27 | 28 | window.opacity: 1.0 29 | 30 | mouse_bindings: 31 | - { mouse: Middle, action: PasteSelection } 32 | 33 | key_bindings: 34 | - { key: V, mods: Command, action: Paste } 35 | - { key: C, mods: Command, action: Copy } 36 | 37 | # The definition of color schemes. 38 | schemes: 39 | gruvbox_medium_dark: &gruvbox_medium_dark 40 | primary: 41 | # hard contrast: background = '#1d2021' 42 | background: '#282828' 43 | # soft contrast: background = '#32302f' 44 | foreground: '#ebdbb2' 45 | normal: 46 | black: '#282828' 47 | red: '#cc241d' 48 | green: '#50fa7b' 49 | yellow: '#d79921' 50 | blue: '#458588' 51 | magenta: '#b16286' 52 | cyan: '#689d6a' 53 | white: '#a89984' 54 | bright: 55 | black: '#928374' 56 | red: '#fb4934' 57 | green: '#5af78e' 58 | yellow: '#fabd2f' 59 | blue: '#83a598' 60 | magenta: '#d3869b' 61 | cyan: '#8ec07c' 62 | white: '#ebdbb2' 63 | gruvbox_material_medium_dark: &gruvbox_material_medium_dark 64 | primary: 65 | background: '#282828' 66 | foreground: '#dfbf8e' 67 | normal: 68 | black: '#665c54' 69 | red: '#ea6962' 70 | green: '#a9b665' 71 | yellow: '#e78a4e' 72 | blue: '#7daea3' 73 | magenta: '#d3869b' 74 | cyan: '#89b482' 75 | white: '#dfbf8e' 76 | bright: 77 | black: '#928374' 78 | red: '#ea6962' 79 | green: '#a9b665' 80 | yellow: '#e3a84e' 81 | blue: '#7daea3' 82 | magenta: '#d3869b' 83 | cyan: '#89b482' 84 | white: '#dfbf8e' 85 | 86 | colors: *gruvbox_material_medium_dark 87 | 88 | window: 89 | padding: 90 | x: 0 91 | y: 0 92 | dynamic_padding: true 93 | -------------------------------------------------------------------------------- /hyprland/hypr/hyprlock.conf: -------------------------------------------------------------------------------- 1 | # BACKGROUND 2 | background { 3 | monitor = 4 | path = ~/.config/hypr/hyprlock.png 5 | blur_passes = 3 6 | contrast = 0.8916 7 | brightness = 0.8172 8 | vibrancy = 0.1696 9 | vibrancy_darkness = 0.0 10 | } 11 | 12 | # GENERAL 13 | general { 14 | no_fade_in = false 15 | grace = 0 16 | disable_loading_bar = false 17 | } 18 | 19 | # TIME 20 | label { 21 | monitor = 22 | text = cmd[update:1000] echo "$(date +"%H:%M")" 23 | color = rgba(250, 189, 47, .75) 24 | font_size = 200 25 | font_family = SF Pro Display Bold 26 | position = 0, 100 27 | halign = center 28 | valign = center 29 | } 30 | 31 | # DAY-DATE-MONTH 32 | # label { 33 | # monitor = 34 | # text = cmd[update:1000] echo "$(date '+%A, %d %B')" 35 | # color = rgba(225, 225, 225, 0.75) 36 | # font_size = 30 37 | # font_family = SF Pro Display Bold 38 | # position = 0, 200 39 | # halign = center 40 | # valign = center 41 | # } 42 | 43 | # LOGO 44 | # label { 45 | # monitor = 46 | # # text = cmd[update:1000] echo " ," 47 | # color = rgba(255, 255, 255, 0.65) 48 | # font_size = 120 49 | # position = 0, 60 50 | # halign = center 51 | # valign = center 52 | # } 53 | 54 | # USER 55 | # label { 56 | # monitor = 57 | # text = Hello, $USER 58 | # color = rgba(255, 255, 255, .65) 59 | # font_size = 120 60 | # font_family = SF Pro Display Bold 61 | # position = 0, 60 62 | # halign = center 63 | # valign = center 64 | # } 65 | 66 | # INPUT FIELD 67 | input-field { 68 | monitor = 69 | size = 290, 60 70 | outline_thickness = 2 71 | dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8 72 | dots_spacing = 0.2 # Scale of dots' absolute size, 0.0 - 1.0 73 | dots_center = true 74 | outer_color = rgba(0, 0, 0, 0) 75 | inner_color = rgba(60, 56, 54, 0.35) 76 | font_color = rgb(200, 200, 200) 77 | fade_on_empty = false 78 | font_family = SF Pro Display Bold 79 | placeholder_text = Unlock Me 80 | hide_input = false 81 | position = 0, -100 82 | halign = center 83 | valign = center 84 | } 85 | 86 | # CURRENT SONG 87 | # label { 88 | # monitor = 89 | # text = cmd[update:1000] echo "$(/home/vivek/.config/hypr/scripts/songdetail.sh)" 90 | # color = rgba(235, 219, 178, .75) 91 | # font_size = 16 92 | # font_family = JetBrains Mono Nerd, SF Pro Display Bold 93 | # position = 0, 80 94 | # halign = center 95 | # valign = bottom 96 | # } 97 | -------------------------------------------------------------------------------- /arch/setup_core.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | [ "$(whoami)" != "root" ] && exec sudo -- "$0" "$@" 3 | set -euo pipefail 4 | IFS=$'\n\t' 5 | 6 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || exit 1 7 | 8 | info() { printf "$(date -Is) %b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$*" >&2; } 9 | warn() { printf "$(date -Is) %b[warn]%b %s\n" '\e[0;33m\033[1m' '\e[0m' "$*" >&2; } 10 | erro() { printf "$(date -Is) %b[erro]%b %s\n" '\e[0;31m\033[1m' '\e[0m' "$*" >&2; } 11 | 12 | function config_system() { 13 | # config time zone 14 | ln -sf /usr/share/zoneinfo/Asia/Chongqing /etc/localtime 15 | } 16 | 17 | function setup_package_manager() { 18 | # Download pacman mirrorlist 19 | # Uncomment the wanted mirror 20 | #wget -O/etc/pacman.d/mirrorlist https://www.archlinux.org/mirrorlist/all/ 21 | #wget -O /etc/pacman.d/mirrorlist 'https://www.archlinux.org/mirrorlist/?country=CN' 22 | 23 | mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak 24 | cp "$SDIR/mirrorlist" /etc/pacman.d/mirrorlist 25 | mv /etc/pacman.conf /etc/pacman.conf.bak 26 | cp "$SDIR/pacman.conf" /etc/pacman.conf 27 | 28 | # paru 29 | pacman --noconfirm -Sy archlinuxcn-keyring 30 | pacman --noconfirm -S --needed paru 31 | pacman --noconfirm -S --needed pkgfile && pkgfile --update 32 | 33 | # auto clean pacman cache 34 | pacman --noconfirm -S --needed pacman-contrib 35 | systemctl daemon-reload 36 | systemctl enable paccache.timer 37 | systemctl start paccache.timer 38 | } 39 | 40 | function install_cli_package() { 41 | pkgs=() 42 | 43 | pkgs+=(base-devel) 44 | pkgs+=(tar zip unzip gzip xz bzip2 unrar p7zip zstd) 45 | pkgs+=(git git-crypt python-pre-commit github-cli git-delta) 46 | pkgs+=(zsh sheldon tmux fzf jq) 47 | pkgs+=(neovim ctags) 48 | pkgs+=(openssh wget axel rsync pv) 49 | pkgs+=(duf dust dua-cli) 50 | pkgs+=(htop bottom procs) 51 | pkgs+=(fd eza bat ripgrep sd yazi xsv zoxide gping tokei) 52 | pkgs+=(words man-db man-pages) 53 | pkgs+=(fastfetch) 54 | pkgs+=(kondo) 55 | 56 | # pkgs+=(clitrans-git) 57 | # pkgs+=(code-minimap-git) 58 | # pkgs+=(csview-git) 59 | 60 | pkgs+=(go nodejs npm) 61 | 62 | paru -S --noconfirm --needed "${pkgs[@]}" 63 | 64 | # crontab 65 | paru -S --noconfirm --needed cronie 66 | systemctl daemon-reload 67 | systemctl enable cronie.service 68 | systemctl start cronie.service 69 | } 70 | 71 | info 'config system...' 72 | config_system 73 | 74 | info 'setup package manager...' 75 | setup_package_manager 76 | 77 | info 'install cli packages...' 78 | install_cli_package 79 | -------------------------------------------------------------------------------- /rpk/packages.toml: -------------------------------------------------------------------------------- 1 | # RPK Config File 2 | # 3 | # See the documentation for more https://github.com/wfxr/rpk#readme 4 | 5 | [pkgs.rpk] 6 | repo = "wfxr/rpk" 7 | desc = "A lightweight, cross-platform cli package manager." 8 | 9 | [pkgs.fd] 10 | repo = "sharkdp/fd" 11 | desc = "A simple, fast and user-friendly alternative to 'find'" 12 | 13 | [pkgs.rg] 14 | repo = "BurntSushi/ripgrep" 15 | desc = "ripgrep recursively searches directories for a regex pattern while respecting your gitignore" 16 | 17 | [pkgs.delta] 18 | repo = "dandavison/delta" 19 | desc = "A syntax-highlighting pager for git, diff, grep, and blame output" 20 | 21 | [pkgs.eza] 22 | repo = "eza-community/eza" 23 | desc = "A modern alternative to ls" 24 | 25 | [pkgs.dua] 26 | repo = "Byron/dua-cli" 27 | desc = "View disk space usage and delete unwanted data, fast." 28 | 29 | [pkgs.gh] 30 | repo = "cli/cli" 31 | desc = "GitHub’s official command line tool" 32 | 33 | [pkgs.bat] 34 | repo = "sharkdp/bat" 35 | desc = "A cat(1) clone with wings." 36 | 37 | [pkgs.jq] 38 | repo = "jqlang/jq" 39 | desc = "Command-line JSON processor" 40 | 41 | [pkgs.sheldon] 42 | repo = "rossmacarthur/sheldon" 43 | desc = ":bowtie: Fast, configurable, shell plugin manager" 44 | 45 | [pkgs.zoxide] 46 | repo = "ajeetdsouza/zoxide" 47 | desc = "A smarter cd command. Supports all major shells." 48 | 49 | [pkgs.duf] 50 | repo = "muesli/duf" 51 | desc = "Disk Usage/Free Utility - a better 'df' alternative" 52 | 53 | [pkgs.btm] 54 | repo = "ClementTsang/bottom" 55 | desc = "Yet another cross-platform graphical process/system monitor." 56 | 57 | [pkgs.sd] 58 | repo = "chmln/sd" 59 | desc = "Intuitive find & replace CLI (sed alternative)" 60 | 61 | [pkgs.fzf] 62 | repo = "junegunn/fzf" 63 | desc = ":cherry_blossom: A command-line fuzzy finder" 64 | 65 | [pkgs.hexyl] 66 | bins = ["hexyl"] 67 | repo = "sharkdp/hexyl" 68 | desc = "A command-line hex viewer" 69 | 70 | [pkgs.fastfetch] 71 | bins = ["fastfetch"] 72 | repo = "fastfetch-cli/fastfetch" 73 | desc = "A maintained, feature-rich and performance oriented, neofetch like system information tool." 74 | 75 | [pkgs.yazi] 76 | bins = [ 77 | "yazi", 78 | "ya", 79 | ] 80 | repo = "sxyazi/yazi" 81 | desc = "💥 Blazing fast terminal file manager written in Rust, based on async I/O." 82 | 83 | [pkgs.procs] 84 | bins = ["procs"] 85 | repo = "dalance/procs" 86 | desc = "A modern replacement for ps written in Rust" 87 | 88 | [pkgs.lazydocker] 89 | enabled = "hash docker" 90 | bins = ["lazydocker"] 91 | repo = "jesseduffield/lazydocker" 92 | desc = "The lazier way to manage everything docker" 93 | 94 | [pkgs.hyperfine] 95 | bins = ["hyperfine"] 96 | repo = "sharkdp/hyperfine" 97 | desc = "A command-line benchmarking tool" 98 | 99 | [pkgs.uv] 100 | bins = ["uv", "uvx"] 101 | repo = "astral-sh/uv" 102 | desc = "An extremely fast Python package and project manager, written in Rust." 103 | -------------------------------------------------------------------------------- /fcitx5/config/conf/pinyin.conf: -------------------------------------------------------------------------------- 1 | # 双拼方案 2 | ShuangpinProfile=Xiaohe 3 | # 显示当前双拼模式 4 | ShowShuangpinMode=True 5 | # 每页候选词 6 | PageSize=5 7 | # 显示英文候选词 8 | SpellEnabled=True 9 | # 显示符号候选词 10 | SymbolsEnabled=True 11 | # 显示拆字候选词 12 | ChaiziEnabled=True 13 | # 启用 Unicode CJK 拓展区 B 之后的更多字符 14 | ExtBEnabled=True 15 | # 输入 h(横),s(竖),p(撇),n(捺),z(折) 时显示笔画候选词 16 | StrokeCandidateEnabled=True 17 | # 启用云拼音 18 | CloudPinyinEnabled=True 19 | # 云拼音候选词顺序 20 | CloudPinyinIndex=2 21 | # 加载云拼音的时候显示动画 22 | CloudPinyinAnimation=True 23 | # 总是显示云拼音的占位符 24 | KeepCloudPinyinPlaceHolder=False 25 | # 预编辑模式 26 | PreeditMode="Composing pinyin" 27 | # 将嵌入预编辑文本的光标固定在开头 28 | PreeditCursorPositionAtBeginning=True 29 | # 在预编辑中显示完整拼音 30 | PinyinInPreedit=False 31 | # 启用预测 32 | Prediction=False 33 | # 预测数量 34 | PredictionSize=10 35 | # 预测时退格键的行为 36 | BackspaceBehaviorOnPrediction="Backspace when not using on-screen keyboard" 37 | # 切换输入法时的行为 38 | SwitchInputMethodBehavior="Commit current preedit" 39 | # 选择第二个候选词 40 | SecondCandidate= 41 | # 选择第三个候选词 42 | ThirdCandidate= 43 | # 使用数字键盘选词 44 | UseKeypadAsSelection=False 45 | # 使用退格键取消选词 46 | BackSpaceToUnselect=True 47 | # 句子数量 48 | Number of sentence=2 49 | # 词组候选词数 50 | WordCandidateLimit=15 51 | # 输入长于...时提示长词 (设置为 0 时禁用) 52 | LongWordLengthLimit=4 53 | # 快速输入的触发键 54 | QuickPhraseKey=semicolon 55 | # 使用 V 来触发快速输入 56 | VAsQuickphrase=True 57 | # FirstRun 58 | FirstRun=False 59 | 60 | [ForgetWord] 61 | 0=Control+7 62 | 63 | [PrevPage] 64 | 0=minus 65 | 1=Control+P 66 | 67 | [NextPage] 68 | 0=equal 69 | 1=Control+N 70 | 71 | [PrevCandidate] 72 | 0=Shift+Tab 73 | 74 | [NextCandidate] 75 | 0=Tab 76 | 77 | [CurrentCandidate] 78 | 0=space 79 | 1=KP_Space 80 | 81 | [CommitRawInput] 82 | 0=Return 83 | 1=KP_Enter 84 | 2=Control+Return 85 | 3=Control+KP_Enter 86 | 4=Shift+Return 87 | 5=Shift+KP_Enter 88 | 6=Control+Shift+Return 89 | 7=Control+Shift+KP_Enter 90 | 91 | [ChooseCharFromPhrase] 92 | 0=bracketleft 93 | 1=bracketright 94 | 95 | [FilterByStroke] 96 | 0=grave 97 | 98 | [QuickPhraseTriggerRegex] 99 | 0=.(/|@)$ 100 | 1=^(www|bbs|forum|mail|bbs)\\. 101 | 2=^(http|https|ftp|telnet|mailto): 102 | 103 | [Fuzzy] 104 | # ue -> ve 105 | VE_UE=True 106 | # 常见错误 107 | NG_GN=True 108 | # 内模糊音节 (xian -> xi'an) 109 | Inner=True 110 | # 短拼音的内模糊音节 (qie -> qi'e) 111 | InnerShort=True 112 | # 匹配不完整的元音 (e -> en, eng, ei) 113 | PartialFinal=True 114 | # 输入长度大于 4 时进行部分双拼匹配 115 | PartialSp=False 116 | # u <-> v 117 | V_U=False 118 | # an <-> ang 119 | AN_ANG=False 120 | # en <-> eng 121 | EN_ENG=False 122 | # ian <-> iang 123 | IAN_IANG=False 124 | # in <-> ing 125 | IN_ING=False 126 | # u <-> ou 127 | U_OU=False 128 | # uan <-> uang 129 | UAN_UANG=False 130 | # c <-> ch 131 | C_CH=False 132 | # f <-> h 133 | F_H=False 134 | # l <-> n 135 | L_N=False 136 | # l <-> r 137 | L_R=False 138 | # s <-> sh 139 | S_SH=False 140 | # z <-> zh 141 | Z_ZH=False 142 | # 纠错布局 143 | Correction=None 144 | 145 | -------------------------------------------------------------------------------- /ranger/commands.py: -------------------------------------------------------------------------------- 1 | # This is a sample commands.py. You can add your own commands here. 2 | # 3 | # Please refer to commands_full.py for all the default commands and a complete 4 | # documentation. Do NOT add them all here, or you may end up with defunct 5 | # commands when upgrading ranger. 6 | 7 | # A simple command for demonstration purposes follows. 8 | # ----------------------------------------------------------------------------- 9 | 10 | from __future__ import (absolute_import, division, print_function) 11 | 12 | # You can import any python module as needed. 13 | import os 14 | 15 | # You always need to import ranger.api.commands here to get the Command class: 16 | from ranger.api.commands import Command 17 | 18 | 19 | # Any class that is a subclass of "Command" will be integrated into ranger as a 20 | # command. Try typing ":my_edit" in ranger! 21 | class my_edit(Command): 22 | # The so-called doc-string of the class will be visible in the built-in 23 | # help that is accessible by typing "?c" inside ranger. 24 | """:my_edit 25 | 26 | A sample command for demonstration purposes that opens a file in an editor. 27 | """ 28 | 29 | # The execute method is called when you run this command in ranger. 30 | def execute(self): 31 | # self.arg(1) is the first (space-separated) argument to the function. 32 | # This way you can write ":my_edit somefilename". 33 | if self.arg(1): 34 | # self.rest(1) contains self.arg(1) and everything that follows 35 | target_filename = self.rest(1) 36 | else: 37 | # self.fm is a ranger.core.filemanager.FileManager object and gives 38 | # you access to internals of ranger. 39 | # self.fm.thisfile is a ranger.container.file.File object and is a 40 | # reference to the currently selected file. 41 | target_filename = self.fm.thisfile.path 42 | 43 | # This is a generic function to print text in ranger. 44 | self.fm.notify("Let's edit the file " + target_filename + "!") 45 | 46 | # Using bad=True in fm.notify allows you to print error messages: 47 | if not os.path.exists(target_filename): 48 | self.fm.notify("The given file does not exist!", bad=True) 49 | return 50 | 51 | # This executes a function from ranger.core.acitons, a module with a 52 | # variety of subroutines that can help you construct commands. 53 | # Check out the source, or run "pydoc ranger.core.actions" for a list. 54 | self.fm.edit_file(target_filename) 55 | 56 | # The tab method is called when you press tab, and should return a list of 57 | # suggestions that the user will tab through. 58 | # tabnum is 1 for and -1 for by default 59 | def tab(self, tabnum): 60 | # This is a generic tab-completion function that iterates through the 61 | # content of the current directory. 62 | return self._tab_directory_content() 63 | -------------------------------------------------------------------------------- /vim/nvim/lua/config/lazy.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 | if not (vim.uv or vim.loop).fs_stat(lazypath) then 3 | local lazyrepo = "https://github.com/folke/lazy.nvim.git" 4 | local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) 5 | if vim.v.shell_error ~= 0 then 6 | vim.api.nvim_echo({ 7 | { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, 8 | { out, "WarningMsg" }, 9 | { "\nPress any key to exit..." }, 10 | }, true, {}) 11 | vim.fn.getchar() 12 | os.exit(1) 13 | end 14 | end 15 | vim.opt.rtp:prepend(lazypath) 16 | 17 | require("lazy").setup({ 18 | spec = { 19 | -- add LazyVim and import its plugins 20 | { "LazyVim/LazyVim", import = "lazyvim.plugins" }, 21 | 22 | -- import any extras modules here 23 | { import = "lazyvim.plugins.extras.lang.clangd" }, 24 | { import = "lazyvim.plugins.extras.lang.go" }, 25 | { import = "lazyvim.plugins.extras.lang.rust" }, 26 | { import = "lazyvim.plugins.extras.lang.yaml" }, 27 | { import = "lazyvim.plugins.extras.lang.toml" }, 28 | { import = "lazyvim.plugins.extras.lang.docker" }, 29 | { import = "lazyvim.plugins.extras.lang.json" }, 30 | { import = "lazyvim.plugins.extras.lang.markdown" }, 31 | 32 | { import = "lazyvim.plugins.extras.ai.copilot" }, 33 | { import = "lazyvim.plugins.extras.util.dot" }, -- Language support for dotfiles 34 | { import = "lazyvim.plugins.extras.util.mini-hipatterns" }, -- Render colors (like #7daea3) in your code. 35 | 36 | -- import/override with your plugins 37 | { import = "plugins" }, 38 | }, 39 | local_spec = true, -- load project specific .lazy.lua spec files. They will be added at the end of the spec. 40 | defaults = { 41 | -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. 42 | -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. 43 | lazy = false, 44 | -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, 45 | -- have outdated releases, which may break your Neovim install. 46 | version = false, -- always use the latest git commit 47 | -- version = "*", -- try installing the latest stable version for plugins that support semver 48 | }, 49 | install = { colorscheme = { "catppuccin", "everforest", "tokyonight" } }, 50 | checker = { enabled = true, notify = false }, -- automatically check for plugin updates 51 | performance = { 52 | rtp = { 53 | -- disable some rtp plugins 54 | disabled_plugins = { 55 | "gzip", 56 | -- "matchit", 57 | -- "matchparen", 58 | -- "netrwPlugin", 59 | "tarPlugin", 60 | "tohtml", 61 | "tutor", 62 | "zipPlugin", 63 | }, 64 | }, 65 | }, 66 | dev = { 67 | path = "~/dev/", 68 | fallback = true, 69 | }, 70 | }) 71 | 72 | -- Some custom commands 73 | require("config/commands") 74 | -------------------------------------------------------------------------------- /vim/UltiSnips/cpp.snippets: -------------------------------------------------------------------------------- 1 | snippet try "try...catch block" b 2 | try { 3 | ${VISUAL}$0 4 | } catch(${1:std::exception& e}) { 5 | ${2:std::cerr << e.what() << std::endl;} 6 | } 7 | endsnippet 8 | 9 | snippet usage "display usage..." b 10 | if (argc != ${1:2}) { 11 | std::cerr << "Usage: " << argv[0] << " <${2:argument}>" << std::endl; 12 | return 1; 13 | }$3 14 | endsnippet 15 | 16 | 17 | snippet once "add #pragma once to header" b 18 | #pragma once 19 | 20 | 21 | endsnippet 22 | 23 | snippet cls "class..." b 24 | class ${1:ClassName} { 25 | public: 26 | private: 27 | }; 28 | endsnippet 29 | 30 | # 生成和file同名的类 31 | snippet classfile "An entire .h generator" b 32 | #pragma once 33 | 34 | class ${1:`!v substitute(substitute(vim_snippets#Filename('$1','ClassName'),'^.','\u&',''), '_\(\w\)', '\u\1', 'g')`} { 35 | public: 36 | 37 | private: 38 | 39 | }; 40 | endsnippet 41 | 42 | snippet vm "main()..." b 43 | int main() { 44 | $0 45 | } 46 | endsnippet 47 | 48 | snippet main "main(int argc, char **argv)..." b 49 | int main(int argc, char **argv) { 50 | $0 51 | } 52 | endsnippet 53 | 54 | snippet ns "using namespace std;" b 55 | using namespace std; 56 | 57 | $0 58 | endsnippet 59 | 60 | snippet cerr "std::cerr << ... << std::endl;" b 61 | std::cerr << ${0} << std::endl; 62 | endsnippet 63 | 64 | snippet debug "insert debug statement" b 65 | std::cerr << "[debug] " << ${0} << std::endl; 66 | endsnippet 67 | 68 | snippet info "insert info statement" b 69 | std::cerr << "[info] " << ${0} << std::endl; 70 | endsnippet 71 | 72 | snippet error "insert error statement" b 73 | std::cerr << "[error] " << ${0} << std::endl; 74 | endsnippet 75 | 76 | snippet sv "std::vector" i 77 | std::vector<${1:int}>$2 78 | endsnippet 79 | 80 | snippet cs "const std::string &" i 81 | const std::string &$1 82 | endsnippet 83 | 84 | snippet ss "std::string" i 85 | std::string$1 86 | endsnippet 87 | 88 | snippet pvec "ostream << vector" b 89 | template 90 | ostream &operator<<(ostream &os, const vector &v) { 91 | os << '['; 92 | char comma[]{'\0', ' ', '\0'}; 93 | for (const auto &e : v) { 94 | os << comma << e; 95 | comma[0] = ','; 96 | } 97 | return os << ']'; 98 | } 99 | 100 | endsnippet 101 | 102 | snippet "(echo|cout)" "cout << ... << endl;" br 103 | $3cout << ${1:"${2:Hello, world!}"} << ${3:std::}endl; 104 | endsnippet 105 | 106 | snippet elapsed 107 | duration(system_clock::now() - start).count() 108 | endsnippet 109 | 110 | snippet fun_elapsed 111 | auto elapsed(const decltype(system_clock::now()) &start) { 112 | return duration(system_clock::now() - start).count(); 113 | } 114 | endsnippet 115 | snippet stream_status "Print stream status" b 116 | void ${1:stream_status}(const std::ios &stream) { 117 | std::cout << "good: " << stream.good() << std::endl; 118 | std::cout << " eof: " << stream.eof() << std::endl; 119 | std::cout << "fail: " << stream.fail() << std::endl; 120 | std::cout << " bad: " << stream.bad() << std::endl; 121 | } 122 | endsnippet 123 | -------------------------------------------------------------------------------- /tilda/config: -------------------------------------------------------------------------------- 1 | tilda_config_version="1.3.3" 2 | # command="" 3 | font="FuraCode Nerd Font 12" 4 | key="grave" 5 | addtab_key="t" 6 | fullscreen_key="F11" 7 | toggle_transparency_key="F12" 8 | toggle_searchbar_key="f" 9 | closetab_key="w" 10 | nexttab_key="Page_Down" 11 | prevtab_key="Page_Up" 12 | movetableft_key="Page_Up" 13 | movetabright_key="Page_Down" 14 | gototab_1_key="1" 15 | gototab_2_key="2" 16 | gototab_3_key="3" 17 | gototab_4_key="4" 18 | gototab_5_key="5" 19 | gototab_6_key="6" 20 | gototab_7_key="7" 21 | gototab_8_key="8" 22 | gototab_9_key="9" 23 | gototab_10_key="0" 24 | copy_key="c" 25 | paste_key="v" 26 | quit_key="q" 27 | title="Tilda" 28 | background_color="white" 29 | # working_dir="" 30 | web_browser="x-www-browser" 31 | increase_font_size_key="equal" 32 | decrease_font_size_key="minus" 33 | normalize_font_size_key="0" 34 | # show_on_monitor="" 35 | word_chars="-A-Za-z0-9,./?%&#:_" 36 | lines=5000 37 | max_width=1274 38 | max_height=727 39 | min_width=1 40 | min_height=1 41 | x_pos=323 42 | y_pos=192 43 | tab_pos=0 44 | expand_tabs=false 45 | show_single_tab=false 46 | backspace_key=0 47 | delete_key=1 48 | d_set_title=3 49 | command_exit=2 50 | scheme=0 51 | slide_sleep_usec=10000 52 | animation_orientation=0 53 | timer_resolution=200 54 | auto_hide_time=2000 55 | on_last_terminal_exit=2 56 | prompt_on_exit=false 57 | palette_scheme=0 58 | non_focus_pull_up_behaviour=0 59 | cursor_shape=0 60 | # show_on_monitor_number=0 61 | # title_max_length_flag=false 62 | title_max_length=25 63 | palette = {10280, 10794, 13878, 65535, 23644, 22359, 23130, 63479, 36494, 65535, 47288, 27756, 22359, 51143, 65535, 48573, 37779, 63993, 0, 65535, 65535, 38036, 41891, 42405, 26728, 26728, 26728, 65535, 23644, 22359, 23130, 63479, 36494, 65535, 47288, 27756, 22359, 51143, 65535, 48573, 37779, 63993, 0, 65535, 65535, 61937, 61937, 61680} 64 | scrollbar_pos=2 65 | back_red=10704 66 | back_green=10704 67 | back_blue=10704 68 | text_red=54227 69 | text_green=55255 70 | text_blue=53199 71 | cursor_red=65535 72 | cursor_green=65535 73 | cursor_blue=65535 74 | scroll_history_infinite=false 75 | scroll_on_output=false 76 | notebook_border=false 77 | antialias=true 78 | scrollbar=false 79 | grab_focus=true 80 | above=false 81 | notaskbar=true 82 | bold=true 83 | blinks=true 84 | scroll_on_key=true 85 | bell=false 86 | run_command=false 87 | pinned=true 88 | animation=false 89 | hidden=true 90 | set_as_desktop=false 91 | centered_horizontally=true 92 | centered_vertically=true 93 | enable_transparency=true 94 | # double_buffer=false 95 | auto_hide_on_focus_lost=false 96 | auto_hide_on_mouse_leave=false 97 | title_behaviour=2 98 | inherit_working_dir=true 99 | command_login_shell=false 100 | start_fullscreen=false 101 | confirm_close_tab=false 102 | # image="" 103 | # scroll_background=false 104 | # use_image=false 105 | transparency=0 106 | back_alpha=52415 107 | -------------------------------------------------------------------------------- /topgrade/topgrade.toml: -------------------------------------------------------------------------------- 1 | # Don't ask for confirmations 2 | #assume_yes = true 3 | 4 | # Disable specific steps - same options as the command line flag 5 | disable = ["containers"] 6 | 7 | # Ignore failures for these steps 8 | #ignore_failures = ["powershell"] 9 | 10 | # Run specific steps - same options as the command line flag 11 | #only = ["system", "emacs"] 12 | 13 | # Do not ask to retry failed steps (default: false) 14 | #no_retry = true 15 | 16 | # Run inside tmux 17 | #run_in_tmux = true 18 | 19 | # List of remote machines with Topgrade installed on them 20 | #remote_topgrades = ["toothless", "pi", "parnas"] 21 | 22 | # Arguments to pass SSH when upgrading remote systems 23 | #ssh_arguments = "-o ConnectTimeout=2" 24 | 25 | # Path to Topgrade executable on remote machines 26 | #remote_topgrade_path = ".cargo/bin/topgrade" 27 | 28 | # Arguments to pass tmux when pulling Repositories 29 | #tmux_arguments = "-S /var/tmux.sock" 30 | 31 | # Do not set the terminal title 32 | #set_title = false 33 | 34 | # Display the time in step titles 35 | # display_time = true 36 | 37 | # Cleanup temporary or old files 38 | #cleanup = true 39 | 40 | [git] 41 | #max_concurrency = 5 42 | # Additional git repositories to pull 43 | #repos = [ 44 | # "~/src/*/", 45 | # "~/.config/something" 46 | #] 47 | 48 | # Don't pull the predefined git repos 49 | #predefined_repos = false 50 | 51 | # Arguments to pass Git when pulling Repositories 52 | #arguments = "--rebase --autostash" 53 | 54 | [composer] 55 | #self_update = true 56 | 57 | # Commands to run before anything 58 | [pre_commands] 59 | #"Emacs Snapshot" = "rm -rf ~/.emacs.d/elpa.bak && cp -rl ~/.emacs.d/elpa ~/.emacs.d/elpa.bak" 60 | 61 | # Custom commands 62 | [commands] 63 | #"Python Environment" = "~/dev/.env/bin/pip install -i https://pypi.python.org/simple -U --upgrade-strategy eager jupyter" 64 | 65 | [brew] 66 | #greedy_cask = true 67 | 68 | [linux] 69 | # Arch Package Manager to use. Allowed values: autodetect, trizen, paru, yay, pacman. 70 | #arch_package_manager = "pacman" 71 | # Arguments to pass yay (or paru) when updating packages 72 | #yay_arguments = "--nodevel" 73 | #show_arch_news = true 74 | #trizen_arguments = "--devel" 75 | #enable_tlmgr = true 76 | #emerge_sync_flags = "-q" 77 | #emerge_update_flags = "-uDNa --with-bdeps=y world" 78 | #redhat_distro_sync = false 79 | #rpm_ostree = false 80 | 81 | [windows] 82 | # Manually select Windows updates 83 | #accept_all_updates = false 84 | #open_remotes_in_new_terminal = true 85 | 86 | # Causes Topgrade to rename itself during the run to allow package managers 87 | # to upgrade it. Use this only if you installed Topgrade by using a package 88 | # manager such as Scoop to Cargo 89 | #self_rename = true 90 | 91 | [npm] 92 | # Use sudo if the NPM directory isn't owned by the current user 93 | #use_sudo = true 94 | 95 | [firmware] 96 | # Offer to update firmware; if false just check for and display available updates 97 | #upgrade = true 98 | 99 | [flatpak] 100 | # Use sudo for updating the system-wide installation 101 | #use_sudo = true 102 | -------------------------------------------------------------------------------- /hyprland/waybar/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | border: none; 3 | border-radius: 0px; 4 | font-family: "JetBrainsMono Nerd Font"; 5 | font-weight: bold; 6 | min-height: 0px; 7 | } 8 | 9 | .topbar { 10 | font-size: 4px; 11 | } 12 | 13 | .botbar { 14 | font-size: 15px; 15 | } 16 | 17 | window#waybar { 18 | background-color: rgba(0, 0, 0, .0); 19 | } 20 | 21 | #battery, 22 | #temperature, 23 | #clock, 24 | #workspaces, 25 | #custom-rofi, 26 | #tray, 27 | #pulseaudio, 28 | #backlight, 29 | #network, 30 | #custom-right, 31 | #custom-left { 32 | color: @main-color; 33 | background: #242424; 34 | margin: 0px 0px 0px 0px; 35 | opacity: 1; 36 | border: 0px solid #181825; 37 | } 38 | 39 | tooltip { 40 | background: @tool-bg; 41 | color: @tool-color; 42 | border-radius: 22px; 43 | border-width: 2px; 44 | border-style: solid; 45 | border-color: #11111b; 46 | } 47 | 48 | #workspaces { 49 | padding: 0px; 50 | opacity: 0.6; 51 | border: none; 52 | } 53 | 54 | #workspaces button { 55 | background: #a6d189; 56 | opacity: 0.5; 57 | box-shadow: none; 58 | text-shadow: none; 59 | border-radius: 4px; 60 | padding: 0px; 61 | margin: 0px 5px 0px 5px; 62 | padding-left: 230px; 63 | padding-right: 230px; 64 | animation: gradient_f 20s ease-in infinite; 65 | transition: all 0.5s cubic-bezier(.55,-0.68,.48,1.682); 66 | } 67 | 68 | #workspaces button.empty { 69 | opacity: .1; 70 | } 71 | 72 | #workspaces button:hover { 73 | background: #81C8BE; 74 | opacity: 0.8; 75 | } 76 | 77 | #workspaces button.active { 78 | background: #81C8BE; 79 | opacity: 1; 80 | padding-left: 240px; 81 | padding-right: 240px; 82 | } 83 | 84 | #custom-rofi { 85 | color: #38ef7d; 86 | padding-left: 0px; 87 | padding-right: 10px; 88 | } 89 | 90 | #temperature { 91 | color: #eebd35; 92 | padding-left: 0px; 93 | padding-right: 19px; 94 | } 95 | 96 | #temperature.critical { 97 | color: #ff0000; 98 | padding-left: 0px; 99 | padding-right: 19px; 100 | } 101 | 102 | #backlight { 103 | color: #FF8B49; 104 | padding-left: 0px; 105 | padding-right: 19px; 106 | } 107 | 108 | #pulseaudio { 109 | color: #EA879D; 110 | padding-left: 0px; 111 | padding-right: 19px; 112 | } 113 | 114 | #battery { 115 | color: #458588; 116 | padding-left: 0px; 117 | padding-right: 0px; 118 | } 119 | 120 | #tray { 121 | padding-left: 0px; 122 | padding-right: 19px; 123 | } 124 | 125 | #network { 126 | padding-left: 0px; 127 | padding-right: 19px; 128 | } 129 | 130 | #clock { 131 | color: #73B580; 132 | padding-left: 0px; 133 | padding-right: 0px; 134 | } 135 | 136 | #custom-right { 137 | margin-right: 9px; 138 | padding-right: 3px; 139 | border-radius: 0px 22px 22px 0px; 140 | } 141 | 142 | #custom-left { 143 | margin-left: 9px; 144 | padding-left: 3px; 145 | border-radius: 22px 0px 0px 22px; 146 | } 147 | -------------------------------------------------------------------------------- /vim/nvim/lua/config/keymaps.lua: -------------------------------------------------------------------------------- 1 | local keymap = vim.keymap.set 2 | 3 | -- stylua: ignore start 4 | keymap("n", "", "q", { noremap = true }) 5 | keymap("n", "", "x", { noremap = true }) 6 | 7 | keymap("n", "", "gccj", { remap = true, desc = "Comment line" }) 8 | keymap("v", "", "gcj", { remap = true, desc = "Comment line" }) 9 | keymap("n", "", "gccj", { remap = true, desc = "which_key_ignore" }) 10 | keymap("v", "", "gcj", { remap = true, desc = "which_key_ignore" }) 11 | 12 | keymap('n', 'zj', 'ok', { noremap = true, desc = "Insert line below" }) 13 | keymap('n', 'zk', 'Oj', { noremap = true, desc = "Insert line above" }) 14 | keymap('n', 'zl', 'i l', { noremap = true, desc = "Insert space after" }) 15 | 16 | keymap('n', 'gp', '`[v`]', { noremap = true, silent = true, desc = "Select last paste" }) 17 | keymap('x', 'p', 'pgvy', { noremap = true, silent = true, desc = "Paste multiple times" }) 18 | 19 | -- Quickly move in normal mode 20 | keymap('n', '', '', { noremap = true, desc = "Scroll up" }) 21 | keymap('n', '', '', { noremap = true, desc = "Scroll down" }) 22 | keymap('n', '', 'A', { noremap = true, desc = "Append at end of line" }) 23 | keymap('n', '', 'I', { noremap = true, desc = "Insert at start of line" }) 24 | 25 | -- Move between windows quickly 26 | keymap('n', '', 'h', { noremap = true, desc = "Move to left window" }) 27 | keymap('n', '', 'j', { noremap = true, desc = "Move to bottom window" }) 28 | keymap('n', '', 'k', { noremap = true, desc = "Move to top window" }) 29 | keymap('n', '', 'l', { noremap = true, desc = "Move to right window" }) 30 | 31 | -- Extra readline-style keymaps 32 | keymap('i', '', '', { noremap = true, desc = "Move to start of line" }) 33 | keymap('i', '', '', { noremap = true, desc = "Move to end of line" }) 34 | keymap('i', '', '', { noremap = true, desc = "Delete previous character" }) 35 | keymap('i', '', '', { noremap = true, desc = "Delete next character" }) 36 | keymap('i', '', '', { noremap = true, desc = "Move right" }) 37 | keymap('i', '', '', { noremap = true, desc = "Move left" }) 38 | -- In insert mode, pressing Ctrl-O switches to normal mode for one command, then switches back to insert mode when the command is finished. 39 | keymap('i', '', 'D', { noremap = true, desc = "Delete to start of line" }) 40 | keymap('i', '', 'v0c', { noremap = true, desc = "Delete to start of line" }) 41 | 42 | keymap('n', '', ':set wrap!', { noremap = true, desc = "Toggle wrap" }) 43 | 44 | -- nnoremap p :echo expand('') 45 | keymap('n', 'tr', 'execute ":!clitrans " .. expand("")', { noremap = true, desc = "Translate word" }) 46 | 47 | keymap('n', '', '', { noremap = false, desc = "Jump to tag" }) 48 | 49 | -- c-v to paste from clipboard 50 | keymap({ "i", "c" }, "", "*", { noremap = true, desc = "Paste from clipboard" }) 51 | 52 | keymap('n', 'l', ":.lua", { noremap = true, desc = "Run lua code" }) 53 | keymap('v', 'l', ":lua", { noremap = true, desc = "Run lua code" }) 54 | -------------------------------------------------------------------------------- /sdk/python/ptpythonrc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Configuration example for ``ptpython``. 5 | 6 | Copy this file to ~/.ptpython/config.py 7 | """ 8 | 9 | __all__ = ( 10 | 'configure', 11 | ) 12 | 13 | 14 | def configure(repl): 15 | """ 16 | Configuration method. This is called during the start-up of ptpython. 17 | 18 | :param repl: `PythonRepl` instance. 19 | """ 20 | # Show function signature (bool). 21 | repl.show_signature = True 22 | 23 | # Show docstring (bool). 24 | repl.show_docstring = True 25 | 26 | # Show the "[Meta+Enter] Execute" message when pressing [Enter] only 27 | # inserts a newline instead of executing the code. 28 | repl.show_meta_enter_message = True 29 | 30 | # Show line numbers (when the input contains multiple lines.) 31 | repl.show_line_numbers = True 32 | 33 | # Show status bar. 34 | repl.show_status_bar = True 35 | 36 | # When the sidebar is visible, also show the help text. 37 | repl.show_sidebar_help = True 38 | 39 | # Highlight matching parethesis. 40 | repl.highlight_matching_parenthesis = True 41 | 42 | # Line wrapping. (Instead of horizontal scrolling.) 43 | repl.wrap_lines = True 44 | 45 | # Mouse support. 46 | repl.enable_mouse_support = True 47 | 48 | # Complete while typing. (Don't require tab before the 49 | # completion menu is shown.) 50 | repl.complete_while_typing = True 51 | 52 | # Vi mode. 53 | repl.vi_mode = False 54 | 55 | # Paste mode. (When True, don't insert whitespace after new line.) 56 | repl.paste_mode = False 57 | 58 | # Use the classic prompt. (Display '>>>' instead of 'In [1]'.) 59 | repl.prompt_style = 'ipython' # 'classic' or 'ipython' 60 | 61 | # History Search. 62 | # When True, going back in history will filter the history on the records 63 | # starting with the current input. (Like readline.) 64 | # Note: When enable, please disable the `complete_while_typing` option. 65 | # otherwise, when there is a completion available, the arrows will 66 | # browse through the available completions instead of the history. 67 | repl.enable_history_search = False 68 | 69 | # Enable auto suggestions. (Pressing right arrow will complete the input, 70 | # based on the history.) 71 | repl.enable_auto_suggest = True 72 | 73 | # Enable open-in-editor. Pressing C-X C-E in emacs mode or 'v' in 74 | # Vi navigation mode will open the input in the current editor. 75 | repl.enable_open_in_editor = True 76 | 77 | # Enable system prompt. Pressing meta-! will display the system prompt. 78 | # Also enables Control-Z suspend. 79 | repl.enable_system_bindings = True 80 | 81 | # Ask for confirmation on exit. 82 | repl.confirm_exit = False 83 | 84 | # Enable input validation. (Don't try to execute when the input contains 85 | # syntax errors.) 86 | repl.enable_input_validation = True 87 | 88 | # Use this colorscheme for the code. 89 | repl.use_code_colorscheme('stata-dark') 90 | 91 | # repl.color_depth = "DEPTH_8_BIT" # The default, 256 colors. 92 | repl.color_depth = "DEPTH_24_BIT" # True color. 93 | 94 | # Syntax. 95 | repl.enable_syntax_highlighting = True 96 | -------------------------------------------------------------------------------- /kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | # Fonts 2 | 3 | # fit size(dpi=96): 24, with CJK 4 | # font_family Iosevka Term 5 | # italic_font Iosevka Term Italic 6 | # bold_font Iosevka Term Bold 7 | # bold_italic_font Iosevka Term Bold Italic 8 | 9 | # fit size(dpi=96): 24, with CJK 10 | # font_family Sarasa Term SC 11 | # italic_font Sarasa Term SC Italic 12 | # bold_font Sarasa Term SC Bold 13 | # bold_italic_font Sarasa Term SC Bold Italic 14 | 15 | # fit size(dpi=96): 20/24, ligatures works good 16 | # font_family FiraCode Nerd Font Mono 17 | # bold_font FiraCode Nerd Font Mono Bold 18 | 19 | # fit size(dpi=96): 20, ligatures works good 20 | # font_family Hasklug Nerd Font Mono 21 | # italic_font Hasklug Nerd Font Mono Italic 22 | # bold_font Hasklug Nerd Font Mono Semibold 23 | # bold_italic_font Hasklug Nerd Font Mono Semibold Italic 24 | 25 | font_family JetBrainsMono NFM 26 | italic_font JetBrainsMono NFM Italic 27 | bold_font JetBrainsMono NFM Bold 28 | bold_italic_font JetBrainsMono NFM Bold Italic 29 | 30 | font_size 12 31 | disable_ligatures cursor 32 | 33 | # 80 chars: ################################################################### 34 | # 100 chars: ####################################################################################### 35 | # 120 chars: ########################################################################################################### 36 | 37 | adjust_line_height 0 38 | adjust_column_width 0 39 | # box_drawing_scale 0.001, 1, 1.5, 2 40 | 41 | # Underline 42 | modify_font underline_position 9 43 | # modify_font underline_thickness 100% 44 | # modify_font strikethrough_position 2px 45 | 46 | # Cursor 47 | cursor_shape block 48 | cursor_blink_interval 0 49 | # cursor_stop_blinking_after 15.0 50 | # cursor_trail 5 51 | 52 | # Scrollback 53 | scrollback_lines 2000 54 | scrollback_pager /usr/bin/less 55 | wheel_scroll_multiplier 5.0 56 | 57 | # URLs 58 | url_style double 59 | open_url_modifiers ctrl+shift 60 | open_url_with firefox 61 | copy_on_select yes 62 | 63 | # Selection 64 | rectangle_select_modifiers ctrl+shift 65 | select_by_word_characters :@-./_~?&=%+# 66 | 67 | # Mouse 68 | click_interval 0.5 69 | mouse_hide_wait 0 70 | focus_follows_mouse no 71 | 72 | # Bell 73 | visual_bell_duration 0.0 74 | enable_audio_bell no 75 | 76 | # Window 77 | remember_window_size no 78 | initial_window_width 700 79 | initial_window_height 400 80 | window_border_width 0 81 | window_margin_width 0 82 | window_padding_width 0 83 | inactive_text_alpha 1.0 84 | background_opacity 1.0 85 | confirm_os_window_close 0 86 | 87 | # Layouts 88 | enabled_layouts * 89 | 90 | # Tabs 91 | tab_bar_edge bottom 92 | tab_separator " ┇" 93 | active_tab_font_style bold 94 | inactive_tab_font_style normal 95 | 96 | # Shell 97 | shell . 98 | close_on_child_death no 99 | allow_remote_control yes 100 | term xterm-kitty 101 | 102 | # Keys 103 | map super+v paste_from_clipboard 104 | map super+c copy_to_clipboard 105 | map ctrl+= increase_font_size 106 | map ctrl+- decrease_font_size 107 | map ctrl+0 restore_font_size 108 | 109 | macos_option_as_alt yes 110 | 111 | # disable new_window keymap 112 | map cmd+enter 113 | 114 | include local.conf 115 | 116 | # BEGIN_KITTY_THEME 117 | # Catppuccin-Frappe 118 | include current-theme.conf 119 | # END_KITTY_THEME 120 | -------------------------------------------------------------------------------- /sdk/python/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ################################################################################ 3 | # Author: Wenxuan Zhang # 4 | # Email: wenxuangm@gmail.com # 5 | # Created: 2020-01-03 18:39 # 6 | ################################################################################ 7 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) 8 | 9 | loginfo() { printf "%b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$@" >&2; } 10 | logwarn() { printf "%b[warn]%b %s\n" '\e[0;33m\033[1m' '\e[0m' "$@" >&2; } 11 | logerror() { printf "%b[error]%b %s\n" '\e[0;31m\033[1m' '\e[0m' "$@" >&2; } 12 | 13 | install_pyenv() { 14 | # pyenv 15 | export PATH="$HOME/.pyenv/bin:$PATH" 16 | if ! hash pyenv &>/dev/null; then 17 | trap 'rm -rf $TEMP' EXIT INT TERM HUP 18 | TEMP="$(mktemp -dt "$(basename "$0")".XXXXXX)" 19 | local installer="$TEMP/installer" 20 | local installer_url=https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer 21 | if ! curl -fsSL "$installer_url" >"$installer"; then 22 | logwarn "directly download failed. try git clone..." 23 | (cd "$TEMP" && git clone --depth=1 https://github.com/pyenv/pyenv-installer && 24 | bash pyenv-installer/bin/pyenv-installer) || return 1 25 | fi 26 | 27 | bash "$installer" || return 1 28 | else 29 | pyenv update 30 | fi 31 | eval "$(pyenv init -)" 32 | eval "$(pyenv virtualenv-init -)" 33 | } 34 | 35 | install_python() { 36 | export PYTHON_CONFIGURE_OPTS="--enable-shared" 37 | # python 38 | v=3.11.1 39 | if ! pyenv versions | grep $v &>/dev/null; then 40 | # pkg=Python-$v.tar.xz 41 | # mkdir -p ~/.pyenv/cache 42 | # if [[ ! -f ~/.pyenv/cache/$pkg ]]; then 43 | # wget http://mirrors.sohu.com/python/$v/$pkg -P /tmp && mv /tmp/$pkg ~/.pyenv/cache/ || return 1 44 | # fi 45 | # https://github.com/pyenv/pyenv/wiki/Common-build-problems 46 | if hash apt 2>/dev/null; then 47 | sudo apt update 48 | sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \ 49 | libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ 50 | xz-utils tk-dev libffi-dev liblzma-dev python-openssl git libedit-dev 51 | fi 52 | pyenv install $v || return 1 53 | fi 54 | pyenv global $v 55 | } 56 | 57 | install_configs() { 58 | mkdir -p "$HOME/.pip" || return 1 59 | ln -sf "$SDIR/pip.conf" "$HOME/.pip/pip.conf" 60 | mkdir -p ~/.config/ptpython || return 1 61 | ln -sf "$SDIR/ptpythonrc" ~/.config/ptpython/config.py 62 | ln -sf "$SDIR/style.yapf" ~/.style.yapf 63 | ln -sf "$SDIR/flake8" ~/.config/flake8 64 | ln -sf "$SDIR/pylintrc" ~/.config/pylintrc 65 | } 66 | 67 | install_tools() { 68 | pip install --upgrade pip 69 | pip install pipenv 70 | 71 | pip install jsbeautifier # json formater 72 | pip install pygments # tags engine 73 | 74 | # Formatter / Repl / Linter 75 | pip install ptpython ipython yapf pylint 76 | } 77 | 78 | loginfo "install pyenv..." 79 | install_pyenv || exit $? 80 | 81 | loginfo "install python..." 82 | install_python || exit $? 83 | 84 | loginfo "install configurations..." 85 | install_configs || exit $? 86 | 87 | loginfo "install tools" 88 | install_tools || exit $? 89 | -------------------------------------------------------------------------------- /eza/catppuccin.yml: -------------------------------------------------------------------------------- 1 | colourful: true 2 | 3 | filekinds: 4 | normal: {foreground: "#c6d0f5"} 5 | directory: {foreground: "#8caaee"} 6 | symlink: {foreground: "#89DCEB"} 7 | pipe: {foreground: "#7F849C"} 8 | block_device: {foreground: "#EBA0AC"} 9 | char_device: {foreground: "#EBA0AC"} 10 | socket: {foreground: "#585B70"} 11 | special: {foreground: "#CBA6F7"} 12 | executable: {foreground: "#A6E3A1"} 13 | mount_point: {foreground: "#74C7EC"} 14 | 15 | perms: 16 | user_read: {foreground: "#e5c890"} 17 | group_read: {foreground: "#e5c890"} 18 | other_read: {foreground: "#e5c890"} 19 | 20 | user_write: {foreground: "#e78284"} 21 | group_write: {foreground: "#e78284"} 22 | other_write: {foreground: "#e78284"} 23 | 24 | user_execute_file: {foreground: "#a6d189"} 25 | user_execute_other: {foreground: "#a6d189"} 26 | group_execute: {foreground: "#a6d189"} 27 | other_execute: {foreground: "#a6d189"} 28 | 29 | special_user_file: {foreground: "#CBA6F7"} 30 | special_other: {foreground: "#585B70"} 31 | attribute: {foreground: "#A6ADC8"} 32 | 33 | size: 34 | major: {foreground: "#A6ADC8"} 35 | minor: {foreground: "#89DCEB"} 36 | number_byte: {foreground: "#CDD6F4"} 37 | number_kilo: {foreground: "#BAC2DE"} 38 | number_mega: {foreground: "#89B4FA"} 39 | number_giga: {foreground: "#CBA6F7"} 40 | number_huge: {foreground: "#CBA6F7"} 41 | unit_byte: {foreground: "#A6ADC8"} 42 | unit_kilo: {foreground: "#89B4FA"} 43 | unit_mega: {foreground: "#CBA6F7"} 44 | unit_giga: {foreground: "#CBA6F7"} 45 | unit_huge: {foreground: "#74C7EC"} 46 | 47 | users: 48 | user_you: {foreground: "#eebebe"} 49 | group_yours: {foreground: "#eebebe"} 50 | user_other: {foreground: "#CBA6F7"} 51 | group_other: {foreground: "#CBA6F7"} 52 | user_root: {foreground: "#F38BA8"} 53 | group_root: {foreground: "#F38BA8"} 54 | 55 | links: 56 | normal: {foreground: "#89DCEB"} 57 | multi_link_file: {foreground: "#74C7EC"} 58 | 59 | git: 60 | new: {foreground: "#A6E3A1"} 61 | modified: {foreground: "#F9E2AF"} 62 | deleted: {foreground: "#F38BA8"} 63 | renamed: {foreground: "#94E2D5"} 64 | typechange: {foreground: "#F5C2E7"} 65 | ignored: {foreground: "#7F849C"} 66 | conflicted: {foreground: "#EBA0AC"} 67 | 68 | git_repo: 69 | branch_main: {foreground: "#CDD6F4"} 70 | branch_other: {foreground: "#CBA6F7"} 71 | git_clean: {foreground: "#A6E3A1"} 72 | git_dirty: {foreground: "#F38BA8"} 73 | 74 | security_context: 75 | colon: {foreground: "#7F849C"} 76 | user: {foreground: "#BAC2DE"} 77 | role: {foreground: "#CBA6F7"} 78 | typ: {foreground: "#585B70"} 79 | range: {foreground: "#CBA6F7"} 80 | 81 | file_type: 82 | image: {foreground: "#F9E2AF"} 83 | video: {foreground: "#F38BA8"} 84 | music: {foreground: "#A6E3A1"} 85 | lossless: {foreground: "#94E2D5"} 86 | crypto: {foreground: "#585B70"} 87 | document: {foreground: "#CDD6F4"} 88 | compressed: {foreground: "#F5C2E7"} 89 | temp: {foreground: "#EBA0AC"} 90 | compiled: {foreground: "#74C7EC"} 91 | build: {foreground: "#EF9F76"} 92 | source: {foreground: "#89B4FA"} 93 | 94 | punctuation: {foreground: "#7F849C"} 95 | date: {foreground: "#8CAAEE"} 96 | inode: {foreground: "#A6ADC8"} 97 | blocks: {foreground: "#9399B2"} 98 | header: {foreground: "#CDD6F4"} 99 | octal: {foreground: "#94E2D5"} 100 | flags: {foreground: "#CBA6F7"} 101 | 102 | symlink_path: {foreground: "#89DCEB"} 103 | control_char: {foreground: "#74C7EC"} 104 | broken_symlink: {foreground: "#F38BA8"} 105 | broken_path_overlay: {foreground: "#585B70"} 106 | -------------------------------------------------------------------------------- /hyprland/fuzzel/fuzzel.ini: -------------------------------------------------------------------------------- 1 | # output= 2 | font=JetBrainsMono NFM:size=14 3 | # dpi-aware=auto 4 | # use-bold=no 5 | # prompt="> " 6 | # placeholder= 7 | # icon-theme=hicolor 8 | # icons-enabled=yes 9 | # hide-before-typing=no 10 | # fields=filename,name,generic 11 | # password-character=* 12 | # filter-desktop=no 13 | # match-mode=fzf 14 | # sort-result=yes 15 | # match-counter=no 16 | # delayed-filter-ms=300 17 | # delayed-filter-limit=20000 18 | # show-actions=no 19 | # terminal=$TERMINAL -e # Note: you cannot actually use environment variables here 20 | # launch-prefix= 21 | # list-executables-in-path=no 22 | 23 | # anchor=center 24 | # x-margin=0 25 | # y-margin=0 26 | # lines=15 27 | width=32 28 | # tabs=8 29 | horizontal-pad=16 30 | vertical-pad=9 31 | # inner-pad=0 32 | 33 | # image-size-ratio=0.5 34 | 35 | # line-height= 36 | # letter-spacing=0 37 | 38 | # layer=overlay 39 | # exit-on-keyboard-focus-loss=yes 40 | 41 | # cache= 42 | 43 | # render-workers= 44 | # match-workers= 45 | 46 | 47 | [colors] 48 | background=414559ee 49 | text=c6d0f5ff 50 | prompt=b5bfe2ff 51 | placeholder=838ba7ff 52 | input=c6d0f5ff 53 | match=99d1dbff 54 | selection=626880ff 55 | selection-text=c6d0f5ff 56 | selection-match=99d1dbff 57 | counter=838ba7ff 58 | border=99d1dbff 59 | 60 | [border] 61 | radius=5 62 | width=0 63 | 64 | [colors] 65 | # background=fdf6e3ff 66 | # text=657b83ff 67 | # prompt=586e75ff 68 | # placeholder=93a1a1ff 69 | # input=657b83ff 70 | # match=cb4b16ff 71 | # selection=eee8d5ff 72 | # selection-text=586e75ff 73 | # selection-match=cb4b16ff 74 | # counter=93a1a1ff 75 | # border=002b36ff 76 | 77 | [border] 78 | # width=1 79 | # radius=10 80 | 81 | [dmenu] 82 | # mode=text # text|index 83 | # exit-immediately-if-empty=no 84 | 85 | [key-bindings] 86 | # cancel=Escape Control+g Control+c Control+bracketleft 87 | # execute=Return KP_Enter Control+y 88 | # execute-or-next=Tab 89 | # execute-input=Shift+Return Shift+KP_Enter 90 | # cursor-left=Left Control+b 91 | # cursor-left-word=Control+Left Mod1+b 92 | # cursor-right=Right Control+f 93 | # cursor-right-word=Control+Right Mod1+f 94 | # cursor-home=Home Control+a 95 | # cursor-end=End Control+e 96 | # delete-prev=BackSpace Control+h 97 | # delete-prev-word=Mod1+BackSpace Control+BackSpace Control+w 98 | # delete-line-backward=Control+u 99 | # delete-next=Delete KP_Delete Control+d 100 | # delete-next-word=Mod1+d Control+Delete Control+KP_Delete 101 | # delete-line-forward=Control+k 102 | # prev=Up Control+p 103 | # prev-with-wrap=ISO_Left_Tab 104 | # prev-page=Page_Up KP_Page_Up 105 | # next=Down Control+n 106 | # next-with-wrap=none 107 | # next-page=Page_Down KP_Page_Down 108 | # expunge=Shift+Delete 109 | # clipboard-paste=Control+v XF86Paste 110 | # primary-paste=Shift+Insert Shift+KP_Insert 111 | 112 | # custom-N: *dmenu mode only*. Like execute, but with a non-zero 113 | # exit-code; custom-1 exits with code 10, custom-2 with 11, custom-3 114 | # with 12, and so on. 115 | 116 | # custom-1=Mod1+1 117 | # custom-2=Mod1+2 118 | # custom-3=Mod1+3 119 | # custom-4=Mod1+4 120 | # custom-5=Mod1+5 121 | # custom-6=Mod1+6 122 | # custom-7=Mod1+7 123 | # custom-8=Mod1+8 124 | # custom-9=Mod1+9 125 | # custom-10=Mod1+0 126 | # custom-11=Mod1+exclam 127 | # custom-12=Mod1+at 128 | # custom-13=Mod1+numbersign 129 | # custom-14=Mod1+dollar 130 | # custom-15=Mod1+percent 131 | # custom-16=Mod1+dead_circumflex 132 | # custom-17=Mod1+ampersand 133 | # custom-18=Mod1+asterix 134 | # custom-19=Mod1+parentleft 135 | -------------------------------------------------------------------------------- /arch/pacman.conf: -------------------------------------------------------------------------------- 1 | # 2 | # /etc/pacman.conf 3 | # 4 | # See the pacman.conf(5) manpage for option and repository directives 5 | 6 | # 7 | # GENERAL OPTIONS 8 | # 9 | [options] 10 | # The following paths are commented out with their default values listed. 11 | # If you wish to use different paths, uncomment and update the paths. 12 | #RootDir = / 13 | #DBPath = /var/lib/pacman/ 14 | #CacheDir = /var/cache/pacman/pkg/ 15 | #LogFile = /var/log/pacman.log 16 | #GPGDir = /etc/pacman.d/gnupg/ 17 | #HookDir = /etc/pacman.d/hooks/ 18 | HoldPkg = pacman glibc 19 | #XferCommand = /usr/bin/curl -L -C - -f -o %o %u 20 | #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u 21 | #CleanMethod = KeepInstalled 22 | Architecture = auto 23 | 24 | # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup 25 | #IgnorePkg = 26 | #IgnoreGroup = 27 | 28 | #NoUpgrade = 29 | #NoExtract = 30 | 31 | # Misc options 32 | #UseSyslog 33 | Color 34 | #NoProgressBar 35 | CheckSpace 36 | #VerbosePkgLists 37 | ParallelDownloads = 10 38 | DownloadUser = alpm 39 | #DisableSandbox 40 | 41 | # By default, pacman accepts packages signed by keys that its local keyring 42 | # trusts (see pacman-key and its man page), as well as unsigned packages. 43 | SigLevel = Required DatabaseOptional 44 | LocalFileSigLevel = Optional 45 | #RemoteFileSigLevel = Required 46 | 47 | # NOTE: You must run `pacman-key --init` before first using pacman; the local 48 | # keyring can then be populated with the keys of all official Arch Linux 49 | # packagers with `pacman-key --populate archlinux`. 50 | 51 | # 52 | # REPOSITORIES 53 | # - can be defined here or included from another file 54 | # - pacman will search repositories in the order defined here 55 | # - local/custom mirrors can be added here or in separate files 56 | # - repositories listed first will take precedence when packages 57 | # have identical names, regardless of version number 58 | # - URLs will have $repo replaced by the name of the current repo 59 | # - URLs will have $arch replaced by the name of the architecture 60 | # 61 | # Repository entries are of the format: 62 | # [repo-name] 63 | # Server = ServerName 64 | # Include = IncludePath 65 | # 66 | # The header [repo-name] is crucial - it must be present and 67 | # uncommented to enable the repo. 68 | # 69 | 70 | # The testing repositories are disabled by default. To enable, uncomment the 71 | # repo name header and Include lines. You can add preferred servers immediately 72 | # after the header, and they will be used before the default mirrors. 73 | 74 | #[core-testing] 75 | #Include = /etc/pacman.d/mirrorlist 76 | 77 | [core] 78 | Include = /etc/pacman.d/mirrorlist 79 | 80 | #[extra-testing] 81 | #Include = /etc/pacman.d/mirrorlist 82 | 83 | [extra] 84 | Include = /etc/pacman.d/mirrorlist 85 | 86 | # If you want to run 32 bit applications on your x86_64 system, 87 | # enable the multilib repositories as required here. 88 | 89 | #[multilib-testing] 90 | #Include = /etc/pacman.d/mirrorlist 91 | 92 | #[multilib] 93 | #Include = /etc/pacman.d/mirrorlist 94 | 95 | # An example of a custom package repository. See the pacman manpage for 96 | # tips on creating your own repositories. 97 | #[custom] 98 | #SigLevel = Optional TrustAll 99 | #Server = file:///home/custompkgs 100 | 101 | [archlinuxcn] 102 | # Server = https://repo.archlinuxcn.org/$arch 103 | Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch 104 | # Server = https://mirrors.163.com/archlinux-cn/$arch 105 | # Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch 106 | -------------------------------------------------------------------------------- /qemu/centos7.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | info() { printf "%b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$*" >&2; } 6 | warn() { printf "%b[warn]%b %s\n" '\e[0;33m\033[1m' '\e[0m' "$*" >&2; } 7 | erro() { printf "%b[erro]%b %s\n" '\e[0;31m\033[1m' '\e[0m' "$*" >&2; } 8 | 9 | # sudo yum list installed > packages.txt 10 | # sudo yum -y install $(cat packages.txt) 11 | 12 | vm=centos7 13 | vm_hostname=$vm 14 | vm_instance_id=$vm 15 | vm_user=$(id -un) 16 | vm_mem=$((24 * 1024)) 17 | vm_cpus=$(nproc) 18 | 19 | vmdir=/var/lib/libvirt/images/$vm 20 | image=CentOS-7-x86_64-GenericCloud.qcow2 21 | 22 | if [ ! -f $image ]; then 23 | info "Download CentOS 7 cloud image from https://cloud.centos.org/centos/7/images/" 24 | wget https://cloud.centos.org/centos/7/images/$image.xz 25 | 26 | info "Extract the image" 27 | xz -d -v $image.xz 28 | fi 29 | 30 | sudo mkdir -vp $vmdir 31 | info "Copy the image to $vmdir" 32 | sudo cp CentOS-7-x86_64-GenericCloud.qcow2 $vmdir/$vm.qcow2 33 | 34 | cat <> /var/log/cloud-init.log" 73 | EOF 74 | 75 | info "Resize the image" 76 | sudo qemu-img resize $vmdir/$vm.qcow2 +60G 77 | 78 | info "Create the cloud-init iso" 79 | # sudo apt install mkisofs 80 | sudo mkisofs -o $vmdir/$vm-cidata.iso -V cidata -r -J $vmdir/meta-data $vmdir/user-data 81 | 82 | info "Create the VM" 83 | # sudo apt install virt-manager 84 | sudo virt-install --import --name $vm \ 85 | --memory "$vm_mem" \ 86 | --vcpus "$vm_cpus" \ 87 | --cpu host \ 88 | --disk $vmdir/$vm.qcow2,format=qcow2,bus=virtio \ 89 | --disk $vmdir/$vm-cidata.iso,device=cdrom \ 90 | --network bridge=virbr0,model=virtio \ 91 | --os-variant=rhel7.5 \ 92 | --graphics spice \ 93 | --noautoconsole 94 | 95 | # sudo virsh change-media $vm sda --eject --config 96 | # sudo rm -rf $vmdir/meta-data $vmdir/user-data $vmdir/$vm-cidata.iso 97 | 98 | info "Find the ip address of the VM" 99 | vm_mac=$(sudo virsh dumpxml centos7 | grep -Po "(?<=mac address=').*(?='.*)") 100 | info "VM $vm mac address: $vm_mac" 101 | 102 | retries=10 103 | for i in $(seq 1 $retries); do 104 | vm_ip=$(sudo virsh net-dhcp-leases default --mac "$vm_mac" | grep -Po '(\d+\.){3}\d+' || true) 105 | if [ -n "$vm_ip" ]; then 106 | break 107 | fi 108 | info "Try to get VM $vm ip address again($i/$retries)" 109 | sleep 3 110 | done 111 | 112 | if [ -z "$vm_ip" ]; then 113 | erro "Failed to get VM $vm ip address" 114 | exit 1 115 | fi 116 | info "VM $vm ip address: $vm_ip" 117 | 118 | # sudo apt install libguestfs-tools 119 | -------------------------------------------------------------------------------- /zsh/zsh_aliases: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | unalias mv rm cd mkdir 2>/dev/null; 3 | 4 | # make sudo support alias 5 | alias sudo='sudo ' 6 | alias usudo='sudo -E -s ' 7 | 8 | alias dot='cd ~/dotfiles' 9 | alias tmp='cd /tmp' 10 | 11 | alias mks='tmux kill-session -t' 12 | alias mkS='tmux kill-server' 13 | alias mv='mv -iv' 14 | [[ "$OSTYPE" =~ linux ]] && alias rm='rm -Iv --one-file-system' || alias rm='rm -iv' 15 | alias ..='cd ..' 16 | alias ...='cd ../..' 17 | alias ....='cd ../../..' 18 | alias .....='cd ../../../..' 19 | alias cdr='cd "$(git rev-parse --show-toplevel)"' 20 | (( $+commands[tac] )) || alias tac='tail -r' 21 | (( $+commands[nvim] )) && alias vim='nvim' 22 | alias svi='usudo vim' 23 | alias svim='svi' 24 | (( $+commands[bat] )) && alias cat='bat' 25 | alias pvim='vim -u NONE' 26 | 27 | alias ls='ls --color=auto' 28 | alias ll='ls --group-directories-first -l' 29 | alias la='ls --group-directories-first -l --all' 30 | if (( $+commands[eza] )); then 31 | alias ls='eza --time-style long-iso --group-directories-first -m' 32 | alias ll='ls --icons -lgbh' 33 | alias la='ll -a' 34 | alias ldot='ll -d .*' 35 | alias lss='ll -s size' 36 | alias lst='ll -s modified' 37 | alias tree='ls --icons --tree' 38 | fi 39 | alias vv='vim $(fzf)' 40 | alias vi=vim 41 | alias vi2='vim -O2' 42 | alias vw=gvim 43 | alias em='emacsclient -t' 44 | alias ew='emacsclient -c -a emacs' 45 | 46 | # copy alias 47 | alias pc='pbcopy' 48 | alias pp='pbpaste' 49 | 50 | # Archlinux 51 | # -F Causes less to automatically exit if the entire file can be displayed on one screen 52 | (( $+commands[pacman] )) && alias autoremove='pacman -R $(pacman -Qdtq)' 53 | 54 | (( $+commands[lein] )) && alias lrepl='lein repl :connect 59237' 55 | 56 | # Edit dotfile in repo 57 | function vim_linked() { vim "$(readlink "$1")" } 58 | alias zshrc='vim_linked ~/.zshrc' 59 | alias zshenv='vim_linked ~/.zshenv' 60 | alias zshfzf='vim_linked ~/.config/zsh/zsh_fzf_extra' 61 | alias zshalias='vim_linked ~/.config/zsh/zsh_aliases' 62 | alias zshcustom='vim_linked ~/.config/zsh/zsh_custom' 63 | alias zshmisc='vim_linked ~/.config/zsh/zsh_misc' 64 | alias zshlocal='vim ~/.config/zsh/zsh_local' 65 | alias zshsec='vim_linked ~/.config/zsh/zsh_secret' 66 | alias tmuxconf='vim_linked ~/.tmux.conf' 67 | 68 | alias csort='LC_ALL=C sort' 69 | 70 | alias localdocker='DOCKER_HOST= DOCKER_TLS_PATH= DOCKER_TLS_VERIFY= docker' 71 | (( $+commands[cargo] )) && alias rust-musl-builder='localdocker run --rm --name rust-musl-builder -it -v "$(pwd)":/home/rust/src ekidd/rust-musl-builder' 72 | 73 | # https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/git.plugin.zsh 74 | alias gc='git commit -v' 75 | alias gb='git branch' 76 | alias gl='git pull' 77 | alias gp='git push' 78 | alias gpu='git push upstream' 79 | # alias gco='git checkout' 80 | alias gst='git status' 81 | alias gstu='git status -uno' 82 | alias gs='git stash' 83 | alias gsp='git stash pop' 84 | alias gr='git rebase' 85 | 86 | alias mycli='LESS="-S $LESS" mycli' 87 | 88 | alias k='kubectl' 89 | alias ka='kubectl apply --recursive -f' 90 | alias kex='kubectl exec -it' 91 | alias klo='kubectl logs -f' 92 | alias kg='kubectl get' 93 | alias kd='kubectl describe' 94 | 95 | (( $+commands[btm] )) && alias htop='btm -n -b' 96 | 97 | alias ui_syncthing='xdg-open "http://127.0.0.1:8384/"' 98 | alias ui_v2ray='xdg-open "http://127.0.0.1:2017/"' 99 | alias ui_flink='xdg-open "http://127.0.0.1:8081/"' 100 | 101 | alias cm='cargo make' 102 | alias ct='cargo make test' 103 | alias cr='cargo make run' 104 | 105 | alias ta='tmux attach -t' 106 | alias tcap='tmux capture-pane -JpS -' 107 | 108 | (( $+commands[gnumfmt] )) && alias numfmt=gnumfmt 109 | (( $+commands[gdate] )) && alias date=gdate 110 | (( $+commands[gsed] )) && alias sed=gsed 111 | (( $+commands[gawk] )) && alias awk=gawk 112 | (( $+commands[fdfind])) && alias fd=fdfind 113 | (( $+commands[fd])) && alias ffd='fd -uLE .git' 114 | 115 | alias yy=clitrans 116 | alias y=yazi 117 | -------------------------------------------------------------------------------- /picom/picom.conf: -------------------------------------------------------------------------------- 1 | # Performance and behaviour related 2 | # Settings for glx backend 3 | backend = "glx"; 4 | glx-no-stencil = true; 5 | glx-copy-from-front = false; 6 | use-damage = true; 7 | # refresh-rate = 0; 8 | # vsync = "opengl-swc"; 9 | dbe = false; 10 | # sw-opti = false; 11 | vsync = true; 12 | 13 | unredir-if-possible = true; 14 | detect-transient = true; 15 | detect-client-leader = true; 16 | 17 | focus-exclude = [ 18 | #"class_g ?= 'rofi'" 19 | #'_NET_WM_NAME@:s = "rofi"' 20 | "class_g ?= 'slop'", 21 | "name = 'rofi'", 22 | "class_g ?= 'Steam'", 23 | "_NET_WM_WINDOW_TYPE *= 'MENU'", 24 | "window_type *= 'menu'", 25 | "window_type = 'utility'", 26 | "window_type = 'dropdown_menu'", 27 | "window_type = 'popup_menu'" 28 | ]; 29 | 30 | # === Shadows === 31 | # Enabled client-side shadows on windows. 32 | shadow = true; 33 | # Detect rounded corners 34 | # (it doesn't really do anything for shadows) 35 | # detect-rounded-corners = true; 36 | 37 | shadow-radius = 40; 38 | shadow-offset-x = -20; 39 | shadow-offset-y = -20; 40 | shadow-opacity = 0.3; 41 | 42 | shadow-exclude = [ 43 | "class_i ?= 'wechat.exe'", 44 | "class_i ?= 'riotclientservices.exe'", 45 | "class_g ?= 'slop'", 46 | "class_g ?= 'Polybar'", 47 | "class_g ?= 'Visualizer'", 48 | # "class_g ?= 'rofi'", 49 | # i3wm titlebar shadows (tabbed/stacked) 50 | "class_g ?= 'i3-frame'", 51 | # i3wm hidden window shadows (tabbed/stacked) 52 | # "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", 53 | "_NET_WM_WINDOW_TYPE *= 'SPLASH'", 54 | # "_NET_WM_WINDOW_TYPE *= 'NOTIFICATION'", 55 | "window_type *= 'menu'", 56 | "window_type = 'utility'", 57 | "window_type = 'dropdown_menu'", 58 | "window_type = 'popup_menu'" 59 | ]; 60 | 61 | # === Transparency === 62 | active-opacity = 0.85 63 | inactive-opacity = 0.80 64 | inactive-dim = 0.10 65 | opacity-rule = [ 66 | "100:class_g *= 'chrome'", 67 | "100:class_g = 'Sxiv'", 68 | "90:class_g = 'wechat.exe'", 69 | ]; 70 | 71 | # Border and titlebar opacity 72 | # frame-opacity = 0.4; 73 | 74 | # === Fading === 75 | # Fade windows during opacity changes. 76 | fading = true; 77 | # The time between steps in a fade in milliseconds. (default 10). 78 | fade-delta = 4; 79 | # Opacity change between steps while fading in. (default 0.028). 80 | fade-in-step = 0.03; 81 | # Opacity change between steps while fading out. (default 0.03). 82 | fade-out-step = 0.03; 83 | # Fade windows in/out when opening/closing 84 | no-fading-openclose = false; 85 | 86 | # Specify a list of conditions of windows that should not be faded. 87 | fade-exclude = [ 88 | # "name = '???'", 89 | # "width >= 3440", 90 | # "fullscreen" 91 | # Only fade AwesomeWM wiboxes 92 | # (Notice the inverse condition) 93 | "class_g != 'awesome'" 94 | ]; 95 | 96 | # === Blurring === 97 | blur-background = true; 98 | blur-method = "dual_kawase"; 99 | blur-strength = 8; 100 | blur-background-fixed = true; 101 | 102 | blur-background-exclude = [ 103 | # Exclude everything except windows of type "splash" 104 | # (Notice the inverse condition) 105 | # "window_type != 'splash'" 106 | "class_g = 'slop'", 107 | ]; 108 | 109 | # >> Rounded corners 110 | # corner-radius = 8 111 | # For HiDPI 112 | # corner-radius = 18 113 | 114 | # rounded-corners-exclude = [ 115 | # # "_NET_WM_WINDOW_TYPE *= 'NOTIFICATION'", 116 | # "window_type *= 'dock'", 117 | # # "class_g = 'awesome'", 118 | # "class_g = 'Tint2'", 119 | # "window_type = 'menu'", 120 | # "window_type = 'tooltip'", 121 | # "window_type = 'popup_menu'", 122 | # "window_type = 'dropdown_menu'" 123 | # ]; 124 | 125 | # Window type settings 126 | wintypes: 127 | { 128 | tooltip = { fade = true; shadow = false; }; 129 | menu = { shadow = false; }; 130 | dnd = { shadow = false; }; 131 | dock = { shadow = false; }; 132 | dropdown_menu = { shadow = false; }; 133 | popup_menu = { shadow = false; }; 134 | utility = { shadow = false; }; 135 | }; 136 | -------------------------------------------------------------------------------- /arch/setup_gui.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | SDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) && cd "$SDIR" || exit 1 6 | 7 | info() { printf "$(date -Is) %b[info]%b %s\n" '\e[0;32m\033[1m' '\e[0m' "$*" >&2; } 8 | warn() { printf "$(date -Is) %b[warn]%b %s\n" '\e[0;33m\033[1m' '\e[0m' "$*" >&2; } 9 | erro() { printf "$(date -Is) %b[erro]%b %s\n" '\e[0;31m\033[1m' '\e[0m' "$*" >&2; } 10 | 11 | function setup_fonts() { 12 | paru --noconfirm -S noto-fonts noto-fonts-cjk noto-fonts-emoji 13 | paru --noconfirm -S ttf-meslo 14 | paru --noconfirm -S ttf-iosevka-term 15 | paru --noconfirm -S ttf-sarasa-gothic 16 | paru --noconfirm -S ttf-jetbrains-mono-nerd 17 | 18 | ../fonts/setup.sh 19 | } 20 | 21 | 22 | function setup_guis() { 23 | paru --noconfirm -S sddm 24 | # Sddm theme 25 | paru --noconfirm -S qt5-graphicaleffects qt5-quickcontrols2 qt5-svg 26 | ( 27 | sudo mkdir -p /etc/sddm.conf.d/ /usr/share/sddm/themes/sugar-candy 28 | rm -rf /tmp/sugar 29 | git clone --depth=1 https://framagit.org/MarianArlt/sddm-sugar-candy /tmp/sugar 30 | cd /tmp/sugar 31 | tar cf - --exclude .git . | sudo tar xf - -C /usr/share/sddm/themes/sugar-candy 32 | sudo cp -b "$SDIR/sddm.conf" /etc/sddm.conf.d/sddm.conf 33 | ) 34 | 35 | # paru --noconfirm -S libsecret seahorse 36 | # paru --noconfirm -S sxiv # simple x image viewer 37 | 38 | # paru --noconfirm -S xorg 39 | # ../xorg/setup.sh 40 | 41 | # paru --noconfirm -S picom 42 | # ../picom/setup.sh 43 | 44 | # paru --noconfirm -S awesome-git 45 | # ../awesomewm/setup.sh 46 | 47 | # paru --noconfirm -S rofi 48 | # paru --noconfirm -S rofi-greenclip # rofi clipboard 49 | # ../rofi/setup.sh 50 | 51 | paru --noconfirm -S kitty alacritty 52 | ../kitty/setup.sh 53 | ../alacritty/setup.sh 54 | 55 | # paru --noconfirm -S xdotool 56 | # paru --noconfirm -S xclip xsel 57 | 58 | paru --noconfirm -S fcitx5 fcitx5-chinese-addons fcitx5-gtk fcitx5-qt fcitx5-pinyin-zhwiki fcitx5-configtool fcitx5-material-color 59 | ../fcitx5/setup.sh 60 | 61 | # paru --noconfirm -S cool-retro-term 62 | # paru --noconfirm -S screenkey 63 | # paru --noconfirm -S xss-lock # auto screen lock 64 | 65 | paru --noconfirm -S libnotify # notify-send 66 | paru --noconfirm -S brightnessctl 67 | 68 | # backgrounds 69 | # paru --noconfirm -S nitrogen # wallpaper manager 70 | paru --noconfirm -S swww # wallpaper manager 71 | paru --noconfirm -S archlinux-wallpaper elementary-wallpapers 72 | 73 | # gtk theme 74 | # paru --noconfirm -S lxappearance # gtk theme manager 75 | paru --noconfirm -S nwg-look # gtk theme manager 76 | paru --noconfirm -S qt5ct qt6ct # qt theme manager 77 | paru --noconfirm -S arc-gtk-theme 78 | paru --noconfirm -S kvantum kvantum-qt5 79 | 80 | # cursor theme 81 | # paru --noconfirm -S vimix-cursors 82 | # mkdir -p ~/.icons/default/ 83 | # printf "[Icon Theme]\nInherits=vimix-cursors\n" > ~/.icons/default/index.theme 84 | 85 | # grub theme 86 | # paru --noconfirm -S grub-theme-vimix-git 87 | # sed -i 's|^\s*#*\s*GRUB_THEME=.*|GRUB_THEME="/usr/share/grub/themes/Vimix/theme.txt"|' /etc/default/grub 88 | # grub-mkconfig -o /boot/grub/grub.cfg 89 | 90 | paru --noconfirm -S google-chrome firefox 91 | 92 | # sound control 93 | paru --noconfirm -S pavucontrol 94 | 95 | # media 96 | paru --noconfirm -S mpv 97 | } 98 | 99 | function enable_services() { 100 | sudo systemctl enable sddm 101 | } 102 | 103 | info 'setup fonts...' 104 | setup_fonts 105 | 106 | info 'setup guis...' 107 | setup_guis 108 | 109 | info 'enable services...' 110 | enable_services 111 | 112 | # dual boot 113 | # sudo mount /dev/win-efi-partition /mnt 114 | # sudo cp /boot/grub/grub.cfg /boot/grub/grub.cfg.bak 115 | # sudo os-prober 116 | # sudo grub-mkconfig -o /boot/grub/grub.cfg 117 | 118 | # sudo mkinitcpio -P 119 | # fix Possibly missing firmware for module XXXX: 120 | # https://wiki.archlinux.org/title/Mkinitcpio#Recompressing_a_modified_extracted_image 121 | --------------------------------------------------------------------------------