Files
nixos-config/glasshouse-laptop/home/scripts/shutdown-script.nix

22 lines
360 B
Nix

{ self, pkgs }:
{
shutdown-script = pkgs.writeShellScriptBin "shutdown-script" (''
#!/usr/bin/env zsh
respond="$(echo " Shutdown\n Restart\n Cancel" | rofi -dmenu)"
if [ $respond = ' Shutdown' ]
then
echo "shutdown"
shutdown now
elif [ $respond = ' Restart' ]
then
echo "restart"
reboot
else
notify-send "cancel shutdown"
fi
'');
}