Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qubes-i3status - json invalid #9094

Closed
neowutran opened this issue Apr 7, 2024 · 24 comments · Fixed by QubesOS/qubes-desktop-linux-i3-settings-qubes#17
Closed

qubes-i3status - json invalid #9094

neowutran opened this issue Apr 7, 2024 · 24 comments · Fixed by QubesOS/qubes-desktop-linux-i3-settings-qubes#17
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: desktop-linux-i3 Support for the i3 tiling window manager diagnosed Technical diagnosis has been performed (see issue comments). P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. pr submitted A pull request has been submitted for this issue. r4.2-host-stable r4.2-vm-bookworm-stable r4.2-vm-fc39-stable r4.2-vm-fc40-stable r4.2-vm-trixie-stable r4.3-host-cur-test r4.3-vm-bookworm-cur-test r4.3-vm-fc39-cur-test r4.3-vm-fc40-cur-test r4.3-vm-trixie-cur-test T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. updates testing Issue regarding an update that is currently in testing. Triage before migrating update to stable.

Comments

@neowutran
Copy link

Qubes OS release

R4.2, testing repositories, latest update

Brief summary

after a dom0 update today, "qubes-i3status" started to generate invalid json causing issue with the i3 bar
The result of amixer sget Master in dom0 has changed.
The AWK command doesn't retrieve the correct thing now https://github.com/QubesOS/qubes-desktop-linux-i3-settings-qubes/blob/main/qubes-i3status#L138 (and it match multiple line, so it add control character in the json, making it invalid.

Didn't had time to check what got modified

@neowutran neowutran added P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. labels Apr 7, 2024
@andrewdavidwong andrewdavidwong added C: desktop-linux-i3 Support for the i3 tiling window manager needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. updates testing Issue regarding an update that is currently in testing. Triage before migrating update to stable. affects-4.2 This issue affects Qubes OS 4.2. labels Apr 8, 2024
@BetoHydroxyButyrate
Copy link

I usually have to make a local copy and edit it. Currently, I have:

    local volume=$(echo "$volcmd" | awk '/%/ {gsub(/[\[\]]/,""); print $4; exit; }')
    local playback=$(echo "$volcmd" | awk '/%/ {gsub(/[\[\]]/,""); print $7; exit; }')

Been that way for years.

I also have some tweaks so that the volume change feedback is more responsive. Once the volume changes, it goes to polling volume once per second, so you can hit UP and wait for it to register, then you can hit UP each subsequent second.

@BetoHydroxyButyrate
Copy link

Here's the main loop. you still have to wait up to 5 seconds for the first volume change to register, but then it becomes more responsive.

main() {
    echo '{"version":1}'
    echo '['
    echo '[]'
    local n
    local vol_mod=1
    local last_vol=''

    for ((n=0; ; ++n)); do
        if (( n % 10 == 0 )); then
            local qubes=$(status_qubes)
            # network status disabled by default as it's dangerous to run a
            # command on a qube from dom0
            # local net=$(status_net)
            local disk=$(status_disk)
            local bat=$(status_bat)
            local load=$(status_load)
        fi
        if (( n % ${vol_mod} == 0 )); then
            local volume=$(status_volume)
            if [[ ${volume} == ${last_vol} ]]; then
                if (( ${vol_mod} < 5 )); then
                    let vol_mod+=1
                fi
            else
                last_vol=${volume}
                vol_mod=1
            fi
        fi
        # echo "n: $n vol_mod: $vol_mod last_vol: $last_vol vol: $volume"
        local time=$(status_time)
        echo ",[$qubes$disk$bat$load$volume$time]"
        sleep 1
    done
}

@daktak
Copy link

daktak commented Apr 30, 2024

In my i3 config i changed status_command to "qubes-i3status 2> /dev/null"

@pshMsGsAZL2n07ohWBCAGX9cC

@daktak @neowutran @BetoHydroxyButyrate - Thank you for testing i3 on Qubes and offering potential solutions. Your work and knowledge helped me fix this issue and increased my knowledge in several areas.

@daktak
Copy link

daktak commented May 7, 2024

Ok, my errors stem from the 4.2 update causing issues with my sound

@daktak
Copy link

daktak commented May 7, 2024

Updated qubes-i3status with below

