diff --git a/home/.config/eww/eww.yuck b/home/.config/eww/eww.yuck index 92af024..32fb932 100644 --- a/home/.config/eww/eww.yuck +++ b/home/.config/eww/eww.yuck @@ -1,5 +1,7 @@ (defvar terminal "alacritty -e") +(include "./modules/variables.yuck") + (include "./modules/clock.yuck") (include "./modules/volume.yuck") (include "./modules/bitcoin.yuck") diff --git a/home/.config/eww/modules/battery.yuck b/home/.config/eww/modules/battery.yuck index 5b06c33..b0f033e 100644 --- a/home/.config/eww/modules/battery.yuck +++ b/home/.config/eww/modules/battery.yuck @@ -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" diff --git a/home/.config/eww/modules/bitcoin.yuck b/home/.config/eww/modules/bitcoin.yuck index 6e5039e..f3adf27 100644 --- a/home/.config/eww/modules/bitcoin.yuck +++ b/home/.config/eww/modules/bitcoin.yuck @@ -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=_" diff --git a/home/.config/eww/modules/clock.yuck b/home/.config/eww/modules/clock.yuck index 5a73b50..24eab33 100644 --- a/home/.config/eww/modules/clock.yuck +++ b/home/.config/eww/modules/clock.yuck @@ -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 diff --git a/home/.config/eww/modules/gammarelay.yuck b/home/.config/eww/modules/gammarelay.yuck index 02ab78f..513d50a 100644 --- a/home/.config/eww/modules/gammarelay.yuck +++ b/home/.config/eww/modules/gammarelay.yuck @@ -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" diff --git a/home/.config/eww/modules/kernel.yuck b/home/.config/eww/modules/kernel.yuck index b0561d4..c784049 100644 --- a/home/.config/eww/modules/kernel.yuck +++ b/home/.config/eww/modules/kernel.yuck @@ -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" diff --git a/home/.config/eww/modules/uptime.yuck b/home/.config/eww/modules/uptime.yuck index d05a306..972b3e1 100644 --- a/home/.config/eww/modules/uptime.yuck +++ b/home/.config/eww/modules/uptime.yuck @@ -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" diff --git a/home/.config/eww/modules/variables.yuck b/home/.config/eww/modules/variables.yuck new file mode 100644 index 0000000..85d1683 --- /dev/null +++ b/home/.config/eww/modules/variables.yuck @@ -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`) diff --git a/home/.config/eww/modules/volume.yuck b/home/.config/eww/modules/volume.yuck index 44b3496..1f689c9 100644 --- a/home/.config/eww/modules/volume.yuck +++ b/home/.config/eww/modules/volume.yuck @@ -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" diff --git a/home/.config/eww/modules/window_name.yuck b/home/.config/eww/modules/window_name.yuck index af74d58..16ace74 100644 --- a/home/.config/eww/modules/window_name.yuck +++ b/home/.config/eww/modules/window_name.yuck @@ -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, ...) diff --git a/home/.config/eww/modules/workspaces.yuck b/home/.config/eww/modules/workspaces.yuck index e9f902e..3f4feb1 100644 --- a/home/.config/eww/modules/workspaces.yuck +++ b/home/.config/eww/modules/workspaces.yuck @@ -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 "|"))