MVP widget system

This commit is contained in:
embr 2020-01-02 16:41:20 +00:00
parent e4b6d0501c
commit e750dccea4
3 changed files with 21 additions and 0 deletions

8
ambient-widgets Executable file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env fish
# Change to the script's directory for now, it makes things easier.
set -l ambient_path (dirname (status --current-filename))
cd $ambient_path
# Use ambient to run the widget dispatcher with data in the environment.
./ambient ./lib/_dispatch_widgets.fish

4
lib/_dispatch_widgets.fish Executable file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env fish
for file in ./widgets.d/**/*.fish
source $file
end

View file

@ -0,0 +1,9 @@
if set -q AMBIENT_DE_ICE_STOP_NEXT
echo "$AMBIENT_DE_ICE_STOP_NEXT"
end
if set -q AMBIENT_DE_ICE_TRAIN_TYPE
echo "$AMBIENT_DE_ICE_TRAIN_TYPE-$AMBIENT_DE_ICE_VZN"
end
if set -q AMBIENT_DE_ICE_SPEED
echo "$AMBIENT_DE_ICE_SPEED km/h"
end