Merge pull request #5 from tjarksaul/master

Support for Bitbar on macOS
This commit is contained in:
embr 2020-01-30 12:12:12 +00:00 committed by GitHub
commit ce911c5d25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 6 deletions

View file

@ -84,6 +84,14 @@ end, "$1", 31)
Remember to add it to your `wibox` list! Search for `mytextclock` with a default configuration.
### Bitbar
Link `bitbar/ambient.60s.sh` into your Bitbar plugin directory.
```
ln -s $(pwd)/bitbar/ambient.60s.sh ~/.bitbar
```
Why `fish`? Why not `bash` or `zsh`?
------------------------------------

21
bitbar/ambient.60s.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
WIDGET=$(/usr/local/bin/fish $DIR/../ambient-widgets | tr '\n' ' ')
if [ -z "$WIDGET" ]; then
echo "🚄"
else
echo $WIDGET
echo "---"
echo "Go to map|href=https://iceportal.de/karte"
echo $(/usr/local/bin/fish $DIR/../ambient | tr '\n' '\r\n')
fi

View file

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

View file

@ -1,12 +1,12 @@
if set -q AMBIENT_DE_ICE_STOP_NEXT
echo " $AMBIENT_DE_ICE_STOP_NEXT"
echo "🚏 $AMBIENT_DE_ICE_STOP_NEXT"
end
if [ -n "$AMBIENT_DE_ICE_STOP_NEXT_ARRIVE_DELAY" ]
echo " $AMBIENT_DE_ICE_STOP_NEXT_ARRIVE_DELAY"
echo " $AMBIENT_DE_ICE_STOP_NEXT_ARRIVE_DELAY"
end
if set -q AMBIENT_DE_ICE_TRAIN_TYPE
echo " $AMBIENT_DE_ICE_TRAIN_TYPE-$AMBIENT_DE_ICE_VZN"
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"
echo "💨 $AMBIENT_DE_ICE_SPEED km/h"
end

View file

@ -1,6 +1,6 @@
if set -q AMBIENT_EU_EUROSTAR_TRAIN_ID
echo " Eurostar $AMBIENT_EU_EUROSTAR_TRAIN_ID"
echo "🚄 Eurostar $AMBIENT_EU_EUROSTAR_TRAIN_ID"
end
if set -q AMBIENT_EU_EUROSTAR_SPEED
echo " $AMBIENT_EU_EUROSTAR_SPEED km/h"
echo "💨 $AMBIENT_EU_EUROSTAR_SPEED km/h"
end