commit c486281b352df030640df4966ee56fd0ad89068d Author: alex Date: Thu Jul 31 00:22:23 2025 +0800 Initial commit diff --git a/.Xresources b/.Xresources new file mode 100644 index 0000000..1884e35 --- /dev/null +++ b/.Xresources @@ -0,0 +1,492 @@ +! $OpenBSD: dot.Xdefaults,v 1.3 2014/07/10 10:22:59 jasper Exp $ +!XTerm*loginShell:true ! 将Urxvt作为登录shell启动 (例如读取~/.profile或~/.bash_profile) + +! ============================================================================== +! 字体配置 +! ============================================================================== +!URxvt*font: xft:Maple Mono Normal CN Medium:size=8 +!URxvt*boldFont: xft:Maple Mono Normal CN Medium:bold:size=8 +!URxvt*italicFont: xft:Maple Mono Normal CN Medium:size=8 +!URxvt*boldItalicFont: xft:Maple Mono Normal CN Medium:bold:italic:size=8 +URxvt*font: xft:MesloLGM Nerd Font Mono:size=10,xft:Sarasa Term SC Nerd:size=10 +URxvt*boldFont: xft:MesloLGM Nerd Font Mono:bold:size=10,xft:SarasaTermSC Nerd SemiBold:size=10 +URxvt*italicFont: xft:MesloLGM Nerd Font Mono:size=10,xft:Sarasa Term SC Nerd:size=10 +URxvt*boldItalicFont: xft:MesloLGM Nerd Font Mono:bold:italic:size=10,xft:Sarasa Term SC Nerd:bold:italic:size=10 + +! 备用字体 (如果主字体中没有某个字符,会尝试使用备用字体) +!URxvt*fallbackFont: xft:Noto Color Emoji:size=10,xft:WenQuanYi Micro Hei:size=8 + +! 设置字符宽度模式 (对于中文字符很重要) +! auto: 自动识别 +! half: 所有字符都占半宽 (可能导致中文重叠) +! double: 全角字符占双倍宽度 (推荐用于中文) +URxvt*cjkWidth: double + +! ============================================================================== +! 颜色配置 +! ============================================================================== +! 真透明设置 +URxvt*depth: 32 +URxvt*background: [80]#000000 +URxvt*foreground: white + +! urxvt 颜色配置实例(Gruvbox Dark) +!URxvt*foreground: #ebdbb2 +!URxvt*background: [90]#282828 +! +!URxvt*color0: #282828 +!URxvt*color1: #cc241d +!URxvt*color2: #98971a +!URxvt*color3: #d79921 +!URxvt*color4: #458588 +!URxvt*color5: #b16286 +!URxvt*color6: #689d6a +!URxvt*color7: #a89984 +!URxvt*color8: #928374 +!URxvt*color9: #fb4934 +!URxvt*color10: #b8bb26 +!URxvt*color11: #fabd2f +!URxvt*color12: #83a598 +!URxvt*color13: #d3869b +!URxvt*color14: #8ec07c +!URxvt*color15: #ebdbb2 + +! urxvt 颜色配置实例(One Dark) +!URxvt*foreground: #abb2bf +!URxvt*background: [90]#282c34 +!URxvt*cursorColor: #528bff +! +!URxvt*color0: #282c34 +!URxvt*color1: #e06c75 +!URxvt*color2: #98c379 +!URxvt*color3: #e5c07b +!URxvt*color4: #61afef +!URxvt*color5: #c678dd +!URxvt*color6: #56b6c2 +!URxvt*color7: #dcdfe4 +!URxvt*color8: #5c6370 +!URxvt*color9: #e06c75 +!URxvt*color10: #98c379 +!URxvt*color11: #d19a66 +!URxvt*color12: #61afef +!URxvt*color13: #c678dd +!URxvt*color14: #56b6c2 +!URxvt*color15: #ffffff + +! urxvt 颜色配置实例(Dracula) +!URxvt*foreground: #f8f8f2 +!URxvt*background: [90]#282a36 +!URxvt*cursorColor: #f8f8f2 +! +!URxvt*color0: #21222c +!URxvt*color1: #ff5555 +!URxvt*color2: #50fa7b +!URxvt*color3: #f1fa8c +!URxvt*color4: #bd93f9 +!URxvt*color5: #ff79c6 +!URxvt*color6: #8be9fd +!URxvt*color7: #f8f8f2 +!URxvt*color8: #6272a4 +!URxvt*color9: #ff6e6e +!URxvt*color10: #69ff94 +!URxvt*color11: #ffffa5 +!URxvt*color12: #d6acff +!URxvt*color13: #ff92df +!URxvt*color14: #a4ffff +!URxvt*color15: #ffffff + +! urxvt 颜色配置实例(Nord) +!URxvt*foreground: #D8DEE9 +!URxvt*background: [90]#2E3440 +URxvt*cursorColor: #88C0D0 + +URxvt*color0: #3B4252 +URxvt*color1: #BF616A +URxvt*color2: #A3BE8C +URxvt*color3: #EBCB8B +URxvt*color4: #81A1C1 +URxvt*color5: #B48EAD +URxvt*color6: #88C0D0 +URxvt*color7: #E5E9F0 +URxvt*color8: #4C566A +URxvt*color9: #BF616A +URxvt*color10: #A3BE8C +URxvt*color11: #EBCB8B +URxvt*color12: #81A1C1 +URxvt*color13: #B48EAD +URxvt*color14: #8FBCBB +URxvt*color15: #ECEFF4 + +! ============================================================================== +! 滚动条配置 +! ============================================================================== +! 隐藏滚动条 +URxvt*scrollBar: false +! 滚动条在右侧 +URxvt*scrollBar_right: true +! 滚动条悬浮在窗口边缘 +URxvt*scrollBar_floating: true +! 仅在需要时显示滚动条 +URxvt*scrollBar_on_request: true +! 滚动条颜色 +URxvt*scrollcolor: #888888 +! 滚动条槽颜色 +URxvt*troughcolor: #333333 +! 滚动条厚度 +URxvt*thickness: 8 + +! 滚动条回溯缓冲区大小(保存多少行历史) +URxvt*saveLines: 10000 + +! ============================================================================== +! 光标配置 +! ============================================================================== +! 下划线光标 +URxvt*cursorUnderline: true +! 块状光标 +URxvt*cursorBlock: false +! 竖线光标(I-beam) +URxvt*cursorBar: false +! 光标闪烁 +URxvt*cursorBlink: true + +! ============================================================================== +! 其他实用功能 +! ============================================================================== +! 关闭闪烁的bell(通常比audible bell更烦人) +URxvt*bell-urxvt: false +! 启动audible bell(声音提示) +URxvt*audibleBell: true +! 关闭iso14755模式,避免Ctrl+Shift+L无法使用 +URxvt*iso14755: false + +! 字体间距 (可选,微调字体显示) +! 字符间距(默认0) +URxvt*letterSpace: 0 +! 字符行间距(默认0) +URxvt*lineSpace: 0 + +!------------------------------------------------------------------------------ +!Xterm 核心配置 +!定义 XTerm 类名,所有以下配置都将应用于 XTerm 实例 +XTerm*termName: xterm-256color + +! ============================================================================== +! 字体配置 +! ============================================================================== +! 启用 Xft 字体渲染 +XTerm*renderFont: true + +! 指定主字体和字号 +! 格式: xft:Font Name:size=SIZE +! 注意: Xterm 在处理粗体/斜体字体时,通常会通过字体渲染库自动合成, +! 或者你可以尝试为 boldFont, italicFont 单独指定,但效果可能不如Urxvt灵活。 +XTerm*faceName: xft:MesloLGM Nerd Font Mono:style=Normal:size=9,xft:Sarasa Term SC Nerd:size=9 +! 显式设置字号,与faceName配合 +XTerm*faceSize: 9 + +! 备用字体 (如果主字体中没有某个字符,会尝试使用备用字体) +! 对于中文或 Emoji 支持至关重要。多个字体用逗号分隔,并按照优先级排列。 +! Xterm 对 fallbackFont 的支持不如 Urxvt 那么直接,有时需要将它们串联在 faceName 中。 +! 尝试将它们放在 faceName 中,或者如果你的 Xterm 版本支持,可以尝试 fallbackFont。 +! 更稳妥的做法是,确保你的主字体(如 Maple Mono CN)本身就包含了这些字符集。 +! 或者: +! XTerm*faceName: xft:Maple Mono Normal CN Medium:size=9:antialias=true:autohint=true,xft:Noto Color Emoji:size=10,xft:WenQuanYi Micro Hei:size=9 + +! 设置字符宽度模式 (对于中文字符很重要) +! 这是解决 Xterm 中文字符过宽或重叠问题的关键。 +XTerm*cjkWidth: true + +! ============================================================================== +! 颜色配置 +! ============================================================================== +! Xterm 配色实例(Tomorrow Light) +!XTerm*foreground: #4d4d4c +!XTerm*background: #ffffff +!XTerm*cursorColor: #4d4d4c +! +!XTerm*color0: #000000 +!XTerm*color1: #c82829 +!XTerm*color2: #718c00 +!XTerm*color3: #eab700 +!XTerm*color4: #4271ae +!XTerm*color5: #8959a8 +!XTerm*color6: #3e999f +!XTerm*color7: #ffffff +!XTerm*color8: #777777 +!XTerm*color9: #c82829 +!XTerm*color10: #718c00 +!XTerm*color11: #eab700 +!XTerm*color12: #4271ae +!XTerm*color13: #8959a8 +!XTerm*color14: #3e999f +!XTerm*color15: #ffffff + +! Xterm 配色实例(Dracula) +!XTerm*foreground: #f8f8f2 +!XTerm*background: #282a36 +!XTerm*cursorColor: #f8f8f2 +! +!XTerm*color0: #21222c +!XTerm*color1: #ff5555 +!XTerm*color2: #50fa7b +!XTerm*color3: #f1fa8c +!XTerm*color4: #bd93f9 +!XTerm*color5: #ff79c6 +!XTerm*color6: #8be9fd +!XTerm*color7: #f8f8f2 +!XTerm*color8: #6272a4 +!XTerm*color9: #ff6e6e +!XTerm*color10: #69ff94 +!XTerm*color11: #ffffa5 +!XTerm*color12: #d6acff +!XTerm*color13: #ff92df +!XTerm*color14: #a4ffff +!XTerm*color15: #ffffff + +! Xterm 配色实例(Solarized Dark) +!XTerm*foreground: #839496 +!XTerm*background: #002b36 +!XTerm*cursorColor: #93a1a1 +! +!XTerm*color0: #073642 +!XTerm*color1: #dc322f +!XTerm*color2: #859900 +!XTerm*color3: #b58900 +!XTerm*color4: #268bd2 +!XTerm*color5: #d33682 +!XTerm*color6: #2aa198 +!XTerm*color7: #eee8d5 +!XTerm*color8: #002b36 +!XTerm*color9: #cb4b16 +!XTerm*color10: #586e75 +!XTerm*color11: #657b83 +!XTerm*color12: #839496 +!XTerm*color13: #6c71c4 +!XTerm*color14: #93a1a1 +!XTerm*color15: #fdf6e3 + +! Xterm 配色实例(Solarized Light) +!XTerm*foreground: #657b83 +!XTerm*background: #fdf6e3 +!XTerm*cursorColor: #586e75 +! +!XTerm*color0: #073642 +!XTerm*color1: #dc322f +!XTerm*color2: #859900 +!XTerm*color3: #b58900 +!XTerm*color4: #268bd2 +!XTerm*color5: #d33682 +!XTerm*color6: #2aa198 +!XTerm*color7: #eee8d5 +!XTerm*color8: #002b36 +!XTerm*color9: #cb4b16 +!XTerm*color10: #586e75 +!XTerm*color11: #657b83 +!XTerm*color12: #839496 +!XTerm*color13: #6c71c4 +!XTerm*color14: #93a1a1 +!XTerm*color15: #fdf6e3 + +! Xterm 配色实例(Base16 Default Light) +!XTerm*foreground: #383838 +!XTerm*background: #f8f8f8 +!XTerm*cursorColor: #d8d8d8 +! +!XTerm*color0: #f8f8f8 +!XTerm*color1: #ab4642 +!XTerm*color2: #a1b56c +!XTerm*color3: #f7ca88 +!XTerm*color4: #7cafc2 +!XTerm*color5: #ba8baf +!XTerm*color6: #86c1b9 +!XTerm*color7: #383838 +!XTerm*color8: #b8b8b8 +!XTerm*color9: #ab4642 +!XTerm*color10: #a1b56c +!XTerm*color11: #f7ca88 +!XTerm*color12: #7cafc2 +!XTerm*color13: #ba8baf +!XTerm*color14: #86c1b9 +!XTerm*color15: #181818 + +! Xterm 配色实例(One Light) +!XTerm*foreground: #383a42 +!XTerm*background: #fafafa +!XTerm*cursorColor: #526eff +! +!XTerm*color0: #fafafa +!XTerm*color1: #e45649 +!XTerm*color2: #50a14f +!XTerm*color3: #c18401 +!XTerm*color4: #4078f2 +!XTerm*color5: #a626a4 +!XTerm*color6: #0184bc +!XTerm*color7: #383a42 +!XTerm*color8: #a0a1a7 +!XTerm*color9: #e06c75 +!XTerm*color10: #98c379 +!XTerm*color11: #e5c07b +!XTerm*color12: #61afef +!XTerm*color13: #c678dd +!XTerm*color14: #56b6c2 +!XTerm*color15: #fafafa + +! Xterm 配色实例(GitHub Light) +!XTerm*foreground: #24292e +!XTerm*background: #ffffff +!XTerm*cursorColor: #0366d6 +! +!XTerm*color0: #24292e +!XTerm*color1: #d73a49 +!XTerm*color2: #28a745 +!XTerm*color3: #dbab09 +!XTerm*color4: #0366d6 +!XTerm*color5: #6f42c1 +!XTerm*color6: #1b7c83 +!XTerm*color7: #6a737d +!XTerm*color8: #959da5 +!XTerm*color9: #cb2431 +!XTerm*color10: #22863a +!XTerm*color11: #b08800 +!XTerm*color12: #005cc5 +!XTerm*color13: #5a32a3 +!XTerm*color14: #005f6b +!XTerm*color15: #ffffff + +! Xterm 配色实例(PaperColor Light) +!XTerm*foreground: #4d4d4c +!XTerm*background: #fefefe +!XTerm*cursorColor: #af0000 +! +!XTerm*color0: #eeeeee +!XTerm*color1: #af0000 +!XTerm*color2: #008700 +!XTerm*color3: #5f8700 +!XTerm*color4: #0087af +!XTerm*color5: #878787 +!XTerm*color6: #005f87 +!XTerm*color7: #444444 +!XTerm*color8: #bcbcbc +!XTerm*color9: #d70000 +!XTerm*color10: #d70087 +!XTerm*color11: #8700af +!XTerm*color12: #d75f00 +!XTerm*color13: #d75f00 +!XTerm*color14: #005faf +!XTerm*color15: #005f87 + +! Xterm 配色实例(Gruvbox Dark Soft) +XTerm*foreground: #ebdbb2 +XTerm*background: #282828 +XTerm*cursorColor: #fe8019 + +XTerm*color0: #282828 +XTerm*color1: #cc241d +XTerm*color2: #98971a +XTerm*color3: #d79921 +XTerm*color4: #458588 +XTerm*color5: #b16286 +XTerm*color6: #689d6a +XTerm*color7: #a89984 +XTerm*color8: #928374 +XTerm*color9: #fb4934 +XTerm*color10: #b8bb26 +XTerm*color11: #fabd2f +XTerm*color12: #83a598 +XTerm*color13: #d3869b +XTerm*color14: #8ec07c +XTerm*color15: #ebdbb2 + +! Xterm 配色实例(One Dark Pro) +!XTerm*foreground: #abb2bf +!XTerm*background: #282c34 +!XTerm*cursorColor: #528bff +! +!XTerm*color0: #282c34 +!XTerm*color1: #e06c75 +!XTerm*color2: #98c379 +!XTerm*color3: #e5c07b +!XTerm*color4: #61afef +!XTerm*color5: #c678dd +!XTerm*color6: #56b6c2 +!XTerm*color7: #dcdfe4 +!XTerm*color8: #5c6370 +!XTerm*color9: #e06c75 +!XTerm*color10: #98c379 +!XTerm*color11: #d19a66 +!XTerm*color12: #61afef +!XTerm*color13: #c678dd +!XTerm*color14: #56b6c2 +!XTerm*color15: #ffffff + +! Xterm 配色实例(Nord Dark) +!XTerm*foreground: #D8DEE9 +!XTerm*background: #2E3440 +!XTerm*cursorColor: #88C0D0 +! +!XTerm*color0: #3B4252 +!XTerm*color1: #BF616A +!XTerm*color2: #A3BE8C +!XTerm*color3: #EBCB8B +!XTerm*color4: #81A1C1 +!XTerm*color5: #B48EAD +!XTerm*color6: #88C0D0 +!XTerm*color7: #E5E9F0 +!XTerm*color8: #4C566A +!XTerm*color9: #BF616A +!XTerm*color10: #A3BE8C +!XTerm*color11: #EBCB8B +!XTerm*color12: #81A1C1 +!XTerm*color13: #B48EAD +!XTerm*color14: #8FBCBB +!XTerm*color15: #ECEFF4 + +! ============================================================================== +! 滚动条配置 +! ============================================================================== +! 隐藏滚动条 +XTerm*scrollBar: false +! 显示滚动条 +! XTerm*scrollBar: true +! 滚动条在右侧 +XTerm*rightScrollBar: true +! 更平滑的滚动 +XTerm*jumpScroll: true +! 滚动回溯缓冲区大小(保存多少行历史) +XTerm*saveLines: 10000 + +! ============================================================================== +! 光标配置 +! ============================================================================== +! 光标闪烁 +XTerm*cursorBlink: true +! 下划线光标 +!XTerm*cursorUnderline: true +! 块装光标(如果cursorUnderline是false) +! XTerm*cursorBlock: true +! 竖条光标 +XTerm*cursorShape: bar + +! ============================================================================== +! 其他实用功能 +! ============================================================================== +! 启用粗体模式 +XTerm*boldMode: true +! 高亮鼠标选择 +XTerm*highlightSelection: true +! 高亮选择的颜色(可与光标颜色不同) +XTerm*highlightColor: #81a2be + +! 启用鼠标选择即复制(通常鼠标中键粘贴) +XTerm*copySelections: true +! 复制时是否包含换行符 +XTerm*cutNewline: false +! 确保Xterm正确初始化终端模式 +XTerm*ptyInitialMode: term + +! 字体渲染调试 (如果字体显示有问题) +! XTerm*renderFont: true +! XTerm*renderFontResample: true +! XTerm*renderFontHinting: true +! XTerm*renderFontAntiAlias: true diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..8e06674 --- /dev/null +++ b/.bashrc @@ -0,0 +1,10 @@ +export LANG=zh_CN.UTF-8 +export LC_ALL=zh_CN.UTF-8 + +alias ls='colorls -Ga' +alias ll='colorls -Gal' +alias df='df -h' +alias du='du -sh' +alias ifconfig='/home/alex/color_ifconfig' + +export PS1="\[\e[1;3;36m\]\u@\h \[\e[0;33m\]\w \[\e[0m\]>" diff --git a/.config/bat/config b/.config/bat/config new file mode 100644 index 0000000..27d33a8 --- /dev/null +++ b/.config/bat/config @@ -0,0 +1 @@ +--theme=ansi diff --git a/.config/i3/config b/.config/i3/config new file mode 100644 index 0000000..e7ffb25 --- /dev/null +++ b/.config/i3/config @@ -0,0 +1,215 @@ +# This file has been auto-generated by i3-config-wizard(1). +# It will not be overwritten, so edit it as you like. +# +# Should you change your keyboard layout some time, delete +# this file and re-run i3-config-wizard(1). +# + +# i3 config file (v4) +# +# Please see https://i3wm.org/docs/userguide.html for a complete reference! + +set $mod Mod4 + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +#font pango:monospace 8 +font pango:MesloLGM Nerd Font Mono 8,Sarasa Term SC Nerd 8 + +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +#font pango:DejaVu Sans Mono 8 + +# Start XDG autostart .desktop files using dex. See also +# https://wiki.archlinux.org/index.php/XDG_Autostart +exec --no-startup-id dex --autostart --environment i3 + +# The combination of xss-lock, nm-applet and pactl is a popular choice, so +# they are included here as an example. Modify as you see fit. + +# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the +# screen before suspend. Use loginctl lock-session to lock your screen. +#exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork + +# NetworkManager is the most popular way to manage wireless networks on Linux, +# and nm-applet is a desktop environment-independent system tray GUI for it. +#exec --no-startup-id nm-applet + +# Use pactl to adjust volume in PulseAudio. +#set $refresh_i3status pkill -SIGUSR1 i3status +#bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status +#bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status +#bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +#bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# move tiling windows via drag & drop by left-clicking into the title bar, +# or left-clicking anywhere into the window while holding the floating modifier. +tiling_drag modifier titlebar + +# start a terminal +bindsym $mod+Return exec i3-sensible-terminal +bindsym Control+u exec urxvt +bindsym Control+n exec nvim-qt +bindsym Control+f exec firefox +bindsym Control+g exec gvim + +# kill focused window +bindsym $mod+Shift+q kill + +# start dmenu (a program launcher) +# bindsym $mod+d exec --no-startup-id dmenu_run +bindsym $mod+d exec --no-startup-id rofi -show drun \ + -theme gruvbox-dark \ + -show-icons +# A more modern dmenu replacement is rofi: +# bindcode $mod+40 exec "rofi -modi drun,run -show drun" +# There also is i3-dmenu-desktop which only displays applications shipping a +# .desktop file. It is a wrapper around dmenu, so you need that installed. +# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop +bindsym $mod+q exec --no-startup-id rofi -show window \ + -theme gruvbox-dark \ + -show-icons +bindsym $mod+t exec --no-startup-id rofi -show run \ + -theme gruvbox-dark \ + -show-icons + +# change focus +bindsym $mod+j focus left +bindsym $mod+k focus down +bindsym $mod+l focus up +bindsym $mod+semicolon focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window +bindsym $mod+Shift+j move left +bindsym $mod+Shift+k move down +bindsym $mod+Shift+l move up +bindsym $mod+Shift+semicolon move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+h split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +# Define names for default workspaces for which we configure key bindings later on. +# We use variables to avoid repeating the names in multiple places. +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +# switch to workspace +bindsym $mod+1 workspace number $ws1 +bindsym $mod+2 workspace number $ws2 +bindsym $mod+3 workspace number $ws3 +bindsym $mod+4 workspace number $ws4 +bindsym $mod+5 workspace number $ws5 +bindsym $mod+6 workspace number $ws6 +bindsym $mod+7 workspace number $ws7 +bindsym $mod+8 workspace number $ws8 +bindsym $mod+9 workspace number $ws9 +bindsym $mod+0 workspace number $ws10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace number $ws1 +bindsym $mod+Shift+2 move container to workspace number $ws2 +bindsym $mod+Shift+3 move container to workspace number $ws3 +bindsym $mod+Shift+4 move container to workspace number $ws4 +bindsym $mod+Shift+5 move container to workspace number $ws5 +bindsym $mod+Shift+6 move container to workspace number $ws6 +bindsym $mod+Shift+7 move container to workspace number $ws7 +bindsym $mod+Shift+8 move container to workspace number $ws8 +bindsym $mod+Shift+9 move container to workspace number $ws9 +bindsym $mod+Shift+0 move container to workspace number $ws10 + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym j resize shrink width 10 px or 10 ppt + bindsym k resize grow height 10 px or 10 ppt + bindsym l resize shrink height 10 px or 10 ppt + bindsym semicolon resize grow width 10 px or 10 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape or $mod+r + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" +} + +bindsym $mod+r mode "resize" + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +#bar { +# status_command i3status -c ~/.i3status.conf +# position top +# font pango:MesloLGM Nerd Font Mono 8 +#} + +include /home/alex/.config/i3/themes/catppuccin/config + +#client.focused #808080 #808080 #ffffff #ffffff #808080 +#client.focused_inactive #808080 #808080 #ffffff #ffffff #808080 +#client.unfocused #505050 #505050 #ffffff #ffffff #505050 +#client.urgent #ff0000 #808080 #ffffff #ff0000 #ff0000 + +exec_always --no-startup-id polybar main diff --git a/.config/i3/themes/catppuccin b/.config/i3/themes/catppuccin new file mode 160000 index 0000000..c072ada --- /dev/null +++ b/.config/i3/themes/catppuccin @@ -0,0 +1 @@ +Subproject commit c072ada05271eec960dc893affe9ac55af63a745 diff --git a/.config/lf/lfrc b/.config/lf/lfrc new file mode 100644 index 0000000..3b36840 --- /dev/null +++ b/.config/lf/lfrc @@ -0,0 +1,34 @@ +set ifs "\n" # 文件名含空格时用换行分隔 +set hidden # 显示隐藏文件 +set number # 显示行号 +set preview # 开启预览 +set previewer ~/.config/lf/pv.sh # 自定义预览脚本 +set icons # 显示图标 + +# 常用快捷键 +map $lf -remote "send $id select $(fd -t f -t d . | fzf)" # 用 fzf 跳转 +map ${{ + # 复制当前文件绝对路径 + printf '%s\n' "$fx" | xclip -sel clip +}} +map &mimeopen "$f" & # 用系统默认程序打开 +# map D trash-put "$fx" # 移动到回收站(需安装 trash-put) +map cp -r "$fx" "$d" # 复制 +map mv -n "$fx" "$d" # 移动 +map mkdir # 新建目录(内置交互) +# map rm -rf "$fx" # 删除(慎用) + +map j down +map k up +map l open +map h updir + +# 预览文本/图片/归档 +cmd pv %{{ + case "$(file -Lb --mime-type "$1")" in + text/*) bat --paging=never --color=always "$1" ;; + image/*) chafa -c 256 -s 80x25 "$1" ;; + application/zip|application/x-tar) atool -l "$1" ;; + *) file -b "$1" ;; + esac +}} diff --git a/.config/lf/pv.sh b/.config/lf/pv.sh new file mode 100755 index 0000000..3e19aa8 --- /dev/null +++ b/.config/lf/pv.sh @@ -0,0 +1,6 @@ +#!/bin/sh +case "$(file -Lb --mime-type "$1")" in + text/*|application/json|application/xml) bat --color=always --paging=never "$1" ;; + image/*) chafa -c 256 -s "$2"x"$3" "$1" ;; + *) file -b "$1" ;; +esac diff --git a/.config/nvim b/.config/nvim new file mode 160000 index 0000000..d342764 --- /dev/null +++ b/.config/nvim @@ -0,0 +1 @@ +Subproject commit d342764889c902948269469c47dd19bf6ade88bd diff --git a/.config/polybar/battery.sh b/.config/polybar/battery.sh new file mode 100755 index 0000000..2771380 --- /dev/null +++ b/.config/polybar/battery.sh @@ -0,0 +1,2 @@ +#!/bin/sh +printf "%s%%\n" "$(apm -l)" diff --git a/.config/polybar/config.ini b/.config/polybar/config.ini new file mode 100644 index 0000000..18b2928 --- /dev/null +++ b/.config/polybar/config.ini @@ -0,0 +1,230 @@ +;========================================================== +; +; +; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ +; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ +; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ +; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ +; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ +; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ +; +; +; To learn more about how to configure Polybar +; go to https://github.com/polybar/polybar +; +; The README contains a lot of information +; +;========================================================== + +[colors] +background = #282A2E +background-alt = #373B41 +foreground = #C5C8C6 +primary = #F0C674 +secondary = #8ABEB7 +alert = #A54242 +disabled = #707880 + +[bar/main] +width = 100% +height = 20pt +radius = 6 +; dpi = 96 + +;background = ${colors.background} +;foreground = ${colors.foreground} +background = #80222222 +;foreground = #90a333 + +line-size = 0pt + +border-size = 0 +border-color = #00000000 + +padding-left = 0 +padding-right = 1 + +module-margin = 1 + +separator = | +separator-foreground = ${colors.disabled} + +font-0 = Sarasa Term SC Nerd:bold:italic:siza=10;2 +font-1 = MesloLGM Nerd Font Mono:bold:size=10;2 +;font-1 = Maple Mono Normal CN:size=10;2 + +modules-left = xworkspaces +modules-right = netrate volume memory cpu battery date + +cursor-click = pointer +cursor-scroll = ns-resize + +enable-ipc = true + +; wm-restack = generic +; wm-restack = bspwm +; wm-restack = i3 + +; override-redirect = true + +; This module is not active by default (to enable it, add it to one of the +; modules-* list above). +; Please note that only a single tray can exist at any time. If you launch +; multiple bars with this module, only a single one will show it, the others +; will produce a warning. Which bar gets the module is timing dependent and can +; be quite random. +; For more information, see the documentation page for this module: +; https://polybar.readthedocs.io/en/stable/user/modules/tray.html +[module/systray] +type = internal/tray + +format-margin = 8pt +tray-spacing = 16pt + +[module/xworkspaces] +type = internal/xworkspaces + +label-active = %name% +label-active-background = ${colors.background-alt} +label-active-underline= ${colors.primary} +label-active-padding = 1 +label-active-foreground = #0afaee + +label-occupied = %name% +label-occupied-padding = 1 +label-occupied-foreground = #6487b4 + +label-urgent = %name% +label-urgent-background = ${colors.alert} +label-urgent-padding = 1 +label-urgent-foreground = #ea2e4e + +label-empty = %name% +label-empty-foreground = ${colors.disabled} +label-empty-padding = 1 + +[module/xwindow] +type = internal/xwindow +label = %title:0:60:...% + +;[module/filesystem] +;type = internal/fs +;interval = 25 +; +;mount-0 = / +; +;label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%% +; +;label-unmounted = %mountpoint% not mounted +;label-unmounted-foreground = ${colors.disabled} +; +;[module/pulseaudio] +;type = internal/pulseaudio +; +;format-volume-prefix = "VOL " +;format-volume-prefix-foreground = ${colors.primary} +;format-volume = +; +;label-volume = %percentage%% +; +;label-muted = muted +;label-muted-foreground = ${colors.disabled} + +[module/netrate] +type = custom/script +exec = ~/.config/polybar/netrate.sh +interval = 2 +format-prefix = "󰑫 " +format-prefix-foreground = ${colors.primary} +label = %output% +label-foreground = #7e9d7b + +[module/volume] +type = custom/script +exec = ~/.config/polybar/sndio.sh +interval = 1 +format-prefix = "󰵪 " +format-prefix-foreground = ${colors.primary} +label = %output%% +label-muted = muted +label-muted-foreground = ${colors.disabled} +label-foreground = #7e9d7b + +;[module/xkeyboard] +;type = internal/xkeyboard +;blacklist-0 = num lock +; +;label-layout = %layout% +;label-layout-foreground = ${colors.primary} +; +;label-indicator-padding = 2 +;label-indicator-margin = 1 +;label-indicator-foreground = ${colors.background} +;label-indicator-background = ${colors.secondary} + +[module/memory] +type = internal/memory +interval = 2 +format-prefix = "󱞚 " +format-prefix-foreground = ${colors.primary} +label = %percentage_used:2%% +label-foreground = #7e9d7b + +[module/cpu] +type = internal/cpu +interval = 2 +format-prefix = "󱑭 " +format-prefix-foreground = ${colors.primary} +label = %percentage:2%% +label-foreground = #7e9d7b + +;[module/battery] +;type = custom/script +;exec = ~/.config/polybar/battery.sh +;interval = 5 +;format =