add hint-chess
This commit is contained in:
parent
af09856e07
commit
d4c5fa83c4
14
polybar-scripts/hint-chess/README.md
Normal file
14
polybar-scripts/hint-chess/README.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Script: hint-chess
|
||||
|
||||
{ A short description of what your script does. Perhaps a few words about the dependencies and requirements, if necessary }
|
||||
|
||||
|
||||
## Module
|
||||
|
||||
```
|
||||
[module/hint-chess]
|
||||
type = custom/script
|
||||
exec = ~/polybar-scripts/hint-chess.sh
|
||||
interval = 10
|
||||
click-left = xdg-open https://www.chess.com/goto_ready_game & disown
|
||||
```
|
19
polybar-scripts/hint-chess/hint-chess.sh
Normal file
19
polybar-scripts/hint-chess/hint-chess.sh
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Your chess.com username
|
||||
username="your username here"
|
||||
|
||||
# Set prefix icon
|
||||
icon="# "
|
||||
|
||||
# Set prefix icon color
|
||||
color_games="#e06c75"
|
||||
color_nogames="#e0e0e0"
|
||||
|
||||
games=$(curl -s "https://api.chess.com/pub/player/$username/games/to-move" | jq ".[] | length")
|
||||
|
||||
if [ "$games" -gt 0 ]; then
|
||||
echo "%{F$color_games}$icon $games"
|
||||
else
|
||||
echo "%{F$color_nogames}$icon $games"
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user