Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@justmegawatt justmegawatt commented Nov 17, 2020

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