add config file: aria2
		 asdf
		 zellij
	         zsh
		 bash
		 starship

 Initial commit

 Changes to be committed:
	new file:   .gitignore
	new file:   app/aria2/AriaNg_config.json
	new file:   app/aria2/AriaNg_config.toml
	new file:   bombadil.toml
	new file:   common/shell/asdf/asdfrc
	new file:   common/shell/bash/bash.toml
	new file:   common/shell/bash/bashrc
	new file:   common/shell/shell.toml
	new file:   common/shell/starship/starship.toml
	new file:   common/shell/zellij/.config.kdl.swp
	new file:   common/shell/zellij/config.kdl
	new file:   common/shell/zellij/themes/README.md
	new file:   common/shell/zellij/themes/catppuccin.kdl
	new file:   common/shell/zellij/themes/dracula.kdl
	new file:   common/shell/zellij/themes/everforest-dark.kdl
	new file:   common/shell/zellij/themes/everforest-light.kdl
	new file:   common/shell/zellij/themes/gruvbox.kdl
	new file:   common/shell/zellij/themes/kanagawa.kdl
	new file:   common/shell/zellij/themes/molokai-dark.kdl
	new file:   common/shell/zellij/themes/nord.kdl
	new file:   common/shell/zellij/themes/one-half-dark.kdl
	new file:   common/shell/zellij/themes/solarized-dark.kdl
	new file:   common/shell/zellij/themes/solarized-light.kdl
	new file:   common/shell/zellij/themes/tokyo-night-dark.kdl
	new file:   common/shell/zellij/themes/tokyo-night-light.kdl
	new file:   common/shell/zellij/themes/tokyo-night-storm.kdl
	new file:   common/shell/zellij/themes/tokyo-night.kdl
	new file:   common/shell/zsh/check.sh
	new file:   common/shell/zsh/zsh.toml
	new file:   common/shell/zsh/zshenv
	new file:   common/shell/zsh/zshrc
	new file:   scripts/check.sh
This commit is contained in:
nan.hu
2022-12-22 14:39:31 +08:00
commit 60a8cbf034
33 changed files with 1494 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.dots

View File

@@ -0,0 +1,29 @@
{
"language": "zh_Hans",
"theme": "light",
"title": "${downspeed}, ${upspeed} - ${title}",
"titleRefreshInterval": 5000,
"browserNotification": false,
"rpcAlias": "",
"rpcHost": "192.168.68.101",
"rpcPort": "6800",
"rpcInterface": "jsonrpc",
"protocol": "http",
"httpMethod": "POST",
"secret": "UDNURVJY",
"extendRpcServers": [],
"globalStatRefreshInterval": 1000,
"downloadTaskRefreshInterval": 1000,
"swipeGesture": true,
"dragAndDropTasks": true,
"rpcListDisplayOrder": "recentlyUsed",
"afterCreatingNewTask": "task-list",
"removeOldTaskAfterRetrying": false,
"confirmTaskRemoval": true,
"includePrefixWhenCopyingFromTaskDetails": true,
"showPiecesInfoInTaskDetailPage": "le10240",
"afterRetryingTask": "task-list-downloading",
"displayOrder": "default:asc",
"fileListDisplayOrder": "default:asc",
"peerListDisplayOrder": "default:asc"
}

View File

@@ -0,0 +1,6 @@
[profiles.aria2.dots]
aria2 = { source = "app/aria2/AriaNg_config.json", target = ".config/aria2/AriaNg_config.json" }

38
bombadil.toml Normal file
View File

@@ -0,0 +1,38 @@
# {dotfiles}/bombadil.toml
# Path to your dotfiles relative to your $HOME directory
dotfiles_dir = "code/bombadil"
import = [
{ path = "common/shell/zsh/zsh.toml" } ,
{ path = "common/shell/bash/bash.toml" }
]
[settings]
# An array of toml files paths containing the variables to inject in your templatized dotfiles
# You can have multiple var files as long as variable names does not colide.
#vars = [ "vars.toml" ]
# An array of post install shell commands
#posthooks = [ "sway reload" ]
[settings.dots]
# A dot entry representing a symlink, `source` is relative to `dotfiles_dir`
# and `target` shall be relative to $HOME directory or absolute.
#aria2 = { source = "aria2/AriaNg_config.json", target = ".config/aria2/AriaNg_config.json" }
#zsh = { source = "common/shell/zsh/zshrc", target = ".zshrc" }
#bash = { source = "common/shell/bash/bashrc", target = ".zshrc" }
#alacritty = { source = "alacritty.yml", target = ".config/alacritty/alacritty.yml" }
[profiles.shell]
extra_profiles = [ "bash", "zsh" ]
[ profiles.shell-simple]
extra_profiles = [ "bash-simple", "zsh-simple", "vim-simple" ]

10
common/shell/asdf/asdfrc Normal file
View File

