A post was split to a new topic: Improve your workflow using Zenity-based GUI
I really appreciate the work you’ve put into this solution and this post. I’m sure it’ll come in useful for some so it deserves to be its own post.
As written in the introduction, this thread is for quick solutions that only take a few line of coding. The source code you posted, while it can solve a lot of problems, goes beyond a few lines and therefore doesn’t fit into the scope of this post. The entry that explains your idea would need to be multiple times longer than what everyone else’s entries are.
I will spin this off into its own thread so it gets more recognition. Be sure to let me know what the title should be.
thats fine…
Post can’t be empty
Can be simplified to:
myqube="sys-usb"; qvm-shutdown --quiet --force --wait "$myqube" ; qvm-start "$myqube"
We already have an entry for keeping sys-usb alive which involves crontab.
I can see why people would want to use your version but I don’t want to have two entries that do essentially the same thing. The crontab version shouldn’t need inputting every boot, so I’m partial to that one.
Let’s put it to a vote
- Prevent loss of control from sys-usb shutdown - [dom0]
crontab -e
, then enter* * * * * qvm-start --skip-if-running sys-usb > /dev/null 2>&1
and save. Reverse the change by commenting out that line - Prevent loss of control from sys-usb shutdown - [dom0]
myqube="sys-usb"; qvm-shutdown --quiet --force --wait "$myqube" ; qvm-start "$myqube"
. Apply only when needed
Poll closes June 15
These two solve different problems.
One of them creates the problem of starting sys-usb at boot, even when ‘qubes.skip_autostart’ is set. That can be extremely annoying, if sys-usb fails to start correctly, although I understand that some people might be prepared to take the risk. I tried it once, and… “Never again !”
As far as I know I actually originated using crontab to restart sys-usb, and yes it DID burn me when I had to boot without it and it started up.
I didn’t abandon the method, but decided to make the check-and-restart interval every five minutes, instead of every minute. That gives me time to log in and edit the crontab. I’m willing to deal with that in extraordinary circumstances (which having to run without sys-usb is–an extraordinary circumstance).
Hi, i’m quite new to linux and even newer to Qubes, so i’m hoping i can get some thorough guidance on how to make these two scripts as I can’t seem to figure it out.
I’ve followed the steps as described. I’ve made a .sh file in /user/bin/, they are executable (double checked with $ls -l), they aren’t in DOS or MAC format, and i’ve copied the code directly from the quoted text.
after that, I open Keyboard commands in dom0, pick the corresponding shell script, and punch in a keyboard command. However when i try it, nothing happens.
When i run the scripts in terminal, this is the error i get for the halt-vm-by-window.sh [emphasis own]:
qubespad@dom0 bin]$ ./halt-vm-by-window.sh
usage: qvm-run [–verbose] [–quiet] [–help] [–user USER] [–autostart]
[–no-autostart] [–pass-io] [–localcmd COMMAND] [–gui]
[–no-gui] [–colour-output COLOUR] [–colour-stderr COLOUR]
[–no-colour-output] [–no-colour-stderr]
[–filter-escape-chars] [–no-filter-escape-chars] [–service]
[–no-shell] [–dispvm [BASE_APPVM] | --all]
[–exclude EXCLUDE]
[VMNAME] COMMAND …
qvm-run: error: no such domain: ‘_QUBES_VMNAME:’
usage: qvm-run [–verbose] [–quiet] [–help] [–user USER] [–autostart]
[–no-autostart] [–pass-io] [–localcmd COMMAND] [–gui]
[–no-gui] [–colour-output COLOUR] [–colour-stderr COLOUR]
[–no-colour-output] [–no-colour-stderr]
[–filter-escape-chars] [–no-filter-escape-chars] [–service]
[–no-shell] [–dispvm [BASE_APPVM] | --all]
[–exclude EXCLUDE]
[VMNAME] COMMAND …
qvm-run: error: no such domain: ‘_QUBES_VMNAME:’
usage: qvm-shutdown [–verbose] [–quiet] [–help] [–all] [–exclude EXCLUDE]
[–wait] [–timeout TIMEOUT] [–force] [–dry-run]
[VMNAME …]
qvm-shutdown: error: no such domain: ‘_QUBES_VMNAME:’
Can someone help me troubleshoot this please?
You have not assigned a shortcut to the script?
Do not run them as scripts from a terminal
I never presume to speak for the Qubes team.
When I comment in the Forum I speak for myself.
I have assigned
a shortcut but it hasn’t run. I mentioned how i did it in my initial n post and i don’t think i missed any steps there. Was i meant to restart dom0 or qubes after assigning them?
It’s not running shell scripts in terminal a qubes thing or a Linux thing?