; Global Styles
(defvar animation-duration-default "600ms")
(defvar animation-duration-slow "1000ms")
(defvar animation-duration-fast "400ms")
(defvar animation-duration-very-fast "200ms")

(defvar spacing-default 8)
(defvar spacing-large 16)
(defvar spacing-medium 8)
(defvar spacing-small 4)
(defvar spacing-tiny 2)

; Wifi
(defpoll wifi_icon :initial "" :interval "5s" "./scripts/wifi --ICON")
(defpoll wifi_essid :initial "" :interval "30s" "./scripts/wifi --ESSID")
(defpoll wifi_radio :initial "off" :interval "2s" "nmcli radio wifi")

; Global
(defpoll volumemute :initial "false" :interval "1s" "pamixer --get-mute")
(defpoll volume :initial "0" :interval "1s" "pactl get-sink-volume @DEFAULT_SINK@ | awk '{print $5}' | tr -d '%'")
(defpoll mic_volume :initial "0" :interval "1s" "pactl get-source-volume @DEFAULT_SOURCE@ | awk '{print $5}' | tr -d '%'")

(defpoll brightness :initial "0" :interval "1s" "brightnessctl -m | awk -F, '{print substr($4, 0, length($4)-1)}' | tr -d '%'")
(defpoll external_monitor_brightness :initial "0" :interval "1s" "./scripts/brightness/get-external-brightness")

(deflisten kbLayout :initial "en" "./scripts/kb-layout/get-active")
(defpoll thour :initial "0" :interval "60s" "date +'%I'")
(defpoll tmin :initial "0" :interval "60s" "date +'%M'")
(defpoll tpm :initial "0" :interval "60s" "date +'%p'")
(defpoll calendar_day :initial "1" :interval "20h" "date '+%d'")
(defpoll calendar_year :initial "2000" :interval "20h" "date '+%Y'")
(defpoll bat0 :initial "0" :interval "30s" "bash ./scripts/sys_info --bat")
(defpoll homedir :initial "" :interval "24h" "echo ~")
(defpoll theme :interval "24h" "./scripts/toggletheme")
(defpoll gpu :interval "1s" "./scripts/sys-info/get-gpu")
; (defpoll cpu :interval "1s" "bash ./scripts/sys_info --cpu")
; (defpoll mem :interval "1s" "bash ./scripts/sys_info --mem")

; Desktop
(defpoll trashcanPath :interval "24h" "./scripts/iconfetch.py trashcan_empty")

; Wallpaper
(defvar wallpapers "[]")

; Hyprland
(defvar gapsouter 0)
(defvar gapsinner 10)
(defvar borderpixel 2)
(defvar caffeine false)

; Osd
(defvar revealOsd false)

; Sidebar
(defvar revealWifiEssid false)
(defvar revealVolume false)
(defvar revealMicrophone false)
(defvar revealBrightness false)
(defvar revealSystray false)
(defvar revealShortcuts false)

; Dock
(defvar revealDock true)
(deflisten tasksjson :initial "[]" "./scripts/tasklist.py")

; Workspaces
(defvar showNoOfWindows false)
(deflisten workspacesJson :initial "[]" "./scripts/workspace/get-workspaces")
(deflisten currentWorkspace :initial "1" "./scripts/workspace/get-active")

; Playerctl
(deflisten music_status :initial "" "playerctl status -F")
(deflisten music_title :initial "" "playerctl metadata -F --format '{{ title }}'")
(deflisten music_artist :initial "" "playerctl metadata -F --format '{{ artist }}'")
(deflisten music_cover "./scripts/pollcover.sh")
(deflisten music_time
  :initial '{
  "position": 0,
  "duration": 0,
  "readable": "0:00"
  }'
  "playerctl -F metadata -f '{ \"position\": {{position/1000000}}, \"duration\": {{mpris:length/1000000}}, \"readable\": \"{{duration(position)}}/{{duration(mpris:length)}}\" }'")

; Controlpanel
(defvar revealControlpanel false)
(defvar revealWeather false)
(defpoll hostname :initial "idk" :interval "24h" 'echo "$(whoami)"')
(defpoll uptime :initial "idk" :interval "1m" "uptime -p")
(defpoll datehour :initial "12" :interval "30m" "date +'%H'")
(defpoll notesc :interval "2s" "cat -s ~/Documents/fuck.txt")

; Python
(defpoll quotejson :interval "1h" "./scripts/python/quote.py")

(deflisten timerdis "./scripts/python/timer.py subscribe")

(deflisten notifications :initial '{
  "count": 0,
  "dnd": false,
  "notifications": [],
  "popups": []
  }'
  "./scripts/python/notifications.py"
)

(defpoll weatherjson
  :initial '{
  "FeelsLikeC": "0",
  "FeelsLikeF": "0",
  "cloudcover": "0",
  "humidity": "0",
  "localObsDateTime": "2000-00-00 07:27 AM",
  "observation_time": "07:27 AM",
  "precipInches": "0.0",
  "precipMM": "0.0",
  "pressure": "0",
  "pressureInches": "0",
  "temp_C": "0",
  "temp_F": "0",
  "uvIndex": "0",
  "visibility": "0",
  "visibilityMiles": "0",
  "weatherCode": "727",
  "weatherDesc": [{"value": "Idk"}],
  "weatherIconUrl": [{"value": ""}],
  "winddir16Point": "",
  "winddirDegree": "0",
  "windspeedKmph": "0",
  "windspeedMiles": "0",
  "icon": "idk",
  "hourly": []
  }'
  :interval "1h"
  :run-while revealControlpanel
"./scripts/python/weather.py")