@@ -0,0 +1,10 @@
# See the docs for explanations: https://asdf-vm.com/manage/configuration.html
# 支持其他
legacy_version_file = no
use_release_candidates = no
always_keep_download = no
plugin_repository_last_check_duration = 60
disable_plugin_short_name_repository = no

View File

@@ -0,0 +1,5 @@
[profiles.bash]
[profiles.bash.dots]
bash = { source = "common/shell/bash/bashrc", target = ".bashrc" }

117
common/shell/bash/bashrc Normal file
View File

@@ -0,0 +1,117 @@
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi

12
common/shell/shell.toml Normal file
View File

@@ -0,0 +1,12 @@
[profiles.shell]
prehooks = ["echo install bash、zsh dotfiles"]
posthooks = ["source ~/.bashrc && source ~/.zshrc"]
[settings.shell.dots]

View File

@@ -0,0 +1,192 @@
# 设置配置范例,开启编辑器的自动补全
"$schema" = 'https://starship.rs/config-schema.json'
# 在命令之间插入空行
add_newline = true
# Use custom format
format = """
$username\
$hostname\
$directory\
$git_branch\
$git_status\
$time\
$status\
$cmd_duration\
$line_break\
$character\
"""
command_timeout = 500
[username]
style_user = "white bold"
style_root = "black bold"
format = "# [$user]($style) "
disabled = false
show_always = true
[directory]
disabled = false
truncation_length = 20
truncation_symbol = "…/"
read_only = " "
format = "in [$path]($style)[$read_only]($read_only_style) "
home_symbol = "~"
truncate_to_repo = false
# Here is how you can shorten some long paths by text replacement
# similar to mapped_locations in Oh My Posh:
[directory.substitutions]
"Documents" = " "
"Downloads" = " "
"Music" = " "
"Pictures" = " "
# Keep in mind that the order matters. For example:
# "Important Documents" = "  "
# will not be replaced, because "Documents" was already substituted before.
# So either put "Important Documents" before "Documents" or use the substituted version:
# "Important  " = "  "
[hostname]
ssh_only = false
format = "@ [$hostname](bold red) "
trim_at = ".companyname.com"
disabled = false
ssh_symbol = "🌐 "
[status]
format = '[\[$symbol$status\]]($style) '
map_symbol = true
symbol = "✖ "
sigint_symbol = "⚡"
not_found_symbol = "✖ "
disabled = false
[git_branch]
format = "on [$symbol$branch(:$remote_branch)]($style)"
symbol = " "
[git_status]
format = '([\[$all_status$ahead_behind\]]($style) )'
[cmd_duration]
format = '[ ⏱ $duration]($style)'
[time]
disabled = false
format = '[\[$time\]]($style) '
time_format = "%T"
utc_time_offset = "+8"
[line_break]
disabled = false
[character]
format = "$symbol "
success_symbol = "[➜](bold green)"
error_symbol = "[✗](bold red)"
[aws]
symbol = " "
format = '\[[$symbol($profile)(\($region\))(\[$duration\])]($style)\]'
[buf]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[c]
symbol = " "
format = '\[[$symbol($version(-$name))]($style)\]'
[cmake]
format = '\[[$symbol($version)]($style)\]'
[conda]
symbol = " "
format = '\[[$symbol$environment]($style)\]'
[dart]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[docker_context]
symbol = " "
format = '\[[$symbol$context]($style)\]'
[elixir]
symbol = " "
format = '\[[$symbol($version \(OTP $otp_version\))]($style)\]'
[elm]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[golang]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[haskell]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[java]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[julia]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[lua]
format = '\[[$symbol($version)]($style)\]'
[nim]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[nix_shell]
symbol = " "
format = '\[[$symbol$state( \($name\))]($style)\]'
[nodejs]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[openstack]
format = '\[[$symbol$cloud(\($project\))]($style)\]'
[package]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[perl]
format = '\[[$symbol($version)]($style)\]'
[php]
format = '\[[$symbol($version)]($style)\]'
[python]
symbol = " "
format = '\[[${symbol}${pyenv_prefix}(${version})(\($virtualenv\))]($style)\]'
[rust]
symbol = "🦀"
format = '\[[$symbol($version)]($style)\]'
[spack]
symbol = "🅢 "
format = '\[[$symbol($version)]($style)\]'
[sudo]
symbol = "🧙 "
allow_windows = false
disabled = true
# command_timeout = 1000

View File

