Skip to content

Commit

Permalink
Site updated: 2024-12-09 20:00:15
Browse files Browse the repository at this point in the history
  • Loading branch information
2-3-5-7 committed Dec 9, 2024
1 parent 9580f52 commit c8e6e39
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions category/2. 处理平台/atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@
<li>.screenrc 文件,参考 <a href="https://linuxize.com/post/how-to-use-linux-screen/">How To Use Linux Screen</a> 和 <a href="https://www.gnu.org/software/screen/manual/screen.html">Screen User’s Manual</a> <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line">startup_message off</span><br><span class="line"></span><br><span class="line"># Disable visual bell</span><br><span class="line"># vbell off</span><br><span class="line"></span><br><span class="line"># Set scrollback buffer to 10000</span><br><span class="line">defscrollback 10000</span><br><span class="line"></span><br><span class="line"># https://superuser.com/questions/506080/screen-divider-border-width-and-color</span><br><span class="line">caption string "%{= dd} "</span><br><span class="line">rendition so "="</span><br><span class="line"># https://stackoverflow.com/questions/359109/using-the-scrollwheel-in-gnu-screen</span><br><span class="line">termcapinfo xterm* ti@:te@</span><br><span class="line"></span><br><span class="line"># 内存部分参考 https://stackoverflow.com/questions/18439129/system-loads-in-gnu-screens-hardstatus-line</span><br><span class="line">hardstatus alwayslastline</span><br><span class="line"># backtick 1 1 1 /bin/bash -c 'free | grep Mem | awk '\''{printf("%.1f%%", $3/$2 * 100.0)}'\'' '</span><br><span class="line">backtick 1 1 1 /bin/bash -c 'free | grep Mem | awk '\''{printf("%.1f%%", 100 - $7/$2 * 100.0)}'\'' '</span><br><span class="line">hardstatus string "%{= KG} %-Lw%{= bW}%n%f %t%{-}%+Lw %=%{= Kg}| %c %{-}%l %1`"</span><br><span class="line"># 给 Windows terminal 用的浅色主题 AtomOneLight https://windowsterminalthemes.dev/</span><br><span class="line"># hardstatus string "%{= wG} %-Lw%{= bW}%n%f %t%{-}%+Lw %=%{= wg}| %c %{-}%l %1`"</span><br><span class="line"></span><br><span class="line"># focus ctrl+a tab,other ctrl+a ctrl+a</span><br><span class="line"># 推荐在左侧标签按键,这样右侧标签分到屏幕右侧,按键焦点留在左侧</span><br><span class="line">bind v eval "split -v" focus other focus</span><br><span class="line"># 这个配置焦点在右侧</span><br><span class="line"># bind v eval "split -v" focus other</span><br><span class="line"></span><br><span class="line">bind x remove</span><br></pre></td></tr></table></figure></li>
<li>screen 状态栏显示正在执行的命令或当前路径,<a href="https://unix.stackexchange.com/questions/28430/screen-status-bar-to-display-current-directory-for-zsh-bash-shell">参考</a><ul>
<li>bash<ul>
<li>.screenrc 文件 <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"># shelltitle | 前面的 ] 表示提示符结尾</span><br><span class="line">shelltitle ']|bash'</span><br></pre></td></tr></table></figure></li>
<li>.bashrc 文件 <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> [[ <span class="variable">$TERM</span> == screen* ]]; <span class="keyword">then</span></span><br><span class="line"> PROMPT_COMMAND=<span class="string">'echo -ne "\033k\033\0134\033k[`basename ${PWD}`]\033\0134"'</span></span><br><span class="line"><span class="keyword">fi</span></span><br></pre></td></tr></table></figure></li>
<li>.screenrc 文件 <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"># shelltitle | 前面的 ] 表示提示符结尾</span><br><span class="line"># 参考官方帮助 https://aperiodic.net/screen/title_examples</span><br><span class="line">shelltitle ']|bash'</span><br></pre></td></tr></table></figure></li>
<li>.bashrc 文件,中文目录会导致显示出问题,所以用 iconv <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> [[ <span class="variable">$TERM</span> == screen* ]]; <span class="keyword">then</span></span><br><span class="line"> PROMPT_COMMAND=<span class="string">'echo -ne "\033k\033\0134\033k[`basename ${PWD} | iconv -f UTF-8 -t ASCII 2>/dev/null`]\033\0134"'</span></span><br><span class="line"><span class="keyword">fi</span></span><br></pre></td></tr></table></figure></li>
</ul>
</li>
<li>zsh,<a href="https://unix.stackexchange.com/questions/28430/screen-status-bar-to-display-current-directory-for-zsh-bash-shell">参考1</a>、<a href="https://stackoverflow.com/questions/45288905/zsh-mystery-variable-expansion">参考2</a> <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">setopt extendedglob</span><br><span class="line">if [[ $TERM == screen* ]]; then</span><br><span class="line"> precmd () {</span><br><span class="line"> local dir=$(print -Pn "%c")</span><br><span class="line"> print -Pn "\ek$dir\e\\"</span><br><span class="line"> }</span><br><span class="line"> preexec () {</span><br><span class="line"> local dir=$(print -Pn "%c")</span><br><span class="line"> # 截短是为了留空间显示 CMD</span><br><span class="line"> dir=$dir[1,6]</span><br><span class="line"> local CMD=${1[(wr)^(sudo|*=*|-*)]}</span><br><span class="line"> print -Pn "\ek$dir] ${CMD}\e\\"</span><br><span class="line"> }</span><br><span class="line">fi</span><br></pre></td></tr></table></figure>
Expand Down
2 changes: 1 addition & 1 deletion category/2. 处理平台/feed.json

Large diffs are not rendered by default.

Loading

0 comments on commit c8e6e39

Please sign in to comment.