[download]

local/bin/startmenu

   1 #!/bin/bash
   2 
   3 cd ${0%/*}
   4 
   5 source icon
   6 declare -A map
   7 
   8 for i in *??menu; do
   9     j=${i%menu}
  10     map[${j%-}]=$i
  11 done
  12 
  13 map[battery]='notify battery'
  14 map[bloge]='wikimenu -b'
  15 map[daylight]='notify daylight'
  16 map[days]='notify days'
  17 map[e3372]='notify e3372'
  18 map[files]='term ranger ~'
  19 map[gtk]='theme-menu -g'
  20 map[mail]='term mutt'
  21 map[moonday]='notify moonday'
  22 map[network]='term nmtui'
  23 map[picker]='picker'
  24 map[player]='playing'
  25 map[pochta]='notify pochta'
  26 map[redshift]='notify redshift -p'
  27 map[temperature]='notify temperature'
  28 map[terminal]='term'
  29 map[torrents]='notify torrents'
  30 map[wallpapers]='wallpapers'
  31 map[weather]='notify weather'
  32 map[windows]='windows'
  33 
  34 map[tor]='notify _tor'
  35 _tor(){ torinfo; }; export -f _tor
  36 
  37 while read _ i; do
  38     ${map[${i,}]}
  39 done < <(
  40     for i in ${!map[@]}; do
  41         icon $i ${i^}
  42     done |
  43     sort -k 2 |
  44     menu -i os
  45 )