fdd76fc5 |
1 | #!/bin/sh |
2 | |
3 | # This script displays battery icon according to the charge level and charging state |
4 | |
5 | # Author: Piotr Miller |
6 | # e-mail: nwg.piotr@gmail.com |
7 | # Website: http://nwg.pl |
8 | # Project: https://github.com/nwg-piotr/tint2-executors |
9 | # Icon by @edskeye |
10 | |
11 | # Dependencies: `wireless_tools` |
12 | # Arguments: [-N] ("Wi-Fi: " instead of icon) | [-M'custom name'] |
13 | IWGETID="sudo /sbin/iwgetid" |
14 | NAME="none" |
15 | |
16 | wifi=$($IWGETID | awk -F '"' '{ print $2 }') |
17 | if [[ ! -z "$wifi" ]]; then |
18 | NAME="$wifi" |
19 | fi |
20 | |
21 | if [[ $1 == -N* ]]; then |
22 | echo "Wi-Fi: $NAME" |
23 | elif [[ $1 == -M* ]]; then |
24 | echo "$(echo $1 | cut -c3-) $NAME" |
25 | else |
26 | echo /usr/share/icons/MB-Mango-Suru-GLOW/devices/16/network-wireless.svg |
27 | echo " ${NAME}" |
28 | fi |