first push of my config files
[my-dotfiles.git] / bin / executors / wifi-name
CommitLineData
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']
13IWGETID="sudo /sbin/iwgetid"
14NAME="none"
15
16wifi=$($IWGETID | awk -F '"' '{ print $2 }')
17if [[ ! -z "$wifi" ]]; then
18 NAME="$wifi"
19fi
20
21if [[ $1 == -N* ]]; then
22 echo "Wi-Fi: $NAME"
23elif [[ $1 == -M* ]]; then
24 echo "$(echo $1 | cut -c3-) $NAME"
25else
26 echo /usr/share/icons/MB-Mango-Suru-GLOW/devices/16/network-wireless.svg
27 echo " ${NAME}"
28fi