From f60ee701d228eaa0f4b37919cb091c1524fc66a1 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 9 Mar 2021 17:29:26 +0100 Subject: update --- .local/bin/dmkill | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to '.local/bin/dmkill') 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); } -- cgit v1.2.3