add emsleep, share code (zsh)

This commit is contained in:
Simon M 2022-02-21 11:05:39 +11:00
parent c2baac565b
commit 23ff2c3ada
1 changed files with 8 additions and 2 deletions

View File

@ -29,15 +29,21 @@ if [ -x /usr/bin/emerge ]; then
unset eixcmd emfcmd emFcmd laycmd revcmd
function emhalt() {
function emthing() {
whilekillproc=$(pgrep emerge)
while ps cax | grep -q $whilekillproc; do
sudo echo wait... && sleep 30
done
date > ~/finished
sleep 30 && sudo shutdown -h now
sleep 30 && sudo $@
unset whilekillproc
}
function emhalt() {
emthing shutdown -h now
}
function emsleep() {
emthing s2mem
}
fi
hash open 2>/dev/null && alias open=' open' || alias open=' xdg-open'