-
-
Notifications
You must be signed in to change notification settings - Fork 59
add script to get the currently focused VM #9701
Copy link
Copy link
Open
Copy link
Labels
C: desktop-linuxThis issue pertains to dom0's desktop in Qubes OS.This issue pertains to dom0's desktop in Qubes OS.P: defaultPriority: default. Default priority for new issues, to be replaced given sufficient information.Priority: default. Default priority for new issues, to be replaced given sufficient information.S: needs reviewStatus: needs review. Waiting for a core dev to review the contributed code.Status: needs review. Waiting for a core dev to review the contributed code.good first issueThis is a recommended issue for first-time contributors.This is a recommended issue for first-time contributors.pr submittedA pull request has been submitted for this issue.A pull request has been submitted for this issue.
Description
Metadata
Metadata
Assignees
Labels
C: desktop-linuxThis issue pertains to dom0's desktop in Qubes OS.This issue pertains to dom0's desktop in Qubes OS.P: defaultPriority: default. Default priority for new issues, to be replaced given sufficient information.Priority: default. Default priority for new issues, to be replaced given sufficient information.S: needs reviewStatus: needs review. Waiting for a core dev to review the contributed code.Status: needs review. Waiting for a core dev to review the contributed code.good first issueThis is a recommended issue for first-time contributors.This is a recommended issue for first-time contributors.pr submittedA pull request has been submitted for this issue.A pull request has been submitted for this issue.
Type
Fields
No fields configured for Feature.
The problem you're addressing
Currently, many scripts and users and rolling ad-hoc methods of determining the currently focused VM. For example:
and I've seen this used in other places too.
The solution you'd like
A new script
/usr/bin/qubes-focused-vm:Note that I have added the if statement for forward compatibility in case dom0 ever sets
_QUBES_VMNAME(why doesn't it, by the way?). It assumes dom0 is the only VM that doesn't set_QUBES_VMNAME.The value to a user, and who that user might be
This simplifies various existing scripts. Also, users may want to add their own shell scripts that bind to a hotkey and perform some action on the currently focused VM. Having a script like this greatly simplifies readability. For example, in my i3 config, I have:
which would by a total mess without the above script.
In fact, it may be worth creating a
qubes-run-in-focused-vmscript too.I'd be happy to submit a pull request if you just let me know where's the best place. Possibly here?