@@ -0,0 +1,199 @@
# 设置配置范例,开启编辑器的自动补全
"$schema" = 'https://starship.rs/config-schema.json'
# 在命令之间插入空行
add_newline = true
# Use custom format
format = """
$username\
$hostname\
$directory\
$git_branch\
$git_status\
$time\
$status\
$conda\
$nodejs\
$package\
$python\
$rust\
$sudo\
$cmd_duration\
$line_break\
$character\
"""
command_timeout = 500
[username]
style_user = "white bold"
style_root = "black bold"
format = "# [$user]($style) "
disabled = false
show_always = true
[directory]
disabled = false
truncation_length = 20
truncation_symbol = "…/"
read_only = " "
format = "in [$path]($style)[$read_only]($read_only_style) "
home_symbol = "~"
truncate_to_repo = false
# Here is how you can shorten some long paths by text replacement
# similar to mapped_locations in Oh My Posh:
[directory.substitutions]
"Documents" = " "
"Downloads" = " "
"Music" = " "
"Pictures" = " "
# Keep in mind that the order matters. For example:
# "Important Documents" = "  "
# will not be replaced, because "Documents" was already substituted before.
# So either put "Important Documents" before "Documents" or use the substituted version:
# "Important  " = "  "
[hostname]
ssh_only = false
format = "@ [$hostname](bold red) "
trim_at = ".companyname.com"
disabled = false
ssh_symbol = "🌐 "
[status]
format = '[\[$symbol$status\]]($style) '
map_symbol = true
symbol = "✖ "
sigint_symbol = "⚡"
not_found_symbol = "✖ "
disabled = false
[git_branch]
format = "on [$symbol$branch(:$remote_branch)]($style)"
symbol = " "
[git_status]
format = '([\[$all_status$ahead_behind\]]($style) )'
[cmd_duration]
format = '[ ⏱ $duration]($style)'
[time]
disabled = false
format = '[\[$time\]]($style) '
time_format = "%T"
utc_time_offset = "+8"
[line_break]
disabled = false
[character]
format = "$symbol "
success_symbol = "[➜](bold green)"
error_symbol = "[✗](bold red)"
[aws]
symbol = " "
format = '\[[$symbol($profile)(\($region\))(\[$duration\])]($style)\]'
[buf]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[c]
symbol = " "
format = '\[[$symbol($version(-$name))]($style)\]'
[cmake]
format = '\[[$symbol($version)]($style)\]'
[conda]
symbol = " "
format = '\[[$symbol$environment]($style)\]'
[dart]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[docker_context]
symbol = " "
format = '\[[$symbol$context]($style)\]'
[elixir]
symbol = " "
format = '\[[$symbol($version \(OTP $otp_version\))]($style)\]'
[elm]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[golang]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[haskell]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[java]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[julia]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[lua]
format = '\[[$symbol($version)]($style)\]'
[nim]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[nix_shell]
symbol = " "
format = '\[[$symbol$state( \($name\))]($style)\]'
[nodejs]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[openstack]
format = '\[[$symbol$cloud(\($project\))]($style)\]'
[package]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[perl]
format = '\[[$symbol($version)]($style)\]'
[php]
format = '\[[$symbol($version)]($style)\]'
[python]
symbol = " "
format = '\[[${symbol}${pyenv_prefix}(${version})(\($virtualenv\))]($style)\]'
[rust]
symbol = "🦀"
format = '\[[$symbol($version)]($style)\]'
[spack]
symbol = "🅢 "
format = '\[[$symbol($version)]($style)\]'
[sudo]
symbol = "🧙 "
allow_windows = false
disabled = true
# command_timeout = 1000

Binary file not shown.

View File

