#!/bin/sh # kill those pesky proceses load_config () { . $HOME/.config/dmenu/config } main () { load_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" } main $@