tl;dr:
This is a work in progress. qubes-label
is renamed to qubes-label-tt
and qvm-appmenus-tweak-tools
is renamed to qvm-appmenus-tt
. Once our job is done, Independent and proper community guidelines will be posted with references to this thread. Please read the entire thread for more information.
Original thread:
I have been working on a tool to create additional custom labels and colors for Qubes OS. So far, I have created a rapid prototype to manage labels in Qubes OS database to analyze effect of new labels on behaviour of different GUI tools. Here is the output of this tool with --help
option:
This tool is a simple command line utility to manage Qubes OS labels. It could
list, create, get value, print index or remove labels from Qubes OS database.
In order to avoid possible conflicts with any probable official labels which
might be introduced in the future, it is advisable to prepend a suffix to new
custom labels. Good examples are 'custom', 'user', 'personal', etc.
Also never ever remove standard labels!
usage: qubes-label [--verbose] [-assume-yes] [--help] [--ANSI] COMMAND ...
options:
-v, --verbose verbose operation
-h, --help show command help
-y, --assume-yes automatically answer yes to all questions
--ANSI print label values in color with ANSI X3.64
(ISO/IEC 6429) escape codes in terminal. it requires
color capable tty such as xterm or xfce4-terminal
--raw-data output data in easy to parse format without headers
intended for bash-parsing. this will disable ANSI &
verbose options.
subcommands:
list List all labels and their values
create <LABEL> <VALUE> Create a new label with the provided color value.
Value should be in '0xRRGGBB' format.
get <LABEL|INDEX> Print hexadecimal value of label
index <LABEL> Print index of the label in Qubes database
remove <LABEL|INDEX> Remove label from Qubes database.
My initial findings are as follow:
- Calling
admin.label.*
API functions viaqubesd-query
is on the slow side. I did not try to switch to Python at the moment since I wanted to keep this tool as a pure bash script for the time. However, 413ms for each admin.label.Get call is not very impressive (neither end of the world). Even on this old i5-4300u based laptop. To reproduce:time for 1 in $(seq 0 9); do qubesd-query dom0 admin.label.Get dom0 red --empty > /dev/null;done
I am not aware if there is any better alternative toqubesd-query
for Admin API calls in bash. I have asked before on forum but received no feedback. - I wonder if any input sanitation is performed at API side. Such as SQL injection protection. Or whether clients should implement it. If anyone has information on this, please inform me.
- I did not find any information on maximum label string length or allowed characters.
- API has some protection against user error. For example you could not delete a label if it is used by a Qube.
- You could inquire
admin.label.Get
with both label name and its Index. I believe this is not documented. - After creating the label, the necessary png/svg files has to generated and copied to
/usr/share/icons/hicolor
folder. I wonder if~/.local/share/icons/hicolor/
would be a viable alternative. Since even the former location is not fully functional (see next points). - Generating all PNG/SVG files from one or more source SVG files is easy, if ImageMagick is installed.
- Some GUI tools work perfectly with custom labels and icons. The old Qubes Manager works fine.
- Even if you replicate all and every png/svg of existing label for your new custom label, some GUI tools would still fail. I wonder if this is because of hard-coded labels in such tools, or there are something else beside API DB and icons that I am missing. If you set a new label for any Qube, Qubes Domains tray widget (qui-domains) goes to a restart loop on next login.
qubes-app-menu
is another GUI widget which does not recognize custom labels. Investigating these tools is the next logical step - Reusing existing Qubes OS icons should be OK as they are shared with CC-BY-SA license under
qubes-artwork
Github repository. - Using Distro Logos (e.g. Debian’s, Fedora’s, Arch, …) should be OK as long as it is allowed by the their copyright guides. I tried a custom debian label with 0xd70a53 color and Debian logo. I would like this as an alternative to the current template icons.
I am trying to look beyond this and explore other possible options. There are many open or closed issues on Github with constructive feedback from users and the Qubes team. Some of them are relatively new and some are really old (over two years). I would really like to know if the team is actively working on this in parallel with a viable outcome in short term.
It would be very nice if a custom property/feature could be added to domains for effect style. Similar to what we currently have for tray icons (overlayed using Alpha channel, thin/thick borders, tint and untoched). An alternative to qvm-get-image
and qvm-get-tinted-image
and improved qubesimgconvert
library.
A custom property/feature for domains to open their Windows in specific Workspaces would be very nice. This could be done via readily available tools such as devilspice(1)
. And each workspace could have their own individual background. Nice colored backgrounds are already made by the UI/UX team.