Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion nmcli-rofi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

# default config
FIELDS=SSID,SECURITY,BARS
POSITION=0; XOFF=0; YOFF=0;
POSITION=0; XOFF=0; YOFF=0; MAXLINES=0; MAXWIDTH=0;
FONT="DejaVu Sans Mono Bold 14"

# get current uuid
Expand Down Expand Up @@ -52,13 +52,15 @@ function linenum () {
[[ "$wa" != '' ]] && ops=4 || ops=3

lines=$(if_wifistate "$(($list_lines_num+$ops))" 1)
[[ $MAXLINES -gt 0 ]] && [[ $lines -ge $MAXLINES ]] && lines=$MAXLINES
echo $lines
}

function rwidth () {
minus=$(echo -n "IN-USE " | wc -m)
rwidth=$(if_wifistate "$(($(echo "$1" | head -n 1 | awk '{print length($0); }')-$minus))" \
"$(echo "$2" | awk '{print length($0); }')" )
[[ $MAXWIDTH -gt 0 ]] && [[ $rwidth -gt $MAXWIDTH ]] && rwidth=$MAXWIDTH
echo $rwidth
}

Expand Down