This commit is contained in:
end-4
2024-02-22 15:35:06 +07:00
commit 8db26e9707
4220 changed files with 208544 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
(defwidget dynamiccenter_widget []
(box
:orientation "v" :space-evenly false
(box ; Module 1: Volume, Brightness
:class "dynamic-module${(osd_vol || osd_bright) ? '' : '-hidetop'}"
(osd_widget)
)
(box ; Module 2: Workspaces
:class "dynamic-module${(osd_vol || osd_bright) ? '-hidebottom' : ''}"
(workspaces_widget)
)
)
)
+19
View File
@@ -0,0 +1,19 @@
(defwidget dynamicright_widget []
(eventbox
:onscroll "echo $(echo {} | sed -e 's/down/-/g' -e 's/up/+/g' | xargs -I% wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.03%) && scripts/volume osd &"
:onmiddleclick "playerctl play-pause"
:onrightclick "playerctl next || playerctl position `bc <<< \"100 * $(playerctl metadata mpris:length) / 1000000 / 100\"`"
:onclick "scripts/toggle-sideright.sh &"
(box
:orientation "v" :space-evenly false
(box ; Module 1: Volume, Brightness
:class "dynamic-module${flash_notif ? '' : '-hidetop'}"
(notifications_widget)
)
(box ; Module 2: Workspaces
:class "dynamic-module${flash_notif ? '-hidebottom' : ''}"
(status_widget)
)
)
)
)
+29
View File
@@ -0,0 +1,29 @@
(defwidget leftspace_widget []
(eventbox
:onscroll "echo $(echo {} | sed -e 's/down/-U 3/g' -e 's/up/-A 3/g' | xargs light) && scripts/brightness osd &"
:onmiddleclick "playerctl play-pause"
:onclick "scripts/toggle-sideleft.sh &"
:onrightclick "playerctl next || playerctl position `bc <<< \"100 * $(playerctl metadata mpris:length) / 1000000 / 100\"`"
(box
:space-evenly false
(box :class "corner-width")
; (eventbox
; :class "bar-btn"
; :onclick "scripts/toggle-powerview.sh"
; (box
; :class "bar-btn-box"
; :space-evenly false :spacing 5
; (label
; :class "icon-material txt-norm txt"
; :text "search"
; )
; (label
; :class "txt-smaller txt txt-smaller-offset"
; :text "Search"
; )
; )
; )
(box :hexpand true)
)
)
)
+122
View File
@@ -0,0 +1,122 @@
(defwidget music_widget []
(eventbox
:onscroll "echo {} | sed -e \"s/up/-1/g\" -e \"s/down/+1/g\" | xargs hyprctl dispatch workspace"
:onmiddleclick "playerctl play-pause"
:onrightclick "playerctl next || playerctl position `bc <<< \"100 * $(playerctl metadata mpris:length) / 1000000 / 100\"`"
:onclick "scripts/toggle-sideleft.sh &"
(box
:class "bar-group-margin bar-sides"
(box
:class "bar-group bar-group-standalone bar-group-pad-rightonly"
:orientation "h"
:space-evenly false
(box
:class "bar-music-playstate${mplay == 'Playing' ? '-playing' : ''}"
(label
:class "bar-music-playstate-txt"
:text {mplay == 'Playing' ? '' : ''}
)
)
(scroll :hscroll true :vscroll false :hexpand true
(box
:space-evenly false :spacing 5
:hexpand true
(label
:hexpand true
:xalign 1
:class "txt-smallie txt"
:text {mname.title != '' ? mname.title : 'Musik'}
)
(label :xalign 0 :class "txt-norm txt"
:text {mname.artist == '' ? '' : '•'}
)
(label
:hexpand true
:xalign 0
:class "txt-smallie txt"
:text {mname.artist}
)
)
)
)
)
)
)
(defwidget music_bottom_widget []
(eventbox
:onhover "${EWW_CMD} update hover_music=true &"
:onhoverlost "${EWW_CMD} update hover_music=false &"
:onscroll "echo $(echo {} | sed -e 's/down/-/g' -e 's/up/+/g' | xargs -I% wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.03%) && scripts/volume osd &"
:onmiddleclick "playerctl play-pause"
:onrightclick "playerctl next || playerctl position `bc <<< \"100 * $(playerctl metadata mpris:length) / 1000000 / 100\"`"
:onclick "scripts/toggle-sideleft.sh &"
(box
:halign "start"
:space-evenly false
:class "bar-group-margin"
(box
:class "bar-bottom-sides bar-group bar-group-round bar-group-pad-less"
:space-evenly false :spacing 10
(box
:valign "center"
:class "bar-music-bottom-cover bar-music-cover"
:style "
background-image: url('${mcover.image == 'null' || mcover.image == '' ? 'eww_covers/cover_art_default' : mcover.image}');
"
(box
:class "bar-music-bottom-ctl-bg bar-music-hide-${!hover_music}"
(box
:halign "center" :valign "center"
:spacing 10
(button
:class "icon-material bar-music-btn"
:onclick "playerctl previous"
"skip_previous"
)
(button
:class "icon-material bar-music-btn"
:onclick "playerctl play-pause"
"${mplay == 'Playing' ? 'pause' : 'play_arrow'}"
)
(button
:class "icon-material bar-music-btn"
:onclick "playerctl next || playerctl position `bc <<< \"100 * $(playerctl metadata mpris:length) / 1000000 / 100\"`"
"skip_next"
)
)
)
)
(box
:hexpand true
:orientation "h" :space-evenly false
:valign "center"
(scroll :hscroll true :vscroll false :hexpand true
(box
:orientation "v"
:space-evenly false
:class "bar-music-bottom-textbox"
:hexpand true
(label :xalign 0
:hexpand true
:class "txt-small txt"
:style "color: ${mcover.materialcolor.onPrimaryContainer};"
:text {mname.title != '' ? mname.title : 'Music...'}
)
(revealer
:reveal {mname.artist != ''}
:transition "slidedown"
(label :xalign 0
:hexpand true
:class "txt-small txt"
:style "color: ${mcover.materialcolor.onPrimaryContainer};"
:text {mname.artist}
)
)
)
)
)
)
)
)
)
@@ -0,0 +1,33 @@
(defwidget notifications_widget []
(eventbox
:onscroll "echo $(echo {} | sed -e 's/down/-/g' -e 's/up/+/g' | xargs -I% wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.03%) && scripts/volume osd &"
:onmiddleclick "playerctl play-pause"
:onrightclick "playerctl next || playerctl position `bc <<< \"100 * $(playerctl metadata mpris:length) / 1000000 / 100\"`"
(box
:class "bar-group-margin bar-group-pad-leftonly"
:space-evenly false :spacing 10
(scroll :hexpand true
:class "bar-group-pad-leftonly"
(label
:halign "end"
:class "txt-small txt"
:text {arraylength(notifications) > 0 ? (notifications[0]['summary']) : ''}
)
)
(box
:valign "center"
:class "bar-notif-indicator"
:space-evenly false :spacing 5
(label
:class "icon-material bar-system-icon txt-small bar-notif-icon"
:text "notifications"
)
(label
:class "txt-small"
:text "${arraylength(notifications)} "
)
)
(box :class "corner-width")
)
)
)
+38
View File
@@ -0,0 +1,38 @@
(defwidget osd_widget []
(eventbox
:onhover "${EWW_CMD} update osd_vol=false && ${EWW_CMD} update osd_bright=false"
:onscroll "echo {} | sed -e \"s/up/-1/g\" -e \"s/down/+1/g\" | xargs hyprctl dispatch workspace"
:onmiddleclick "scripts/toggle-powerview.sh &"
:onrightclick "scripts/toggle-powerview.sh &"
(box
:class "bar-ws-width bar-group-margin"
(box
:spacing 15
:class "bar-group bar-group-standalone bar-group-pad-less"
(box
:space-evenly false :spacing 5
(label :class "icon-material txt-norm txt"
:text "sunny"
)
(progress
:value {brightness.level}
:class "bar-prog-osd"
:hexpand true :valign "center"
)
)
(box
:space-evenly false :spacing 5
(progress
:flipped true
:value {volume.percent}
:class "bar-prog-osd"
:hexpand true :valign "center"
)
(label :class "icon-material txt-norm txt"
:text "volume_up"
)
)
)
)
)
)
+17
View File
@@ -0,0 +1,17 @@
(defwidget status_widget []
(box
:space-evenly false
(box :hexpand true)
(systray :pack-direction "rtl" :icon-size 18)
(box :class "corner-width")
(label
:class "bar-width icon-material bar-system-icon txt-norm txt"
:text {WIFI_ICONS[net.level]}
)
(label
:class "bar-width icon-material bar-system-icon txt-norm txt"
:text {bluetooth.icon}
)
(box :class "corner-width")
)
)
+181
View File
@@ -0,0 +1,181 @@
(defwidget system_widget []
(eventbox
:onscroll "echo {} | sed -e \"s/up/-1/g\" -e \"s/down/+1/g\" | xargs hyprctl dispatch workspace"
:onmiddleclick "playerctl play-pause"
:onrightclick "playerctl next || playerctl position `bc <<< \"100 * $(playerctl metadata mpris:length) / 1000000 / 100\"`"
:onclick "scripts/toggle-sideright.sh &"
(box
:class "bar-group-margin bar-sides"
(box
:class "bar-group bar-group-standalone bar-group-pad"
:orientation "h" :space-evenly false :spacing 15
(box
:space-evenly false :spacing 5
(label :xalign 0 :class "txt-norm txt"
:text {formattime(EWW_TIME, '%I:%M')}
)
(label :xalign 0 :class "txt-norm txt"
:text "•"
)
(label :xalign 0 :class "txt-smallie txt"
:text {formattime(EWW_TIME, '%A, %d/%m')}
)
)
(box
:hexpand true :valign "center"
:space-evenly false :spacing 2
:class "bar-batt${battery.percentage <= BATTERY_LOW ? '-low' : ''}"
:tooltip {battery.status == ' left' || battery.status == ' to full' ? "${battery.percentage}%" : battery.status}
(label :xalign 0
:valign "center"
:class "bar-batt-percentage"
:text {battery.percentage}
)
(progress
:hexpand true :valign "center"
:value {battery.percentage}
:class "bar-prog-batt${battery.percentage <= BATTERY_LOW ? '-low' : ''}"
)
(box
:valign "center"
:class "bar-batt-chargestate${battery.quickicon == '' ? '' : (battery.percentage <= BATTERY_LOW ? '-charging-low' : '-charging')}"
)
)
(box ; Icons
:space-evenly false :spacing 10
:orientation "h"
:class "bar-pad-horiz-moreright"
(box
:valign "center"
:orientation "v"
:space-evenly false :spacing -4
(label :class "icon-material bar-system-icon txt-norm txt"
:text "keyboard"
)
(label :class "txt-tiny txt" :text {lang_ibus.name_abbr})
)
; (label
; :valign "center"
; :class "icon-material bar-system-icon txt-norm"
; :text {WIFI_ICONS[net.level]}
; )
; (label
; :valign "center"
; :class "icon-material bar-system-icon txt-norm"
; :text {bluetooth.icon}
; )
)
)
)
)
)
(defwidget system_bottom_widget []
(eventbox
:onscroll "echo $(echo {} | sed -e 's/down/-/g' -e 's/up/+/g' | xargs -I% wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.03%) && scripts/volume osd &"
:onmiddleclick "playerctl play-pause"
:onrightclick "playerctl next || playerctl position `bc <<< \"100 * $(playerctl metadata mpris:length) / 1000000 / 100\"`"
:onclick "scripts/toggle-sideright.sh &"
(box
:class "bar-group-margin bar-bottom-sides"
(box
:class "bar-group bar-group-round bar-group-pad-less"
:orientation "h" :space-evenly false :spacing 10
(box ; Icons
:space-evenly false :spacing 10
:orientation "h"
:class "bar-pad-horiz-moreright"
(systray :pack-direction "rtl" :icon-size 20)
(box
:valign "center"
:orientation "v"
:space-evenly false :spacing -4
(label :class "icon-material bar-system-icon txt-norm txt"
:text "keyboard"
)
(label :class "txt-tiny txt" :text {lang_ibus.name_abbr})
)
(label
:valign "center"
:class "icon-material bar-system-icon txt-norm txt"
:text {WIFI_ICONS[net.level]}
)
(label
:valign "center"
:class "icon-material bar-system-icon txt-norm txt"
:text {bluetooth.icon}
)
)
(box
:valign "center"
:orientation "v"
:space-evenly false
(label :xalign 0 :class "txt-norm txt"
:text {formattime(EWW_TIME, '%I:%M')}
)
(label :xalign 0 :class "txt-smallie txt"
:text {formattime(EWW_TIME, '%A, %d/%m')}
)
)
(box
:hexpand true :valign "center"
:space-evenly false
:class "bar-batt-bottom"
(label :xalign 0
:valign "center"
:hexpand true
:class "bar-batt-percentage-bottom txt-norm"
:text "${memory.used} + ${memory.swapused}"
)
(overlay
(box :class "bar-circ-bottom-size")
(circular-progress
:halign "end" :valign "center"
:class "bar-batt-circ"
:value {memory.percentage}
:thickness 3
:start-at 75
:hexpand true :valign "center"
(box :class "bar-batt-circ-inside")
)
(circular-progress
:halign "end" :valign "center"
:value {memory.swappercentage}
:thickness 3
:start-at 75
:class "bar-batt-circ-layer2"
:hexpand true :valign "center"
(box :class "bar-batt-circ-layer2-inside")
)
)
)
(box
:hexpand true :valign "center"
:space-evenly false
:class "bar-batt-bottom${battery.percentage <= BATTERY_LOW ? '-low' : ''}"
:tooltip "Battery: ${battery.percentage}%"
(label :xalign 0
:valign "center"
:hexpand true
:class "bar-batt-percentage-bottom txt-norm"
:text {battery.status == ' left' || battery.status == ' to full' ? "${battery.percentage}%" : battery.status}
)
(box :class "bar-circ-bottom-size"
(circular-progress
:halign "end" :valign "center"
:value {battery.percentage}
:thickness 3
:start-at 75
:class "bar-batt-circ${battery.percentage <= BATTERY_LOW ? '-low' : ''}"
:hexpand true :valign "center"
(box
:valign "center" :halign "center"
:class "bar-batt-chargestate-bottom${battery.quickicon == '' ? '' : (battery.percentage <= BATTERY_LOW ? '-charging-low' : '-charging')}"
)
)
)
)
)
)
)
)
+47
View File
@@ -0,0 +1,47 @@
(defwidget taskbar_widget []
(eventbox
:onscroll "echo {} | sed -e \"s/up/-1/g\" -e \"s/down/+1/g\" | xargs hyprctl dispatch workspace"
:onmiddleclick "scripts/toggle-powerview.sh &"
:onrightclick "scripts/toggle-powerview.sh &"
(overlay
(box
:class "bar-group-margin"
:style "
min-width: ${(arraylength(tasks) > 13 ? 13 : arraylength(tasks)) * BAR_HEIGHT_BOTTOM_NORMAL}px;
"
(box
:class "bar-group bar-group-round"
)
)
(scroll
(box
:halign "center"
:orientation "h"
:space-evenly false
:onscroll "echo {} | sed -e \"s/up/-1/g\" -e \"s/down/+1/g\" | xargs hyprctl dispatch workspace"
(for app in tasks
(overlay
(eventbox
:cursor "pointer"
:onclick "${app.count > 0 ? ('hyprctl dispatch focuswindow address:' + app.address[0] + ' &') : (app.exec)}"
; :tooltip "${app.class}"
(box
:class "taskbar-button ${app.class == awin.class ? 'taskbar-button-active' : ''}"
(image
:class "taskbaricon"
:path {app.icon}
:image-width 32
:image-height 32
)
)
)
(box :class "taskbar-indicator-${app.class == awin.class ? 'true' : (app.count > 0 ? 'false' : 'none')}")
)
)
; Dummy keep alive
(revealer :transition "slideright" :reveal false (label :text {awin.class}))
)
)
)
)
)
+57
View File
@@ -0,0 +1,57 @@
(defwidget workspaces_widget []
(eventbox
:onscroll "echo {} | sed -e \"s/up/-1/g\" -e \"s/down/+1/g\" | xargs hyprctl dispatch workspace"
:onmiddleclick "scripts/toggle-powerview.sh &"
:onrightclick `hyprctl keyword bind ",mouse:273,exec,hyprctl keyword unbind ,mouse:273 && hyprctl dispatch submap editmode && notify-send 'Edit mode enabled' 'LMB to move, RMB to resize, Esc to exit' -a 'Edit mode' &" &`
:onhoverlost `hyprctl keyword unbind ",mouse:273" &`
(overlay
; Only displays workspace state (has windows or not)
(box
:class "bar-ws-width bar-group-margin"
(box
:class "bar-group bar-group-standalone bar-group-pad"
)
)
(box
:class "bar-group-pad"
:halign "center"
(for i in workspace
(button
:onclick "hyprctl dispatch workspace ${i.num}"
(label
:valign "center"
; NOTE: Array is 0-based but i.num values are 1-based
:class "bar-ws-txt txt-norm bar-ws-txt-${
i.haswins ? (
i.num == 1 ? (workspace[(i.num)]['haswins'] ? 'left' : 'alone') : (
i.num == 10 ? (workspace[(i.num - 2)]['haswins'] ? 'right' : 'alone') : (
workspace[(i.num - 2)]['haswins'] && workspace[(i.num)]['haswins'] ? 'middle' : (
workspace[(i.num - 2)]['haswins'] ? 'right' : (
workspace[(i.num)]['haswins'] ? 'left' : 'alone'
)
)
)
)
) : 'false'
}"
:text "${ws-icons[i.num - 1]}"
)
)
)
)
; Use a separate indicator for active workspace (animations, yay) (and more performant)
(button
:class "ws"
:style "
margin-left: ${1.79 * (activews - 1) + WORKSPACE_SIDE_PAD}rem;
margin-right: ${1.79 * (10 - activews) + WORKSPACE_SIDE_PAD}rem;
"
(label
:valign "center"
:class "bar-ws-txt bar-ws-txt-active"
:text "${activews}"
)
)
)
)
)