Add sxmo_timer.sh & sxmo_timermenu.sh

master
Miles Alan 5 years ago
parent 8ae9fbdb1c
commit 722455262f
  1. 13
      scripts/sxmo_appmenu.sh
  2. 24
      scripts/sxmo_timer.sh
  3. 22
      scripts/sxmo_timermenu.sh

@ -20,11 +20,12 @@ programchoicesinit() {
")" && WINNAME=sys
echo $WMCLASS | grep -i "applications" && CHOICES="$(echo "
Surf ^ 0 ^ surf
NetSurf ^ 0 ^ netsurf
St ^ 0 ^ st
Firefox ^ 0 ^ firefox
Foxtrotgps ^ 0 ^ foxtrotgps
Surf ^ 0 ^ surf
NetSurf ^ 0 ^ netsurf
St ^ 0 ^ st
Firefox ^ 0 ^ firefox
Foxtrotgps ^ 0 ^ foxtrotgps
Timer ^ 0 ^ sxmo_timer.sh
Close Menu ^ 0 ^ quit
")" && WINNAME=Apps
@ -123,7 +124,7 @@ mainloop() {
cut -d'^' -f1 |
sed '/^[[:space:]]*$/d' |
awk '{$1=$1};1' |
dmenu -idx $DMENUIDX -l 10 -c -fn "Terminus-30" -p "$WINNAME"
dmenu -idx $DMENUIDX -l 14 -c -fn "Terminus-30" -p "$WINNAME"
)
LOOP=$(echo "$CHOICES" | grep "$PICKED" | cut -d '^' -f2)
CMD=$(echo "$CHOICES" | grep "$PICKED" | cut -d '^' -f3)

@ -0,0 +1,24 @@
#!/usr/bin/env sh
TIME=$(
echo "$@" |
sed 's#h#*60m#g'|
sed 's#m#*60s#g'|
sed 's#s#*1#g'|
sed 's# #+#g' |
bc
)
date1=$((`date +%s` + $TIME));
while [ "$date1" -ge `date +%s` ]; do
echo -ne "$(date -u --date @$(($date1 - `date +%s`)) +%H:%M:%S) \r";
sleep 0.1
done
echo "Done with $@"
while :;
do notify-send "Done with $@";
xset dpms force off
xset dpms force on
sleep 0.5
done

@ -0,0 +1,22 @@
#!/usr/bin/env sh
sxmo_keyboard.sh on &
TIMEINPUT=$(
echo "1h
10m
9m
8m
7m
6m
5m
4m
3m
2m
1m
30s
Close Menu" | dmenu -p Timer -c -fn "Terminus-30" -l 20
)
sxmo_keyboard.sh off &
[ "Close Menu" = $TIMEINPUT ] && exit 0
st -f Monospace-50 -e sxmo_timer.sh $TIMEINPUT
Loading…
Cancel
Save