dots

Personal dotfiles
git clone git://git.gormless.xyz/dots.git
Log | Files | Refs

xnotifmenu (1646B)


      1 #!/bin/sh
      2 
      3 playing() {
      4 state="$(cmus-remote -C status | grep status | cut -f 2 -d " ")"
      5 test -z "$state" && np="Nothing"
      6 test -n "$state" && np="$(showmus)"
      7 printf "$np"
      8 }
      9 
     10 net() {
     11 inter=$(echo -n $(ifconfig | awk '/ieee80211:/ { print $3" " "(" $8 ")" }'))
     12 test $(ifconfig | awk '/ieee80211:/ { print $8}') == "psk" && echo "Airplane" || echo  "$inter"
     13 }
     14 
     15 battery()
     16 {
     17    bat=$(apm -l)
     18    stat=$(apm -a)
     19    case $stat in
     20       1)
     21          test $bat = 100 && st="=" || st="+"
     22          ;;
     23       0)
     24          test $bat = 100 && st="=" || st="-"
     25          ;;
     26    esac
     27    printf "$st$bat%"
     28 }
     29 
     30 email() {
     31 unread="$(find "${XDG_DATA_HOME}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f 2>/dev/null | wc -l 2>/dev/null | cut -c 8-$@)"
     32 test -z $(pgrep -f mbsync) || icon="..."
     33 printf "$unread$icon"
     34 }
     35 
     36 cat <<EOF | pmenu | sh &
     37 IMG:$HOME/var/theme/icons/system/health.png	health show
     38 IMG:/usr/local/share/icons/ubo-icons-0.1alpha/128x128/apps/audio-player.png	notify-send -i /usr/local/share/icons/ubo-icons-0.1alpha/64x64/actions/media-playback-start.png "$(playing)"
     39 IMG:/usr/local/share/icons/ubo-icons-0.1alpha/128x128/devices/network-wireless.png	notify-send -i /usr/local/share/icons/ubo-icons-0.1alpha/128x128/devices/network-wireless.png "$(net)"
     40 IMG:/usr/local/share/icons/ubo-icons-0.1alpha/128x128/apps/gnome-news.png	notify-send -i /usr/local/share/icons/ubo-icons-0.1alpha/128x128/apps/gnome-news.png "You have $(cat /home/anon/etc/newsboat/newsupdate) unread articles."
     41 IMG:/usr/local/share/icons/ubo-icons-0.1alpha/128x128/apps/email.png	notify-send -i /usr/local/share/icons/ubo-icons-0.1alpha/128x128/apps/email.png "$(email) unread mails.\n"
     42 EOF