@@ -0,0 +1,309 @@
// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true"
keybinds {
normal {
// uncomment this and adjust key if using copy_on_select=false
// bind "Alt c" { Copy; }
}
locked {
bind "Ctrl g" { SwitchToMode "Normal"; }
}
resize {
bind "Ctrl n" { SwitchToMode "Normal"; }
bind "h" "Left" { Resize "Increase Left"; }
bind "j" "Down" { Resize "Increase Down"; }
bind "k" "Up" { Resize "Increase Up"; }
bind "l" "Right" { Resize "Increase Right"; }
bind "H" { Resize "Decrease Left"; }
bind "J" { Resize "Decrease Down"; }
bind "K" { Resize "Decrease Up"; }
bind "L" { Resize "Decrease Right"; }
bind "=" "+" { Resize "Increase"; }
bind "-" { Resize "Decrease"; }
}
pane {
bind "Ctrl p" { SwitchToMode "Normal"; }
bind "h" "Left" { MoveFocus "Left"; }
bind "l" "Right" { MoveFocus "Right"; }
bind "j" "Down" { MoveFocus "Down"; }
bind "k" "Up" { MoveFocus "Up"; }
bind "p" { SwitchFocus; }
bind "n" { NewPane; SwitchToMode "Normal"; }
bind "d" { NewPane "Down"; SwitchToMode "Normal"; }
bind "r" { NewPane "Right"; SwitchToMode "Normal"; }
bind "x" { CloseFocus; SwitchToMode "Normal"; }
bind "f" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
bind "z" { TogglePaneFrames; SwitchToMode "Normal"; }
bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; }
bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; }
bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;}
}
move {
bind "Ctrl h" { SwitchToMode "Normal"; }
bind "n" "Tab" { MovePane; }
bind "h" "Left" { MovePane "Left"; }
bind "j" "Down" { MovePane "Down"; }
bind "k" "Up" { MovePane "Up"; }
bind "l" "Right" { MovePane "Right"; }
}
tab {
bind "Ctrl t" { SwitchToMode "Normal"; }
bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; }
bind "h" "Left" "Up" "k" { GoToPreviousTab; }
bind "l" "Right" "Down" "j" { GoToNextTab; }
bind "n" { NewTab; SwitchToMode "Normal"; }
bind "x" { CloseTab; SwitchToMode "Normal"; }
bind "s" { ToggleActiveSyncTab; SwitchToMode "Normal"; }
bind "1" { GoToTab 1; SwitchToMode "Normal"; }
bind "2" { GoToTab 2; SwitchToMode "Normal"; }
bind "3" { GoToTab 3; SwitchToMode "Normal"; }
bind "4" { GoToTab 4; SwitchToMode "Normal"; }
bind "5" { GoToTab 5; SwitchToMode "Normal"; }
bind "6" { GoToTab 6; SwitchToMode "Normal"; }
bind "7" { GoToTab 7; SwitchToMode "Normal"; }
bind "8" { GoToTab 8; SwitchToMode "Normal"; }
bind "9" { GoToTab 9; SwitchToMode "Normal"; }
bind "Tab" { ToggleTab; }
}
scroll {
bind "Ctrl s" { SwitchToMode "Normal"; }
bind "e" { EditScrollback; SwitchToMode "Normal"; }
bind "s" { SwitchToMode "EnterSearch"; SearchInput 0; }
bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
bind "j" "Down" { ScrollDown; }
bind "k" "Up" { ScrollUp; }
bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; }
bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; }
bind "d" { HalfPageScrollDown; }
bind "u" { HalfPageScrollUp; }
// uncomment this and adjust key if using copy_on_select=false
// bind "Alt c" { Copy; }
}
search {
bind "Ctrl s" { SwitchToMode "Normal"; }
bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
bind "j" "Down" { ScrollDown; }
bind "k" "Up" { ScrollUp; }
bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; }
bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; }
bind "d" { HalfPageScrollDown; }
bind "u" { HalfPageScrollUp; }
bind "n" { Search "down"; }
bind "p" { Search "up"; }
bind "c" { SearchToggleOption "CaseSensitivity"; }
bind "w" { SearchToggleOption "Wrap"; }
bind "o" { SearchToggleOption "WholeWord"; }
}
entersearch {
bind "Ctrl c" "Esc" { SwitchToMode "Scroll"; }
bind "Enter" { SwitchToMode "Search"; }
}
renametab {
bind "Ctrl c" { SwitchToMode "Normal"; }
bind "Esc" { UndoRenameTab; SwitchToMode "Tab"; }
}
renamepane {
bind "Ctrl c" { SwitchToMode "Normal"; }
bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; }
}
session {
bind "Ctrl o" { SwitchToMode "Normal"; }
bind "Ctrl s" { SwitchToMode "Scroll"; }
bind "d" { Detach; }
}
tmux {
bind "[" { SwitchToMode "Scroll"; }
bind "Ctrl b" { Write 2; SwitchToMode "Normal"; }
bind "\"" { NewPane "Down"; SwitchToMode "Normal"; }
bind "%" { NewPane "Right"; SwitchToMode "Normal"; }
bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
bind "c" { NewTab; SwitchToMode "Normal"; }
bind "," { SwitchToMode "RenameTab"; }
bind "p" { GoToPreviousTab; SwitchToMode "Normal"; }
bind "n" { GoToNextTab; SwitchToMode "Normal"; }
bind "Left" { MoveFocus "Left"; SwitchToMode "Normal"; }
bind "Right" { MoveFocus "Right"; SwitchToMode "Normal"; }
bind "Down" { MoveFocus "Down"; SwitchToMode "Normal"; }
bind "Up" { MoveFocus "Up"; SwitchToMode "Normal"; }
bind "h" { MoveFocus "Left"; SwitchToMode "Normal"; }
bind "l" { MoveFocus "Right"; SwitchToMode "Normal"; }
bind "j" { MoveFocus "Down"; SwitchToMode "Normal"; }
bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; }
bind "o" { FocusNextPane; }
bind "d" { Detach; }
}
shared_except "locked" {
bind "Ctrl g" { SwitchToMode "Locked"; }
bind "Ctrl q" { Quit; }
bind "Alt n" { NewPane; }
bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; }
bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; }
bind "Alt j" "Alt Down" { MoveFocus "Down"; }
bind "Alt k" "Alt Up" { MoveFocus "Up"; }
bind "Alt =" "Alt +" { Resize "Increase"; }
bind "Alt -" { Resize "Decrease"; }
}
shared_except "normal" "locked" {
bind "Enter" "Esc" { SwitchToMode "Normal"; }
}
shared_except "pane" "locked" {
bind "Ctrl p" { SwitchToMode "Pane"; }
}
shared_except "resize" "locked" {
bind "Ctrl n" { SwitchToMode "Resize"; }
}
shared_except "scroll" "locked" {
bind "Ctrl s" { SwitchToMode "Scroll"; }
}
shared_except "session" "locked" {
bind "Ctrl o" { SwitchToMode "Session"; }
}
shared_except "tab" "locked" {
bind "Ctrl t" { SwitchToMode "Tab"; }
}
shared_except "move" "locked" {
bind "Ctrl h" { SwitchToMode "Move"; }
}
shared_except "tmux" "locked" {
bind "Ctrl b" { SwitchToMode "Tmux"; }
}
}
plugins {
tab-bar { path "tab-bar"; }
status-bar { path "status-bar"; }
strider { path "strider"; }
compact-bar { path "compact-bar"; }
}
// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP
// eg. when terminal window with an active zellij session is closed
// Options:
// - detach (Default)
// - quit
//
// on_force_close "quit"
// Send a request for a simplified ui (without arrow fonts) to plugins
// Options:
// - true
// - false (Default)
//
//simplified_ui true
// Choose the path to the default shell that zellij will use for opening new panes
// Default: $SHELL
//
default_shell "zsh"
// Toggle between having pane frames around the panes
// Options:
// - true (default)
// - false
//
pane_frames false
// Define color themes for Zellij
// For more examples, see: https://github.com/zellij-org/zellij/tree/main/example/themes
// Once these themes are defined, one of them should to be selected in the "theme" section of this file
//
// themes {
// dracula {
// fg 248 248 242
// bg 40 42 54
// red 255 85 85
// green 80 250 123
// yellow 241 250 140
// blue 98 114 164
// magenta 255 121 198
// orange 255 184 108
// cyan 139 233 253
// black 0 0 0
// white 255 255 255
// }
//}
// Choose the theme that is specified in the themes section.
// Default: default
//
theme "one-half-dark"
// The name of the default layout to load on startup
// Default: "default"
//
// default_layout "compact"
// Choose the mode that zellij uses when starting up.
// Default: normal
//
// default_mode "locked"
// Toggle enabling the mouse mode.
// On certain configurations, or terminals this could
// potentially interfere with copying text.
// Options:
// - true (default)
// - false
//
// mouse_mode false
// Configure the scroll back buffer size
// This is the number of lines zellij stores for each pane in the scroll back
// buffer. Excess number of lines are discarded in a FIFO fashion.
// Valid values: positive integers
// Default value: 10000
//
// scroll_buffer_size 10000
// Provide a command to execute when copying text. The text will be piped to
// the stdin of the program to perform the copy. This can be used with
// terminal emulators which do not support the OSC 52 ANSI control sequence
// that will be used by default if this option is not set.
// Examples:
//
// copy_command "xclip -selection clipboard" // x11
// copy_command "wl-copy" // wayland
// copy_command "pbcopy" // osx
// Choose the destination for copied text
// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard.
// Does not apply when using copy_command.
// Options:
// - system (default)
// - primary
//
// copy_clipboard "primary"
// Enable or disable automatic copy (and clear) of selection when releasing mouse
// Default: true
//
// copy_on_select false
// Path to the default editor to use to edit pane scrollbuffer
// Default: $EDITOR or $VISUAL
//
// scrollback_editor "/usr/bin/vim"
// When attaching to an existing session with other users,
// should the session be mirrored (true)
// or should each user have their own cursor (false)
// Default: false
//
//mirror_session true
// The folder in which Zellij will look for layouts
//
// layout_dir "/path/to/my/layout_dir"
// The folder in which Zellij will look for themes
//
// theme_dir "/path/to/my/theme_dir"
//
//
// 设置圆角
ui {
pane_frames {
rounded_corners true
}
}

