userscripts/reboot-dmenu

10 lines
362 B
Plaintext
Raw Normal View History

2024-05-31 06:04:56 +00:00
#!/bin/sh
# cat /boot/grub/grub.cfg | sed -n "s/^menuentry [\"']\([^\"']*\)[\"'].*$/\1/gmp" | dmenu -i | tr -d '\n' | sudo xargs -t -r0 -n1 grub-reboot
# sudo /usr/bin/reboot
entry="$(sed -n "s/^menuentry [\"']\([^\"']*\)[\"'].*$/\1/gmp" /boot/grub/grub.cfg | dmenu -i | tr -d '\n')"
if [ -n "$entry" ]; then
sudo grub-reboot "$entry"
sudo /usr/bin/reboot
fi