Share your desktop screen / workspace

Thank you, i’ll try it as soon as possible (even if ’ know nothing in lua lol) :slight_smile:

1 Like

Amazing. How do I add my panel to the bottom as well?

1 Like

You right-click the panel and open its preferences. There you uncheck the box that says “lock panel”.

After that some dots will appear on the left-hand side of the panel. Then you drag it over to the bottom to move the panel.

2 Likes

Someone ask about how to use lua in conky.conf, in case others have the same question l’ll just post the answer here.

Add the line lua_load = '/home/user/.config/conky/qubes.lua' to conky.config, this will load the lua script from that path

You execute lua functions with ${lua function}, conky will automatically add conky_ to the function name, e.g. ${lua Main} will execute the function ${lua conky_Main} in the lua file.

Here are the conky.conf and qubes.lua I use.

conky.conf
-- Conky, a system monitor https://github.com/brndnmtthws/conky
--
-- This configuration file is Lua code. You can write code in here, and it will
-- execute when Conky loads. You can use it to generate your own advanced
-- configurations.
--
-- Try this (remove the `--`):
--
--   print("Loading Conky config")
--
-- For more on Lua, see:
-- https://www.lua.org/pil/contents.html

conky.config = {
    lua_load = '/home/user/.config/conky/qubes.lua',
    alignment = 'top_right',
    background = true,
    border_width = 1,
    cpu_avg_samples = 2,
    default_color = 'white',
    default_outline_color = 'white',
    default_shade_color = 'white',
    double_buffer = true,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    extra_newline = false,
    font = 'JetBrains Mono:size=12',
    gap_x = 60,
    gap_y = 75,
    minimum_height = 5,
    minimum_width = 5,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_ncurses = false,
    out_to_stderr = false,
    out_to_x = true,
    own_window = true,
    own_window_class = 'Conky',
    own_window_type = 'normal',
    own_window_transparent = true,
    own_window_argb_visual = true,
    own_window_argb_value = 0,
    own_window_hints = 'undecorated, below, sticky, skip_taskbar, skip_pager',
    show_graph_range = false,
    show_graph_scale = false,
    stippled_borders = 0,
    update_interval = 5.0,
    uppercase = false,
    use_spacer = 'none',
    use_xft = true,
}

conky.text = [[
${lua Main}
Total mem: ${lua GetTotalMemory} MB
Free mem: ${lua GetFreeMemory} MB
$hr
P-Cores: ${lua GetPCoreLoad}% load / ${lua GetPCoreVcpus} vcpus
E-Cores: ${lua GetECoreLoad}% load / ${lua GetECoreVcpus} vcpus
CPU temp: ${lua GetCpuTemp} / ${lua GetFanSpeed} RPM
$hr
Running VMs: ${lua GetVmCount}
GPU used by: ${lua GetGpuVmName}
]]
qubes.lua
local pcoreLoad = 0
local ecoreLoad = 0
local gpuVmName = ""
local totalMemory = ""
local freeMemory = ""
local vmCount = 0
local pCoreVcpus = 0
local eCoreVcpus = 0
local cpuTemp = ""
local fanSpeed = ""

function conky_Main()
    GetCoreLoad()
    GetGpuVmName()
    GetMemoryInfo()
    GetVmInfo()
    GetTempInfo()

    return "";
end

function conky_GetPCoreLoad()
    if pcoreLoad < 10 then
        return " " .. tostring(pcoreLoad);
    end
    return tostring(pcoreLoad);
end

function conky_GetECoreLoad()
    if ecoreLoad < 10 then
        return " " .. tostring(ecoreLoad);
    end
    return tostring(ecoreLoad);
end

function conky_GetPCoreVcpus()
    return pCoreVcpus
end

function conky_GetECoreVcpus()
    return eCoreVcpus
end

function conky_GetFreeMemory()
    local memInt = tonumber(freeMemory)
    if memInt < 10000 then
        return "   " .. freeMemory
    elseif memInt < 100000 then
        return "  " .. freeMemory
    else
        return " " .. freeMemory
    end
end

function conky_GetTotalMemory()
    return totalMemory
end

function conky_GetVmCount()
    return vmCount
end

function conky_GetFanSpeed()
    return fanSpeed
end

function conky_GetCpuTemp()
    return cpuTemp
end

function conky_GetGpuVmName()
    if gpuVmName == nil or gpuVmName == "" then
        return "none"
    end

    return gpuVmName
end

function GetCoreLoad()

    local output = RunCommand("xenpm start 1 | grep -e P0")

    local idx = 1
    pcoreLoad = 0
    ecoreLoad = 0
    for line in output:gmatch("[^\r\n]+") do
        if(line ~= nil) then
            local elements = SplitString(line, "[^%s]+")
            if elements[2] ~= nil then
                if idx < 17 then
                    pcoreLoad = pcoreLoad + tonumber(elements[2])
                else
                    ecoreLoad = ecoreLoad + tonumber(elements[2])
                end
                idx = idx + 1
            end
        end
    end

    pcoreLoad = math.ceil(pcoreLoad / 160)
    ecoreLoad = math.ceil(ecoreLoad / 160)

