Skip to content

Instantly share code, notes, and snippets.

@100111001
100111001 / qvm-filemanager.sh
Created Jun 16, 2019
Bash version of the qvm-filemanager.pl
View qvm-filemanager.sh
#!/bin/sh
set -e
front=$(xprop -notype -root _NET_ACTIVE_WINDOW | awk '{if (match($0,"^_NET_ACTIVE_WINDOW: window id # (0x[0-9a-f]*), 0x0$",m)){print m[1];} exit 0;}' )
test -n "$front"
vm=$(xprop -id "$front" -notype _QUBES_VMNAME | awk '{if (match($0,"^_QUBES_VMNAME = \"([^\"]*)\"$",m)){print m[1];} exit 0;}')
if [ -n "$vm" ]; then
@100111001
100111001 / qvm-filemanager.pl
Created Jun 16, 2019 — forked from jpouellet/qvm-filemanager.pl
Qubes OS: Opens a file manager in the focused VM
View qvm-filemanager.pl
#!/usr/bin/env perl
use strict;
use warnings;
sub open_file_manager {
my $vm = shift;
exec {'qvm-run'} ('qvm-run', '--', $vm, 'exec nautilus --new-window --no-desktop </dev/null >/dev/null') or die "qvm-run exec failed\n";
}
@100111001
100111001 / qvm-terminal.pl
Last active Jun 16, 2019 — forked from jpouellet/qvm-terminal.pl
Opens a terminal in the front-most Qubes VM.
View qvm-terminal.pl
#!/usr/bin/env perl
use strict;
use warnings;
sub dom0_term {
(exec 'xfce4-terminal') or (exec 'xterm') or die "dom0 terminal exec failed\n";
}
sub domU_term {