volcmd=$(pactl list sinks)
local volume=$(echo "$volcmd" | grep Volume | awk '/%/ {gsub(/[\[\]]/,""); print $5; exit; }')
local playback=$(echo "$volcmd" | grep Mute | cut -f 2 -d \ )
if [[ $playback == yes ]]; then

@mpas97
Copy link

mpas97 commented Jun 29, 2024

@andrewdavidwong Any updates here? I hope that will get fixed soon. I never used testing releases but instead of important information (like date, time, battery, volume etc) my whole status bar just shows this big red json format error and that already since this issue exists (so over two months).

@fepitre
Copy link
Member

fepitre commented Jun 29, 2024

@andrewdavidwong Any updates here? I hope that will get fixed soon. I never used testing releases but instead of important information (like date, time, battery, volume etc) my whole status bar just shows this big red json format error and that already since this issue exists (so over two months).

This is absolutely not a priority. Feel free to fix it and open a PR.

@mpas97
Copy link

mpas97 commented Jun 29, 2024

I leave that to @daktak @BetoHydroxyButyrate as they are familiar with the code and already proposed some solutions.

@fepitre
Copy link
Member

fepitre commented Jun 30, 2024

I took some extra time for reworking the whole in Python. Feel free to test it, give me some feedback before we merge it please.

fepitre added a commit to fepitre/qubes-desktop-linux-i3-settings-qubes that referenced this issue Jul 1, 2024
@andrewdavidwong andrewdavidwong added diagnosed Technical diagnosis has been performed (see issue comments). pr submitted A pull request has been submitted for this issue. and removed needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. labels Jul 1, 2024
@neowutran
Copy link
Author

Tested qubes-i3status.py on my side, work fine.
For a future update probably need to find a way on how to handle "audiovm" once it is officially supported

@andrewdavidwong
Copy link
Member

For a future update probably need to find a way on how to handle "audiovm" once it is officially supported

Please open a separate issue for that.

@qubesos-bot
Copy link

Automated announcement from builder-github

The package desktop-linux-i3-settings-qubes has been pushed to the r4.3 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing bookworm-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component desktop-linux-i3-settings-qubes (including package desktop-linux-i3-settings-qubes) has been pushed to the r4.3 testing repository for the Fedora template.
To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.3-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component desktop-linux-i3-settings-qubes (including package desktop-linux-i3-settings-qubes) has been pushed to the r4.3 testing repository for the Fedora template.
To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.3-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package desktop-linux-i3-settings-qubes has been pushed to the r4.3 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing trixie-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package desktop-linux-i3-settings-qubes has been pushed to the r4.2 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing bookworm-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package desktop-linux-i3-settings-qubes has been pushed to the r4.2 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing trixie-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component desktop-linux-i3-settings-qubes (including package desktop-linux-i3-settings-qubes) has been pushed to the r4.2 testing repository for the Fedora template.
To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.2-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component desktop-linux-i3-settings-qubes (including package desktop-linux-i3-settings-qubes) has been pushed to the r4.2 testing repository for the Fedora template.
To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.2-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package desktop-linux-i3-settings-qubes has been pushed to the r4.2 stable repository for the Debian template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package desktop-linux-i3-settings-qubes has been pushed to the r4.2 stable repository for the Debian template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component desktop-linux-i3-settings-qubes (including package desktop-linux-i3-settings-qubes) has been pushed to the r4.2 stable repository for the Fedora template.
To install this update, please use the standard update command:

sudo dnf update

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component desktop-linux-i3-settings-qubes (including package desktop-linux-i3-settings-qubes) has been pushed to the r4.2 stable repository for the Fedora template.
To install this update, please use the standard update command:

sudo dnf update

Changes included in this update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: desktop-linux-i3 Support for the i3 tiling window manager diagnosed Technical diagnosis has been performed (see issue comments). P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. pr submitted A pull request has been submitted for this issue. r4.2-host-stable r4.2-vm-bookworm-stable r4.2-vm-fc39-stable r4.2-vm-fc40-stable r4.2-vm-trixie-stable r4.3-host-cur-test r4.3-vm-bookworm-cur-test r4.3-vm-fc39-cur-test r4.3-vm-fc40-cur-test r4.3-vm-trixie-cur-test T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. updates testing Issue regarding an update that is currently in testing. Triage before migrating update to stable.
Projects
None yet
8 participants