#!/bin/sh

PWD=~/projects/simple_x_widgets
cd $PWD

# background
#                x    y    w   h   override-redirect  font-size  symbol  color      command
# bin/iconbutton 430  260   1060 560     0                  60         ""      6      '' &
# sleep 1

# special widgets (some need width and height)
#                xpos    ypos  width   height    overide-redirect font-size
bin/weather      440     270   250     160        0               35          &
bin/mpdinfo      440     440   300     60         0               18          &
bin/mpdplay      564     510   50      50         0               30          &
bin/brightness   810     380   100     50         0               21          &
bin/volume       855     570   55      240        0               18          &
bin/quote        1030    380   450     210        0               17          &
bin/planets      1030    600   240     150        0               30          &

# icon buttons (clickable widgets)
#                x    y    w   h   override-redirect  font-size  symbol  color      command
bin/iconbutton 440  510   50   50      0                  25                1      'mpc prev' & 
bin/iconbutton 502  510   50   50      0                  25               0      'mpc seek -00:00:10' &
bin/iconbutton 626  510   50   50      0                  25               0      'mpc seek +00:00:10' &
bin/iconbutton 688  510   50   50      0                  25                1      'mpc next' &
bin/iconbutton 440  570   75   73      0                  35               3      'sudo reboot' &
bin/iconbutton 440  653   75   73      0                  35               4      'sudo poweroff' &
bin/iconbutton 440  738   75   73      0                  35               2      'pkill -u liquidcat' &
bin/iconbutton 920  270   100  100     0                  50               2      'firefox' &
bin/iconbutton 920  380   100  100     0                  50               0      'emacs' &
bin/iconbutton 920  490   100  100     0                  50               1      'firefox www.youtube.com' &
bin/iconbutton 920  600   100  100     0                  50               3      'firefox www.google.com' &
bin/iconbutton 920  710   100  100     0                  50               4      'st -e neomutt' &
bin/iconbutton 750  440   160  120     0                  60               4      '~/Music/music_selector.sh' &
bin/iconbutton 1290 600   190  150     0                  60               4      '' &

# info widgets (non-clickable widgets) (update times are in seconds)
#              x     y    w     h      override-redirect font-size   color  update time   command
bin/infowidget 700   380  100   50     0                  23          2      10            'echo $(cat /sys/class/power_supply/BAT0/capacity)' &
bin/infowidget 700   270  210   100    0                  50          0      10            'date +%H:%M' &
bin/infowidget 525   570  150   55     0                  18          2      2             'echo " "$(ifstat | grep wlp3s0 | tr -s " " | cut -d " " -f6 | sed "s/K/000/g" | numfmt --to=si)"B/s"' &
bin/infowidget 525   635  150   50     0                  18          4      2             'echo " "$(ifstat | grep wlp3s0 | tr -s " " | cut -d " " -f8 | sed "s/K/000/g" | numfmt --to=si)"B/s"' &
bin/infowidget 525   695  150   55     0                  18          3      2             'echo " "$(top -bn 2 -d 0.01 | grep "^%Cpu" | tail -n 1 | gawk -f scripts/cpu.awk)"%"' &
bin/infowidget 525   760  150   50     0                  18          3      2             'echo " "$(scripts/meminfo.sh)"B"' &
bin/infowidget 685   570  160   115    0                  40          2      3600          'echo ""$(xbps-install -un | wc -l) ' &
bin/infowidget 1030  270  450   100    0                  40          5      3600          'scripts/greeting.sh' &
bin/infowidget 685   695  160   115    0                  30          1      3600          'date +"%d %b"' &
bin/infowidget 1030  760  450   50     0                  20          3      10            'uptime -p' &

