diff options
Diffstat (limited to 'X11/eww/launch_dashboard')
| -rwxr-xr-x | X11/eww/launch_dashboard | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/X11/eww/launch_dashboard b/X11/eww/launch_dashboard new file mode 100755 index 0000000..91e6441 --- /dev/null +++ b/X11/eww/launch_dashboard | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | ## Files and cmd | ||
| 4 | FILE="$HOME/.cache/eww_launch.dashboard" | ||
| 5 | CFG="$HOME/.config/eww/dashboard" | ||
| 6 | EWW=`which eww` | ||
| 7 | |||
| 8 | ## Run eww daemon if not running already | ||
| 9 | if [[ ! `pidof eww` ]]; then | ||
| 10 | ${EWW} daemon | ||
| 11 | sleep 1 | ||
| 12 | fi | ||
| 13 | |||
| 14 | ## Open widgets | ||
| 15 | run_eww() { | ||
| 16 | ${EWW} --config "$CFG" open-many \ | ||
| 17 | background \ | ||
| 18 | system \ | ||
| 19 | clock \ | ||
| 20 | uptime \ | ||
| 21 | sleep | ||
| 22 | } | ||
| 23 | |||
| 24 | ## Launch or close widgets accordingly | ||
| 25 | if [[ ! -f "$FILE" ]]; then | ||
| 26 | touch "$FILE" | ||
| 27 | run_eww | ||
| 28 | else | ||
| 29 | ${EWW} --config "$CFG" close \ | ||
| 30 | background profile system clock uptime music github \ | ||
| 31 | reddit twitter youtube weather apps mail logout sleep reboot poweroff folders | ||
| 32 | rm "$FILE" | ||
| 33 | fi | ||