implemented poor man's pkill
This commit is contained in:
parent
98c7467194
commit
74602e8d8d
1 changed files with 30 additions and 3 deletions
33
.tmux.conf
33
.tmux.conf
|
@ -209,6 +209,33 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim
|
||||||
# printf '%s' "$*" | perl -CS -pe 's/(\\u([0-9A-Fa-f]{1,4})|\\U([0-9A-Fa-f]{1,8}))/chr(hex($2.$3))/eg' 2>/dev/null
|
# printf '%s' "$*" | perl -CS -pe 's/(\\u([0-9A-Fa-f]{1,4})|\\U([0-9A-Fa-f]{1,8}))/chr(hex($2.$3))/eg' 2>/dev/null
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
|
# if command -v pkill > /dev/null 2>&1; then
|
||||||
|
# _pkillf() {
|
||||||
|
# pkill -f "$@" || true
|
||||||
|
# }
|
||||||
|
# else
|
||||||
|
# case "$_uname_s" in
|
||||||
|
# *CYGWIN*)
|
||||||
|
# _pkillf() {
|
||||||
|
# while IFS= read -r pid; do
|
||||||
|
# kill "$pid" || true
|
||||||
|
# done << EOF
|
||||||
|
# $(grep -Eao "$@" /proc/*/cmdline | xargs -0 | sed -E -n 's,/proc/([0-9]+)/.+$,\1,pg')
|
||||||
|
# EOF
|
||||||
|
# }
|
||||||
|
# ;;
|
||||||
|
# *)
|
||||||
|
# _pkillf() {
|
||||||
|
# while IFS= read -r pid; do
|
||||||
|
# kill "$pid" || true
|
||||||
|
# done << EOF
|
||||||
|
# $(ps -x -o pid= -o command= | grep -E "$@" | cut -d' ' -f1)
|
||||||
|
# EOF
|
||||||
|
# }
|
||||||
|
# ;;
|
||||||
|
# esac
|
||||||
|
# fi
|
||||||
|
#
|
||||||
# _maximize_pane() {
|
# _maximize_pane() {
|
||||||
# current_session=${1:-$(tmux display -p '#{session_name}')}
|
# current_session=${1:-$(tmux display -p '#{session_name}')}
|
||||||
# current_pane=${2:-$(tmux display -p '#{pane_id}')}
|
# current_pane=${2:-$(tmux display -p '#{pane_id}')}
|
||||||
|
@ -1079,7 +1106,7 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim
|
||||||
# tmux_conf_battery_status_charging=$(_decode_unicode_escapes "${tmux_conf_battery_status_charging:-↑}") # U+2191
|
# tmux_conf_battery_status_charging=$(_decode_unicode_escapes "${tmux_conf_battery_status_charging:-↑}") # U+2191
|
||||||
# tmux_conf_battery_status_discharging=$(_decode_unicode_escapes "${tmux_conf_battery_status_discharging:-↓}") # U+2193
|
# tmux_conf_battery_status_discharging=$(_decode_unicode_escapes "${tmux_conf_battery_status_discharging:-↓}") # U+2193
|
||||||
#
|
#
|
||||||
# pkill -f 'cut -c3- ~/\.tmux\.conf \| sh -s _battery_bar' || true
|
# _pkillf 'cut -c3- ~/\.tmux\.conf \| sh -s _battery_bar'
|
||||||
# _battery_info
|
# _battery_info
|
||||||
# if [ "$charge" != 0 ]; then
|
# if [ "$charge" != 0 ]; then
|
||||||
# case "$status_left $status_right" in
|
# case "$status_left $status_right" in
|
||||||
|
@ -1118,7 +1145,7 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim
|
||||||
# ;;
|
# ;;
|
||||||
# esac
|
# esac
|
||||||
#
|
#
|
||||||
# pkill -f 'cut -c3- ~/\.tmux\.conf \| sh -s _uptime' || true
|
# _pkillf 'cut -c3- ~/\.tmux\.conf \| sh -s _uptime'
|
||||||
# case "$status_left $status_right" in
|
# case "$status_left $status_right" in
|
||||||
# *'#{uptime_d}'*|*'#{uptime_h}'*|*'#{uptime_m}'*|*'#{uptime_s}'*)
|
# *'#{uptime_d}'*|*'#{uptime_h}'*|*'#{uptime_m}'*|*'#{uptime_s}'*)
|
||||||
# status_left=$(echo "$status_left" | sed -E \
|
# status_left=$(echo "$status_left" | sed -E \
|
||||||
|
@ -1145,7 +1172,7 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim
|
||||||
# ;;
|
# ;;
|
||||||
# esac
|
# esac
|
||||||
#
|
#
|
||||||
# pkill -f 'cut -c3- ~/\.tmux\.conf \| sh -s _loadavg' || true
|
# _pkillf 'cut -c3- ~/\.tmux\.conf \| sh -s _loadavg'
|
||||||
# case "$status_left $status_right" in
|
# case "$status_left $status_right" in
|
||||||
# *'#{loadavg}'*)
|
# *'#{loadavg}'*)
|
||||||
# status_left=$(echo "$status_left" | sed -E \
|
# status_left=$(echo "$status_left" | sed -E \
|
||||||
|
|
Loading…
Reference in a new issue