tmux/status
All checks were successful
/ job (push) Successful in 4m58s

This commit is contained in:
Marc Beninca 2025-07-02 01:07:24 +02:00
parent a4f13e49a2
commit b96c804717
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -45,6 +45,34 @@ rwx_tmux_servers() {
IFS=\"\${ifs}\"
echo \"\${text}\"
}
rwx_tmux_status() {
local current=\"\${1}\"
local operand=\"\${2}\"
case \"\${operand}\" in
\"+\")
case \"\${current}\" in
\"off\") current=\"on\" ;;
\"on\") current=\"2\" ;;
\"2\") current=\"3\" ;;
\"3\") current=\"4\" ;;
\"4\") current=\"5\" ;;
*) ;;
esac
;;
\"-\")
case \"\${current}\" in
\"on\") current=\"off\" ;;
\"2\") current=\"on\" ;;
\"3\") current=\"2\" ;;
\"4\") current=\"3\" ;;
\"5\") current=\"4\" ;;
*) ;;
esac
;;
*) ;;
esac
tmux set-option status \"\${current}\"
}
rwx_tmux_uptime() {
local since=\"\$(uptime --since)\"
local date=\"\$(echo \"\${since}\" | awk '{print \$1}')\"
@ -275,6 +303,8 @@ bind-key -n C-F2 set-option -g status 2
bind-key -n C-F3 set-option -g status 3
bind-key -n C-F4 set-option -g status 4
bind-key -n C-F5 set-option -g status 5
bind-key -n M-NPage run-shell '. ${script}; rwx_tmux_status #{status} -'
bind-key -n M-PPage run-shell '. ${script}; rwx_tmux_status #{status} +'
# switch session
bind-key -n M-Down switch-client -n