end

function GetGpuVmName()

    local output = RunCommand("qvm-ls --no-spinner --fields name,state --tags gpuvm | grep Running | awk '{print $1}'")
    gpuVmName = output:gsub("%s+", "")

end

function GetMemoryInfo()

    local lines = GetLines("xl info | grep -e total_memory -e free_memory");
    totalMemory = SplitString(lines[1], "[^%s]+")[3]
    freeMemory = SplitString(lines[2], "[^%s]+")[3]

end

function GetVmInfo()

    local output = RunCommand("xl vcpu-list")

    vmCount = 0
    pCoreVcpus = 0
    eCoreVcpus = 0
    local domains = {}
    for line in output:gmatch("[^\r\n]+") do
        local elements = SplitString(line, "[^%s]+")

        if elements[4] ~= nil and tonumber(elements[4]) ~= nil then
            if tonumber(elements[4]) < 16 then
                pCoreVcpus = pCoreVcpus + 1
            else
                eCoreVcpus = eCoreVcpus + 1
            end
        end

        if elements[1] ~= nil and not Contains(domains, elements[1]) then
                table.insert(domains, elements[1])
        end

    end
    vmCount = #domains -1;

end

function GetTempInfo()

    local lines = GetLines("sensors | grep -e 'PECI 0.0' -e fan1:");
    fanSpeed = SplitString(lines[1], "[^%s]+")[2]
    cpuTemp = SplitString(lines[2], "[^%s]+")[3]

end

function Contains(table, val)

    for i=1,#table do
        if table[i] == val then 
            return true
        end
    end

    return false

 end

function RunCommand(command)

    local cmd = io.popen(command)
    if cmd == nil then
        return ""
    end

    local output = cmd:read("*a")
    cmd:close();

    return output

end

function GetLines(command)
    local lines = {}
    local output = RunCommand(command)
    for line in output:gmatch("[^\r\n]+") do
        if(line ~= nil) then
            table.insert(lines, line)
        end
    end

    return lines

end

function SplitString(string, pattern)

    local elements = {}
    for e in string:gmatch(pattern) do
        if e ~= nil and e ~= "" then
            local value = e:gsub("%s+", "")
            table.insert(elements, value)
        end
    end

    return elements;

end
3 Likes

@renehoj Can you create a guide for ricing Qubes OS without a need for copy pasting some script in dom0, please. Your work is really cool.

I don’t really know much about making GTK themes, and there isn’t anything special about making them for Qubes OS, just search for a guide on how to do it on Linux.

The themes I use are modified versions of GTK themes other people have made, it is probably the easiest way to get started if you do have any experience with making a theme yourself.

The only thing that is different from traditional Linux is styling the borders, and I have made a small guide about making custom xpm borders.

2 Likes

2 posts were split to a new topic: How can I install Dasharo firmware?

Bro how did you have those beautiful icons in the sys tray?
EVEN THE WHONIX LOCK
im in love ahaaha im tired of this white background emojis, how can i replicate those emojis and the arrow ?

You need to remove the transparent background from the icons in the appVM, the application used to show the icons in dom0 can’t handle transparency.

If you are using SVG icons, you can just edit the file with a text editor and add a background element.

If you are using PNG or JPG icons, you can try and edit them using GIMP.

2 Likes

Are there any KDE solutions to change tray icons?
Searched the forum, but didn’t find any solution to this… I keep getting them white.

Thank you! And how did you found those icons? are there any packs for qubes os?

You can use any Linux icons, I’m using the dark version of the Fluent icons.

Just keep in mind that both dom0 and the appVMs are going their own icons, e.g. the networking icon showed in dom0 is that icon used in the appVM.

2 Likes

The problem is that the color is changed based on the qube color, since my sys-whonix is green the icon is green too, i changed the background colors to the same as my panel but it still look darker then its supposed too because of the qubes color overlaying the original color of the icon

How did you managed to remove the color from the sys-whonix lock and make it white?

The color isn’t removed, the color for the Whonix gateway is black.

The theme I use has a dark grey background, I use the same color as the background for the icons, that is the color that gets tinted by Qubes OS.

The entire image doesn’t get tinted, I’m not 100% how the tinting works, I believe the tinting process tries to detect the background and foreground color and only tints the color presumed to be the background.

In the case of Whonix, it is dark grey tinted with black, making it look like a black and white image.

The Whonix icons are in /usr/share/sdwdata-gui/icons in the template.

Damn thats a lot of memory! nice setup btw.