| #!/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"; | |
| } | |
| if (defined $ARGV[0]) { | |
| open_file_manager $ARGV[0]; | |
| } | |
| $_ = `xprop -notype -root _NET_ACTIVE_WINDOW`; | |
| /^_NET_ACTIVE_WINDOW: window id # (?<id>0x[0-9a-f]+), 0x0$/m or die "unable to get active window\n"; | |
| $_ = `xprop -id "$+{id}" -notype _QUBES_VMNAME`; | |
| if (/^_QUBES_VMNAME = \"(?<vm>[^\"]+)\"$/m) { | |
| length $+{vm} or die "empty string VM is invalid\n"; | |
| open_file_manager $+{vm}; | |
| } |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
Based on qvm-terminal: https://gist.github.com/jpouellet/0f74459699433cabc26c389caf36b455 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Based on qvm-terminal: https://gist.github.com/jpouellet/0f74459699433cabc26c389caf36b455