View File

@@ -0,0 +1,19 @@
# Themes
Themes can contain different flavors in one file, or can be created as individual files.
Example:
```
gruvbox.kdl
├─ gruvbox-light
└─ gruvbox-dark
or
gruvbox-light.kdl
└─ gruvbox-light
gruvbox-dark.kdl
└─ gruvbox-dark
```

View File

@@ -0,0 +1,60 @@
// Catppuccin Theme:
// https://github.com/catppuccin/catppuccin
themes {
catppuccin-latte {
bg "#acb0be" // Surface2
fg "#acb0be" // Surface2
red "#d20f39"
green "#40a02b"
blue "#1e66f5"
yellow "#df8e1d"
magenta "#ea76cb" // Pink
orange "#fe640b" // Peach
cyan "#04a5e5" // Sky
black "#dce0e8" // Crust
white "#4c4f69" // Text
}
catppuccin-frappe {
bg "#626880" // Surface2
fg "#c6d0f5"
red "#e78284"
green "#a6d189"
blue "#8caaee"
yellow "#e5c890"
magenta "#f4b8e4" // Pink
orange "#ef9f76" // Peach
cyan "#99d1db" // Sky
black "#292c3c" // Mantle
white "#c6d0f5"
}
catppuccin-macchiato {
bg "#5b6078" // Surface2
fg "#cad3f5"
red "#ed8796"
green "#a6da95"
blue "#8aadf4"
yellow "#eed49f"
magenta "#f5bde6" // Pink
orange "#f5a97f" // Peach
cyan "#91d7e3" // Sky
black "#1e2030" // Mantle
white "#cad3f5"
}
catppuccin-mocha {
bg "#585b70" // Surface2
fg "#cdd6f4"
red "#f38ba8"
green "#a6e3a1"
blue "#89b4fa"
yellow "#f9e2af"
magenta "#f5c2e7" // Pink
orange "#fab387" // Peach
cyan "#89dceb" // Sky
black "#181825" // Mantle
white "#cdd6f4"
}
}

