shutdown without any menu user action ?

70 views
Skip to first unread message

Episteme PROMENEUR

unread,
Feb 28, 2021, 8:52:32 PM2/28/21
to Android-x86
cm-x86-14.1-r5
openSuse 15.2
kde environment

i use a virtualbox command to close cleanly the VM.

VBoxManage controlvm "{9b2b0a8e-fdcf-4338-9b43-1a5cd20a5de8}" acpipowerbutton

but  i get a menu with options shutdown, restart which requires user action.

Is there a way that cm-x86 execute a shutdown command directly ?

Or perhaps somewhere there is some script defining the action of the acpibutton ?
I could put the statement "/sbin/shutdown -h now".

another solution : modifying the menu according after 15 s the option "shutdown" is automatically exectuted.

Thanks

crw

unread,
Mar 1, 2021, 12:53:02 AM3/1/21
to Android-x86
You can set up ADB, and power off the device with ADB.

Chih-Wei Huang

unread,
Mar 2, 2021, 12:56:07 AM3/2/21
to Android-x86
Episteme PROMENEUR <episteme....@gmail.com> 於 2021年3月1日 週一 上午9:52寫道:
> cm-x86-14.1-r5
> openSuse 15.2
> kde environment
>
> i use a virtualbox command to close cleanly the VM.
>
> VBoxManage controlvm "{9b2b0a8e-fdcf-4338-9b43-1a5cd20a5de8}" acpipowerbutton
>
> but i get a menu with options shutdown, restart which requires user action.
>
> Is there a way that cm-x86 execute a shutdown command directly ?
>
> Or perhaps somewhere there is some script defining the action of the acpibutton ?
> I could put the statement "/sbin/shutdown -h now".

The simplest way to do it is to use the Android built-in "input" command.
For example, the script invokes the power menu and select power off:

input keyevent --longpress POWER
sleep 2
input keyevent TAB
input keyevent ENTER

How to run the script is another story.

Episteme PROMENEUR

unread,
Mar 14, 2021, 8:16:29 AM3/14/21
to Android-x86
I must complete the problem definition.

i want that if i shutdown my pc or I logout then this closes cleanly the vm.

i found a solution in kde environment:

a script executed when logout "dock_android_shutdown.sh". this one take a snapshot of the vm (some kind of "hibernate") and close it.
a script executed when login "dock_android_startup.sh". this one launches the snapshot and put it in the systray. you must install kdocker and rdesktop.

a script to execute on demand the launching of the snapshot. if you want test the launching or the vm disappears.
a scipt to execute on demand the launching of rdesktop "dock_android_ondemand_rdesktop.sh" in case you close rdesktop instead of minimizing it.

I join these scripts if this may help.
dock_android_shutdown.sh
dock_android_startup.sh
dock_android_ondemand.sh
dock_android_ondemand_rdesktop.sh
Reply all
Reply to author
Forward
0 new messages