Save emacs session before shutdown with a script
This commit is contained in:
16
scripts/.local/share/scripts/power-manager
Executable file
16
scripts/.local/share/scripts/power-manager
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
usage() {
|
||||
echo "Usage: power-manager <operation>"
|
||||
echo "operation: poweroff|reboot"
|
||||
}
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
operation=$1
|
||||
|
||||
emacsclient --eval '(doom/save-session "~/.emacs.d/.local/etc/workspaces/autosave")'
|
||||
systemctl "$operation"
|
||||
Reference in New Issue
Block a user