#!/bin/sh

# kill those pesky proceses

source $HOME/.config/dmenu/config

pid=$(ps -u $USER -o pid,%mem,%cpu,comm,cmd | sort -b -k3 -r | $DMENU -l 15 -i -p "Choose procces to kill: " | awk '{print $1}')

[ -n "$pid" ] || exit

answer=$(printf "yes\\nno" | $DMENU -p "Are you sure?")

[ $answer = "yes" ] || exit

kill -15 $pid 2>/dev/null

quick-notify "Killed Procces" "$pid"