Score:1

Reboot to another grub entry

ca flag

I need to use Windows for 1 task. Thus I made a script to reboot in another boot entry (for the next reboot only):

#!/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

I'd like to be able to call it in the power menu along with sleep, shutdown, close session... I guess I have to write some gnome-shell-extension ? As I'm new to gnome shell extensions I'd like to know where to start ? How can I add/modify these menu entries ?

By the way I'm on Ubuntu 20.04.

cn flag
I would not do this and just add it to the desktop so you can click it and have it execute. Or put it into a key combination (like control-alt-7)
Lorenz Keel avatar
gr flag
Maybe https://github.com/p-e-w/argos can partially fit your needs, because you can create a new item in the top bar. This is only a suggestion, I have never used it.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.