View File

@@ -0,0 +1,17 @@
// From https://github.com/dracula/zellij
themes {
dracula {
fg 248 248 242
bg 40 42 54
black 0 0 0
red 255 85 85
green 80 250 123
yellow 241 250 140
blue 98 114 164
magenta 255 121 198
cyan 139 233 253
white 255 255 255
orange 255 184 108
}
}

View File

@@ -0,0 +1,15 @@
themes {
everforest-dark {
bg "#2b3339"
fg "#d3c6aa"
black "#4b565c"
red "#e67e80"
green "#a7c080"
yellow "#dbbc7f"
blue "#7fbbb3"
magenta "#d699b6"
cyan "#83c092"
white "#d3c6aa"
orange "#FF9E64"
}
}

View File

@@ -0,0 +1,15 @@
themes {
everforest-light {
bg "#fff9e8"
fg "#5c6a72"
black "#5c6a72"
red "#f85552"
green "#8da101"
yellow "#dfa000"
blue "#3a94c5"
magenta "#df69ba"
cyan "#35a77c"
white "#dfddc8"
orange "#FF9E64"
}
}

View File

@@ -0,0 +1,29 @@
themes {
gruvbox-light {
fg 60 56 54
bg 251 82 75
black 40 40 40
red 205 75 69
green 152 151 26
yellow 215 153 33
blue 69 133 136
magenta 177 98 134
cyan 104 157 106
white 213 196 161
orange 214 93 14
}
gruvbox-dark {
fg 213 196 161
bg 40 40 40
black 60 56 54
red 204 36 29
green 152 151 26
yellow 215 153 33
blue 69 133 136
magenta 177 98 134
cyan 104 157 106
white 251 241 199
orange 214 93 14
}
}

View File

@@ -0,0 +1,15 @@
themes {
kanagawa {
fg "#DCD7BA"
bg "#1F1F28"
red "#C34043"
green "#76946A"
yellow "#FF9E3B"
blue "#7E9CD8"
magenta "#957FB8"
orange "#FFA066"
cyan "#7FB4CA"
black "#16161D"
white "#DCD7BA"
}
}

View File

@@ -0,0 +1,16 @@
themes {
molokai-dark {
fg 248 248 240
bg 27 29 30
black 0 0 0
red 255 0 0
green 0 140 0
yellow 255 255 0
blue 102 217 239
magenta 174 129 255
cyan 0 255 255
white 255 255 255
orange 253 151 31
}
}

View File

@@ -0,0 +1,15 @@
themes {
nord {
fg 216 222 233 // #D8DEE9
bg 46 52 64 // #2E3440
black 59 66 82 // #3B4252
red 191 97 106 // #BF616A
green 163 190 140 // #A3BE8C
yellow 235 203 139 // #EBCB8B
blue 129 161 193 // #81A1C1
magenta 180 142 173 // #B48EAD
cyan 136 192 208 // #88C0D0
white 229 233 240 // #E5E9F0
orange 208 135 112 // #D08770
}
}

View File

@@ -0,0 +1,16 @@
themes {
one-half-dark {
fg 220 223 228
bg 40 44 52
black 27 29 35
red 227 63 76
green 152 195 121
yellow 229 192 123
blue 97 175 239
magenta 198 120 221
cyan 86 182 194
white 233 225 254
orange 216 133 76
}
}

View File

@@ -0,0 +1,16 @@
themes {
solarized-dark {
fg 253 246 227
bg 0 43 54
black 7 54 66
red 220 50 47
green 133 153 0
yellow 181 137 0
blue 38 139 210
magenta 211 54 130
cyan 42 161 152
white 238 232 213
orange 203 75 22
}
}

View File

@@ -0,0 +1,16 @@
themes {
solarized-light {
fg 101 123 131
bg 253 246 227
black 7 54 66
red 220 50 47
green 133 153 0
yellow 181 137 0
blue 38 139 210
magenta 211 54 130
cyan 42 161 152
white 238 232 213
orange 203 75 22
}
}

View File

