~smlavine/scripts

ref: 8fd7e1c6d1b698b7adcb0b5b3b765a0ccc628b06 scripts/src/quitdwm -rwxr-xr-x 532 bytes
8fd7e1c6Sebastian LaVine src/touch-menu: Use mykill 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
# Copyright (c) 2019-2021 Sebastian LaVine <mail@smlavine.com>
# Licensed under the MIT license. See MIT.txt for details.
#
# File:        quitdwm
# Description: Quits dwm, but first prompts the user with a dmenu prompt asking
#              if they are sure.

if [ "$(printf "Y\nN" | dmenu -i -sb 'dark red' -p "Are you sure?")" = "Y" ]
then

	#shellcheck disable=SC2009
	ps --sort -etime a o pid,etime,tty,comm |
		grep ' dwm$' |
		dmenu -n -l 6 -sb 'dark green' -p "Which one?" |
		awk '{ print $1 }' |
		xargs kill
fi