Introduces eww bar
This commit is contained in:
parent
75bc7eb6a7
commit
e58899e4ae
30 changed files with 279 additions and 1147 deletions
22
.config/eww/widgets/bar/elements/audio.yuck
Normal file
22
.config/eww/widgets/bar/elements/audio.yuck
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
(defpoll bar-audio-icon :interval "1s" :initial "" `~/.config/eww/widgets/bar/scripts/audio.sh`)
|
||||
(defpoll bar-audio-volume :interval "1s" :initial "" `pactl --format="json" get-sink-volume $(pactl get-default-sink) | jq '.volume | map(.value) | length as $amount | add / $amount'`)
|
||||
|
||||
(defwidget bar-audio []
|
||||
(eventbox
|
||||
:onclick "hyprctl dispatch exec pavucontrol"
|
||||
:onrightclick "hyprctl dispatch exec rofi -show pactl"
|
||||
(box
|
||||
:hexpand false
|
||||
:halign "end"
|
||||
:space-evenly false
|
||||
:spacing 20
|
||||
:class "widget default-padding"
|
||||
|
||||
{bar-audio-icon}
|
||||
(progress
|
||||
:valign "center"
|
||||
:value {(bar-audio-volume / 65536) * 100}
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
8
.config/eww/widgets/bar/elements/time.yuck
Normal file
8
.config/eww/widgets/bar/elements/time.yuck
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
(defpoll bar-time-display :interval "1s" :initial "" `date +" %d %R"`)
|
||||
|
||||
(defwidget bar-time []
|
||||
(box
|
||||
:class "widget default-padding"
|
||||
{bar-time-display}
|
||||
)
|
||||
)
|
||||
76
.config/eww/widgets/bar/elements/workspaces.yuck
Normal file
76
.config/eww/widgets/bar/elements/workspaces.yuck
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
(defpoll bar-workspace-data :interval "0.1s" :initial "[]" `~/.config/eww/widgets/bar/scripts/workspaces.sh`)
|
||||
|
||||
(defwidget bar-workspaces []
|
||||
(box
|
||||
:class "widget workspaces"
|
||||
:space-evenly false
|
||||
:hexpand false
|
||||
:halign "start"
|
||||
(for workspace in bar-workspace-data
|
||||
(eventbox
|
||||
:onclick "${EWW_CMD} open bar-workspace-window --arg workspaceId=${workspace.id}"
|
||||
:cursor "pointer"
|
||||
(box
|
||||
:space-evenly false
|
||||
:spacing 10
|
||||
:class "workspace ${workspace.activeOnAnyScreen ? "active": ""} ${workspace.activeOnCurrentScreen ? "current": ""}"
|
||||
|
||||
(box
|
||||
:space-evenly false
|
||||
:spacing 10
|
||||
(label
|
||||
:text {workspace.name}
|
||||
)
|
||||
(box
|
||||
:spacing 10
|
||||
(for window in {workspace.windows}
|
||||
(label
|
||||
:text {window.icon}
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defwindow bar-workspace-window [workspaceId]
|
||||
:monitor 1
|
||||
:geometry (geometry
|
||||
:x "10px"
|
||||
:y "50px"
|
||||
:width "512px"
|
||||
:height "0px"
|
||||
:anchor "top left")
|
||||
:stacking "fg"
|
||||
|
||||
(box
|
||||
|
||||
(for workspace in bar-workspace-data
|
||||
(box
|
||||
:orientation "v"
|
||||
:vexpand false
|
||||
:valign "start"
|
||||
:class "widget default-padding"
|
||||
:space-evenly false
|
||||
:spacing 10
|
||||
:visible {workspaceId == workspace.id}
|
||||
(for window in {workspace.windows}
|
||||
(eventbox
|
||||
:cursor "pointer"
|
||||
:onclick "hyprctl dispatch focuswindow pid:${window.pid} && ${EWW_CMD} close bar-workspace-window"
|
||||
:onrightclick "${EWW_CMD} close bar-workspace-window"
|
||||
|
||||
(label
|
||||
:halign "start"
|
||||
:text "${window.icon} ${window.title}"
|
||||
:truncate false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue