✨ a lot of changes and new stuff! started using mako
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
|
||||
(defwidget audio []
|
||||
(eventbox :onclick "eww open --toggle audio-popup"
|
||||
(eventbox :onclick "sh scripts/eww-window.sh toggle volume-control"
|
||||
:class "audio-eventbox"
|
||||
(box :class "audio"
|
||||
(box :class "audio ${window_state_volume-control}"
|
||||
(eventbox :onscroll `[ {} == "up" ] && wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ || wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-`
|
||||
(label :text "${ json_volume.output != 0 ? '' : '' } ${json_volume.output}%"))
|
||||
(eventbox :onscroll `[ {} == "up" ] && wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 5%+ || wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 5%-`
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
|
||||
(defwidget cc-toggle []
|
||||
(box :class "control-center-toggle"
|
||||
(button :onclick "eww open --toggle control-center"
|
||||
" ")
|
||||
)
|
||||
(button :onclick "sh scripts/eww-window.sh toggle control-center"
|
||||
:class "control-center-toggle ${ window_state_control-center == "open" ? "open" : "closed" }"
|
||||
{ notification_modes =~ "dnd" ? "" : ""})
|
||||
)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
(defwidget clock []
|
||||
(box :class "clock"
|
||||
(button :onclick "eww open calendar-window --toggle"
|
||||
:tooltip "${day-name}, ${month-name} ${day}"
|
||||
(button :onclick "sh scripts/eww-window.sh toggle calendar-window"
|
||||
:class "${window_state_calendar-window == 'open' ? 'cal-open' : ''}"
|
||||
"${day-name} ${day}, ${time}")
|
||||
)
|
||||
)
|
||||
|
||||
+47
-40
@@ -1,48 +1,55 @@
|
||||
|
||||
(defvar media_reveal_controls false)
|
||||
|
||||
(deflisten json_media :initial "{}"
|
||||
`python3 ./scripts/mediaplayer.py`)
|
||||
|
||||
(defwidget media []
|
||||
(eventbox :onhover "eww update media_reveal_controls=true"
|
||||
:onhoverlost "eww update media_reveal_controls=false"
|
||||
:visible { json_media.title == "null" && json_media.artist == "null" ?
|
||||
false
|
||||
:
|
||||
"${ active_window.class =~ json_media.player || active_window.title =~ json_media.title ? false : true }"
|
||||
}
|
||||
(box :class "mediaplayer ${ media_reveal_controls ? 'revealed' : '' }"
|
||||
:space-evenly false
|
||||
(eventbox :onhover "${EWW_CMD} update media_reveal_controls=true"
|
||||
:onhoverlost "${EWW_CMD} update media_reveal_controls=false"
|
||||
:visible { json_media.title == "null" && json_media.artist == "null" ?
|
||||
false
|
||||
:
|
||||
"${ active_window.class =~ json_media.player || active_window.title =~ json_media.title ? false : true }"
|
||||
}
|
||||
:onclick "sh scripts/eww-window.sh toggle floating-media"
|
||||
|
||||
(box :class "media"
|
||||
:space-evenly false
|
||||
(label :class "player"
|
||||
:text { json_media.player == "spotify" ? " " : " " })
|
||||
(label :class "media-title"
|
||||
:text "${json_media.title}"
|
||||
:limit-width 40)
|
||||
(box :class "separator")
|
||||
(label :class "media-artist"
|
||||
:text "${json_media.artist}"
|
||||
:limit-width 25)
|
||||
)
|
||||
(revealer :class "media-controls-revealer"
|
||||
:reveal { media_reveal_controls ? true : false }
|
||||
:transition "slideright"
|
||||
:duration "180ms"
|
||||
(box :class "media-controls"
|
||||
(button :class "previous"
|
||||
:onclick "playerctl previous --player=${json_media.player}"
|
||||
"")
|
||||
(button :class "toggle play-pause"
|
||||
:onclick "playerctl play-pause --player=${json_media.player}"
|
||||
{ json_media.status == "playing" ? "" : "" })
|
||||
(button :class "next"
|
||||
:onclick "playerctl next --player=${json_media.player}"
|
||||
"")
|
||||
)
|
||||
)
|
||||
(box :class "mediaplayer ${ media_reveal_controls && window_state_floating-media == "closed" ? 'revealed' : '' }"
|
||||
:space-evenly false
|
||||
|
||||
(box :class "media"
|
||||
:space-evenly false
|
||||
:tooltip "${json_media.title} - ${json_media.artist}"
|
||||
|
||||
(label :class "player"
|
||||
:text { json_media.player == "spotify" ? " " : " " })
|
||||
|
||||
(label :class "media-title"
|
||||
:text "${json_media.title}"
|
||||
:limit-width 40)
|
||||
|
||||
(box :class "separator")
|
||||
|
||||
(label :class "media-artist"
|
||||
:text "${json_media.artist}"
|
||||
:limit-width 25)
|
||||
)
|
||||
(revealer :class "media-controls-revealer"
|
||||
:reveal { media_reveal_controls ? "${ window_state_floating-media == 'closed' ? true : false }" : false }
|
||||
:transition "slideright"
|
||||
:duration "180ms"
|
||||
|
||||
(box :class "media-controls"
|
||||
(button :class "previous"
|
||||
:onclick "playerctl previous --player=${json_media.player}"
|
||||
"")
|
||||
|
||||
(button :class "toggle play-pause"
|
||||
:onclick "playerctl play-pause --player=${json_media.player}"
|
||||
{ json_media.status == "playing" ? "" : "" })
|
||||
|
||||
(button :class "next"
|
||||
:onclick "playerctl next --player=${json_media.player}"
|
||||
"")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
(defpoll connection_status :interval "5s"
|
||||
`nmcli n c`)
|
||||
|
||||
(defwidget network []
|
||||
(box
|
||||
(button :class "network"
|
||||
{ connection_status == "full" || connection_status == "partial" ? " " : " " })
|
||||
(box :class "network"
|
||||
(button "${ network_status == 'full' ? ' ' : ' ' }")
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
|
||||
(deflisten active_window :initial `{ "title": "null", "class": "null" }`
|
||||
`sh ./scripts/active-window.sh`)
|
||||
|
||||
(defwidget window []
|
||||
(box :class "window"
|
||||
:visible { active_window.class == "null" ? false : true }
|
||||
:visible { active_window.class == "" || active_window.class == "null" ? false : true }
|
||||
:vexpand false
|
||||
:space-evenly false
|
||||
:orientation "horizontal"
|
||||
|
||||
(image :class "icon"
|
||||
:icon "${active_window.initialClass}"
|
||||
:icon "${ active_window.initialClass =~ 'zen-(.*)$' ? 'zen-browser' : active_window.initialClass }"
|
||||
:icon-size "toolbar")
|
||||
|
||||
(box :class "info"
|
||||
:orientation { active_window.title == "" ? "horizontal" : "vertical" }
|
||||
:space-evenly false
|
||||
(label :class "window-class"
|
||||
:text "${active_window.class}")
|
||||
:text "${active_window.class}"
|
||||
:xalign 0)
|
||||
(label :class "window-title"
|
||||
:text "${active_window.title}"
|
||||
:visible { active_window.title != "" ? true : false }
|
||||
:limit-width 45)
|
||||
:limit-width 45
|
||||
:tooltip "${active_window.title}"
|
||||
:xalign 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user