@@ -0,0 +1,15 @@
themes {
tokyo-night-dark {
fg 169 177 214
bg 26 27 38
black 56 62 90
red 249 51 87
green 158 206 106
yellow 224 175 104
blue 122 162 247
magenta 187 154 247
cyan 42 195 222
white 192 202 245
orange 255 158 100
}
}

View File

@@ -0,0 +1,16 @@
themes {
tokyo-night-light {
fg 52 59 88
bg 213 214 219
black 15 15 20
red 186 75 96
green 72 94 48
yellow 143 94 21
blue 52 84 138
magenta 90 74 120
cyan 15 75 110
white 130 137 172
orange 150 80 39
}
}

View File

@@ -0,0 +1,16 @@
themes {
tokyo-night-storm {
fg 169 177 214
bg 36 40 59
black 56 62 90
red 249 51 87
green 158 206 106
yellow 224 175 104
blue 122 162 247
magenta 187 154 247
cyan 42 195 222
white 192 202 245
orange 255 158 100
}
}

View File

@@ -0,0 +1,16 @@
themes {
tokyo-night {
fg 169 177 214
bg 26 27 38
black 56 62 90
red 249 51 87
green 158 206 106
yellow 224 175 104
blue 122 162 247
magenta 187 154 247
cyan 42 195 222
white 192 202 245
orange 255 158 100
}
}

11
common/shell/zsh/check.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
#echo $PWD
. ./scripts/check.sh
if have zsh ;then
echo "Install zsh dotfiles"
else
echo "You need install zsh"
$SUDO $PACKAGE install zsh
fi

11
common/shell/zsh/zsh.toml Normal file
View File

@@ -0,0 +1,11 @@
[profiles.zsh]
#prehooks = ["echo install zsh dotfiles"]
prehooks = ["bash -c ./common/shell/zsh/check.sh"]
#posthooks = ["source ~/.zshrc"]
[profiles.zsh.dots]
zsh = { source = "common/shell/zsh/zshrc", target = ".zshrc" }
starship = { source = "common/shell/starship/starship.toml", target = ".config/starship.toml" }
asdfrc = { source = "common/shell/asdf/asdfrc", target = ".asdfrc" }
zellij = { source = "common/shell/zellij", target = ".config/zellij" }

11
common/shell/zsh/zshenv Normal file
View File

@@ -0,0 +1,11 @@
OS_ID="$(uname -s)"
case "${OS_ID}" in
Linux*) OS_NAME=Linux;;
Darwin*) OS_NAME=Mac;;
*) OS_NAME=Other;;
esac
export OS_NAME

187
common/shell/zsh/zshrc Normal file
View File

