Giter Club home page Giter Club logo

Comments (10)

phiresky avatar phiresky commented on July 20, 2024

looks like the WM_CLASS of some window looks different than expected.. if you can identify from which window it comes that would be helpful (you can use xprop |grep WM_CLASS to find out the wm class of programs, should be two strings

from timetrackrs.

ivanmilov avatar ivanmilov commented on July 20, 2024

So far I "fixed" it commenting out the panic:

// "2\u{0}4\u{0}5\u{0}6\u{0}8\u{0}9\u{0}1\u{0}" to array of strings
pub fn split_zero(s: &str) -> Vec<String> {
    let mut vec: Vec<String> = s.split('\0').map(String::from).collect();
    // let last = vec.pop().unwrap();
    // if !last.is_empty() {
    //     panic!("not zero terminated");
    // }
    vec
}

from timetrackrs.

ivanmilov avatar ivanmilov commented on July 20, 2024

and yes:

❯ xprop | grep WM_CLASS                     
WM_CLASS(STRING) = "konsole", "konsole"

from timetrackrs.

phiresky avatar phiresky commented on July 20, 2024

that konsole string looks fine - it could be in another window. maybe you could add a log::warn!("unexpected class: {vec:#?}") in the if !last.is_empty()?

from timetrackrs.

ivanmilov avatar ivanmilov commented on July 20, 2024

Ok, I guess it happens because of my custom desktop names:
image

from timetrackrs.

phiresky avatar phiresky commented on July 20, 2024

uh, that's weird that those are in the window class though - can you say which window manager and status bar etc you are using?

from timetrackrs.

ivanmilov avatar ivanmilov commented on July 20, 2024

bspwm and polybar

from timetrackrs.

ivanmilov avatar ivanmilov commented on July 20, 2024

and I think it called from here: let desktop_names = split_zero(&get_property_text(..., so desktop names

from timetrackrs.

phiresky avatar phiresky commented on July 20, 2024

ah, i forgot that that function is also used there. I guess the panic should only apply to classes then, where it makes sense to strip out the last empty bit

from timetrackrs.

phiresky avatar phiresky commented on July 20, 2024

There seems to be an inconsistency in the way the string lists are created, bspwm not zero-terminating the list. I've added a check that only removes the last element if it is empty, this should fix it. Let me know if you still encounter this issue.

from timetrackrs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.