2

I have a shell script that I created to change the next EFI boot then execute a reboot. If I execute it in a terminal window it works fine, but if I execute it using an Icon in KDE it reboots, but does not change the next efiboot. I have tried setting the Icon to run as root, but that didn't make a difference.

Here is the script

#!/bin/bash
kdialog --title "Reboot to Windows Prompt" --yesno "Are you sure you want to reboot to Windows?";
if [ $? = 0 ]; then
    sudo efibootmgr -n 0
    reboot
else
    kdialog --msgbox "Reboot aborted by user"
fi

Someone even suggested having a pause between the efibootmgr and the reboot, but that didn't work either.

1

Not sure if it's what you're looking for, but have you considered launching a terminal + executing your script from an icon.

Right click the icon > Icon Settings > Applicaiton > Command:

konsole -e /path/to/your/script.sh

Or if you need the window to stay open for some reason use -noclose

  • Thanks Chad. I'm what I consider very green when it comes to Linux. I'm trying to hide or at least minimize the Konsole itself. The best i've been able to come up with is --hide-tabbar --hide-menubar --geometry=50x50-1-1. This puts it in the lower right corner. I tried making the size 1x1, but then the kdialog doesn't appear. I also tried to make it way off the screen 50x50+4100+4100, but that didn't work either. I assume that it looks at you resolution and doesn't let you go beyond that point? <br> So in short anyway to make the konsole window itself not visible to the user?? – Doug Nov 3 '16 at 19:00
  • You can launch konsole in the background using &. The icon command would look like this: konsole -e /path/to/your/script.sh & You might still see the console flash in the foreground on launch and I'm not sure if you can prevent that. – Chad Sheets Nov 3 '16 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.