Files
colorshell/eww/variables.yuck
T

61 lines
1.8 KiB
Plaintext

; All globally used variables, polls and listeners should be stored here
; Variables
; State
(defvar window_state_powermenu "closed")
(defvar window_state_control-center "closed")
(defvar window_state_floating-notifications "closed")
(defvar window_state_bar "closed")
(defvar window_state_volume-control "closed")
(defvar window_state_calendar-window "closed")
(defvar window_state_volume-popup "closed")
(defvar window_state_floating-media "closed")
(defvar json_popup_notifications "{ \"notifications\": [] }")
; Listeners
(deflisten json_notification_history :initial "{\"history\": []}"
`sh scripts/notification-watch.sh`)
(deflisten json_volume :initial `{ "output": 60, "source": 80 }`
`sh scripts/get-volume-watch.sh`)
(deflisten literal_workspaces :initial ""
`sh scripts/workspaces.sh`)
(deflisten json_media :initial "{}"
`python3 scripts/mediaplayer.py`)
(deflisten json_active_window :initial "{ \"title\": \"null\", \"class\": \"null\" }"
`sh scripts/active-window.sh`)
; Polls
(defpoll hostname :initial "GNU/Linux"
:interval "24h"
`cat /etc/hostname`)
(defpoll uptime_info :interval "50s"
`uptime -p | sed -e 's/^up //'`)
(defpoll network_status :interval "2s"
`nmcli n c`)
(defpoll bluetooth_powered :interval "2s"
`bluetoothctl show | grep Powered | awk '{ print $2 }'`)
(defpoll notification_modes :interval "1s"
`makoctl mode | xargs`)
(defpoll media_shuffle_status :interval "1.5s"
:run-while { json_media.player != ""
&& json_media.player != "null" }
`playerctl shuffle`)
(defpoll is_recording :interval "1s"
`sh -c "[[ -f $HOME/.cache/recording.lock ]] && echo true || echo false"`)
(defpoll night_light :interval "1s"
`sh -c "[[ -f $HOME/.cache/night-light.pid ]] && echo true || echo false"`)