diff options
author | Joe <rbo@gmx.us> | 2024-07-02 10:05:50 +0200 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-07-02 10:05:50 +0200 |
commit | 87d13157a1e060634be415aa9bf1fcf90b90bac6 (patch) | |
tree | 5442f69cb95f7b363fc1f3442fd4b307b204e199 /.local/bin/dmkill | |
parent | up (diff) | |
download | dotfiles-bsd-87d13157a1e060634be415aa9bf1fcf90b90bac6.tar.gz dotfiles-bsd-87d13157a1e060634be415aa9bf1fcf90b90bac6.tar.bz2 dotfiles-bsd-87d13157a1e060634be415aa9bf1fcf90b90bac6.tar.xz dotfiles-bsd-87d13157a1e060634be415aa9bf1fcf90b90bac6.tar.zst dotfiles-bsd-87d13157a1e060634be415aa9bf1fcf90b90bac6.zip |
up
Diffstat (limited to '.local/bin/dmkill')
-rwxr-xr-x | .local/bin/dmkill | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/.local/bin/dmkill b/.local/bin/dmkill index 521f315..9c7c838 100755 --- a/.local/bin/dmkill +++ b/.local/bin/dmkill @@ -29,7 +29,6 @@ sub confirm sub action { my ($var, $user) = @_; - my @split; my $pid; my $proc; @@ -37,10 +36,12 @@ sub action if (not $var) { return; } - @split = split / $user /, $var; - $pid = $split[0]; - $pid =~ s/\D//g; - $proc = (split / /, $split[1])[0]; + if ($var =~ /^\s*(\d+)\s/) { + $pid = $1; + } + if ($var =~ /^\s*\S+\s+\S+\s+(\S+)/) { + $proc = $1; + } if (confirm($pid, $proc) == 1) { exec(KILL_PATH, '-9', $pid); } |