-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reboot to windows option #3
base: master
Are you sure you want to change the base?
Conversation
Since this only works for systemd-boot at the moment, adding this to another branch is more sufficient. When available with other bootloaders such as GRUB, rEFInd, etc, this should be added to the main branch, that is if the owner allows it. |
I guess the best option for now is to just keep this PR unmerged. But I agree, that this feature should live on it's own branch until other bootloaders work as well. |
This can be added to one of the forks such as mine(https://github.com/Spaxly/rofi-power-menu) as a separate branch. I will start development on this soon. |
# By default, show all (i.e., just copy the array) | ||
show=("${all[@]}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# By default, show all (i.e., just copy the array) | |
show=("${all[@]}") | |
# By default, show all others except "Reboot to Windows" | |
show=(shutdown reboot suspend hibernate logout lockscreen) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, makes sense. Then this windows option should get added to the readme for visibility.
@@ -45,9 +47,10 @@ actions[suspend]="systemctl suspend" | |||
actions[hibernate]="systemctl hibernate" | |||
actions[reboot]="systemctl reboot" | |||
actions[shutdown]="systemctl poweroff" | |||
actions[windows]="systemctl reboot --boot-loader-entry=auto-windows --boot-loader-menu=0.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a generic way to reboot to Windows?
Also, why doesn't normal reboot work? I suppose you can choose which OS to launch during the boot time, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is quite old. I learned a lot since opening this, so I can explain more what would be the right way to do things.
Is this a generic way to reboot to Windows?
As noted above by Spaxly, this systemctl reboot --boot-loader...
command only works when you use both systemd (as init) and systemd-boot (as bootloader).
Because setting the next entry is bootloader specific, one would need to add special commands for each bootloader. As I can see it, grub also supports rebooting into another entry. See the manpage. You can specify an entry there.
Using another init (i.e. no systemd) completely breaks the entire script, as there is no systemctl
when using other inits. This is also discussed in #11.
Covering all the cases would be hard I guess, so a decision needs to be taken on which inits and boot loaders should be supported. I guess we could also just start with some inits and bootloaders and then extend if people are interested.
Also, why doesn't normal reboot work? I suppose you can choose which OS to launch during the boot time, right?
Yes, you are right. Usually when you use dual booting, your bootloader shows a screen where you can select the boot entry for a few seconds. What this command does though, is that it preselects the chosen entry. No user intervention is needed until the other entry/OS is booted up. That is somewhat convenient.
This only works for systemd-boot. Tell me what you think about adding this to master. I mean we could add it to a second branch too.