diff options
38 files changed, 520 insertions, 207 deletions
diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua index 52ceb01..ee97612 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua @@ -260,6 +260,75 @@ return { }, }, { + "greggh/claude-code.nvim", + dependencies = { + "nvim-lua/plenary.nvim", -- Required for git operations + }, + config = function() + require("claude-code").setup({ + -- Terminal window settings + window = { + split_ratio = 0.3, -- Percentage of screen for the terminal window (height for horizontal, width for vertical splits) + position = "vertical", -- Position of the window: "botright", "topleft", "vertical", "float", etc. + enter_insert = true, -- Whether to enter insert mode when opening Claude Code + hide_numbers = true, -- Hide line numbers in the terminal window + hide_signcolumn = true, -- Hide the sign column in the terminal window + + -- Floating window configuration (only applies when position = "float") + float = { + width = "80%", -- Width: number of columns or percentage string + height = "80%", -- Height: number of rows or percentage string + row = "center", -- Row position: number, "center", or percentage string + col = "center", -- Column position: number, "center", or percentage string + relative = "editor", -- Relative to: "editor" or "cursor" + border = "rounded", -- Border style: "none", "single", "double", "rounded", "solid", "shadow" + }, + }, + -- File refresh settings + refresh = { + enable = true, -- Enable file change detection + updatetime = 100, -- updatetime when Claude Code is active (milliseconds) + timer_interval = 1000, -- How often to check for file changes (milliseconds) + show_notifications = true, -- Show notification when files are reloaded + }, + -- Git project settings + git = { + use_git_root = true, -- Set CWD to git root when opening Claude Code (if in git project) + }, + -- Shell-specific settings + shell = { + separator = "&&", -- Command separator used in shell commands + pushd_cmd = "pushd", -- Command to push directory onto stack (e.g., 'pushd' for bash/zsh, 'enter' for nushell) + popd_cmd = "popd", -- Command to pop directory from stack (e.g., 'popd' for bash/zsh, 'exit' for nushell) + }, + -- Command settings + command = "claude", -- Command used to launch Claude Code + -- Command variants + command_variants = { + -- Conversation management + continue = "--continue", -- Resume the most recent conversation + resume = "--resume", -- Display an interactive conversation picker + + -- Output options + verbose = "--verbose", -- Enable verbose logging with full turn-by-turn output + }, + -- Keymaps + keymaps = { + toggle = { + normal = "<C-,>", -- Normal mode keymap for toggling Claude Code, false to disable + terminal = "<C-,>", -- Terminal mode keymap for toggling Claude Code, false to disable + variants = { + continue = "<leader>cC", -- Normal mode keymap for Claude Code with continue flag + verbose = "<leader>cV", -- Normal mode keymap for Claude Code with verbose flag + }, + }, + window_navigation = true, -- Enable window navigation keymaps (<C-h/j/k/l>) + scrolling = true, -- Enable scrolling keymaps (<C-f/b>) for page up/down + }, + }) + end, + }, + { "NickvanDyke/opencode.nvim", dependencies = { -- Recommended for `ask()` and `select()`. @@ -277,7 +346,7 @@ return { vim.o.autoread = true -- Recommended/example keymaps. - vim.keymap.set({ "n", "x" }, "<C-a>", function() + vim.keymap.set({ "n", "x" }, "<C-q>", function() require("opencode").ask("@this: ", { submit = true }) end, { desc = "Ask opencode" }) vim.keymap.set({ "n", "x" }, "<C-x>", function() @@ -387,7 +456,7 @@ return { instructions_file = "avante.md", ---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string ---@type Provider - provider = "openai", -- The provider used in Aider mode or in the planning phase of Cursor Planning Mode + provider = "claude", -- The provider used in Aider mode or in the planning phase of Cursor Planning Mode ---@alias Mode "agentic" | "legacy" ---@type Mode mode = "agentic", -- The default mode for interaction. "agentic" uses tools to automatically generate code, "legacy" uses the old planning method to generate code. @@ -398,6 +467,7 @@ return { providers = { claude = { endpoint = "https://api.anthropic.com", + auth_type = "max", -- Set to "max" to sign in with Claude Pro/Max subscription model = "claude-sonnet-4-20250514", timeout = 30000, -- Timeout in milliseconds extra_request_body = { diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua index 993b02c..848bf09 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua @@ -796,21 +796,21 @@ end tell ---@return string symbol, string hlGroup local function mapSymbols(status, is_symlink) local statusMap = { --- stylua: ignore start -[" M"] = { symbol = "✹", hlGroup = "MiniDiffSignChange"}, -- Modified in the working directory -["M "] = { symbol = "•", hlGroup = "MiniDiffSignChange"}, -- modified in index -["MM"] = { symbol = "≠", hlGroup = "MiniDiffSignChange"}, -- modified in both working tree and index -["A "] = { symbol = "+", hlGroup = "MiniDiffSignAdd" }, -- Added to the staging area, new file -["AA"] = { symbol = "≈", hlGroup = "MiniDiffSignAdd" }, -- file is added in both working tree and index -["D "] = { symbol = "-", hlGroup = "MiniDiffSignDelete"}, -- Deleted from the staging area -["AM"] = { symbol = "⊕", hlGroup = "MiniDiffSignChange"}, -- added in working tree, modified in index -["AD"] = { symbol = "-•", hlGroup = "MiniDiffSignChange"}, -- Added in the index and deleted in the working directory -["R "] = { symbol = "→", hlGroup = "MiniDiffSignChange"}, -- Renamed in the index -["U "] = { symbol = "‖", hlGroup = "MiniDiffSignChange"}, -- Unmerged path -["UU"] = { symbol = "⇄", hlGroup = "MiniDiffSignAdd" }, -- file is unmerged -["UA"] = { symbol = "⊕", hlGroup = "MiniDiffSignAdd" }, -- file is unmerged and added in working tree -["??"] = { symbol = "?", hlGroup = "MiniDiffSignDelete"}, -- Untracked files -["!!"] = { symbol = "!", hlGroup = "MiniDiffSignChange"}, -- Ignored files + -- stylua: ignore start + [" M"] = { symbol = "✹", hlGroup = "MiniDiffSignChange"}, -- Modified in the working directory + ["M "] = { symbol = "•", hlGroup = "MiniDiffSignChange"}, -- modified in index + ["MM"] = { symbol = "≠", hlGroup = "MiniDiffSignChange"}, -- modified in both working tree and index + ["A "] = { symbol = "+", hlGroup = "MiniDiffSignAdd" }, -- Added to the staging area, new file + ["AA"] = { symbol = "≈", hlGroup = "MiniDiffSignAdd" }, -- file is added in both working tree and index + ["D "] = { symbol = "-", hlGroup = "MiniDiffSignDelete"}, -- Deleted from the staging area + ["AM"] = { symbol = "⊕", hlGroup = "MiniDiffSignChange"}, -- added in working tree, modified in index + ["AD"] = { symbol = "-•", hlGroup = "MiniDiffSignChange"}, -- Added in the index and deleted in the working directory + ["R "] = { symbol = "→", hlGroup = "MiniDiffSignChange"}, -- Renamed in the index + ["U "] = { symbol = "‖", hlGroup = "MiniDiffSignChange"}, -- Unmerged path + ["UU"] = { symbol = "⇄", hlGroup = "MiniDiffSignAdd" }, -- file is unmerged + ["UA"] = { symbol = "⊕", hlGroup = "MiniDiffSignAdd" }, -- file is unmerged and added in working tree + ["??"] = { symbol = "?", hlGroup = "MiniDiffSignDelete"}, -- Untracked files + ["!!"] = { symbol = "!", hlGroup = "MiniDiffSignChange"}, -- Ignored files -- stylua: ignore end } @@ -927,18 +927,18 @@ end tell ---@param buf_id integer ---@return nil local function updateGitStatus(buf_id) - local cwd = vim.uv.cwd() - if not cwd or not vim.fs.root(cwd, ".git") then + local git_root = vim.fs.root(buf_id, ".git") + if not git_root then return end local currentTime = os.time() - if gitStatusCache[cwd] and currentTime - gitStatusCache[cwd].time < cacheTimeout then - updateMiniWithGit(buf_id, gitStatusCache[cwd].statusMap) + if gitStatusCache[git_root] and currentTime - gitStatusCache[git_root].time < cacheTimeout then + updateMiniWithGit(buf_id, gitStatusCache[git_root].statusMap) else - fetchGitStatus(cwd, function(content) + fetchGitStatus(git_root, function(content) local gitStatusMap = parseGitStatus(content) - gitStatusCache[cwd] = { + gitStatusCache[git_root] = { time = currentTime, statusMap = gitStatusMap, } @@ -979,9 +979,9 @@ end tell pattern = "MiniFilesBufferUpdate", callback = function(sii) local bufnr = sii.data.buf_id - local cwd = vim.fn.expand("%:p:h") - if gitStatusCache[cwd] then - updateMiniWithGit(bufnr, gitStatusCache[cwd].statusMap) + local git_root = vim.fs.root(bufnr, ".git") + if git_root and gitStatusCache[git_root] then + updateMiniWithGit(bufnr, gitStatusCache[git_root].statusMap) end end, }) diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/recordings.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua index 9ce9124..90528a1 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/recordings.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua @@ -6,8 +6,8 @@ local f = ls.function_node local fmt = require("luasnip.extras.fmt").fmta -local recordings_snippet = s( - "recordings", +local diary_snippet = s( + "diary", fmt( [[--- title: <title> @@ -26,5 +26,5 @@ date: <date> ) ) -ls.add_snippets("markdown", { recordings_snippet }) -ls.add_snippets("quarto", { recordings_snippet }) +ls.add_snippets("markdown", { diary_snippet }) +ls.add_snippets("quarto", { diary_snippet }) diff --git a/ar/.config/fcitx5/config b/ar/.config/fcitx5/config index cf1c6da..2b164b3 100644 --- a/ar/.config/fcitx5/config +++ b/ar/.config/fcitx5/config @@ -1,5 +1,5 @@ [Hotkey] -# Enumerate when press trigger key repeatedly +# Enumerate when holding modifier of Toggle key EnumerateWithTriggerKeys=True # Enumerate Input Method Forward EnumerateForwardKeys= @@ -9,24 +9,26 @@ EnumerateBackwardKeys= EnumerateSkipFirst=False # Toggle embedded preedit TogglePreedit= +# Time limit in milliseconds for triggering modifier key shortcuts +ModifierOnlyKeyTimeout=250 [Hotkey/TriggerKeys] 0= 1= -[Hotkey/AltTriggerKeys] +[Hotkey/ActivateKeys] 0= -[Hotkey/EnumerateGroupForwardKeys] +[Hotkey/DeactivateKeys] 0= -[Hotkey/EnumerateGroupBackwardKeys] +[Hotkey/AltTriggerKeys] 0= -[Hotkey/ActivateKeys] +[Hotkey/EnumerateGroupForwardKeys] 0= -[Hotkey/DeactivateKeys] +[Hotkey/EnumerateGroupBackwardKeys] 0= [Hotkey/PrevPage] @@ -60,9 +62,9 @@ CompactInputMethodInformation=True ShowFirstInputMethodInformation=True # Default page size DefaultPageSize=5 -# Override Xkb Option +# Override XKB Option OverrideXkbOption=False -# Custom Xkb Option +# Custom XKB Option CustomXkbOption= # Force Enabled Addons EnabledAddons= @@ -76,3 +78,4 @@ AllowInputMethodForPassword=False ShowPreeditForPassword=False # Interval of saving user data in minutes AutoSavePeriod=30 + diff --git a/ar/.config/fontconfig/fonts.conf b/ar/.config/fontconfig/fonts.conf index 935549d..c5ac402 100644 --- a/ar/.config/fontconfig/fonts.conf +++ b/ar/.config/fontconfig/fonts.conf @@ -7,7 +7,6 @@ <family>Source Han Serif KR</family> <family>DejaVu Serif</family> <family>Droid Serif</family> - <family>Libertinus Serif</family> <family>Joy Pixels</family> <family>Noto Color Emoji</family> <family>FontAwesome</family> @@ -19,7 +18,6 @@ <family>Source Han Serif KR</family> <family>DejaVu Serif</family> <family>Droid Serif</family> - <family>Libertinus Serif</family> <family>Joy Pixels</family> <family>Noto Color Emoji</family> <family>FontAwesome</family> @@ -31,7 +29,6 @@ <family>Source Han Sans KR</family> <family>DejaVu Sans</family> <family>Droid Sans</family> - <family>Libertinus Sans</family> <family>Joy Pixels</family> <family>Noto Color Emoji</family> <family>FontAwesome</family> @@ -42,7 +39,6 @@ <prefer> <family>Noto Sans Mono</family> <family>Noto Sans Mono CJK KR</family> - <family>Libertinus Mono</family> <family>FontAwesome</family> <family>Braille</family> </prefer> @@ -52,7 +48,6 @@ <prefer> <family>D2CodingLigature Nerd Font Mono</family> <family>Hack Nerd Font Mono</family> - <family>Libertinus Mono</family> <family>FontAwesome</family> <family>Braille</family> </prefer> @@ -62,7 +57,6 @@ <prefer> <family>Noto Sans CJK KR</family> <family>D2CodingLigature Nerd Font</family> - <family>Libertinus</family> <family>FontAwesome</family> <family>Braille</family> </prefer> diff --git a/ar/.config/git/config b/ar/.config/git/config index 7dc029b..3d9b746 100644 --- a/ar/.config/git/config +++ b/ar/.config/git/config @@ -83,6 +83,12 @@ [user] name = TheSiahxyz email = 164138827+TheSiahxyz@users.noreply.github.com - signingkey = 67BE7AD056C803BA + signingkey = 6E0F6060D236F2AB [commit] gpgsign = true +[credential "https://github.com"] + helper = + helper = !/usr/bin/gh auth git-credential +[credential "https://gist.github.com"] + helper = + helper = !/usr/bin/gh auth git-credential diff --git a/ar/.config/git/ignore b/ar/.config/git/ignore index 03a48c8..779455d 100644 --- a/ar/.config/git/ignore +++ b/ar/.config/git/ignore @@ -87,13 +87,22 @@ shortcutrc zshnameddirrc # Suckless +dmenu/config.h dmenu/dmenu dmenu/stest +dwm/config.h dwm/dwm +dwmblocks/config.h dwmblocks/dwmblocks +slock/config.h slock/slock +st/config.h st/st +surf/config.h surf/surf +tabbed/config.h +tabbed/tabbed +tabbed/xembed # Tmux */tmux/plugins/ diff --git a/ar/.config/htop/htoprc b/ar/.config/htop/htoprc index 8666417..6df10ed 100644 --- a/ar/.config/htop/htoprc +++ b/ar/.config/htop/htoprc @@ -1,53 +1,72 @@ # Beware! This file is rewritten by htop when settings are changed in the interface. # The parser is also very primitive, and not human-friendly. -.all_branches_collapsed=0 -.sort_direction=-1 -.sort_key=PERCENT_CPU -.tree_sort_direction=1 -.tree_sort_key=PID -.tree_view=0 -.tree_view_always_by_pid=0 -account_guest_in_cpu_meter=0 -all_branches_collapsed=0 -color_scheme=5 -column_meter_modes_0=1 1 1 2 2 2 1 -column_meter_modes_1= -column_meters_0=LeftCPUs Memory Swap Uptime LoadAverage Tasks RightCPUs -column_meters_1= +htop_version=3.4.1-ee21c79 config_reader_min_version=3 -cpu_count_from_one=0 -delay=15 -detailed_cpu_time=0 -enable_mouse=1 -fields=0 48 17 18 38 39 2 46 46 47 49 1 -find_comm_in_cmdline=1 -header_layout=two_50_50 -header_margin=1 -hide_function_bar=0 +fields=0 48 17 18 38 39 40 2 46 47 49 1 hide_kernel_threads=1 -hide_running_in_container=0 hide_userland_threads=0 +hide_running_in_container=0 +shadow_other_users=1 +show_thread_names=0 +show_program_path=1 highlight_base_name=1 -highlight_changes=1 -highlight_changes_delay_secs=1 highlight_deleted_exe=1 +shadow_distribution_path_prefix=0 highlight_megabytes=1 highlight_threads=1 -htop_version=3.3.0-dev -screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT STATE PERCENT_CPU PERCENT_MEM TIME Command +highlight_changes=1 +highlight_changes_delay_secs=1 +find_comm_in_cmdline=1 +strip_exe_from_cmdline=1 +show_merged_command=0 +header_margin=1 screen_tabs=1 -shadow_distribution_path_prefix=0 -shadow_other_users=1 -show_cpu_frequency=1 +detailed_cpu_time=0 +cpu_count_from_one=0 show_cpu_usage=1 -show_merged_command=0 -show_program_path=1 -show_thread_names=0 -sort_direction=-1 +show_cpu_frequency=1 +show_cpu_temperature=0 +degree_fahrenheit=0 +show_cached_memory=1 +update_process_names=0 +account_guest_in_cpu_meter=0 +color_scheme=6 +enable_mouse=1 +delay=15 +hide_function_bar=0 +header_layout=two_50_50 +column_meters_0=LeftCPUs2 Memory Swap +column_meter_modes_0=1 1 1 +column_meters_1=RightCPUs2 Tasks LoadAverage Uptime +column_meter_modes_1=1 2 2 2 +tree_view=0 sort_key=46 -strip_exe_from_cmdline=1 -tree_sort_direction=1 tree_sort_key=0 -tree_view=0 +sort_direction=-1 +tree_sort_direction=1 tree_view_always_by_pid=0 -update_process_names=0 +all_branches_collapsed=0 +screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU PERCENT_MEM TIME Command +.sort_key=PERCENT_CPU +.tree_sort_key=PID +.tree_view_always_by_pid=0 +.tree_view=0 +.sort_direction=-1 +.tree_sort_direction=1 +.all_branches_collapsed=0 +screen:I/O=PID USER IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE PERCENT_SWAP_DELAY PERCENT_IO_DELAY Command +.sort_key=IO_RATE +.tree_sort_key=PID +.tree_view_always_by_pid=0 +.tree_view=0 +.sort_direction=-1 +.tree_sort_direction=1 +.all_branches_collapsed=0 +screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT STATE PERCENT_CPU PERCENT_MEM TIME Command +.sort_key=PID +.tree_sort_key=PID +.tree_view_always_by_pid=0 +.tree_view=0 +.sort_direction=1 +.tree_sort_direction=1 +.all_branches_collapsed=0 diff --git a/ar/.config/shell/aliasrc b/ar/.config/shell/aliasrc index 55f04e7..1e129f6 100644 --- a/ar/.config/shell/aliasrc +++ b/ar/.config/shell/aliasrc @@ -379,7 +379,7 @@ alias skype='skypeforlinux' # ssh alias gts="ssh $THESIAH_SERVER" -alias wwr="ssh recordings" +alias wwr="ssh diary" # sudo alias su='sudo su -l root' @@ -487,7 +487,8 @@ alias sps="source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile" alias szs="source ${XDG_CONFIG_HOME:-${HOME}/.config}/zsh/.zshrc" alias ylogh='ylog -s hidden -c us | grep $(LC_TIME=C date +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' -alias ylogi='ylog -s hidden -c us | grep $(LC_TIME=C date -v-1d +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' -alias ylogt='ylog -s recordings -c us | grep $(LC_TIME=C date +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' -alias ylogy='ylog -s recordings -c us | grep $(LC_TIME=C date -v-1d +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' -alias ylogu='ylog -s recordings -c us' +alias ylogi='ylog -s hidden -c us | grep $(LC_TIME=C date -d "1 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' +alias ylogt='ylog -s diary -c us | grep $(LC_TIME=C date +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' +alias ylogy='ylog -s diary -c us | grep $(LC_TIME=C date -d "1 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' +alias ylogr='ylog -s diary -c us | grep $(LC_TIME=C date -d "2 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' +alias ylogu='ylog -s diary -c us' diff --git a/ar/.config/shell/bm-dirs b/ar/.config/shell/bm-dirs index 5d7eb89..6a9db9d 100644 --- a/ar/.config/shell/bm-dirs +++ b/ar/.config/shell/bm-dirs @@ -51,10 +51,12 @@ gdn ${XDG_DOWNLOAD_DIR:-${HOME}/Downloads} gdo ${XDG_DOTFILES_DIR:-${HOME}/.dotfiles} gfx $HOME/.mozilla/firefox/$USER.default gmu ${XDG_MUSIC_DIR:-${HOME}/Music} +gnu $HOME/.gnupg gpb ${XDG_PUBLICSHARE_DIR:-${HOME}/Public} gpp ${XDG_PICTURES_DIR:-${HOME}/Pictures} gpv $HOME/Private grr ${XDG_PICTURES_DIR:-${HOME}/Pictures}/resources +gsh $HOME/.ssh gss ${XDG_PICTURES_DIR:-${HOME}/Pictures}/screenshots gtc $HOME/Torrents/complete gti $HOME/Torrents/incomplete diff --git a/ar/.config/shell/bm-files b/ar/.config/shell/bm-files index fc8bce1..709c064 100644 --- a/ar/.config/shell/bm-files +++ b/ar/.config/shell/bm-files @@ -13,6 +13,8 @@ vff ${XDG_CONFIG_HOME:-${HOME}/.config}/fastfetch/config.jsonc vga ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/git-aliasrc # Git aliases vgc ${XDG_CONFIG_HOME:-${HOME}/.config}/git/config # Git config vgi ${XDG_CONFIG_HOME:-${HOME}/.config}/git/ignore # Git ignore +vgn $HOME/.gnupg/gpg-agent.conf # GNUPG config +vgs $HOME/.gnupg/sshcontrol # GNUPG SSH control config vlf ${XDG_CONFIG_HOME:-${HOME}/.config}/lf/lfrc # LF (file browser) config vlg ${XDG_CONFIG_HOME:-${HOME}/.config}/lazygit/config.yml # Lazygit config vls ${XDG_CONFIG_HOME:-${HOME}/.config}/lf/scope # LF's scope/preview file @@ -29,6 +31,7 @@ Vsm /etc/samba/smb.conf vsa ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/aliasrc # Aliases used by shell (and potentially other shells) vse ${XDG_CONFIG_HOME:-${HOME}/.config}/sesh/sesh.toml # Sesh config vsf ${XDG_SOURCES_HOME:-${HOME}/.local/src}/suckless/surf/config.def.h # Surf: a simple browser +vsh $HOME/.ssh/config # SSH config vsl ${XDG_SOURCES_HOME:-${HOME}/.local/src}/suckless/slock/config.def.h # Slock: lock screen vsn ${XDG_DATA_HOME:-${HOME}/.local/share}/thesiah/snippets # Snippets vsp ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile # Shell profile used for system diff --git a/ar/.config/zsh/scripts.zsh b/ar/.config/zsh/scripts.zsh index 5a47ffa..d70522d 100644 --- a/ar/.config/zsh/scripts.zsh +++ b/ar/.config/zsh/scripts.zsh @@ -390,9 +390,13 @@ EOF ) [[ -z "${SELECTED_DIRS// }" ]] && return if [[ "$(echo "$SELECTED_DIRS" | wc -l)" -eq 1 ]]; then - cd "$SELECTED_DIRS" - if [[ -n "$(git -C "$SELECTED_DIRS" status --porcelain)" ]]; then - git status --porcelain 2>/dev/null + if [[ -n "$TMUX" ]]; then + opensessions "$SELECTED_DIRS" + else + cd "$SELECTED_DIRS" || return + if [[ -n "$(git -C "$SELECTED_DIRS" status --porcelain 2>/dev/null)" ]]; then + git status --porcelain + fi fi else opensessions "$SELECTED_DIRS" diff --git a/ar/.local/bin/ecrypt b/ar/.local/bin/ecrypt index e13c033..4240c71 100755 --- a/ar/.local/bin/ecrypt +++ b/ar/.local/bin/ecrypt @@ -27,6 +27,9 @@ attempt_mount() { targets="$HOME/.secret" mounts="$HOME/Private" pw="default" +[ -d "$targets" ] || mkdir -p "$targets" +[ -d "$mounts" ] || mkdir -p "$mounts" + set -- $mounts # Set positional parameters to mounts i=1 for target in $targets; do diff --git a/ar/.local/bin/fzffiles b/ar/.local/bin/fzffiles index 97047e9..9f5cd90 100755 --- a/ar/.local/bin/fzffiles +++ b/ar/.local/bin/fzffiles @@ -35,7 +35,7 @@ files=$(fzf-tmux \ fi fi if [ -d \"\$target\" ]; then - exa --color=always --long --all --header --icons --git \"\$target\" + eza --color=always --long --all --header --icons --git \"\$target\" elif [ -f \"\$target\" ]; then bat --color=always --style=header,grid --line-range=:500 \"\$target\" else diff --git a/ar/.local/bin/hugow b/ar/.local/bin/hugow index 0460174..13cdf51 100755 --- a/ar/.local/bin/hugow +++ b/ar/.local/bin/hugow @@ -2,11 +2,11 @@ set -eu repodir="$HOME/Private/repos/THESIAH" -out="$repodir/public/recordings/index.html" +out="$repodir/public/diary/index.html" server="${THESIAH_SERVER:-root@thesiah.xyz}" -dest="/var/www/thesiah/recordings/" +dest="/var/www/thesiah/diary/" defaults="sy after foramonth" -src="$repodir/public/recordings/" +src="$repodir/public/diary/" cd "$repodir" hugo --cleanDestinationDir @@ -16,35 +16,35 @@ if [ ! -f "$out" ]; then exit 1 fi -tmp="$(mktemp "$out.XXXXXXXX.tmp")" - -awk -v defaults="$defaults" ' -BEGIN { - n = split(defaults, a, /[[:space:]]+/) - insert = "" - for (i = 1; i <= n; i++) { - if (a[i] == "") continue - name = a[i] ".mp4" - insert = insert \ -" <li>\n" \ -" <a href=\"/recordings/" name "\" data-name=\"" name "\" class=\"vid\">" name "</a>\n" \ -" </li>\n" - } - injected = 0 -} -{ - print - if (!injected && $0 ~ /<ul[^>]*id=["'\''"]list["'\''"][^>]*>/) { - printf("%s", insert) - injected = 1 - } -} -END { if (!injected) exit 2 } -' "$out" >"$tmp" - -mv "$tmp" "$out" -echo "Injected defaults into: $out" +# tmp="$(mktemp "$out.XXXXXXXX.tmp")" +# awk -v defaults="$defaults" ' +# BEGIN { +# n = split(defaults, a, /[[:space:]]+/) +# insert = "" +# for (i = 1; i <= n; i++) { +# if (a[i] == "") continue +# name = a[i] ".mp4" +# insert = insert \ +# " <li>\n" \ +# " <a href=\"/diary/" name "\" data-name=\"" name "\" class=\"vid\">" name "</a>\n" \ +# " </li>\n" +# } +# injected = 0 +# } +# { +# print +# if (!injected && $0 ~ /<ul[^>]*id=["'\''"]list["'\''"][^>]*>/) { +# printf("%s", insert) +# injected = 1 +# } +# } +# END { if (!injected) exit 2 } +# ' "$out" >"$tmp" +# +# mv "$tmp" "$out" +# echo "Injected defaults into: $out" +# ssh "$server" "mkdir -p '$dest'" if [ -n "${THESIAH_SSH_OPTS:-}" ]; then @@ -57,7 +57,7 @@ else fi if [ -n "${1-}" ]; then - new="$repodir/content/recordings/$1" + new="$repodir/content/diary/$1" if [ -f "$new" ]; then rsync -az --update "$new" "$server:$dest" elif [ -d "$new" ]; then diff --git a/ar/.local/bin/mounter b/ar/.local/bin/mounter index a9d7a61..c8eabbf 100755 --- a/ar/.local/bin/mounter +++ b/ar/.local/bin/mounter @@ -81,7 +81,7 @@ unopenedluks="$(for drive in $allluks; do done | filter)" # Get all normal, non-encrypted or decrypted partitions that are not mounted. -normalparts="$(echo "$lsblkoutput" | grep -v crypto_LUKS | grep -v 'part 1M' | grep 'part\|rom\|crypt' | sed "s/^/💾 /" | filter)" +normalparts="$(echo "$lsblkoutput" | grep -v crypto_LUKS | grep -v 'LVM2_member' | grep -v 'part 1M' | grep 'part\|rom\|crypt' | sed "s/^/💾 /" | filter)" # Get all available IP addresses with open Samba shares in the wlan0 subnet, excluding eth0 IP smbips="$(sudo arp-scan --interface=eth0 --interface=wlan0 --localnet | grep -vEi '(EFM Networks|DUP:)' | awk '/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/{print $1}')" diff --git a/ar/.local/bin/opensessions b/ar/.local/bin/opensessions index 6f9f236..d16f42f 100755 --- a/ar/.local/bin/opensessions +++ b/ar/.local/bin/opensessions @@ -18,7 +18,10 @@ set -- $dirs for dir in $dirs; do if [ -d "$dir" ]; then session_name=$(get_session_name "$dir") - if ! tmux has-session -t "$session_name" 2>/dev/null; then + if tmux has-session -t "$session_name" 2>/dev/null; then + session_path=$(tmux display-message -t "$session_name" -p '#{session_path}') + tmux send-keys -t "$session_name" "cd \"$session_path\"" C-m + else tmux new-session -d -s "$session_name" -c "$dir" if git -C "$dir" rev-parse --is-inside-work-tree >/dev/null 2>&1 && [ -n "$(git -C "$dir" status --porcelain)" ]; then tmux send-keys -t "$session_name" "git status --porcelain" C-m diff --git a/ar/.local/bin/remaps b/ar/.local/bin/remaps index 93832ea..580076d 100755 --- a/ar/.local/bin/remaps +++ b/ar/.local/bin/remaps @@ -10,6 +10,10 @@ xinput list | grep 'id=' | while read -r line; do mouse=$(echo "$line" | grep -i '.*id.*pointer' | sed 's/.*id=\([0-9]\+\).*/\1/') [ -z "$keyboard" ] || { case "$(echo "$line" | grep -oE '.*id=' | sed 's/ id=.*//')" in + *"Lenovo TrackPoint Keyboard II"*) + setxkbmap -device "$keyboard" -option + setxkbmap -device "$keyboard" -option caps:ctrl_modifier,altwin:menu_win,altwin:swap_lalt_lwin + ;; *"Lite-On Tech Lenovo USB Travel Keyboard with Ultra Nav"*) setxkbmap -device "$keyboard" -option setxkbmap -device "$keyboard" -option caps:ctrl_modifier,ctrl:swap_lwin_lctl @@ -43,6 +47,9 @@ xinput list | grep 'id=' | while read -r line; do *"SynPS/2 Synaptics TouchPad"*) xinput set-prop "$mouse" "libinput Tapping Enabled" 0 ;; + *"Lenovo TrackPoint Keyboard II"*) + [ -z "$1" ] && xinput set-prop "$mouse" "Coordinate Transformation Matrix" 5, 0, 0, 0, 5, 0, 0, 0, 1 || xinput set-prop "$mouse" "Coordinate Transformation Matrix" $1, 0, 0, 0, $1, 0, 0, 0, 1 + ;; *"Lite-On Tech Lenovo USB Travel Keyboard with Ultra Nav Mouse"*) [ -z "$1" ] && xinput set-prop "$mouse" "Coordinate Transformation Matrix" 5, 0, 0, 0, 5, 0, 0, 0, 1 || xinput set-prop "$mouse" "Coordinate Transformation Matrix" $1, 0, 0, 0, $1, 0, 0, 0, 1 xinput set-prop "$mouse" "libinput Scroll Method Enabled" 0, 0, 1 diff --git a/ar/.local/bin/statusbar/sb-clock b/ar/.local/bin/statusbar/sb-clock index a5992a5..d909326 100755 --- a/ar/.local/bin/statusbar/sb-clock +++ b/ar/.local/bin/statusbar/sb-clock @@ -1,7 +1,7 @@ #!/bin/sh # Get current hour and minute -calendar="🗓️" +calendar="🗓" hour=$(date '+%I') minute=$(date '+%M') diff --git a/ar/.local/bin/statusbar/sb-internet b/ar/.local/bin/statusbar/sb-internet index df43676..baa5ebd 100755 --- a/ar/.local/bin/statusbar/sb-internet +++ b/ar/.local/bin/statusbar/sb-internet @@ -4,34 +4,74 @@ # Show 🌐 if connected to ethernet or ❎ if none. # Show 🛰️ if a vpn connection is active +eth_con="$(nmcli -t -f NAME,TYPE,DEVICE connection show | + awk -F: '$2=="ethernet" && $3!="" { print $1; exit }')" + +wifi_con="$(nmcli -t -f NAME,TYPE connection show | + awk -F: '$2=="wifi" { print $1; exit }')" + +if [ -n "$eth_con" ]; then + nmcli connection modify "$eth_con" ipv4.method auto + nmcli connection modify "$eth_con" ipv4.never-default no + nmcli connection modify "$eth_con" ipv4.dns-priority -42 + nmcli connection modify "$eth_con" ipv4.route-metric 100 + nmcli connection modify "$eth_con" connection.autoconnect yes +fi + +if [ -n "$wifi_con" ]; then + nmcli connection modify "$wifi_con" ipv4.dns-priority 100 + nmcli connection modify "$wifi_con" ipv4.route-metric 600 +fi + case $BLOCK_BUTTON in 1) "$TERMINAL" -e nmtui pkill -RTMIN+7 dwmblocks ;; +2) + wifi_dev="$(nmcli -t -f DEVICE,TYPE device | + awk -F: '$2=="wifi" { print $1; exit }')" + + wifi_state="$(nmcli -t -f DEVICE,STATE device | + awk -F: -v dev="$wifi_dev" '$1==dev { print $2 }')" + + if [ "$wifi_state" = "connected" ]; then + nmcli radio wifi off + notify-send "Wi-Fi" "Wi-Fi disconnected" + else + nmcli radio wifi on + notify-send "Wi-Fi" "Wi-Fi connected" + fi + + pkill -RTMIN+7 dwmblocks + ;; 3) notify-send "🌐 Internet module" "\- Left click to connect ❌: wifi disabled 📡: no wifi connection 🛜: wifi connection with quality ❎: no ethernet 🌐: ethernet working -🛰️: vpn is active +🛰: vpn is active " ;; 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac # Wifi -if grep -q 'up' /sys/class/net/w*/operstate; then - wifiicon="$(awk '/^\s*w/ { print "🛜" int($3 * 100 / 70) "%" }' /proc/net/wireless)" -elif grep -q 'down' /sys/class/net/w*/operstate; then - grep -q '0x1003' /sys/class/net/w*/flags && wifiicon="📡" || wifiicon="❌" +if grep -q 'up' /sys/class/net/w*/operstate 2>/dev/null; then + if grep -q '^\s*w' /proc/net/wireless; then + wifiicon="$(awk '/^\s*w/ { print "🛜" int($3 * 100 / 70) "%" }' /proc/net/wireless)" + else + wifiicon="📡" + fi +elif grep -q 'down' /sys/class/net/w*/operstate 2>/dev/null; then + wifiicon="❌" fi # Ethernet grep -q 'up' /sys/class/net/e*/operstate && ethericon="🌐" || ethericon="❎" # TUN -[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon="🛰️" +grep -q 'up' /sys/class/net/tun*/operstate 2>/dev/null && tunicon="🛰" icons="" [ -n "$wifiicon" ] && icons="${icons}$wifiicon " diff --git a/ar/.local/bin/statusbar/sb-keyboard b/ar/.local/bin/statusbar/sb-keyboard index 34fa2bc..67b5f6d 100755 --- a/ar/.local/bin/statusbar/sb-keyboard +++ b/ar/.local/bin/statusbar/sb-keyboard @@ -5,7 +5,7 @@ case $BLOCK_BUTTON in 1) fcitx5-remote -t && kill -44 "$(pidof "${STATUSBAR:-dwmblocks}")" ;; 2) remaps ;; -3) notify-send "⌨️ Input Method module" "\- Shows current input method (defalt US) +3) notify-send "⌨ Input Method module" "\- Shows current input method (defalt US) - Left click to switch language (EN/KO) - Middle click to change keyboard" ;; 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; @@ -28,4 +28,4 @@ hangul) lang="KO" ;; *) lang="??" ;; esac -echo "⌨️$lang" +echo "⌨$lang" diff --git a/ar/.local/bin/statusbar/sb-repos b/ar/.local/bin/statusbar/sb-repos index 2c259ba..d5acfac 100755 --- a/ar/.local/bin/statusbar/sb-repos +++ b/ar/.local/bin/statusbar/sb-repos @@ -9,7 +9,7 @@ private_repos="$HOME/Private/repos" public_repos="${XDG_PUBLICSHARE_DIR:-${HOME}/Public}/repos" # Icon indicators -dotfiles_icon="⚙️" +dotfiles_icon="⚙" suckless_icon="🛠" private_icon="🏠" public_icon="🏢" diff --git a/ar/.local/bin/ylog b/ar/.local/bin/ylog index 254803b..c56df36 100755 --- a/ar/.local/bin/ylog +++ b/ar/.local/bin/ylog @@ -5,7 +5,7 @@ LOG_DIR="/var/log/nginx" TARGET="all" # "all" means no target filter (show all lines) COUNTRY="all" # all|kr|us -SCOPE="all" # all|access|recordings +SCOPE="all" # all|access|recordings|hidden|diary|peertube EXCL_FIREFOX=0 # 1 = exclude Firefox lines by default EXCLUDES="59.19.56.8" # default exclude pattern ADD_EXCLUDES="" @@ -24,13 +24,16 @@ Options: -c COUNTRY Select country logs (default: all) all : all logs - kr : recordings.kr.log + recordings.access.log - us : recordings.us.log + recordings.access.log + kr : recordings.kr.log + recordings.access.log (and diary.kr.log when -s diary) + us : recordings.us.log + recordings.access.log (and diary.us.log when -s diary) -s SCOPE Select log scope (default: all) - all : recordings + access + all : recordings + access + hidden + diary + peertube recordings : recordings.* logs only access : access.* logs only + hidden : hidden.access.* logs only + diary : diary.* logs only + peertube : peertube.* logs only -n Disable Firefox exclusion (by default, Firefox lines are excluded) @@ -51,7 +54,10 @@ Options: Examples: ylog # All logs, last 10 lines each ylog -s recordings # Recordings logs only, last 10 lines each + ylog -s diary # Diary logs only, last 10 lines each + ylog -s peertube # Peertube logs only, last 10 lines each ylog -c kr -t 1.2.3.4 # Search specific IP in Korean logs + ylog -c kr -s diary # Korean diary logs only ylog -t all -l 50 # All logs, last 50 lines each ylog -d 1 # Logs from 1 day ago only ylog -d ~2 # Logs from 2 days ago to today @@ -119,6 +125,32 @@ pick_files() { [ -e "$q" ] && printf "%s\n" "$q" done fi + # diary logs: similar structure to recordings + if [ "$SCOPE" = "diary" ] || [ "$SCOPE" = "all" ]; then + if [ "$COUNTRY" = "all" ]; then + for q in "$LOG_DIR/diary.access.log" "$LOG_DIR/diary.access.log".*; do + [ -e "$q" ] && printf "%s\n" "$q" + done + fi + case "$COUNTRY" in + kr) for q in "$LOG_DIR/diary.kr.log" "$LOG_DIR/diary.kr.log".*; do [ -e "$q" ] && printf "%s\n" "$q"; done ;; + us) for q in "$LOG_DIR/diary.us.log" "$LOG_DIR/diary.us.log".*; do [ -e "$q" ] && printf "%s\n" "$q"; done ;; + all) + for p in diary.kr.log diary.us.log; do + for q in "$LOG_DIR/$p" "$LOG_DIR/$p".*; do [ -e "$q" ] && printf "%s\n" "$q"; done + done + ;; + esac + fi + # peertube logs + if [ "$SCOPE" = "peertube" ] || [ "$SCOPE" = "all" ]; then + for q in "$LOG_DIR/peertube.access.log" "$LOG_DIR/peertube.access.log".*; do + [ -e "$q" ] && printf "%s\n" "$q" + done + for q in "$LOG_DIR/peertube.error.log" "$LOG_DIR/peertube.error.log".*; do + [ -e "$q" ] && printf "%s\n" "$q" + done + fi } # build exclude regex diff --git a/debian/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua b/debian/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua index 993b02c..848bf09 100644 --- a/debian/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua +++ b/debian/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua @@ -796,21 +796,21 @@ end tell ---@return string symbol, string hlGroup local function mapSymbols(status, is_symlink) local statusMap = { --- stylua: ignore start -[" M"] = { symbol = "✹", hlGroup = "MiniDiffSignChange"}, -- Modified in the working directory -["M "] = { symbol = "•", hlGroup = "MiniDiffSignChange"}, -- modified in index -["MM"] = { symbol = "≠", hlGroup = "MiniDiffSignChange"}, -- modified in both working tree and index -["A "] = { symbol = "+", hlGroup = "MiniDiffSignAdd" }, -- Added to the staging area, new file -["AA"] = { symbol = "≈", hlGroup = "MiniDiffSignAdd" }, -- file is added in both working tree and index -["D "] = { symbol = "-", hlGroup = "MiniDiffSignDelete"}, -- Deleted from the staging area -["AM"] = { symbol = "⊕", hlGroup = "MiniDiffSignChange"}, -- added in working tree, modified in index -["AD"] = { symbol = "-•", hlGroup = "MiniDiffSignChange"}, -- Added in the index and deleted in the working directory -["R "] = { symbol = "→", hlGroup = "MiniDiffSignChange"}, -- Renamed in the index -["U "] = { symbol = "‖", hlGroup = "MiniDiffSignChange"}, -- Unmerged path -["UU"] = { symbol = "⇄", hlGroup = "MiniDiffSignAdd" }, -- file is unmerged -["UA"] = { symbol = "⊕", hlGroup = "MiniDiffSignAdd" }, -- file is unmerged and added in working tree -["??"] = { symbol = "?", hlGroup = "MiniDiffSignDelete"}, -- Untracked files -["!!"] = { symbol = "!", hlGroup = "MiniDiffSignChange"}, -- Ignored files + -- stylua: ignore start + [" M"] = { symbol = "✹", hlGroup = "MiniDiffSignChange"}, -- Modified in the working directory + ["M "] = { symbol = "•", hlGroup = "MiniDiffSignChange"}, -- modified in index + ["MM"] = { symbol = "≠", hlGroup = "MiniDiffSignChange"}, -- modified in both working tree and index + ["A "] = { symbol = "+", hlGroup = "MiniDiffSignAdd" }, -- Added to the staging area, new file + ["AA"] = { symbol = "≈", hlGroup = "MiniDiffSignAdd" }, -- file is added in both working tree and index + ["D "] = { symbol = "-", hlGroup = "MiniDiffSignDelete"}, -- Deleted from the staging area + ["AM"] = { symbol = "⊕", hlGroup = "MiniDiffSignChange"}, -- added in working tree, modified in index + ["AD"] = { symbol = "-•", hlGroup = "MiniDiffSignChange"}, -- Added in the index and deleted in the working directory + ["R "] = { symbol = "→", hlGroup = "MiniDiffSignChange"}, -- Renamed in the index + ["U "] = { symbol = "‖", hlGroup = "MiniDiffSignChange"}, -- Unmerged path + ["UU"] = { symbol = "⇄", hlGroup = "MiniDiffSignAdd" }, -- file is unmerged + ["UA"] = { symbol = "⊕", hlGroup = "MiniDiffSignAdd" }, -- file is unmerged and added in working tree + ["??"] = { symbol = "?", hlGroup = "MiniDiffSignDelete"}, -- Untracked files + ["!!"] = { symbol = "!", hlGroup = "MiniDiffSignChange"}, -- Ignored files -- stylua: ignore end } @@ -927,18 +927,18 @@ end tell ---@param buf_id integer ---@return nil local function updateGitStatus(buf_id) - local cwd = vim.uv.cwd() - if not cwd or not vim.fs.root(cwd, ".git") then + local git_root = vim.fs.root(buf_id, ".git") + if not git_root then return end local currentTime = os.time() - if gitStatusCache[cwd] and currentTime - gitStatusCache[cwd].time < cacheTimeout then - updateMiniWithGit(buf_id, gitStatusCache[cwd].statusMap) + if gitStatusCache[git_root] and currentTime - gitStatusCache[git_root].time < cacheTimeout then + updateMiniWithGit(buf_id, gitStatusCache[git_root].statusMap) else - fetchGitStatus(cwd, function(content) + fetchGitStatus(git_root, function(content) local gitStatusMap = parseGitStatus(content) - gitStatusCache[cwd] = { + gitStatusCache[git_root] = { time = currentTime, statusMap = gitStatusMap, } @@ -979,9 +979,9 @@ end tell pattern = "MiniFilesBufferUpdate", callback = function(sii) local bufnr = sii.data.buf_id - local cwd = vim.fn.expand("%:p:h") - if gitStatusCache[cwd] then - updateMiniWithGit(bufnr, gitStatusCache[cwd].statusMap) + local git_root = vim.fs.root(bufnr, ".git") + if git_root and gitStatusCache[git_root] then + updateMiniWithGit(bufnr, gitStatusCache[git_root].statusMap) end end, }) diff --git a/debian/.local/bin/fzffiles b/debian/.local/bin/fzffiles index 97047e9..9f5cd90 100755 --- a/debian/.local/bin/fzffiles +++ b/debian/.local/bin/fzffiles @@ -35,7 +35,7 @@ files=$(fzf-tmux \ fi fi if [ -d \"\$target\" ]; then - exa --color=always --long --all --header --icons --git \"\$target\" + eza --color=always --long --all --header --icons --git \"\$target\" elif [ -f \"\$target\" ]; then bat --color=always --style=header,grid --line-range=:500 \"\$target\" else diff --git a/global/.gnupg/sshcontrol b/global/.gnupg/sshcontrol index 24243e0..e64aa3c 100644 --- a/global/.gnupg/sshcontrol +++ b/global/.gnupg/sshcontrol @@ -21,4 +21,7 @@ CEA80B05ABA46C5DE584655EFD7D26E81A2DFF65 # Ed25519 key added on: 2025-12-26 23:24:56 # Fingerprints: MD5:4d:4a:d4:bf:7f:05:d5:5c:b1:e6:15:dc:6f:f8:fb:d8 # SHA256:T8WNYKy8dz+VIYeVm3k3bqpcZiViQChxrNc3BIVgykk -B62CB11C68C40B7C5E743B2DD09D0D8CED85EB92 0 +# Ed25519 key added on: 2026-01-09 00:07:16 +# Fingerprints: MD5:94:45:bc:ff:b2:5e:9f:56:04:a1:b5:e4:6d:c0:1f:c1 +# SHA256:VL5p1d+iHFL8EJZ/y/tgrUXhpxads6ik1SoZim+U/fk +5A04F5DC42D5A09E50DFEB163B5F3E5A89FC04FE 0 diff --git a/global/.ssh/config b/global/.ssh/config index 95182bb..bbeb10f 100644 --- a/global/.ssh/config +++ b/global/.ssh/config @@ -1,14 +1,16 @@ Match host * exec "gpg-connect-agent UPDATESTARTUPTTY /bye" -Host recordings +Host diary HostName thesiah.xyz User root RequestTTY yes - RemoteCommand cd /var/www/thesiah/recordings && exec $SHELL -l + RemoteCommand cd /var/www/thesiah/diary && exec $SHELL -l -Host github.com +Host github + HostName github.com User git IdentityAgent ~/.gnupg/S.gpg-agent.ssh + IdentitiesOnly yes Host evcp HostName 3.36.92.165 diff --git a/global/Music/.music.txt b/global/Music/.music.txt index a64bfc5..723a23d 100644 --- a/global/Music/.music.txt +++ b/global/Music/.music.txt @@ -914,3 +914,5 @@ youtube edJ1dXbaqak youtube Qe8fa4b5xNU youtube RgKAFK5djSk youtube 6wmuFMBouyQ +youtube t8p8FF16zJs +youtube Ejc__vhP2U8 diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua index 52ceb01..ee97612 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua @@ -260,6 +260,75 @@ return { }, }, { + "greggh/claude-code.nvim", + dependencies = { + "nvim-lua/plenary.nvim", -- Required for git operations + }, + config = function() + require("claude-code").setup({ + -- Terminal window settings + window = { + split_ratio = 0.3, -- Percentage of screen for the terminal window (height for horizontal, width for vertical splits) + position = "vertical", -- Position of the window: "botright", "topleft", "vertical", "float", etc. + enter_insert = true, -- Whether to enter insert mode when opening Claude Code + hide_numbers = true, -- Hide line numbers in the terminal window + hide_signcolumn = true, -- Hide the sign column in the terminal window + + -- Floating window configuration (only applies when position = "float") + float = { + width = "80%", -- Width: number of columns or percentage string + height = "80%", -- Height: number of rows or percentage string + row = "center", -- Row position: number, "center", or percentage string + col = "center", -- Column position: number, "center", or percentage string + relative = "editor", -- Relative to: "editor" or "cursor" + border = "rounded", -- Border style: "none", "single", "double", "rounded", "solid", "shadow" + }, + }, + -- File refresh settings + refresh = { + enable = true, -- Enable file change detection + updatetime = 100, -- updatetime when Claude Code is active (milliseconds) + timer_interval = 1000, -- How often to check for file changes (milliseconds) + show_notifications = true, -- Show notification when files are reloaded + }, + -- Git project settings + git = { + use_git_root = true, -- Set CWD to git root when opening Claude Code (if in git project) + }, + -- Shell-specific settings + shell = { + separator = "&&", -- Command separator used in shell commands + pushd_cmd = "pushd", -- Command to push directory onto stack (e.g., 'pushd' for bash/zsh, 'enter' for nushell) + popd_cmd = "popd", -- Command to pop directory from stack (e.g., 'popd' for bash/zsh, 'exit' for nushell) + }, + -- Command settings + command = "claude", -- Command used to launch Claude Code + -- Command variants + command_variants = { + -- Conversation management + continue = "--continue", -- Resume the most recent conversation + resume = "--resume", -- Display an interactive conversation picker + + -- Output options + verbose = "--verbose", -- Enable verbose logging with full turn-by-turn output + }, + -- Keymaps + keymaps = { + toggle = { + normal = "<C-,>", -- Normal mode keymap for toggling Claude Code, false to disable + terminal = "<C-,>", -- Terminal mode keymap for toggling Claude Code, false to disable + variants = { + continue = "<leader>cC", -- Normal mode keymap for Claude Code with continue flag + verbose = "<leader>cV", -- Normal mode keymap for Claude Code with verbose flag + }, + }, + window_navigation = true, -- Enable window navigation keymaps (<C-h/j/k/l>) + scrolling = true, -- Enable scrolling keymaps (<C-f/b>) for page up/down + }, + }) + end, + }, + { "NickvanDyke/opencode.nvim", dependencies = { -- Recommended for `ask()` and `select()`. @@ -277,7 +346,7 @@ return { vim.o.autoread = true -- Recommended/example keymaps. - vim.keymap.set({ "n", "x" }, "<C-a>", function() + vim.keymap.set({ "n", "x" }, "<C-q>", function() require("opencode").ask("@this: ", { submit = true }) end, { desc = "Ask opencode" }) vim.keymap.set({ "n", "x" }, "<C-x>", function() @@ -387,7 +456,7 @@ return { instructions_file = "avante.md", ---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string ---@type Provider - provider = "openai", -- The provider used in Aider mode or in the planning phase of Cursor Planning Mode + provider = "claude", -- The provider used in Aider mode or in the planning phase of Cursor Planning Mode ---@alias Mode "agentic" | "legacy" ---@type Mode mode = "agentic", -- The default mode for interaction. "agentic" uses tools to automatically generate code, "legacy" uses the old planning method to generate code. @@ -398,6 +467,7 @@ return { providers = { claude = { endpoint = "https://api.anthropic.com", + auth_type = "max", -- Set to "max" to sign in with Claude Pro/Max subscription model = "claude-sonnet-4-20250514", timeout = 30000, -- Timeout in milliseconds extra_request_body = { diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua index be4daa4..a9e39c2 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua @@ -927,18 +927,18 @@ return { ---@param buf_id integer ---@return nil local function updateGitStatus(buf_id) - local cwd = vim.uv.cwd() - if not cwd or not vim.fs.root(cwd, ".git") then + local git_root = vim.fs.root(buf_id, ".git") + if not git_root then return end local currentTime = os.time() - if gitStatusCache[cwd] and currentTime - gitStatusCache[cwd].time < cacheTimeout then - updateMiniWithGit(buf_id, gitStatusCache[cwd].statusMap) + if gitStatusCache[git_root] and currentTime - gitStatusCache[git_root].time < cacheTimeout then + updateMiniWithGit(buf_id, gitStatusCache[git_root].statusMap) else - fetchGitStatus(cwd, function(content) + fetchGitStatus(git_root, function(content) local gitStatusMap = parseGitStatus(content) - gitStatusCache[cwd] = { + gitStatusCache[git_root] = { time = currentTime, statusMap = gitStatusMap, } @@ -979,9 +979,9 @@ return { pattern = "MiniFilesBufferUpdate", callback = function(sii) local bufnr = sii.data.buf_id - local cwd = vim.fn.expand("%:p:h") - if gitStatusCache[cwd] then - updateMiniWithGit(bufnr, gitStatusCache[cwd].statusMap) + local git_root = vim.fs.root(bufnr, ".git") + if git_root and gitStatusCache[git_root] then + updateMiniWithGit(bufnr, gitStatusCache[git_root].statusMap) end end, }) diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/recordings.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua index 9ce9124..90528a1 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/recordings.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua @@ -6,8 +6,8 @@ local f = ls.function_node local fmt = require("luasnip.extras.fmt").fmta -local recordings_snippet = s( - "recordings", +local diary_snippet = s( + "diary", fmt( [[--- title: <title> @@ -26,5 +26,5 @@ date: <date> ) ) -ls.add_snippets("markdown", { recordings_snippet }) -ls.add_snippets("quarto", { recordings_snippet }) +ls.add_snippets("markdown", { diary_snippet }) +ls.add_snippets("quarto", { diary_snippet }) diff --git a/mac/.config/shell/aliasrc b/mac/.config/shell/aliasrc index 6dcdf7d..64783f8 100644 --- a/mac/.config/shell/aliasrc +++ b/mac/.config/shell/aliasrc @@ -383,7 +383,7 @@ alias skype='skypeforlinux' # ssh alias gts="ssh $THESIAH_SERVER" -alias wwr="ssh recordings" +alias wwr="ssh diary" # sudo alias su='sudo su -l root' @@ -501,6 +501,6 @@ alias szs="source ${XDG_CONFIG_HOME:-${HOME}/.config}/zsh/.zshrc" alias ylogh='ylog -s hidden -c us | grep $(LC_TIME=C date +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' alias ylogi='ylog -s hidden -c us | grep $(LC_TIME=C date -v-1d +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' -alias ylogt='ylog -s recordings -c us | grep $(LC_TIME=C date +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' -alias ylogy='ylog -s recordings -c us | grep $(LC_TIME=C date -v-1d +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' -alias ylogu='ylog -s recordings -c us' +alias ylogt='ylog -s diary -c us | grep $(LC_TIME=C date +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' +alias ylogy='ylog -s diary -c us | grep $(LC_TIME=C date -v-1d +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' +alias ylogu='ylog -s diary -c us' diff --git a/mac/.config/tmux/tmux.conf b/mac/.config/tmux/tmux.conf index eb13530..156cfff 100644 --- a/mac/.config/tmux/tmux.conf +++ b/mac/.config/tmux/tmux.conf @@ -319,7 +319,7 @@ set -ga status-right "#[bg=default,fg=#{@thm_overlay_0},none]│" # TODO: configure when the battery is available set -ga status-right "#{?#{<=:#{battery_percentage},0},#{#[bg=default,fg=#{@thm_red}] #{battery_icon} },#{#[bg=default,fg=#{@thm_green}]} #{battery_icon} #{battery_percentage} }" set -ga status-right "#[bg=default,fg=#{@thm_overlay_0},none]│" -set -ga status-right "#[bg=default]#{?#{==:#{online_status},ok},#[fg=#{@thm_pink}] ,#[fg=#{@thm_red},bold]#[reverse] }" +set -ga status-right "#{?#{==:#{online_status},ok},#{#[fg=#{@thm_pink}] },#{#[fg=#{@thm_red},bold,reverse]} }" set -ga status-right "#[bg=default,fg=#{@thm_overlay_0},none]│" # set -ga status-right "#[bg=default,fg=#{@thm_red}] #{weather} " # set -ga status-right "#[bg=default,fg=#{@thm_overlay_0},none]│" diff --git a/mac/.config/zsh/scripts.zsh b/mac/.config/zsh/scripts.zsh index f92a6c4..ac59ca6 100644 --- a/mac/.config/zsh/scripts.zsh +++ b/mac/.config/zsh/scripts.zsh @@ -388,9 +388,13 @@ EOF ) [[ -z "${SELECTED_DIRS// }" ]] && return if [[ "$(echo "$SELECTED_DIRS" | wc -l)" -eq 1 ]]; then - cd "$SELECTED_DIRS" - if [[ -n "$(git -C "$SELECTED_DIRS" status --porcelain)" ]]; then - git status --porcelain 2>/dev/null + if [[ -n "$TMUX" ]]; then + opensessions "$SELECTED_DIRS" + else + cd "$SELECTED_DIRS" || return + if [[ -n "$(git -C "$SELECTED_DIRS" status --porcelain 2>/dev/null)" ]]; then + git status --porcelain + fi fi else opensessions "$SELECTED_DIRS" diff --git a/mac/.local/bin/fzffiles b/mac/.local/bin/fzffiles index 97047e9..6c0bcfd 100755 --- a/mac/.local/bin/fzffiles +++ b/mac/.local/bin/fzffiles @@ -11,7 +11,7 @@ IFS=' files=$(fzf-tmux \ --header "^a pwd ^b public ^d .dotfiles ^f configs ^g git ^h home ^k desktop ^r scripts ^s suckless ^u staged files ^v private ^/ help" \ --preview "selection={}; - clean=\$(printf '%s' \"\$selection\" | sed -e 's/^📄 //' -e 's/^✏️ //' -e 's/^✅ //' -e 's/^❌ //' -e 's/^🔀 //' -e 's/^❓ //'); + clean=\$(printf '%s' \"\$selection\" | sed -e 's/^📄 //' -e 's/^✏️ //' -e 's/^✅ //' -e 's/^❌ //' -e 's/^🔀 //' -e 's/^🗑️ //' -e 's/^❓ //'); [ -z \"\$clean\" ] && { echo 'No selection'; exit 0; } target=\$(readlink -f \"\$clean\" 2>/dev/null || printf '%s' \"\$clean\"); if [ -z \"\$target\" ]; then @@ -35,7 +35,7 @@ files=$(fzf-tmux \ fi fi if [ -d \"\$target\" ]; then - exa --color=always --long --all --header --icons --git \"\$target\" + eza --color=always --long --all --header --icons --git \"\$target\" elif [ -f \"\$target\" ]; then bat --color=always --style=header,grid --line-range=:500 \"\$target\" else @@ -61,7 +61,8 @@ files=$(fzf-tmux \ file=substr(\$0,4); gsub(/^ +/, \"\", file); if (file == \"\") next; - if (staged == \"?\" && unstaged == \"?\") icon=\"📄\"; + if (staged == \"D\" || unstaged == \"D\") icon=\"🗑️\"; + else if (staged == \"?\" && unstaged == \"?\") icon=\"📄\"; else if (staged == \"!\" && unstaged == \"!\") icon=\"❌\"; else if (staged != \" \" && staged != \"?\" && unstaged != \" \" && unstaged != \"?\") icon=\"🔀\"; else if (staged != \" \" && staged != \"?\") icon=\"✅\"; @@ -85,7 +86,7 @@ files=$(fzf-tmux \ # Check if any files were selected, and exit if not [ -z "$files" ] && exit 0 -files=$(printf '%s\n' "$files" | sed -e 's/^📄 //' -e 's/^✏️ //' -e 's/^✅ //' -e 's/^❌ //' -e 's/^🔀 //' -e 's/^❓ //') +files=$(printf '%s\n' "$files" | sed -e 's/^📄 //' -e 's/^✏️ //' -e 's/^✅ //' -e 's/^❌ //' -e 's/^🔀 //' -e 's/^🗑️ //' -e 's/^❓ //') if [ -d "$files" ]; then absolute_files=$(realpath $files) diff --git a/mac/.local/bin/hugow b/mac/.local/bin/hugow index 972d285..13cdf51 100755 --- a/mac/.local/bin/hugow +++ b/mac/.local/bin/hugow @@ -2,11 +2,11 @@ set -eu repodir="$HOME/Private/repos/THESIAH" -out="$repodir/public/recordings/index.html" +out="$repodir/public/diary/index.html" server="${THESIAH_SERVER:-root@thesiah.xyz}" -dest="/var/www/thesiah/recordings/" +dest="/var/www/thesiah/diary/" defaults="sy after foramonth" -src="$repodir/public/recordings/" +src="$repodir/public/diary/" cd "$repodir" hugo --cleanDestinationDir @@ -27,7 +27,7 @@ fi # name = a[i] ".mp4" # insert = insert \ # " <li>\n" \ -# " <a href=\"/recordings/" name "\" data-name=\"" name "\" class=\"vid\">" name "</a>\n" \ +# " <a href=\"/diary/" name "\" data-name=\"" name "\" class=\"vid\">" name "</a>\n" \ # " </li>\n" # } # injected = 0 @@ -57,7 +57,7 @@ else fi if [ -n "${1-}" ]; then - new="$repodir/content/recordings/$1" + new="$repodir/content/diary/$1" if [ -f "$new" ]; then rsync -az --update "$new" "$server:$dest" elif [ -d "$new" ]; then diff --git a/mac/.local/bin/opensessions b/mac/.local/bin/opensessions index 6f9f236..d16f42f 100755 --- a/mac/.local/bin/opensessions +++ b/mac/.local/bin/opensessions @@ -18,7 +18,10 @@ set -- $dirs for dir in $dirs; do if [ -d "$dir" ]; then session_name=$(get_session_name "$dir") - if ! tmux has-session -t "$session_name" 2>/dev/null; then + if tmux has-session -t "$session_name" 2>/dev/null; then + session_path=$(tmux display-message -t "$session_name" -p '#{session_path}') + tmux send-keys -t "$session_name" "cd \"$session_path\"" C-m + else tmux new-session -d -s "$session_name" -c "$dir" if git -C "$dir" rev-parse --is-inside-work-tree >/dev/null 2>&1 && [ -n "$(git -C "$dir" status --porcelain)" ]; then tmux send-keys -t "$session_name" "git status --porcelain" C-m diff --git a/mac/.local/bin/ylog b/mac/.local/bin/ylog index 254803b..c56df36 100755 --- a/mac/.local/bin/ylog +++ b/mac/.local/bin/ylog @@ -5,7 +5,7 @@ LOG_DIR="/var/log/nginx" TARGET="all" # "all" means no target filter (show all lines) COUNTRY="all" # all|kr|us -SCOPE="all" # all|access|recordings +SCOPE="all" # all|access|recordings|hidden|diary|peertube EXCL_FIREFOX=0 # 1 = exclude Firefox lines by default EXCLUDES="59.19.56.8" # default exclude pattern ADD_EXCLUDES="" @@ -24,13 +24,16 @@ Options: -c COUNTRY Select country logs (default: all) all : all logs - kr : recordings.kr.log + recordings.access.log - us : recordings.us.log + recordings.access.log + kr : recordings.kr.log + recordings.access.log (and diary.kr.log when -s diary) + us : recordings.us.log + recordings.access.log (and diary.us.log when -s diary) -s SCOPE Select log scope (default: all) - all : recordings + access + all : recordings + access + hidden + diary + peertube recordings : recordings.* logs only access : access.* logs only + hidden : hidden.access.* logs only + diary : diary.* logs only + peertube : peertube.* logs only -n Disable Firefox exclusion (by default, Firefox lines are excluded) @@ -51,7 +54,10 @@ Options: Examples: ylog # All logs, last 10 lines each ylog -s recordings # Recordings logs only, last 10 lines each + ylog -s diary # Diary logs only, last 10 lines each + ylog -s peertube # Peertube logs only, last 10 lines each ylog -c kr -t 1.2.3.4 # Search specific IP in Korean logs + ylog -c kr -s diary # Korean diary logs only ylog -t all -l 50 # All logs, last 50 lines each ylog -d 1 # Logs from 1 day ago only ylog -d ~2 # Logs from 2 days ago to today @@ -119,6 +125,32 @@ pick_files() { [ -e "$q" ] && printf "%s\n" "$q" done fi + # diary logs: similar structure to recordings + if [ "$SCOPE" = "diary" ] || [ "$SCOPE" = "all" ]; then + if [ "$COUNTRY" = "all" ]; then + for q in "$LOG_DIR/diary.access.log" "$LOG_DIR/diary.access.log".*; do + [ -e "$q" ] && printf "%s\n" "$q" + done + fi + case "$COUNTRY" in + kr) for q in "$LOG_DIR/diary.kr.log" "$LOG_DIR/diary.kr.log".*; do [ -e "$q" ] && printf "%s\n" "$q"; done ;; + us) for q in "$LOG_DIR/diary.us.log" "$LOG_DIR/diary.us.log".*; do [ -e "$q" ] && printf "%s\n" "$q"; done ;; + all) + for p in diary.kr.log diary.us.log; do + for q in "$LOG_DIR/$p" "$LOG_DIR/$p".*; do [ -e "$q" ] && printf "%s\n" "$q"; done + done + ;; + esac + fi + # peertube logs + if [ "$SCOPE" = "peertube" ] || [ "$SCOPE" = "all" ]; then + for q in "$LOG_DIR/peertube.access.log" "$LOG_DIR/peertube.access.log".*; do + [ -e "$q" ] && printf "%s\n" "$q" + done + for q in "$LOG_DIR/peertube.error.log" "$LOG_DIR/peertube.error.log".*; do + [ -e "$q" ] && printf "%s\n" "$q" + done + fi } # build exclude regex |