@@ -0,0 +1,187 @@
export LANG=zh_CN.UTF-8
export LANGUAGE=zh_CN:en_US
export PATH="$HOME/.local/bin/:$PATH"
### PATH
#### zinit
if [[ ! -f ~/.zinit/bin/zinit.zsh ]]; then
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
command mkdir -p ~/.zinit/bin && command chmod g-rwX "$HOME/.zinit/bin"
command git clone https://github.com/zdharma-continuum/zinit.git ~/.zinit/bin && \
print -P "%F{33} %F{34}Installation successful.%f%b" || \
print -P "%F{160} The clone has failed.%f%b"
fi
source "$HOME/.zinit/bin/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
ZINIT[HOME_DIR]="$HOME/.zinit"
# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \
zdharma-continuum/zinit-annex-as-monitor \
zdharma-continuum/zinit-annex-bin-gem-node \
zdharma-continuum/zinit-annex-patch-dl \
zdharma-continuum/zinit-annex-rust
### End of Zinit's installer chunk
#### brew
if [[ -d /home/linuxbrew ]];then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
#### asdf
# ASDF
#export ASDF_DIR=$HOME/.asdf
#if [ -d "$HOME/.asdf" ]; then
zinit ice src"asdf.sh" \
atclone"source $PWD/asdf.sh; \
asdf plugin add nodejs; \
asdf install nodejs latest ; asdf global nodejs latest; \
asdf plugin-add rust https://github.com/asdf-community/asdf-rust.git; \
asdf install rust; asdf global rust latest; \
"
# zinit ice wait lucid
zinit light asdf-vm/asdf
# OR
# load_asdf() {
# . $HOME/.asdf/asdf.sh
# }
# zinit light-mode wait lucid for \
# atload'load_asdf' \
# zdharma-continuum/null
#fi
### starship
export STARSHIP_CONFIG=~/.config/starship.toml
zinit ice as"command" from"gh-r" \
atclone"./starship init zsh > init.zsh; ./starship completions zsh > _starship" \
atpull"%atclone" src"init.zsh"
zinit light starship/starship
#zinit ice as"command" from"gh-r" \
# atclone'starship init zsh > init.zsh; starship completions zsh > _starship' \
# atpull"%atclone" src"init.zsh"
#zinit light starship/starship
## zinit 插件
#### 补全
zinit ice lucid wait='0'
zinit light zsh-users/zsh-completions
#zinit light marlonrichert/zsh-autocomplete
#### 语法高亮
zinit ice lucid wait='0' atinit='zpcompinit'
zinit light zdharma-continuum/fast-syntax-highlighting
#### 自动建议
zinit ice lucid wait="0" atload='_zsh_autosuggest_start'
zinit light zsh-users/zsh-autosuggestions
#### z.lua
#zinit ice lucid wait='1'
#zinit light skywind3000/z.lua
### fzf
#zinit ice lucid wait="1"
#zinit light junegunn/fzf
#zinit light Aloxaf/fzf-tab
zinit ice wait"2" as"command" from"gh-r" lucid \
mv"zoxide*/zoxide -> zoxide" \
atclone"./zoxide init zsh > init.zsh" \
atpull"%atclone" src"init.zsh" nocompile'!'
zinit light ajeetdsouza/zoxide
#### 建议
zinit ice lucid wait='1'
zinit light-mode lucid wait for \
MichaelAquilina/zsh-you-should-use \
zdharma-continuum/history-search-multi-word \
#### nvm 插件
#zinit ice lucid wait='1'
#zinit light-mode lucid wait for lukechilds/zsh-nvm
#### z模块
#zinit load agkozak/zsh-z
### zinit 的 oh_my_zsh 插件
#zinit ice svn
zinit snippet OMZL::theme-and-appearance.zsh
#zinit snippet OMZL::git.zsh
#zinit snippet OMZL::git.zsh
#zinit snippet OMZP::git
zinit snippet OMZL::completion.zsh
zinit snippet OMZ::lib/history.zsh
#zinit snippet OMZP::sublime
#zinit snippet OMZP::svn
zinit snippet OMZ::plugins/colored-man-pages/colored-man-pages.plugin.zsh
zinit snippet OMZ::plugins/extract
zinit snippet OMZ::plugins/sudo/sudo.plugin.zsh
zinit cdclear -q # <- forget completions provided up to this moment
setopt promptsubst
#zinit snippet OMZT::ys
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
if [ -d "$HOME/SoftWare/mamba" ]; then
__conda_setup="$('$HOME/SoftWare/mamba/mambaforge/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "$HOME/SoftWare/mamba/mambaforge/etc/profile.d/conda.sh" ]; then
. "$HOME/SoftWare/mamba/mambaforge/etc/profile.d/conda.sh"
else
export PATH="$HOME/SoftWare/mamba/mambaforge/bin:$PATH"
fi
fi
unset __conda_setup
if [ -f "$HOME/SoftWare/mamba/mambaforge/etc/profile.d/mamba.sh" ]; then
. "$HOME/SoftWare/mamba/mambaforge/etc/profile.d/mamba.sh"
conda config --set auto_activate_base false
fi
fi
# <<< conda initialize <<<
#inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
#inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
#inoremap <expr> <cr> pumvisible() ? "\<C-y>\<cr>" : "\<cr>"
#### starship
#eval "$($ASDF_DIR/shims/starship init zsh)"
#export WASMTIME_HOME="$HOME/.wasmtime"
#export PATH="$WASMTIME_HOME/bin:$PATH"
#export PATH="/home/h/linux-app/qemu-7.0.0/build/:$PATH"
#export PATH="/home/h/linux-app/qemu-7.0.0/build/riscv64-softmmu:$PATH"
#export PATH="/home/h/linux-app/qemu-7.0.0/build/riscv64-linux-user:$PATH"
#
#
## cargo PATH
#
if [ -d "$HOME/.cargo/bin" ];then
export PATH="$PATH:$HOME/.cargo/bin"
fi

44
scripts/check.sh Normal file
View File

@@ -0,0 +1,44 @@
#!/bin/bash
have() {
have=$(which "$1" 2>/dev/null) && test -n "$have"
}
command_exists() {
command -v "$@" >/dev/null 2>&1
}
user_can_sudo() {
# Check if sudo is installed
command_exists sudo || return 1
# The following command has 3 parts:
#
# 1. Run `sudo` with `-v`. Does the following:
# • with privilege: asks for a password immediately.
# • without privilege: exits with error code 1 and prints the message:
# Sorry, user <username> may not run sudo on <hostname>
#
# 2. Pass `-n` to `sudo` to tell it to not ask for a password. If the
# password is not required, the command will finish with exit code 0.
# If one is required, sudo will exit with error code 1 and print the
# message:
# sudo: a password is required
#
# 3. Check for the words "may not run sudo" in the output to really tell
# whether the user has privileges or not. For that we have to make sure
# to run `sudo` in the default locale (with `LANG=`) so that the message
# stays consistent regardless of the user's locale.
#
! LANG= sudo -n -v 2>&1 | grep -q "may not run sudo"
}
[[ $EUID -ne 0 ]] && SUDO=sudo
command_exists apt && PACKAGE=apt
command_exists yum && PACKAGE=yum
command_exists pkg && PACKAGE=pkg
command_exists zypper && PACKAGE=zypper