Coder Social home page Coder Social logo

swayblocks's People

Contributors

rei2hu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

swayblocks's Issues

Use a streaming json parser

Various changes to swaybar keep breaking the program because I keep using workarounds like this.

A possible library to use is Jaxon except it doesn't seem to handle encoding. I could just write my own thing as it seems straightforward enough.

Edit: I wrote a parser in C and there seems to be a few problems with using escript and nifs together. Really the more that I think about it what I'm doing currently should be acceptable enough.

Crash when a script that outputs multiple blocks times out

Swayblocks often crashes when two modules ran into a timeout with failed to parse i3bar json as the visual error and cerr contains:

[23:19:24] [INFO] Timed out message recieved from ~/.config/swayblocks/scripts/wifi ["{\"separator_block_width\":\"10\",\"separator\":\"\",\"name\":\"~/.config/swayblocks/scripts/wifi\",\"instance\":0,\"full_text\":\" 10.0.0.8\",\"color\":\"#44ff44\",\"border\":\"#333333\"}", "{\"separator_block_width\":25,\"name\":\"~/.config/swayblocks/scripts/wifi\",\"instance\":1,\"full_text\":\" 46.0%\",\"color\":\"#A8FF00\",\"border\":\"#333333\"}"]
:gen_event handler Logger.Backends.Console installed in Logger terminating
** (exit) an exception was raised:
    ** (RuntimeError) no device registered with the name :user
        (logger) lib/logger/backends/console.ex:160: Logger.Backends.Console.async_io/2
        (logger) lib/logger/backends/console.ex:145: Logger.Backends.Console.log_event/5
        (logger) lib/logger/backends/console.ex:49: Logger.Backends.Console.handle_event/2
        (stdlib) gen_event.erl:577: :gen_event.server_update/4
        (stdlib) gen_event.erl:559: :gen_event.server_notify/4
        (stdlib) gen_event.erl:300: :gen_event.handle_msg/6
        (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

The first calls to wifi/volume take much longer after I unplug my laptop and are causing the timeouts, probably due to power saving hardware states

Allow specifying config file at runtime

It would be nice to be able to select a different config file at runtime. Something like swayblocks -c ~/.config/swayblocks/other_config.exs would be nice. I use multiple monitors, sometimes rotated 90 degrees, and being able to have a separate config for each monitor type would be fantastic.

wifi script won't work with LC_NUMERIC="ru_RU.UTF-8"

I am running swayblocks on:

Arch linux AUR version of swayblocks

~λ sway -v
sway version 1.4

Description of issue/expected behaviour:

in Russia standard decimal delimiter is comma, not period
so this

~λ printf "%.f" 57.0
bash: printf: 57.0: недопустимое число
57

gives error while this is OK

~λ printf "%.f" 57,0
57

and check


~λ cat /proc/net/wirelessInter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
wlp1s0: 0000   59.  -51.  -256        0      0      0    131   4888        0

Relevant logs:

replace this text with relevant logs

Actual output:

replace this text with actual output

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.