Terminal in the same disposable

Better late than never:

  1. Create a script at /home/user/bin/open_terminal.sh
#!/bin/bash

ID=`xdotool getwindowfocus`
QUBE=`xprop _QUBES_VMNAME -id $ID|cut -f2 -d\" `
if [[ "$QUBE" == "_QUBES_VMNAME:  not found." ]]; then
	exit
else
  qvm-run $QUBE /usr/bin/qubes-run-terminal &
fi
  1. Make script executable
    sudo chmod +x /home/user/bin/open_terminal.sh

  2. Create shortcut

  3. In KDE:
    * SystemSettings->Shortcuts->“Custom Shortcuts”
    * Edit-New->Global Shortcut->Command/URL
    * Optionally Provide Name for action
    * Under “Trigger” enter keyboard combo
    * Under Action, enter path to script
    * Apply

  4. Xfce:
    * Settings->keyboard
    * On Application Shortcuts pane, select “Add”
    * Use chooser to select command
    * Define Keyboard combo

  5. The script at 1 is completely generic - you can use it for any
    commands- eg echo $QUBE|speak-ng -- will speak the name of the
    focussed qube.
    You can use one-liners of complex scripts as you will.

The first if statement tests for lack of QUBES_VMNAME - that is dom0.
Instead of exit call you can run program/script here.

  1. To have a root terminal use qvm-run -u root..
    You can, of course, have separate scripts and shortcuts for spawning root and
    user terminals, or run different applications by qube name using elif
    statements.
I never presume to speak for the Qubes team. When I comment in the Forum I speak for myself.
2 Likes