The officially official Devuan Forum!

You are not logged in.

#1 2021-10-29 01:38:28

hevidevi
Member
Registered: 2021-09-17
Posts: 225  

NetworkManager wifi signal bars

Just wondering if anyone could shed some light on this weird issue. Probably belongs over at suckless.org but thought id pose the question here. When i start slstatus normally via .xinitrc the bars show up as asterisk symbols but if i start slstatus via xterm or st term then the bars show up. Seems like there is a bug or something starting characters such as these bars via xsetroot or however slstatus prints output to the statusbar and needs a terminal to print the bars?

how i start slstatus via .xinitrc to show the bars = xterm -e nohup slstatus

code:

nmcli -f ACTIVE,SIGNAL,BARS dev wifi list | awk '$1=="yes" {print $3}'

scrots:

2021-10-29-112613-419x91-scrot.png

2021-10-29-112504-519x101-scrot.png

Offline

#2 2021-10-30 09:21:32

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 2,326  

Re: NetworkManager wifi signal bars

I'm confused, slstatus is a C program so why have you posted a shell script?


To obtain a root shell use su -. Using just su will result in "command not found" messages.

Offline

#3 2021-10-30 11:55:17

hevidevi
Member
Registered: 2021-09-17
Posts: 225  

Re: NetworkManager wifi signal bars

i call a network status shell script from slstatus.

#!/bin/sh

get_net="$(ip r | awk '/^default/{print $5}')"
get_bars="$(nmcli -f ACTIVE,SIGNAL,BARS dev wifi list | awk '$1=="yes" {print $3}')"

if [ "$get_net" = "wlan0" ]; then
        printf "$get_bars"
elif [ "$get_net" = "usb0" ]; then
        printf ":Usb0"
else
        printf "no network"
fi

Last edited by hevidevi (2021-10-30 11:55:52)

Offline

#4 2021-10-31 08:14:01

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 2,326  

Re: NetworkManager wifi signal bars

Is NetworkManager running and connected before your user logs in? I don't use it myself so I'm not sure how that works.

hevidevi wrote:

i call a network status shell script from slstatus

Wait, what? Why would you do that? hmm

Please show how you have hooked the shell script into slstatus' components.

Last edited by Head_on_a_Stick (2021-10-31 08:14:19)


To obtain a root shell use su -. Using just su will result in "command not found" messages.

Offline

#5 2021-10-31 09:46:25

hevidevi
Member
Registered: 2021-09-17
Posts: 225  

Re: NetworkManager wifi signal bars

Head_on_a_Stick wrote:

Is NetworkManager running and connected before your user logs in? I don't use it myself so I'm not sure how that works.

hevidevi wrote:

i call a network status shell script from slstatus

Wait, what? Why would you do that? hmm

Please show how you have hooked the shell script into slstatus' components.

Yes network manager is running before user logs in.

slstatus in config.h has below function call and i want a network status script that tells me at a glance the wifi is working with minimal info possible, just prints nmcli bars for the wifi and a usb icon for when im using usb phone tethering.

* run_command         custom shell command            command (echo foo)

then i put it as an argument like so.

static const struct arg args[] = {
        /* function format          argument */
        { run_command, " %s ",          ("temperature") },
        { run_command, " %s ",          ("network") },
        { run_command, " %s ",          ("volume") },
         { datetime, "%s;",                      "%R" }
};

Last edited by hevidevi (2021-10-31 09:53:14)

Offline

Board footer