Skip to content

Commit

Permalink
add cpu freq on right status.
Browse files Browse the repository at this point in the history
  • Loading branch information
laixintao committed Nov 6, 2024
1 parent 184bab0 commit 157c369
Show file tree
Hide file tree
Showing 12 changed files with 1,574 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .common_alias
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,5 @@ alias pytest="pytest --log-cli-level=DEBUG"
alias mount-canon="sudo rmdir -v /Volumes/canon ; sudo mkdir /Volumes/canon && sudo mount -t msdos /dev/disk2s1 /Volumes/canon"

alias reboot-foobar="vagrant halt 1c && vagrant up 1c"

alias sed="gsed"
6 changes: 4 additions & 2 deletions .config/coc/extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"coc-snippets": ">=3.1.9",
"coc-tsserver": ">=2.1.3"
},
"disabled": [],
"disabled": [
"coc-clangd"
],
"locked": [],
"lastUpdate": 1715855356043
"lastUpdate": 1721981926449
}
Binary file modified .config/coc/list_history.dat
Binary file not shown.
1 change: 1 addition & 0 deletions .config/iterm2/AppSupport
3 changes: 2 additions & 1 deletion .config/kitty/kitty.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#: individual font faces and even specify special fonts for particular
#: characters.

font_family hack
font_family "Hack"
bold_font auto
italic_font auto
bold_italic_font auto
Expand Down Expand Up @@ -535,6 +535,7 @@ macos_option_as_alt yes
#: Hide the kitty window from running tasks (Option+Tab) on macOS.

# macos_quit_when_last_window_closed no
confirm_os_window_close 0

#: Have kitty quit when all the top-level windows are closed. By
#: default, kitty will stay running, even with no open windows, as is
Expand Down
3 changes: 2 additions & 1 deletion .config/yarn/global/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"dependencies": {
"create-next-app": "^12.2.3",
"create-vite": "^5.2.3"
"create-vite": "^5.2.3",
"markmap-cli": "^0.17.2"
}
}
1,541 changes: 1,541 additions & 0 deletions .config/yarn/global/yarn.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions .tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ set -g status-bg black
set -g status-fg white
set-option -g status-justify left
set-option -g status-left '#[fg=cyan][#{session_name}]'
set-option -g status-right ''
set-option -g status-right '#(tmux-status-right.sh)'
set-option -g status-right '#[fg=#9e5d3c]#(tmux-status-right.sh)'

# window
setw -g automatic-rename off
Expand Down
4 changes: 4 additions & 0 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ function replace(){
gsed -i"" "s#$1#$2#g" $(rg --hidden $1 -l)
}

function delete-lines(){
gsed -i"" "/$1/d" $(rg --hidden $1 -l)
}

unset __PYVENV_LAUNCHER__
export ANSIBLE_NOCOWS=1
export CC=gcc
Expand Down
13 changes: 13 additions & 0 deletions bin/2
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SESSION=$(tmux display-message -p '#S')

tmux new-window -t $SESSION

WINDOW=$(tmux display-message -p '#{last_window_index}')

tmux rename-window -t $SESSION:$WINDOW $1

tmux split-window -v -t $SESSION:$WINDOW.1
tmux select-layout -t $SESSION:$WINDOW tile

tmux send-keys -t $SESSION:$WINDOW.1 "$*" C-m
tmux send-keys -t $SESSION:$WINDOW.2 "$*" C-m
5 changes: 4 additions & 1 deletion bin/tmux-status-right.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash

cpu_freq=$(sudo powermetrics -i 1000 -n 1 -s cpu_power \
| grep "System Average frequency as fraction of nominal" \
| awk '{sum += substr($8, 1, length($8)-1)} END {print sum/NR}')

load1=$(uptime | rg -o "load average: (.*?)," -r "\$1")

load1round=$( printf "%.0f" $load1 )

echo $load1round
echo " $load1round / $cpu_freq%"
Binary file modified ssh_config
Binary file not shown.

0 comments on commit 157c369

Please sign in to comment.