rei2hu / swayblocks

status bar manager for i3 and sway written in elixir
17 stars 1 forks source link

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

Open cypa opened 4 years ago

cypa commented 4 years ago

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
cypa commented 4 years ago

maybe

~λ echo $(echo "${SIGNAL_STR%.*}")
60
cypa commented 4 years ago

~λ acpi -b | head -n 1 | sed -rn 's/^.*, (.*?)%, ((.*?):[0-9]{2} )?(.*)$/\1 \3 \4/p' gives empty string but

~λ acpi -b
Battery 0: Full, 100%
cypa commented 4 years ago

it won't work anyway and ps_mem shows 1Gb RAM! 588.6 MiB + 597.3 MiB = 1.2 GiB beam.smp (26)

rei2hu commented 4 years ago

Oh wow!

Admittedly I've only tested all the scripts on my own machine a long time ago so they aren't very comprehensive. They're mainly there for example so you can add/modify/remove as you want.

Possible fix for your battery acpi -b | head -n 1 | sed -rn 's/^.*, (.*?)%$/\1/p' but since I don't know all the possible outputs I don't know if it works for all cases.

I've never come across the high memory usage issue but it might be worth looking into why there are 26 processes running. I think there should be 3 or 4 at most for this - main process, one for handling input, and scheduler if I remember correctly. It could be some other things using beam or it's running multiple times somehow.

Also I stopped running Arch Linux a while back so I haven't used this program in a while.