1
0
Fork 0
mirror of synced 2024-12-21 22:31:06 -05:00

implemented poor man's pkill

This commit is contained in:
Gregory Pakosz 2020-02-18 21:22:29 +01:00
parent 98c7467194
commit 74602e8d8d

View file

@ -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
# }
#
# 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() {
# current_session=${1:-$(tmux display -p '#{session_name}')}
# 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_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
# if [ "$charge" != 0 ]; then
# case "$status_left $status_right" in
@ -1118,7 +1145,7 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim
# ;;
# 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
# *'#{uptime_d}'*|*'#{uptime_h}'*|*'#{uptime_m}'*|*'#{uptime_s}'*)
# status_left=$(echo "$status_left" | sed -E \
@ -1145,7 +1172,7 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim
# ;;
# 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
# *'#{loadavg}'*)
# status_left=$(echo "$status_left" | sed -E \