Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upKeyboard shortcut to open terminal in same VM as front-most window #2706
Comments
andrewdavidwong
added
C: core
enhancement
labels
Mar 15, 2017
andrewdavidwong
added this to the Release 4.1 milestone
Mar 15, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Mar 15, 2017
Member
Looks very useful :) There is a lot of space of some race conditions, but I think the worst that could happen, is getting terminal from a different VM.
|
Looks very useful :) There is a lot of space of some race conditions, but I think the worst that could happen, is getting terminal from a different VM. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jpouellet
Mar 16, 2017
Contributor
Looks very useful :)
To be honest, I'd be surprised if an equivalent hasn't already been re-implemented a dozen times by different people in isolation. Sure you don't have one yourself? :P
edit: oh hey! look what i found...
There is a lot of space of some race conditions, but I think the worst that could happen, is getting terminal from a different VM.
Indeed. EWONTFIX ;)
I suppose I should re-implement this in python to avoid needing perl as a dependency of core-admin[-linux]...
To be honest, I'd be surprised if an equivalent hasn't already been re-implemented a dozen times by different people in isolation. Sure you don't have one yourself? :P edit: oh hey! look what i found...
Indeed. EWONTFIX ;) I suppose I should re-implement this in python to avoid needing perl as a dependency of core-admin[-linux]... |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jpouellet
Mar 16, 2017
Contributor
Mine is more conservative with the interpretation of the output of xprop, but @SietsevanderMolen's is unquestionably more readable.
I also like his generalized terminal selection.
I also now remember my reasoning for implementing this in perl: runtime startup cost. I run this command literally hundreds of times a day (definitely already paid off), and if the delay between the keyboard shortcut being pressed and the terminal opening in the VM is too slow then it can miss the first key(s) I try to type into it. This actually happened in practice with the shell version (due to invoking awk) and perl's startup time is consistently <20ms whereas python's can be >50ms (at least as observed on my system).
|
Mine is more conservative with the interpretation of the output of xprop, but @SietsevanderMolen's is unquestionably more readable. I also like his generalized terminal selection. I also now remember my reasoning for implementing this in perl: runtime startup cost. I run this command literally hundreds of times a day (definitely already paid off), and if the delay between the keyboard shortcut being pressed and the terminal opening in the VM is too slow then it can miss the first key(s) I try to type into it. This actually happened in practice with the shell version (due to invoking awk) and perl's startup time is consistently <20ms whereas python's can be >50ms (at least as observed on my system). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Mar 16, 2017
Member
|
On Wed, Mar 15, 2017 at 05:25:59PM -0700, Jean-Philippe Ouellet wrote:
> Looks very useful :) There is a lot of space of some race conditions, but I think the worst that could happen, is getting terminal from a different VM.
Indeed. EWONTFIX ;)
I suppose I should re-implement this in python to avoid needing perl as a dependency of core-admin[-linux]...
Or, create separate, optional package for just one (two?) script, and
a perl dependency ;) Perl is installed in dom0 anyway, so this isn't a
problem itself. Rather - having some perl script means that working on
(some parts of) Qubes would require knowledge of one more programming
language...
Actually, I'm _slightly_ in favor of creating separate repository for this
script. And maybe move some parts of core-admin-linux (tools/qvm-xkill?)
there.
…--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jpouellet
Mar 16, 2017
Contributor
Speaking of saving time opening things in particular VMs, I also have a better application launcher I should really get around to finishing. Searching for a particular VM in the xfce "Q" menu can be super annoying when you have ~90 VMs and are in a hurry.
|
Speaking of saving time opening things in particular VMs, I also have a better application launcher I should really get around to finishing. Searching for a particular VM in the xfce "Q" menu can be super annoying when you have ~90 VMs and are in a hurry. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jpouellet
Mar 16, 2017
Contributor
Actually, I'm slightly in favor of creating separate repository for this script. And maybe move some parts of core-admin-linux (tools/qvm-xkill?) there.
I agree that core-admin-linux right now seems a bit too much of a core-misc-crap, but it's not clear to me what the most logical separation of it would be. In my long-term effort to get *BSDs as first-class qubes guests, I've considered that we will eventually probably need a core-admin-posix and core-admin-linux, but that time hasn't come yet (currently blocked on finding time to re-implement vchan under not-GPL).
I agree that core-admin-linux right now seems a bit too much of a core-misc-crap, but it's not clear to me what the most logical separation of it would be. In my long-term effort to get *BSDs as first-class qubes guests, I've considered that we will eventually probably need a core-admin-posix and core-admin-linux, but that time hasn't come yet (currently blocked on finding time to re-implement vchan under not-GPL). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
core-util-linux? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Mar 16, 2017
Member
Some insight on naming: https://blog.invisiblethings.org/2013/03/21/introducing-qubes-odyssey-framework.html
"admin"/"agent" - component for "dom0" or "VM"
"core"/"gui"/... - "base things", "gui passthrough related things", ...
So, maybe "utils-admin-linux"? Or "linux-utils-admin"? ("linux-utils" repo was naming fail, should be "utils-linux")
|
Some insight on naming: https://blog.invisiblethings.org/2013/03/21/introducing-qubes-odyssey-framework.html "admin"/"agent" - component for "dom0" or "VM" So, maybe "utils-admin-linux"? Or "linux-utils-admin"? ("linux-utils" repo was naming fail, should be "utils-linux") |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jpouellet
Mar 16, 2017
Contributor
Hmm. I suppose utils-admin-linux is the most consistent with the intended scheme, if a bit confusing. Without being certain what even belongs together, it's hard to determine what those groupings should be called. Naming is hard... I miss my bsd source tree where everything is an intuitive 3-5 letter subdir.
As long as the choice isn't as visually similar to an existing repo as core-agent-linux and core-admin-linux are to each other, I'll be fine :)
|
Hmm. I suppose utils-admin-linux is the most consistent with the intended scheme, if a bit confusing. Without being certain what even belongs together, it's hard to determine what those groupings should be called. Naming is hard... I miss my bsd source tree where everything is an intuitive 3-5 letter subdir. As long as the choice isn't as visually similar to an existing repo as core-agent-linux and core-admin-linux are to each other, I'll be fine :) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rustybird
Mar 18, 2017
Allow me to pile on another qvm-terminal. ;) Probably slower than pure Perl, though.
rustybird
commented
Mar 18, 2017
|
Allow me to pile on another qvm-terminal. ;) Probably slower than pure Perl, though. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jpouellet
Mar 18, 2017
Contributor
Hmm... I wonder if we should write one in C instead.
Benefits:
- lowest startup cost
- even faster by eliminating need to exec xprop or equivalent (twice!)
- narrows race between getting focused window id from property on root window & that window disappearing or changing before getting its _QUBES_VMNAME
- wouldn't add another language to the list of those used for base qubes code
|
Hmm... I wonder if we should write one in C instead. Benefits:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Mar 18, 2017
Member
Hmm... I wonder if we should write one in C instead.
It's too easy to shoot yourself in the foot, so I'd avoid that if it isn't really necessary (either for performance reasons, or need to do some really low level stuff).
As for avoiding xprop calls, you can do that directly from python, see here for example.
It's too easy to shoot yourself in the foot, so I'd avoid that if it isn't really necessary (either for performance reasons, or need to do some really low level stuff). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rustybird
Mar 19, 2017
Replacing qvm-run VM CMD with /usr/lib/qubes/qrexec-client -e -d VM user:CMD shaves off some noticeable startup time.
rustybird
commented
Mar 19, 2017
|
Replacing |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
SietsevanderMolen
Mar 21, 2017
I don't think this needs to be rewritten in another language, especially not for performance reasons. I made copies of these and other tools in Ada (at least as fast as any version in C), for fun, but it's useless. It's more important that they're easy to change. Window managers are a very personal thing, everybody's i3 is different, and this way everybody can easily modify it to work however they want without having to recompile or learn a new language.
SietsevanderMolen
commented
Mar 21, 2017
|
I don't think this needs to be rewritten in another language, especially not for performance reasons. I made copies of these and other tools in Ada (at least as fast as any version in C), for fun, but it's useless. It's more important that they're easy to change. Window managers are a very personal thing, everybody's i3 is different, and this way everybody can easily modify it to work however they want without having to recompile or learn a new language. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evadogstar
Mar 30, 2017
- What is the best keyboard shortcut for this script?
- Which one is the best roght now?
- I think we need page at the Qubes Documentation which will describe all available utils as packages. As for me I read fist time about some utils like this.
- When this util will be available as package?
evadogstar
commented
Mar 30, 2017
|
evadogstar
referenced this issue
Mar 30, 2017
Open
Nautilus often doesn't start the first (or second, or third) time #2449
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jpouellet
Mar 30, 2017
Contributor
What is the best keyboard shortcut for this script?
Personally, I have it on Ctrl+Enter. This is inspired by i3. We're constantly pressing enter in terminals, so ctrl-enter to open a terminal feels natural.
Every time I've tried to work on a feature which involves keyboard shortcuts, somebody disagrees about the choice of key, and then it goes nowhere. [1] [2] [3] I think we should just reserve a single key as the Qubes modifier to allow us to freely pick shortcuts involving it (guaranteed non-conflict), and would provide other nice properties like the ability to prevent AppVMs from sniffing the beginning of shortcuts. I think more people voted for windows key for this purpose than people voted against it, but no clear consensus was reached.
The simplest things cause the largest discussions... sigh.
Which one is the best roght now?
You mean which qvm-terminal implementation? The yet-to-be-written one which incorporates the best parts of all the others :P
I think we need page at the Qubes Documentation which will describe all available utils as packages. As for me I read fist time about some utils like this.
You mean like https://www.qubes-os.org/doc/dom0-tools/ and https://www.qubes-os.org/doc/vm-tools/?
When this util will be available as package?
When someone gets around to the following:
- combining the best parts of the above-linked implementations into a single better implementation
- creating an appropriate new repo to house such tools so qubes-core-admin-linux doesn't continue to accumulate things which are irrelevant to qubes core but have no better home
I'll do it eventually if nobody else beats me to it. I'm rather busy with IRL stuff at the moment.
Personally, I have it on Ctrl+Enter. This is inspired by i3. We're constantly pressing enter in terminals, so ctrl-enter to open a terminal feels natural. Every time I've tried to work on a feature which involves keyboard shortcuts, somebody disagrees about the choice of key, and then it goes nowhere. [1] [2] [3] I think we should just reserve a single key as the Qubes modifier to allow us to freely pick shortcuts involving it (guaranteed non-conflict), and would provide other nice properties like the ability to prevent AppVMs from sniffing the beginning of shortcuts. I think more people voted for windows key for this purpose than people voted against it, but no clear consensus was reached. The simplest things cause the largest discussions... sigh.
You mean which qvm-terminal implementation? The yet-to-be-written one which incorporates the best parts of all the others :P
You mean like https://www.qubes-os.org/doc/dom0-tools/ and https://www.qubes-os.org/doc/vm-tools/?
When someone gets around to the following:
I'll do it eventually if nobody else beats me to it. I'm rather busy with IRL stuff at the moment. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jpouellet
Mar 30, 2017
Contributor
@marmarek how about qubes-desktop-linux-common as a suitable repo/pkg name? (for this, qvm-xkill, and the the accumulating miscellany of things which don't belong to core but have no better home at the moment)
|
@marmarek how about |
added a commit
to jpouellet/qubes-desktop-linux-common
that referenced
this issue
Mar 31, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jpouellet
Mar 31, 2017
Contributor
I plan to re-write this in python using xcb directly instead of shelling out to xprop (twice).
The qvm-xkill move to new new repo in no way depends on this issue and can proceed independently.
|
I plan to re-write this in python using xcb directly instead of shelling out to xprop (twice). The qvm-xkill move to new new repo in no way depends on this issue and can proceed independently. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evadogstar
Mar 31, 2017
Shortcuts help.
There are a lot of shortcuts and some other very useful information that newbie Qubes/linux user must know. How about to add one more shortcut ie. Ctrl+F1 to show some very quick help for user with all of this shortcuts description? Maybe with some info how to access full Qubes help online/offline and some other "must know and hard to remember" help? maybe show at this help all QUBES SPECIFIC shortcuts and bash terminal shortcuts.
Or at least the page to docs with all of this shortcuts?
#2449 QubesOS/qubes-manager#19 #2229 #881 #2002 #1448 #1019
https://groups.google.com/forum/#!topic/qubes-devel/poVtf6X0-BM/discussion
evadogstar
commented
Mar 31, 2017
•
|
Shortcuts help. Or at least the page to docs with all of this shortcuts? #2449 QubesOS/qubes-manager#19 #2229 #881 #2002 #1448 #1019 https://groups.google.com/forum/#!topic/qubes-devel/poVtf6X0-BM/discussion |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jpouellet
Mar 31, 2017
Contributor
Indeed. The most challenging part of the GUI DoS mitigation is having people know it's there and think to use it, without being able to look it up while their GUI is being DoSed ;) Due to this, I wonder how useful (if at all) it would really be in practice. You have no reason to care until such a time as you are unable to figure it out and are perhaps more likely to just hold the power button.
I agree that having a single page documenting all qubes-specific shortcuts would be nice. Not sure about a shortcut to show it though - if the problem is people not knowing of or remembering shortcuts, trying to solve that by introducing yet another shortcut seems unlikely to be helpful.
|
Indeed. The most challenging part of the GUI DoS mitigation is having people know it's there and think to use it, without being able to look it up while their GUI is being DoSed ;) Due to this, I wonder how useful (if at all) it would really be in practice. You have no reason to care until such a time as you are unable to figure it out and are perhaps more likely to just hold the power button. I agree that having a single page documenting all qubes-specific shortcuts would be nice. Not sure about a shortcut to show it though - if the problem is people not knowing of or remembering shortcuts, trying to solve that by introducing yet another shortcut seems unlikely to be helpful. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evadogstar
commented
Apr 8, 2017
|
Why it have so far in the future milestone? @jpouellet |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
andrewdavidwong
Apr 10, 2017
Member
@evadogstar: Well, it's up to @marmarek when this actually gets integrated. There will be no new features for 3.x, but perhaps 4.0 is more likely than 4.1. :)
|
@evadogstar: Well, it's up to @marmarek when this actually gets integrated. There will be no new features for 3.x, but perhaps 4.0 is more likely than 4.1. :) |
andrewdavidwong
modified the milestones:
Release 4.0,
Release 4.1
Apr 10, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jpouellet
May 6, 2017
Contributor
@evadogstar requested in #2449 (comment) to also have a shortcut for something like qvm-filemanager
|
@evadogstar requested in #2449 (comment) to also have a shortcut for something like qvm-filemanager |
andrewdavidwong commentedMar 15, 2017
Scripts created by @jpouellet: https://gist.github.com/jpouellet/0f74459699433cabc26c389caf36b455
Can we integrate this functionality into Qubes?