refactor: cleaned up syntax

This commit is contained in:
matt1432 2023-06-04 01:41:14 -04:00
parent 23547fc6df
commit bdc1c4daa2
2 changed files with 29 additions and 16 deletions

View file

@ -44,7 +44,8 @@
(sysblock :icon "${network_icon}" (sysblock :icon "${network_icon}"
:onclick "~/.config/eww/scripts/network.sh toggle" :onclick "~/.config/eww/scripts/network.sh toggle"
:active "${network_status == 'Connected' ? true : false}" :active "${network_status == 'Connected' ? true : false}"
:label "${network_ssid}") :label "${network_ssid}"
)
) )
(box :halign "center" (box :halign "center"
:orientation "h" :orientation "h"
@ -52,7 +53,8 @@
(sysblock :icon "${bluetooth_state == 'on' ? '' : ''}" (sysblock :icon "${bluetooth_state == 'on' ? '' : ''}"
:onclick "~/.config/eww/scripts/bluetooth toggle" :onclick "~/.config/eww/scripts/bluetooth toggle"
:active "${bluetooth_state == 'on' ? true : false}" :active "${bluetooth_state == 'on' ? true : false}"
:label "Bluetooth") :label "Bluetooth"
)
) )
(box :halign "end" (box :halign "end"
:orientation "h" :orientation "h"
@ -60,7 +62,8 @@
(sysblock :icon "${network_radio == 'on' ? '' : ''}" (sysblock :icon "${network_radio == 'on' ? '' : ''}"
:onclick "~/.config/eww/scripts/network.sh toggle-radio" :onclick "~/.config/eww/scripts/network.sh toggle-radio"
:active "${network_radio == 'on' ? false : true}" :active "${network_radio == 'on' ? false : true}"
:label "Airplane") :label "Airplane"
)
) )
) )
(box :class "lastrow" (box :class "lastrow"
@ -72,7 +75,8 @@
(sysblock :icon "${redshift_state == 'on' ? '' : ''}" (sysblock :icon "${redshift_state == 'on' ? '' : ''}"
:onclick "~/.config/eww/scripts/redshift toggle" :onclick "~/.config/eww/scripts/redshift toggle"
:active "${redshift_state == 'on' ? true : false}" :active "${redshift_state == 'on' ? true : false}"
:label "Night Light") :label "Night Light"
)
) )
(box :halign "center" (box :halign "center"
:orientation "h" :orientation "h"
@ -80,7 +84,8 @@
(sysblock :icon "${volume_icon}" (sysblock :icon "${volume_icon}"
:onclick "~/.config/eww/scripts/volume.sh toggle-muted" :onclick "~/.config/eww/scripts/volume.sh toggle-muted"
:active "${is_muted == 'yes' ? false : true}" :active "${is_muted == 'yes' ? false : true}"
:label "Volume") :label "Volume"
)
) )
(box :halign "end" (box :halign "end"
:orientation "h" :orientation "h"
@ -88,7 +93,8 @@
(sysblock :icon "${mic_status == 'yes' ? '' : ''}" (sysblock :icon "${mic_status == 'yes' ? '' : ''}"
:onclick "~/.config/eww/scripts/mic toggle" :onclick "~/.config/eww/scripts/mic toggle"
:active "${mic_status == 'yes' ? true : false}" :active "${mic_status == 'yes' ? true : false}"
:label "Micro") :label "Micro"
)
) )
) )
) )
@ -108,7 +114,8 @@
(scale :value volume_value (scale :value volume_value
:onchange "~/.config/eww/scripts/volume.sh set {}" :onchange "~/.config/eww/scripts/volume.sh set {}"
:min 0 :min 0
:max 101) :max 101
)
) )
(box :orientation "h" (box :orientation "h"
:space-evenly "false" :space-evenly "false"
@ -119,7 +126,8 @@
(scale :value br (scale :value br
:onchange "~/.config/eww/scripts/brightness.sh set {}" :onchange "~/.config/eww/scripts/brightness.sh set {}"
:min 0 :min 0
:max 101) :max 101
)
) )
) )
) )
@ -148,7 +156,8 @@
:valign "center" :valign "center"
:hexpand true :hexpand true
(box :class "pfp" (box :class "pfp"
:style "background-image: url('${pfp}');") :style "background-image: url('${pfp}');"
)
) )
) )
) )
@ -198,8 +207,9 @@
:height "10px" ; automatically generated by eww. :height "10px" ; automatically generated by eww.
:anchor "top right") :anchor "top right")
(revealer (revealer :transition "crossfade"
:transition "crossfade" :reveal actions-visible
:reveal actions-visible :duration "550ms"
:duration "550ms" (actions)
(actions))) )
)

View file

@ -33,7 +33,8 @@
:height "100%" :height "100%"
:anchor "center") :anchor "center")
:wm-ignore true :wm-ignore true
(powermenu-clickhandler)) (powermenu-clickhandler)
)
(defvar powermenu-visible false) (defvar powermenu-visible false)
@ -49,4 +50,6 @@
:transition "crossfade" :transition "crossfade"
:reveal powermenu-visible :reveal powermenu-visible
:duration "550ms" :duration "550ms"
(powermenu))) (powermenu)
)
)