90 lines
1.5 KiB
Plaintext
90 lines
1.5 KiB
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
calendar() {
|
||
|
LOCK_FILE="$HOME/.cache/eww-calendar.lock"
|
||
|
EWW_BIN="/usr/bin/eww"
|
||
|
|
||
|
run() {
|
||
|
${EWW_BIN} open calendar
|
||
|
}
|
||
|
|
||
|
# Open widgets
|
||
|
if [[ ! -f "$LOCK_FILE" ]]; then
|
||
|
${EWW_BIN} close system music_win audio_ctl
|
||
|
touch "$LOCK_FILE"
|
||
|
run && echo "ok good!"
|
||
|
else
|
||
|
${EWW_BIN} close calendar
|
||
|
rm "$LOCK_FILE" && echo "closed"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
|
||
|
system() {
|
||
|
LOCK_FILE_MEM="$HOME/.cache/eww-system.lock"
|
||
|
EWW_BIN="/usr/bin/eww"
|
||
|
|
||
|
run() {
|
||
|
${EWW_BIN} open system
|
||
|
}
|
||
|
|
||
|
# Open widgets
|
||
|
if [[ ! -f "$LOCK_FILE_MEM" ]]; then
|
||
|
${EWW_BIN} close calendar music_win audio_ctl
|
||
|
touch "$LOCK_FILE_MEM"
|
||
|
run && echo "ok good!"
|
||
|
else
|
||
|
${EWW_BIN} close system
|
||
|
rm "$LOCK_FILE_MEM" && echo "closed"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
|
||
|
music() {
|
||
|
LOCK_FILE_SONG="$HOME/.cache/eww-song.lock"
|
||
|
EWW_BIN="/usr/bin/eww"
|
||
|
|
||
|
run() {
|
||
|
${EWW_BIN} open music_win
|
||
|
}
|
||
|
|
||
|
# Open widgets
|
||
|
if [[ ! -f "$LOCK_FILE_SONG" ]]; then
|
||
|
${EWW_BIN} close system calendar
|
||
|
touch "$LOCK_FILE_SONG"
|
||
|
run && echo "ok good!"
|
||
|
else
|
||
|
${EWW_BIN} close music_win
|
||
|
rm "$LOCK_FILE_SONG" && echo "closed"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
audio() {
|
||
|
LOCK_FILE_AUDIO="$HOME/.cache/eww-audio.lock"
|
||
|
EWW_BIN="/usr/bin/eww"
|
||
|
|
||
|
run() {
|
||
|
${EWW_BIN} open audio_ctl
|
||
|
}
|
||
|
|
||
|
# Open widgets
|
||
|
if [[ ! -f "$LOCK_FILE_AUDIO" ]]; then
|
||
|
${EWW_BIN} close system calendar music
|
||
|
touch "$LOCK_FILE_AUDIO"
|
||
|
run && echo "ok good!"
|
||
|
else
|
||
|
${EWW_BIN} close audio_ctl
|
||
|
rm "$LOCK_FILE_AUDIO" && echo "closed"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
|
||
|
case $1 in
|
||
|
calendar) calendar;;
|
||
|
system) system;;
|
||
|
music) music;;
|
||
|
audio) audio;;
|
||
|
esac
|