Move all variable definitions under a single file

This commit is contained in:
ItsDrike 2023-01-29 17:25:48 +01:00
parent d583587360
commit 0734993789
No known key found for this signature in database
GPG key ID: B014E761034AF742
11 changed files with 53 additions and 54 deletions

View file

@ -1,5 +1,7 @@
(defvar terminal "alacritty -e")
(include "./modules/variables.yuck")
(include "./modules/clock.yuck")
(include "./modules/volume.yuck")
(include "./modules/bitcoin.yuck")

View file

@ -1,8 +1,3 @@
(defpoll battery
:interval "1s"
:initial '{"percent":"0","plugged":"false","status":"N/A","capacity_icon":"","extra_icon":"","manufacturer":"N/A","model_name":"N/A","technology":"N/A","energy_now":"0","enerfy_full":"0","enerfy_full_design":"0","cycle_count":"0","critical":"false","full":"false"}'
`scripts/battery`)
(defwidget battery_module []
(eventbox
:class "module battery"

View file

@ -1,8 +1,3 @@
(defpoll bitcoin
:interval "5m"
:initial "$N/A"
`~/.local/bin/scripts/cli/bitcoin`)
(defwidget bitcoin_module []
(eventbox
:onclick "~/.local/bin/scripts/cli/bitcoin | xargs -I_ ${EWW_CMD} update bitcoin=_"

View file

@ -1,8 +1,3 @@
(defpoll time
:interval "5s"
:initial '{"date": "01 Jan", "hour": "00", "minute": "00", "day": "Monday"}'
`date +'{"date": "%d %b", "hour": "%H", "minute": "%M", "day": "%A"}'`)
(defwidget clock_module []
(eventbox

View file

@ -1,7 +1,3 @@
(deflisten temperature `scripts/gammarelay temperature watch`)
(deflisten brightness `scripts/gammarelay brightness watch`)
; (deflisten gamma `scripts/gammarelay gamma watch`)
(defwidget gammarelay_module []
(box
:class "module gammarelay"

View file

@ -1,11 +1,3 @@
; TODO: Figure out how to store this one-time
(defpoll kernel
:interval "10000h"
:initial 'N/A'
; `uname -r | sed -r 's/(.+)-arch(.+)/\\1/'`
`uname -r`)
(defwidget kernel_module []
(eventbox
:class "module kernel"

View file

@ -1,17 +1,3 @@
(defpoll uptime
:interval "1m"
:initial 'N/A'
`uptime -p | sed \\
-e 's/^up //' \\
-e 's/ years\\?,\\?/y/' \\
-e 's/ months\\?,\\?/m/' \\
-e 's/ weeks\\?,\\?/w/' \\
-e 's/ days\\?,\\?/d/' \\
-e 's/ hours\\?,\\?/h/' \\
-e 's/ minutes\\?,\\?/m/' \\
-e 's/ seconds\\?,\\?/s/' \\
| cut -d' ' -f-2`)
(defwidget uptime_module []
(eventbox
:class "module uptime"

View file

@ -0,0 +1,51 @@
(defpoll time
:interval "5s"
:initial '{"date": "01 Jan", "hour": "00", "minute": "00", "day": "Monday"}'
`date +'{"date": "%d %b", "hour": "%H", "minute": "%M", "day": "%A"`)
(deflisten volume
:initial '{ "speaker_vol": "100", "speaker_mute": false, "speaker_icon": "", "microphone_mute": false, "microphone_vol": "100", "microphone_icon": "" }'
`scripts/volume loop`)
(deflisten window_name
:initial `{"class":"","name":"","formatted_name":""}`
`scripts/window_name`)
(deflisten workspaces
:initial `[{"id": 1,"name": "N/A","monitor": "N/A","windows": 1,"hasfullscreen": false,"lastwindow": "N/A","lastwindowtitle": "N/A","format_name": "N/A","active": true}]`
`scripts/workspaces --loop`)
(defpoll battery
:interval "1s"
:initial '{"percent":"0","plugged":"false","status":"N/A","capacity_icon":"","extra_icon":"","manufacturer":"N/A","model_name":"N/A","technology":"N/A","energy_now":"0","enerfy_full":"0","enerfy_full_design":"0","cycle_count":"0","critical":"false","full":"false"}'
`scripts/battery`)
(defpoll uptime
:interval "1m"
:initial 'N/A'
`uptime -p | sed \\
-e 's/^up //' \\
-e 's/ years\\?,\\?/y/' \\
-e 's/ months\\?,\\?/m/' \\
-e 's/ weeks\\?,\\?/w/' \\
-e 's/ days\\?,\\?/d/' \\
-e 's/ hours\\?,\\?/h/' \\
-e 's/ minutes\\?,\\?/m/' \\
-e 's/ seconds\\?,\\?/s/' \\
| cut -d' ' -f-2`)
(defpoll bitcoin
:interval "5m"
:initial "$N/A"
`~/.local/bin/scripts/cli/bitcoin`)
; TODO: Figure out how to store this one-time
(defpoll kernel
:interval "10000h"
:initial 'N/A'
; `uname -r | sed -r 's/(.+)-arch(.+)/\\1/'`
`uname -r`)
(deflisten temperature `scripts/gammarelay temperature watch`)
(deflisten brightness `scripts/gammarelay brightness watch`)
(deflisten gamma `scripts/gammarelay gamma watch`)

View file

@ -1,9 +1,5 @@
(defvar mic_rev false)
(deflisten volume
:initial '{ "speaker_vol": "100", "speaker_mute": false, "speaker_icon": "", "microphone_mute": false, "microphone_vol": "100", "microphone_icon": "" }'
`scripts/volume loop`)
(defwidget volume_module []
(box
:class "module volume"

View file

@ -1,7 +1,3 @@
(deflisten window_name
:initial `{"class":"","name":"","formatted_name":""}`
`scripts/window_name`)
; Consider making the window name clickable, opening up a full window that's showing
; the selected window details (class, unformatted name, and perhaps even more, like
; xwayland status, ...)

View file

@ -1,8 +1,3 @@
(deflisten workspaces
:initial `[{"id": 1,"name": "N/A","monitor": "N/A","windows": 1,"hasfullscreen": false,"lastwindow": "N/A","lastwindowtitle": "N/A","format_name": "N/A","active": true}]`
`scripts/workspaces --loop`)
; (defwidget sep []
; (label :class "separ module" :text "|"))