我需要使用 Windows 來完成一項任務。因此,我製作了一個腳本來在另一個啟動條目中重新啟動(僅用於下次重新啟動):
#!/bin/bash
if [[ $UID != 0 ]] ; then
sudo $0 $@
exit $?
fi
ENTRY=$(gawk -F "'" '/menuentry / {print $2}' /boot/grub/grub.cfg | grep "Windows Boot Manager.*")
grub-reboot "$ENTRY"
if [ $? -ne 0 ] ; then
exit 1
fi
if zenity --question --title="Reboot Now ?" --text="Are you ready to reboot now ?" --no-wrap ; then
shutdown -r now
fi
我希望能夠在電源選單中呼叫它以及睡眠、關閉、關閉會話...我想我必須編寫一些 gnome-shell-extension ?由於我是 gnome shell 擴展的新手,我想知道從哪裡開始?如何新增/修改這些選單項目?
順便說一句,我使用的是 Ubuntu 20.04。