diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2021-03-09 17:29:26 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2021-03-09 17:29:26 +0100 |
commit | f60ee701d228eaa0f4b37919cb091c1524fc66a1 (patch) | |
tree | 847286dc5a3f2a8724a364c563a8b3ccb4dbbd5d | |
parent | new scripts (diff) | |
download | dotfiles-bsd-f60ee701d228eaa0f4b37919cb091c1524fc66a1.tar.gz dotfiles-bsd-f60ee701d228eaa0f4b37919cb091c1524fc66a1.tar.bz2 dotfiles-bsd-f60ee701d228eaa0f4b37919cb091c1524fc66a1.tar.xz dotfiles-bsd-f60ee701d228eaa0f4b37919cb091c1524fc66a1.tar.zst dotfiles-bsd-f60ee701d228eaa0f4b37919cb091c1524fc66a1.zip |
update
-rwxr-xr-x | .local/bin/dmkill | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/.local/bin/dmkill b/.local/bin/dmkill index 87c91fd..2932353 100755 --- a/.local/bin/dmkill +++ b/.local/bin/dmkill @@ -3,6 +3,7 @@ use strict; use warnings; use File::HomeDir qw(home); +use constant KILL_PATH => '/bin/kill'; use constant CONFIRM => [ "No", "Yes" @@ -36,10 +37,9 @@ sub action @split = split / $user /, $var; $pid = $split[0]; $pid =~ s/\D//g; - print $pid . "\n"; $proc = (split / /, $split[1])[0]; - print $proc . "\n"; if (confirm($pid, $proc) == 1) { + exec(KILL_PATH, '-9', $pid); } return; } @@ -47,10 +47,11 @@ sub action sub main { my $choice; + my $ps; my $user; $user = getlogin(); - $choice = `ps -U "$user" -o pid,user,command | dmenu -i -l 30 -m 0`; + $choice = `ps -U "$user" -o pid,user,command | cut -c -128 | dmenu -i -l 30 -m 0`; action($choice, $user); return (0); } |