blob: aef82e88c7cfc865e9d4877a954937f9471dfb59 [file] [log] [blame]
Samuel Shuert3f828662024-02-10 20:45:50 -05001#!/bin/bash
2
3calendar() {
4LOCK_FILE="$HOME/.cache/eww-calendar.lock"
5EWW_BIN="$HOME/.local/bin/eww/eww"
6
7run() {
8 ${EWW_BIN} -c $HOME/.config/eww/bar open calendar
9}
10
11# Open widgets
12if [[ ! -f "$LOCK_FILE" ]]; then
13 ${EWW_BIN} -c $HOME/.config/eww/bar close system music_win audio_ctl
14 touch "$LOCK_FILE"
15 run && echo "ok good!"
16else
17 ${EWW_BIN} -c $HOME/.config/eww/bar close calendar
18 rm "$LOCK_FILE" && echo "closed"
19fi
20}
21
22
23system() {
24LOCK_FILE_MEM="$HOME/.cache/eww-system.lock"
25EWW_BIN="$HOME/.local/bin/eww/eww"
26
27run() {
28 ${EWW_BIN} -c $HOME/.config/eww/bar open system
29}
30
31# Open widgets
32if [[ ! -f "$LOCK_FILE_MEM" ]]; then
33 ${EWW_BIN} -c $HOME/.config/eww/bar close calendar music_win audio_ctl
34 touch "$LOCK_FILE_MEM"
35 run && echo "ok good!"
36else
37 ${EWW_BIN} -c $HOME/.config/eww/bar close system
38 rm "$LOCK_FILE_MEM" && echo "closed"
39fi
40}
41
42
43music() {
44LOCK_FILE_SONG="$HOME/.cache/eww-song.lock"
45EWW_BIN="$HOME/.local/bin/eww/eww"
46
47run() {
48 ${EWW_BIN} -c $HOME/.config/eww/bar open music_win
49}
50
51# Open widgets
52if [[ ! -f "$LOCK_FILE_SONG" ]]; then
53 ${EWW_BIN} -c $HOME/.config/eww/bar close system calendar
54 touch "$LOCK_FILE_SONG"
55 run && echo "ok good!"
56else
57 ${EWW_BIN} -c $HOME/.config/eww/bar close music_win
58 rm "$LOCK_FILE_SONG" && echo "closed"
59fi
60}
61
62
63
64audio() {
65LOCK_FILE_AUDIO="$HOME/.cache/eww-audio.lock"
66EWW_BIN="$HOME/.local/bin/eww/eww"
67
68run() {
69 ${EWW_BIN} -c $HOME/.config/eww/bar open audio_ctl
70}
71
72# Open widgets
73if [[ ! -f "$LOCK_FILE_AUDIO" ]]; then
74 ${EWW_BIN} -c $HOME/.config/eww/bar close system calendar music
75 touch "$LOCK_FILE_AUDIO"
76 run && echo "ok good!"
77else
78 ${EWW_BIN} -c $HOME/.config/eww/bar close audio_ctl
79 rm "$LOCK_FILE_AUDIO" && echo "closed"
80fi
81}
82
83
84if [ "$1" = "calendar" ]; then
85calendar
86elif [ "$1" = "system" ]; then
87system
88elif [ "$1" = "music" ]; then
89music
90elif [ "$1" = "audio" ]; then
91audio
92fi