Skip to content

Instantly share code, notes, and snippets.

@dmoerner
Created July 11, 2020 03:11
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmoerner/65528941dd20b05c98ee79e92d7e0183 to your computer and use it in GitHub Desktop.
Save dmoerner/65528941dd20b05c98ee79e92d7e0183 to your computer and use it in GitHub Desktop.
Smartly open a terminal in any VM on Qubes
#!/bin/sh
# Inspired by Holger Levsen's 2017 DebConf talk.
result="$(qvm-ls --no-spinner --raw-data --fields NAME | dmenu)"
[[ -n "$result" ]] || exit
if [[ "$result" == "dom0" ]]; then
xterm
else
template=$(qvm-prefs $result template)
# Template VMs have no template class, so we need to test for this as well.
if [[ "$template" == fedora* || "$template" == debian* || "$result" == fedora* || "$result" == debian* ]]; then
if [[ "$result" == fedora*dvm ]]; then
qvm-run -q -a --service --dispvm=$result -- qubes.StartApp+xterm
else
qvm-run -a $result gnome-terminal
fi
elif [[ "$template" == whonix* || "$result" == whonix* ]]; then
if [[ "$result" == whonix*dvm ]]; then
qvm-run -q -a --service --dispvm=$result -- qubes.StartApp+xfce4-terminal
else
qvm-run -a $result xfce4-terminal
fi
else
qvm-run -a $result xterm
fi
fi
@justmegawatt
Copy link

How can I make it so that the "Qubes Settings" for each Qube are hidden? When the d-menu appears and I type in a qube name, I don't like the option "Qubes Settings" always appearing since I never want to edit it, if I did I would use the Qube Manager and edit it from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment