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
+61
View File
@@ -0,0 +1,61 @@
(defwidget bgdecor_widget []
(box
:vexpand true
:space-evenly false :orientation "v"
(box
:class "bar-bg ${BAR_HEIGHT >= 2 ? 'bar-height' : ''}"
)
(overlay
:vexpand true
(box
:vexpand true
:class "bgdecor-box"
)
(image
:path "images/svg/corner_topleft.svg"
:halign "start"
:valign "start"
:image-width BG_ROUNDING
:image-height BG_ROUNDING
)
(image
:path "images/svg/corner_topright.svg"
:halign "end"
:valign "start"
:image-width BG_ROUNDING
:image-height BG_ROUNDING
)
(image
:path "images/svg/corner_bottomleft.svg"
:halign "start"
:valign "end"
:image-width BG_ROUNDING
:image-height BG_ROUNDING
)
(image
:path "images/svg/corner_bottomright.svg"
:halign "end"
:valign "end"
:image-width BG_ROUNDING
:image-height BG_ROUNDING
)
)
(box
:class "bar-bg ${BAR_HEIGHT >= 2 ? '' : 'bar-bottom-height'}"
)
(box
:class "bar-bg ${open_visualizer ? 'visualizer-height' : ''}"
)
)
)
(defwindow bgdecor
:monitor 0
:stacking "bg"
:namespace "noblur"
:geometry (geometry
:width "100%"
:height "100%"
)
(bgdecor_widget)
)
+115
View File
@@ -0,0 +1,115 @@
(defwidget cheatsheet_widget []
(box
:class "cheatsheet-bg spacing-v-15"
:orientation "v"
:space-evenly false
(centerbox
(box)
(box
:valign "center"
:orientation "h"
:space-evenly false
:class "spacing-h-15"
(label
:class "txt txt-hugeass"
:text "Cheat sheet"
)
(box
:space-evenly false
(label
:valign "center"
:class "cheatsheet-key txt-small"
:text ""
)
(label
:valign "center"
:class "cheatsheet-key-notkey txt-small"
:text "+"
)
(label
:valign "center"
:class "cheatsheet-key txt-small"
:text "/"
)
)
)
(button
:halign "end" :valign "center"
:class "cheatsheet-closebtn icon-material txt txt-hugeass"
:onclick "hyprctl dispatch submap reset && scripts/toggle-cheatsheet.sh --close &"
(label
:text "close"
)
)
)
(box
:spacing 15 ; can't apply dynamic children spacing for for loops sadly
(for column in cheatsheet
(box
:orientation "v"
:space-evenly false
:spacing 15 ; can't apply dynamic children spacing for for loops sadly
(for category in column
(revealer
:transition "crossfade"
:duration "150ms"
:reveal {open_cheatsheet >= category.appeartick}
(box :space-evenly false :orientation "v"
:class "spacing-v-15"
(box
:orientation "h"
:space-evenly false
:class "spacing-h-10"
(label :xalign 0
:class "icon-material txt txt-larger"
:text {category.icon}
)
(label :xalign 0
:class "txt txt-larger"
:text {category.name}
)
)
(box
:space-evenly false :orientation "h"
:class "spacing-h-10"
(box
:orientation "v"
(for keybind in {category.binds}
(box :space-evenly false :orientation "h"
(for key in {keybind.keys}
(label
:class "${key == 'OR' || key == '+' ? 'cheatsheet-key-notkey' : 'cheatsheet-key'} txt-small"
:text {key}
)
)
)
)
)
(box
:orientation "v"
(for keybind in {category.binds}
(label :xalign 0
:class "txt chearsheet-action txt-small"
:text {keybind.action}
)
)
)
)
)
)
)
)
)
)
)
)
(defwindow cheatsheet
:monitor 0
:stacking "fg"
:namespace "eww"
:geometry (geometry
:anchor "center center"
)
(cheatsheet_widget)
)
+86
View File
@@ -0,0 +1,86 @@
(defwidget notificationspopup_widget []
(box
(box
:style "
${open_notificationspopup ? '' : 'margin-top: -${RES_HEIGHT}px;'}
${open_notificationspopup ? ANIM_ENTER[0] : ANIM_EXIT[0]}
"
(eventbox
:onhoverlost "scripts/toggle-notificationspopup.sh --close && ${EWW_CMD} update notification_read=${notifications[0]['id']} &"
(box
:orientation "v" :space-evenly false
(box
:orientation "v" :space-evenly false
(for notif in notifications
(revealer
:reveal {notif.id > notification_read && notif.id <= notification_revcnt}
:transition "slidedown"
:duration "100ms"
(box
:class "popup-notif-common popup-notif${
arraylength(notifications) - notification_read == 1 ? '' : (
notif.id == arraylength(notifications) ? (
notifications[1]['app_name'] == notif.app_name && notifications[1]['urgency'] == notif.urgency ? '-top' : ''
) : (
notif.id == 1 ? (
notifications[arraylength(notifications) - 2]['app_name'] == notif.app_name && notifications[arraylength(notifications) - 2]['urgency'] == notif.urgency ? '-bottom' : ''
) : (
notifications[arraylength(notifications) - notif.id + 1]['app_name'] == notif.app_name && notifications[arraylength(notifications) - notif.id + 1]['urgency'] == notif.urgency && notif.id != notification_read + 1 ? (
notifications[arraylength(notifications) - notif.id - 1]['app_name'] == notif.app_name && notifications[arraylength(notifications) - notif.id - 1]['urgency'] == notif.urgency ? '-middle' : '-top') : (
notifications[arraylength(notifications) - notif.id - 1]['urgency'] == notif.urgency ? '-bottom' : ''
)
)
)
)
} ${notif.urgency == 2 ? 'popup-notif-urgent' : 'popup-notif-normal'}"
:orientation "h"
(box :orientation "v" :space-evenly false
(box :orientation "h" :space-evenly false
(label :xalign 0
:wrap true
:class "txt-norm txt-bold"
:text "${notif.summary}"
)
(box :hexpand true)
(label :xalign 0
:wrap true
:class "txt-small"
:text "${notif.app_name} • ${notif.time}"
:text "${arraylength(notifications) == 1 ||
notif.id == arraylength(notifications) ||
notifications[arraylength(notifications) - notif.id - 1]['app_name'] != notif.app_name || notifications[arraylength(notifications) - notif.id - 1]['urgency'] != notif.urgency ?
'${notif.app_name} • ${notif.time}' : notif.time
}"
)
)
(label :xalign 0
:wrap true
:class "txt-smaller"
:text {notif.body}
)
)
)
)
)
)
(label
:halign "center"
:class "txt-small txt popup-notif-hint"
:text "Press right Ctrl or unhover to dismiss"
)
)
)
)
)
)
(defwindow notificationspopup
:monitor 0
:stacking "overlay"
:namespace "eww"
:geometry (geometry
:anchor "top center"
:y "4%"
)
(notificationspopup_widget)
)
+269
View File
@@ -0,0 +1,269 @@
(defwidget powermenu_button [ icon text optn_num force_height ]
(box
(button
:class "powermenu-btn${force_height ? '-forceheight' : ''}${optn_num == powermenu_option ? '-active' : ''}"
:onclick "hyprctl dispatch submap reset && eww close powermenu; ${POWERMENU_COMMANDS[optn_num]}"
(box
:valign "center"
:orientation "v"
:space-evenly false
(label
:class "icon-material txt-badonkers"
:text {icon}
)
(label
:class "txt-small"
:text {text}
)
)
)
)
)
(defwidget powermenu_quicklaunch [ icon text optn_num ]
(box
(button
:class "powermenu-btn-bottom"
:onclick {POWERMENU_QUICKLAUNCHES[optn_num]}
(overlay
(box
:valign "center"
:orientation "v"
:space-evenly false
(label
:class "icon-material txt-hugeass"
:text {icon}
)
(label
:class "txt-small"
:text {text}
)
)
; number indicator
(box
:class "powermenu-btn-number"
:halign "start" :valign "start"
(label
:class "txt-small"
:text {optn_num == 0 ? 'Grave' : optn_num}
)
)
)
)
)
)
(defwidget powermenu_guidetext [ icon text ]
(box
:class "spacing-h-10"
:space-evenly false :orientation "h"
(label :xalign 1
:class "txt-large powermenu-keybind-min-width"
:text "[${icon}]"
)
(label :xalign 0
:class "txt-small"
:text {text}
)
)
)
(defwidget powermenu_widget []
(box
:orientation "v"
:space-evenly false
:class "powermenu-bg"
(box ; Top corners
:space-evenly false
:orientation "h"
(image
:path "images/svg/corner_topleft.svg"
:image-width BG_ROUNDING
:image-height BG_ROUNDING
)
(box :hexpand true)
(image
:path "images/svg/corner_topright.svg"
:image-width BG_ROUNDING
:image-height BG_ROUNDING
)
)
(centerbox
:space-evenly false
(box ; Guide text
:hexpand true
:space-evenly false
:orientation "v"
:class "powermenu-time txt"
(powermenu_guidetext :icon "←↑→↓" :text "Arrows to navigate")
(powermenu_guidetext :icon "↵" :text "Enter to confirm")
(powermenu_guidetext :icon "Esc" :text "Esc to cancel")
(powermenu_guidetext :icon "C_S+R" :text "Ctrl+Super+R to force exit")
(powermenu_guidetext :icon "#" :text "<Number> to quick-launch")
)
(box ; Power options
:space-evenly false
:halign "center"
:class "spacing-v-15 powermenu-btn-area"
:orientation "v"
(box
:space-evenly false
:class "spacing-h-15"
(powermenu_button :optn_num 0 :force_height true :icon "lock" :text "Lock")
(powermenu_button :optn_num 1 :force_height true :icon "logout" :text "Logout")
(powermenu_button :optn_num 2 :force_height true :icon "bedtime" :text "Sleep")
)
(box
:space-evenly false
:class "spacing-h-15"
(powermenu_button :optn_num 3 :force_height true :icon "system_update_alt" :text "Hibernate")
(powermenu_button :optn_num 4 :force_height true :icon "power_settings_new" :text "Shutdown")
(powermenu_button :optn_num 5 :force_height true :icon "restart_alt" :text "Reboot")
)
; Cancel button
(box :halign "center"
(powermenu_button :optn_num 7 :force_height false :icon "Close" :text "Cancel")
)
)
(box ; Clock
:hexpand true
:space-evenly false
:orientation "v"
:class "powermenu-time txt"
(label :xalign 1
:class "txt-badonkers"
:text {formattime(EWW_TIME, '%I:%M')}
)
(label :xalign 1
:class "txt-large"
:text {formattime(EWW_TIME, '%A, %d/%m')}
)
)
)
; (box :vexpand true)
; Info stuff
(box
:halign "center" :valign "center"
:vexpand true
:orientation "h"
:space-evenly false
:class "spacing-h-15"
(box
:valign "center"
:class "spacing-h-15"
:space-evenly false
:orientation "h"
(label
:class "icon-material txt-badonkers powermenu-icon"
:text "devices"
)
(box
:valign "center"
:orientation "v"
:space-evenly false
:class "spacing-v-5"
; (label :xalign 0
; :class "txt-large txt"
; :text "Hardware"
; )
(label :xalign 0
:wrap true
:class "txt-small txt"
:text "${cpuname}"
)
(label :xalign 0
:wrap true
:class "txt-small txt"
:text "${gpunames}"
)
)
)
(box
:valign "center"
:class "spacing-h-10"
:space-evenly false
:orientation "h"
(box
:class "powermenu-icon"
:style "background-image: url('images/svg/${distro}.svg');"
)
(box
:valign "center"
:orientation "v"
:space-evenly false
:class "spacing-v-5"
(label :xalign 0
:class "txt-large txt"
:text "${username}@${hostname}"
)
(label :xalign 0
:class "txt-small txt"
:text "${kernel}"
)
)
)
(box
:valign "center"
:class "spacing-h-15"
:space-evenly false
:orientation "h"
(box
:class "powermenu-icon"
:style "background-image: url('images/svg/hyprland.svg');"
)
(box
:valign "center"
:orientation "v"
:space-evenly false
:class "spacing-v-5"
(label :xalign 0
:class "txt-large txt"
:text "Hyprland"
)
(label :xalign 0
:class "txt-small txt"
:text "${hyprland_version}"
)
)
)
)
(box ; Quick-launches
:space-evenly false
:halign "center"
:class "spacing-h-15 powermenu-btn-area"
; toggle fps
(powermenu_quicklaunch :optn_num 0 :icon "60fps_select" :text "Toggle FPS")
(powermenu_quicklaunch :optn_num 1 :icon "language" :text "Open browser setup")
(powermenu_quicklaunch :optn_num 2 :icon "widgets" :text "Config Eww")
(powermenu_quicklaunch :optn_num 3 :icon "water_drop" :text "Config Hyprland")
(powermenu_quicklaunch :optn_num 4 :icon "article" :text "Hyprland Wiki")
(powermenu_quicklaunch :optn_num 5 :icon "auto_awesome" :text "Rickroll")
)
(box ; Bottom corners
:space-evenly false
:orientation "h"
(image
:path "images/svg/corner_bottomleft.svg"
:image-width BG_ROUNDING
:image-height BG_ROUNDING
)
(box :hexpand true)
(image
:path "images/svg/corner_bottomright.svg"
:image-width BG_ROUNDING
:image-height BG_ROUNDING
)
)
)
)
(defwindow powermenu
:monitor 0
:stacking "overlay"
:namespace "noanim"
:geometry (geometry
:width "100%"
:height "100%"
)
(powermenu_widget)
)
+226
View File
@@ -0,0 +1,226 @@
(defwidget powerview_workspacebox_widget [wspace]
(box
:class "powerview-ws"
(overlay
(box
:space-evenly false
:orientation "h"
:style "
min-width: ${RES_WIDTH * OVERVIEW_SCALE}px;
min-height: ${RES_HEIGHT * OVERVIEW_SCALE}px;
"
(box
:hexpand true
:class "powerview-ws-${wspace[0].workspace.id == activews}"
:style "
border-radius: 99px;
margin: 0px ${RES_WIDTH / 3 * OVERVIEW_SCALE}px;
margin-bottom: ${(BAR_HEIGHT == 0 ? GAPS : (RES_HEIGHT - BAR_HEIGHT)) * OVERVIEW_SCALE + OVERVIEW_INDICATOR_GAP}px;
margin-top: ${(BAR_HEIGHT == 0 ? (RES_HEIGHT - BAR_HEIGHT_BOTTOM) : GAPS) * OVERVIEW_SCALE + OVERVIEW_INDICATOR_GAP}px;
"
)
)
(box
:space-evenly false
:orientation "h"
:style "
min-width: ${RES_WIDTH * OVERVIEW_SCALE}px;
min-height: ${RES_HEIGHT * OVERVIEW_SCALE}px;
"
(for ws-window in wspace
(box
:class "${ws-window.address == '_none' ? '' : (
ws-window.address != selected ? 'powerview-ws-window' : 'powerview-ws-window-selected'
)}"
:style "
margin-left: ${round(ws-window.at[0] * OVERVIEW_SCALE, 0)}px;
margin-top: ${round(ws-window.at[1] * OVERVIEW_SCALE, 0)}px;
margin-right: -${round((ws-window.at[0] + ws-window.size[0]) * OVERVIEW_SCALE,0)}px;
margin-bottom: ${round(RES_HEIGHT * OVERVIEW_SCALE - ((ws-window.at[1] + ws-window.size[1]) * OVERVIEW_SCALE), 0)}px;
"
(eventbox
:cursor "${ws-window.class == 'workspace' ? '' : 'cell'}"
:onrightclick "scripts/selectwindow ${ws-window.address} '${EWW_CMD}' ${ws-window.workspace.id}"
:onmiddleclick "hyprctl dispatch closewindow address:${ws-window.address}"
:onclick "scripts/focuswindow ${ws-window.address} ${ws-window.workspace.id} && scripts/toggle-powerview.sh --close &"
:onhover "${ws-window.class == 'workspace' ? '' : (EWW_CMD + ' update overview_hover_name=\'' + ws-window + '\'')}"
(literal
:content `
${ ws-window.icon == 'null' ? '(box)' :
'
(image
:vexpand true
:path {ws-window.icon}
:image-width {round(ws-window.size[0] * OVERVIEW_SCALE * 45 / 100, 0)}
:image-height {round(ws-window.size[1] * OVERVIEW_SCALE * 45 / 100, 0)}
)
'
}
`
)
)
)
)
)
)
)
)
(defwidget powerview_widget []
(box
:space-evenly false
:orientation "v"
(eventbox
:onclick "scripts/toggle-powerview.sh --close &"
:onmiddleclick "scripts/toggle-powerview.sh --close &"
:onrightclick "scripts/toggle-powerview.sh --close &"
:onscroll "echo {} | sed -e \"s/up/-1/g\" -e \"s/down/+1/g\" | xargs hyprctl dispatch workspace"
)
; Search box
(box
:class "powerview-search-box-size"
:halign "center"
(box
(overlay
(input
:class "powerview-search-field"
:halign "fill" :vexpand true
:onchange "${EWW_CMD} update overview_query=\"{}\" && ${EWW_CMD} update overview_results=\"$(scripts/appsearch '{}')\" &"
:onaccept "scripts/launchapp '${overview_results == '[]' ? {} : overview_results[0].exec}' &"
)
(revealer
:reveal false
:transition "slidedown"
(label
:text {ICON_GET} ; Dummy to keep listener active
)
)
(box
:space-evenly false
:halign "center" :valign "center"
:orientation "v"
(revealer
:reveal "${overview_query == ''}"
:duration "150ms"
(label
:class "powerview-search-prompt-txt"
:xalign 0
:text "Search or calculate"
)
)
)
)
)
)
(eventbox ; Apps in workspaces
:onhoverlost `eww update overview_hover_name='{"class":"LMB: Focus | MMB: Close | RMB: Select/Move","title":"Powerview","workspace":{"id":0,"name":"0"},"icon": "/usr/share/icons/breeze-dark/actions/16/window.svg", "size": [0,0], "at": [0,0]}' &`
:onscroll "echo {} | sed -e \"s/up/-1/g\" -e \"s/down/+1/g\" | xargs hyprctl dispatch workspace"
(revealer
:reveal "${overview_query == ''}"
:transition "slidedown"
:duration "${overview_query == '' ? '180ms' : '150ms'}"
(revealer
:reveal "${overview_query == ''}"
:transition "crossfade"
:duration "${overview_query == '' ? '180ms' : '150ms'}"
(box
:space-evenly false
:orientation "v"
(box
:space-evenly false
:orientation "v"
:class "powerview-bg"
(box
:orientation "h"
(for wspace in wsjsona
(powerview_workspacebox_widget
:wspace {wspace}
)
)
)
(box
:orientation "h"
(for wspace in wsjsonb
(powerview_workspacebox_widget
:wspace {wspace}
)
)
)
)
(centerbox
:halign "center"
:orientation "h"
:class "bar-bg powerview-info"
(label :xalign 0
:class "txt-norm txt"
:text "${overview_hover_name.class}"
)
(label
:class "txt-norm txt"
:style "margin: 0px 50px;"
:text "${overview_hover_name.title}"
)
(label :xalign 1
:class "txt-norm txt"
:text "${overview_hover_name.size[0]}x${overview_hover_name.size[1]} "
)
)
)
)
)
)
(box ; Search results
:space-evenly false
:halign "center"
:orientation "v"
(revealer
:reveal "${overview_query != ''}"
:transition "slidedown"
:duration "${overview_query == '' ? '170ms' : '200ms'}"
(revealer
:reveal "${overview_query != ''}"
:transition "crossfade"
:duration "${overview_query == '' ? '170ms' : '200ms'}"
(scroll
:class "powerview-search-list-size"
(box
:halign "center"
:orientation "v"
:spacing 2
:space-evenly false
(for entry in overview_results
(overlay
(input
:value "${entry.name}"
:class "powerview-search-result"
:onaccept "scripts/launchapp '${entry.exec}' &"
)
(image
:halign "start"
:class "overview-search-result-icon"
:path {(entry.icon != '_letter' && entry.icon != '') ? entry.icon : 'images/svg/app.svg'}
:image-width 33
:image-height 33
)
)
)
)
)
)
)
)
)
)
(defwindow powerview
:stacking "overlay"
:focusable true
:monitor 0
:namespace "eww"
:geometry (geometry
:anchor "top center"
:y 80
)
(powerview_widget)
)
+578
View File
@@ -0,0 +1,578 @@
(defwidget sideleft_widget []
(eventbox
:onhoverlost "scripts/toggle-sideleft.sh --close &"
(box
:orientation "v" :space-evenly false
(eventbox
:onclick "scripts/toggle-sideleft.sh &"
: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"
:onrightclick "playerctl next || playerctl position `bc <<< \"100 * $(playerctl metadata mpris:length) / 1000000 / 100\"`"
(box :class {BAR_HEIGHT >= 2 ? 'bar-height' : ''})
)
(box
:vexpand true
:class "sidebar-window ${open_sideleft ? 'anim-enter' : 'anim-exit'} ${open_sideleft ? '' : 'sidebar-hide-left'}"
(scroll
:hscroll false :vscroll false
:vexpand true
(box
:orientation "h"
:spacing 1
:style "
${ANIM_ENTER[0]}
${rev_mixer ? 'margin-left: -34.091rem' : 'margin-right: -34.091rem;'}
"
(scroll
:hscroll false :vscroll true
:vexpand true
(box
:vexpand true
:class "spacing-v-15"
:orientation "v" :space-evenly false
(box ; Resources
:class "spacing-h-5"
:orientation "h"
:space-evenly false
(box
:class "sidebar-resource-value"
:space-evenly false
(label :class "icon-material txt-large"
:valign "center"
:text "data_saver_on"
)
(label :class "txt-smaller" :text "${round(EWW_CPU.avg, 0)}%")
(progress
:valign "center"
:class "sidebar-prog-resource"
:value {round(EWW_CPU.avg, 0)}
)
)
(box
:class "sidebar-resource-value"
:space-evenly false
(label :class "icon-material txt-larger"
:valign "center"
:text "memory"
)
(box :orientation "v"
(label :xalign 0
:class "txt-smaller"
:text {memory.used}
)
(label :xalign 0
:class "txt-smaller"
:text "+${memory.swapused}"
)
)
(box
:valign "center"
:orientation "v" :space-evenly false
(progress
:valign "center"
:class "sidebar-prog-resource"
:value {memory.percentage}
)
(progress
:valign "center"
:class "sidebar-prog-resource"
:value {memory.swappercentage}
)
)
)
(box
:class "sidebar-resource-value"
:space-evenly false
:hexpand true
(label :class "icon-material txt-larger"
:valign "center"
:text "hard_drive"
)
(label :xalign 0
:class "txt-smaller"
:text {diskfree}
)
(progress
:hexpand true
:valign "center"
:class "sidebar-prog-resource"
:value {diskfreepercent}
)
)
)
(box ; Music
(eventbox
:onhover "${EWW_CMD} update rev_mixerbtn=true &"
:onhoverlost "${EWW_CMD} update rev_mixerbtn=false &"
(box
:hexpand true
(overlay
:hexpand true
(box ; 0. Fallback background
:class "sidebar-music-thumbnail-fallback"
)
(box ; 1. The background
:class "sidebar-music-thumbnail"
:style "
${mcover.image == 'null' ? '' : ('background-image: url(\'' + mcover.image + '\'); background-size: 100% auto; background-position: center')}
"
)
(box ; 2. Color tint
:class "sidebar-music-vignette"
:hexpand true
)
(box ; 3. Text and controls
:class "spacing-v-minus5"
:orientation "v"
:space-evenly false
(box ; Media source, output
:class "sidebar-music-toprow"
:space-evenly false
:orientation "h"
(label :xalign 0
:hexpand true
:class "sidebar-music-source txt-hugeass"
:text "${mcover.color.source}"
:style "color: ${mcover.materialcolor.onPrimaryContainer};"
:style {mcover.materialcolor.onPrimaryContainer == "null" ? "" : "color: ${mcover.materialcolor.onPrimaryContainer};"}
)
(box
:orientation "h" :space-evenly false :class "spacing-h-5"
:halign "end"
:class "sidebar-music-output txt-small"
:style "
${mcover.materialcolor.primary == 'null' ? '' : 'background-color: ${mcover.materialcolor.primary};'}
${mcover.materialcolor.onPrimary == 'null' ? '' : 'color: ${mcover.materialcolor.onPrimary};'}
"
(label
:class "icon-material sidebar-music-device"
:text "${volume.device == 'Headphones' ? '' : ''} "
:style {mcover.materialcolor.onPrimary == "null" ? "" : "color: ${mcover.materialcolor.onPrimary};"}
)
(label
:text "${volume.device}"
:style {mcover.materialcolor.onPrimary == "null" ? "" : "color: ${mcover.materialcolor.onPrimary};"}
)
)
(button ; Open mixer
:halign "end"
:class "sidebar-music-output txt-small"
:style "
${ANIM_ENTER[0]}
${rev_mixerbtn ? '' : 'margin-right: -10rem;'}
"
:onclick "${EWW_CMD} update rev_mixer=${!rev_mixer}"
(box
:orientation "h" :space-evenly false
:class "spacing-h-5"
(label
:class "icon-material sidebar-music-device"
:text "tune "
)
(label
:text "Mixer "
)
(label
:class "icon-material sidebar-music-device txt-norm"
:text "chevron_right"
)
)
)
)
(box ; Title, play button
:space-evenly false
:orientation "h"
(scroll
:class "sidebar-music-title-scroll"
:hexpand true
:hscroll true :vscroll false
(box
:orientation "v"
:space-evenly false
:valign "center"
(label :xalign 0
:class "sidebar-music-title txt-norm"
:style {mcover.materialcolor.onPrimaryContainer == "null" ? "" : "color: ${mcover.materialcolor.onPrimaryContainer};"}
:text "${strlength(mname.title) == 0 ? 'Music' : mname.title}"
)
(label :xalign 0
:class "sidebar-music-artist txt-small"
:style {mcover.materialcolor.onPrimaryContainer == "null" ? "" : "color: ${mcover.materialcolor.onPrimaryContainer};"}
:text "${mname.artist}"
)
)
)
(eventbox
:valign "center"
:class "txt-hugeass sidebar-music-playbtn"
:onclick "playerctl play-pause"
:cursor "pointer"
(box
:style "
${mcover.materialcolor.primary == 'null' ? '' : 'background-color: ${mcover.materialcolor.primary};'}
${mcover.materialcolor.onPrimary == 'null' ? '' : 'color: ${mcover.materialcolor.onPrimary};'}
"
"${mplay == 'Playing' ? 'pause' : 'play_arrow'}"
)
)
)
(box ; Slider and skip track buttons
:space-evenly false
:orientation "h"
(eventbox
:class "txt-larger sidebar-music-trackbtn"
:onclick "playerctl previous"
(box
:style "
${mcover.materialcolor.onPrimaryContainer == 'null' ? '' : ('color: ' + mcover.materialcolor.onPrimaryContainer + ';')}
"
"skip_previous"
)
)
(overlay
:hexpand true
(box
:hexpand true
:valign "center"
:class "sidebar-music-progress"
:style "
background-image:
linear-gradient(to right,
${mcover.materialcolor.onPrimaryContainer} ${music.position}%,
rgba(200, 200, 200, 0.6) ${music.position}%);
"
)
(label
:class "sidebar-music-progress-btn txt-large"
:valign "center"
:xalign {music.position == '' ? 0 : (music.position / 100)}
:style "
${mcover.materialcolor.onPrimaryContainer == 'null' ? '' : ('color: ' + mcover.materialcolor.onPrimaryContainer + ';')}
"
:text "●"
)
)
; ; Below is the proper scale widget, but doesn't follow Material colors
; (scale
; :hexpand true
; :class "sidebar-music-slider"
; :style "
; highlight {
; color: red;
; }
; "
; :value {music.position}
; ; :onchange "playerctl position `bc <<< \"{} * $(playerctl metadata mpris:length) / 1000000 / 100\"`"
; )
(eventbox
:class "txt-larger sidebar-music-trackbtn"
:onclick "playerctl next || playerctl position `bc <<< \"100 * $(playerctl metadata mpris:length) / 1000000 / 100\"`"
:cursor "pointer"
(box
:style "
color: ${mcover.materialcolor.onPrimaryContainer};
"
"skip_next"
)
)
)
)
)
)
)
)
(box
:vexpand true
:orientation "h"
:space-evenly false
:class "sidebar-waifu-scrollbg spacing-h-15"
(box
:space-evenly false :orientation "h"
(eventbox
:onscroll "scripts/scroll-waifu {} &"
(box
:orientation "v"
; :height {SCROLL_MULTIPLIER_WAIFUTAGS * SCROLL_TOSHOW_WAIFUTAGS}
(scroll :vscroll false :hscroll false
(box
:class "spacing-v-5"
:orientation "v"
:valign "start"
:style "
${ANIM_ENTER[1]}
margin-top: -${(SCROLL_MULTIPLIER_WAIFUTAGS * scroll_offset_waifu)}px;
margin-bottom: -${(arraylength(WAIFU_TAG_ID) - SCROLL_TOSHOW_WAIFUTAGS - scroll_offset_waifu) * SCROLL_MULTIPLIER_WAIFUTAGS}px;
"
(for id in WAIFU_TAG_ID
(button
:class "sidebar-waifu-tag"
:onclick "${EWW_CMD} update waifu=\"$(scripts/waifu-get.py --segs ${WAIFU_CATEGORIES_ARGS[id]})\" &"
(box
:space-evenly false :orientation "h"
; (label
; :class "icon-material txt-smallie"
; :text {WAIFU_CATEGORIES_ICONS[id]}
; )
(label
:class "txt-smallie"
:text {WAIFU_CATEGORIES[id]}
)
)
)
)
)
)
)
)
)
(scroll
:hexpand true
:hscroll true :vscroll false
(box
:class "spacing-v-15"
:orientation "v" :space-evenly false
(box :orientation "h" :class "spacing-h-5"
(eventbox
:class "sidebar-waifu-actionbtn"
:cursor "pointer"
:onclick `mkdir -p ~/Pictures/Waifus/ && cp ${waifu.path} ~/Pictures/Waifus/eww_"$(date '+%Y_%m_%_d..%H.%M.%S')"${waifu.ext} && notify-send 'Saved pic to ~/Pictures/Waifus' eww_"$(date '+%Y_%m_%_d..%H.%M.%S')"${waifu.ext} -a 'eww' &`
(box
(box
:halign "center"
:space-evenly false :class "spacing-h-5"
(label
:class "icon-material txt-large"
:text "file_copy"
)
(label
:class "txt-norm"
:text "Hoard"
)
)
)
)
(eventbox
:class "sidebar-waifu-actionbtn"
:cursor "pointer"
:onclick `xdg-open ${waifu.sauce} &`
(box
(box
:halign "center"
:space-evenly false :class "spacing-h-5"
(label
:class "icon-material txt-large"
:text "location_on"
)
(label
:class "txt-norm"
:text "Sauce"
)
)
)
)
)
(eventbox
:vexpand true
:onclick "${EWW_CMD} update show_waifu=${!show_waifu} &"
(overlay
:vexpand true
(box
:class "sidebar-waifu-pic-bg"
)
(box
:class "sidebar-waifu-pic"
:style "
background-image: url('${waifu.path}');
"
)
(revealer
:reveal {!show_waifu}
:duration "50ms"
:transition "crossfade"
(box
:class "sidebar-waifu-pic-cover"
(box
:valign "center"
:orientation "v"
:space-evenly false
(label :valign "center" :class "icon-material txt-badonkers" :text "visibility_off")
(label :valign "center" :class "txt-norm" :text "Click to reveal")
)
)
)
(revealer
:valign "end"
:reveal {rev_waifustatus}
:duration "100ms"
:transition "slidedown"
(label
:valign "end"
:class "txt-smaller sidebar-waifu-status"
:text {waifu_status}
)
)
)
)
)
)
)
(eventbox ; Quote
; :vexpand true
:onscroll "scripts/scroll-quote {} &"
:onclick "${EWW_CMD} update quote_index=${(quote_index + 1 + arraylength(quote_content)) % arraylength(quote_content)} &"
(box
; :vexpand true
:orientation "v" :space-evenly false
:class "sidebar-quote"
(box
:space-evenly false
(label :xalign 0
:hexpand true
:angle 180
:class "icon-material txt-hugeass"
:text "format_quote"
)
(label :xalign 1
:class "txt-small sidebar-section-title-text"
:text "${quote_index+1}/${arraylength(quote_content)}"
)
)
(label :xalign 0 :yalign 1
:vexpand true
:class "txt-small"
:wrap true
:text {quote_content[quote_index]}
)
(label :xalign 0.9 :yalign 0
:vexpand true
:class "txt-small"
:wrap true
:text {quote_author[quote_index]}
)
)
)
)
)
(box
:space-evenly false :orientation "v"
:class "spacing-v-15"
(box ; Volume mixer header
:class "sidebar-mixer-header spacing-h-10"
:space-evenly false
(box
(eventbox
:cursor "pointer"
:class "sidebar-mixer-header-btn"
:onclick "${EWW_CMD} update rev_mixer=${!rev_mixer} &"
(box
(label
:class "icon-material txt-hugeass"
:text "arrow_back"
)
)
)
)
(label :xalign 0
:hexpand true
:class "txt-hugeass"
:text "Volume mixer"
)
; Instructions
(label :xalign 1
:hexpand true
:class "txt-smaller"
:text "scroll to change volume"
)
)
(scroll ; Volume mixer
:hscroll false :vscroll true
:vexpand true
(box
:valign "start"
:orientation "V"
:space-evenly false :spacing 10
(for app in audiojson
(box
:class "sidebar-mixer-app spacing-h-10"
:space-evenly false :orientation "h"
(image
:class "sidebar-mixer-app-icon"
:valign "start"
:path {app.icon}
:image-width 30
:image-height 30
:tooltip {app.name}
)
(box
:orientation "v"
:hexpand true
:spacing 10
(for client in {app["clients"]}
(eventbox
:onscroll "pactl set-sink-input-volume ${client.serial} $(echo {} | sed -e \"s/up/+5/g\" -e \"s/down/-5/g\")%"
:onrightclick "pactl set-sink-input-volume ${client.serial} 100%"
:onclick "pactl set-sink-input-volume ${client.serial} 0%"
(box
:hexpand true
:space-evenly false
:orientation "h"
:class "sidebar-mixer-app-serial"
(box
:hexpand true
:orientation "v"
; :space-evenly false
:class "sidebar-mixer-app-num spacing-v-5 txt-norm"
(scroll :hscroll true :vscroll false
(label
:xalign 0 :hexpand true
:wrap true
:text "${client.title}"
)
)
)
(box
:style "margin: 0px 10px;"
(circular-progress
:value {client.volume <= 100 ? client.volume : 100}
:start-at 75 :thickness 3
:width 37 :height 37
:class "sidebar-mixer-app-circle"
(label
:class "sidebar-mixer-app-incircle"
:text "${client.volume}"
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
(eventbox
:onclick "scripts/toggle-sideleft.sh &"
: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"
:onrightclick "playerctl next || playerctl position `bc <<< \"100 * $(playerctl metadata mpris:length) / 1000000 / 100\"`"
(box :class {BAR_HEIGHT >= 2 ? '' : 'bar-bottom-height'})
)
)
)
)
(defwindow sideleft
:monitor 0
:stacking "fg"
:namespace "eww"
:geometry (geometry
:anchor "top left"
:height "100%"
)
(sideleft_widget)
)
+424
View File
@@ -0,0 +1,424 @@
(defwidget sideright_widget []
(eventbox
:onhoverlost "scripts/toggle-sideright.sh --close &"
(box
:orientation "v" :space-evenly false
(eventbox
:onclick "scripts/toggle-sideright.sh &"
: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_HEIGHT >= 2 ? 'bar-height' : ''})
)
(box
:vexpand true
:class "sidebar-window ${open_sideright ? 'anim-enter' : 'anim-exit'} ${open_sideright ? '' : 'sidebar-hide-right'}"
(box
:vexpand true
:class "spacing-v-15"
:orientation "v" :space-evenly false
(box
:class "spacing-v-5"
:orientation "v" :space-evenly false
(box
:class "spacing-h-5"
:orientation "h"
(box
(eventbox ; Wifi
:class "sidebar-toggle${net.essid == 'lo' ? '' : '-active'}"
:onclick "scripts/net toggle &"
:cursor "pointer"
:onrightclick "XDG_CURRENT_DESKTOP='gnome' gnome-control-center wifi &"
(box
:class "spacing-h-5"
:space-evenly false :orientation "h"
(label
:class "icon-material txt-norm"
:text {WIFI_ICONS[net.level]}
)
(label :xalign 0
:class "txt-txt-norm"
:hexpand true
:text "Internet"
)
(label
:class "icon-material txt-norm"
:text "chevron_right"
)
)
)
)
(box
(eventbox ; Bluetooth
:class "sidebar-toggle${bluetooth.text == 'Bluetooth off' ? '' : '-active'}"
:onclick "scripts/bluetooth toggle &"
:cursor "pointer"
:onrightclick "blueberry &"
(box
:class "spacing-h-5"
:space-evenly false :orientation "h"
(label
:class "icon-material txt-norm"
:text {bluetooth.icon}
)
(label :xalign 0
:class "txt-txt-norm"
:hexpand true
:text "Bluetooth"
)
(label
:class "icon-material txt-norm"
:text "chevron_right"
)
)
)
)
(box
(eventbox
:class "sidebar-toggle${hyprjson.nightlight ? '-active' : ''}"
:onclick "scripts/toggle-nightlight.sh &"
:cursor "pointer"
(box
:space-evenly false :orientation "h":class "spacing-h-5"
(label
:class "icon-material txt-norm"
:text {hyprjson.nightlight ? "Nightlight" : ""}
)
(label :xalign 0
:class "txt-txt-norm"
:hexpand true
:text "Night light"
)
)
)
)
)
(box
:class "spacing-h-5"
:orientation "h"
(box
(eventbox ; Mouse raw input
:class "sidebar-toggle${hyprjson.force_no_accel == 1 ? '-active' : ''}"
:onclick "hyprctl keyword input:force_no_accel ${1 - hyprjson.force_no_accel} &"
:cursor "pointer"
(box
:space-evenly false :orientation "h" :class "spacing-h-5"
(label
:class "icon-material txt-norm"
:text "arrow_selector_tool"
)
(label :xalign 0
:class "txt-txt-norm"
:hexpand true
:text "Raw input"
)
)
)
)
(box
(eventbox ; Disable touchpad while typing
:class "sidebar-toggle${hyprjson.touchpad_disable_while_typing == 1 ? '-active' : ''}"
:onclick "hyprctl keyword input:touchpad:disable_while_typing ${1 - hyprjson.touchpad_disable_while_typing} &"
:cursor "pointer"
(box
:space-evenly false :orientation "h" :class "spacing-h-5"
(label
:class "icon-material txt-norm"
:text "keyboard"
)
(label :xalign 0
:class "txt-txt-norm"
:hexpand true
:text "→ No touchpad"
)
)
)
)
(box
(eventbox
:class "sidebar-toggle"
:onclick "~/.local/bin/record-script.sh &"
:cursor "pointer"
(box
:space-evenly false :orientation "h" :class "spacing-h-5"
(label
:class "icon-material txt-norm"
:text "screen_record"
)
(label :xalign 0
:class "txt-txt-norm"
:hexpand true
:text "Record"
)
)
)
)
)
)
(box
:orientation "h" :spacing 10
(button
:class "sidebar-action"
:onclick "scripts/toggle-sideright.sh --close && XDG_CURRENT_DESKTOP='gnome' gnome-control-center &"
(label
:class "icon-material txt-norm"
:text "settings"
)
)
(button
:class "sidebar-action"
:onclick "scripts/toggle-sideright.sh --close && gtklock &"
(label
:class "icon-material txt-norm"
:text "lock"
)
)
(button
:class "sidebar-action"
:onclick "scripts/toggle-sideright.sh --close && systemctl suspend &"
(label
:class "icon-material txt-norm"
:text "bedtime"
)
)
(button
:class "sidebar-action"
:onclick "scripts/toggle-sideright.sh --close && ${EWW_CMD} open powermenu && hyprctl dispatch submap powermenu"
(label
:class "icon-material txt-norm"
:text "power_settings_new"
)
)
)
(box
(revealer
:reveal {arraylength(notifications) - notification_cleared > 0}
:duration "180ms"
:transition "slidedown"
(box
:class "sidebar-notif-actions"
:space-evenly false
(label
:class "sidebar-notif-heading txt-norm"
:text "Notifications"
)
(eventbox
:hexpand true
:onclick "${EWW_CMD} update notification_cleared=${arraylength(notifications)} &"
:class "sidebar-notif-action"
(box
:halign "end"
:space-evenly false :orientation "h"
(label
:class "icon-material txt-norm"
:text "clear_all"
)
(label :xalign 0
:class "txt-txt-norm"
:hexpand true
:text "Clear"
)
)
)
)
)
)
(scroll :vscroll true :hscroll false :vexpand true
(box :orientation "v" :space-evenly false
(box
:orientation "v" :space-evenly false
(for notif in notifications
(revealer
:reveal {notif.id > notification_cleared && notif.id <= notification_revcnt}
:transition "slidedown"
:duration "100ms"
(box
:class "sidebar-notif-common sidebar-notif${
arraylength(notifications) - notification_cleared == 1 ? '' : (
notif.id == arraylength(notifications) ? (
notifications[1]['app_name'] == notif.app_name && notifications[1]['urgency'] == notif.urgency ? '-top' : ''
) : (
notif.id == 1 ? (
notifications[arraylength(notifications) - 2]['app_name'] == notif.app_name && notifications[arraylength(notifications) - 2]['urgency'] == notif.urgency ? '-bottom' : ''
) : (
notifications[arraylength(notifications) - notif.id + 1]['app_name'] == notif.app_name && notifications[arraylength(notifications) - notif.id + 1]['urgency'] == notif.urgency && notif.id != notification_cleared + 1? (
notifications[arraylength(notifications) - notif.id - 1]['app_name'] == notif.app_name && notifications[arraylength(notifications) - notif.id - 1]['urgency'] == notif.urgency ? '-middle' : '-top') : (
notifications[arraylength(notifications) - notif.id - 1]['app_name'] == notif.app_name && notifications[arraylength(notifications) - notif.id - 1]['urgency'] == notif.urgency ? '-bottom' : ''
)
)
)
)
} ${notif.urgency == 2 ? 'sidebar-notif-urgent' : 'sidebar-notif-normal'}"
:orientation "h"
(box :orientation "v" :space-evenly false
(box :orientation "h" :space-evenly false
(label :xalign 0
:wrap true
:class "txt-norm txt-bold"
:text "${notif.summary}"
)
(box :hexpand true)
(label :xalign 0
:wrap true
:class "txt-small"
:text "${notif.app_name} • ${notif.time}"
:text "${arraylength(notifications) == 1 ||
notif.id == arraylength(notifications) ||
notifications[arraylength(notifications) - notif.id - 1]['app_name'] != notif.app_name || notifications[arraylength(notifications) - notif.id - 1]['urgency'] != notif.urgency ?
'${notif.app_name} • ${notif.time}' : notif.time
}"
)
)
(label :xalign 0
:wrap true
:class "txt-smaller"
:text {notif.body}
)
)
)
)
)
)
(revealer
:vexpand true
:reveal {arraylength(notifications) - notification_cleared == 0}
:duration "180ms"
:transition "slidedown"
(box
:halign "center" :valign "center"
:space-evenly false :orientation "v"
(label
:class "icon-material txt-badonkers txt"
:text "notifications"
)
(label
:class "txt txt-norm"
:text "All caught up!"
)
)
)
)
)
(box
:orientation "v" :space-evenly false
:class "sidebar-section"
(box
:space-evenly false :orientation "v"
(eventbox
:onscroll "scripts/scrollmonth {} &"
:onclick "${EWW_CMD} update monthshift=0 &"
(box :space-evenly false :orientation "h"
(label :xalign 0
:class "sidebar-section-heading txt-large"
:text {calendartitle}
)
(box :hexpand true)
(label :xalign 0
:class "sidebar-section-heading txt-large"
:text "To-do list"
)
)
)
(box ; Calendar
:orientation "v"
:space-evenly false
(box
:class "sidebar-content"
:orientation "h" :space-evenly false :spacing 8
(eventbox
:onscroll "scripts/scrollmonth {} &"
(box
:orientation "v"
:space-evenly false
(box
(for day in weekdays
(box
:class "sidebar-calendar-btn day${day.today}"
(label
:class "sidebar-calendar-txt txt-smallie"
:text "${day.day}"
)
)
)
)
(for week in calendar
(box
(for day in week
(button
:class "sidebar-calendar-btn day${day.today}"
(label
:class "sidebar-calendar-txt txt-smallie"
:text "${day.day}"
)
)
)
)
)
)
)
(box
:class "sidebar-divider"
)
(box
:orientation "v"
:space-evenly false
:hexpand true
:class "sidebar-todo-box"
(scroll
:hscroll false :vscroll true
:vexpand true
(box
:orientation "v"
:space-evenly false
(for task in todolist
(box
:orientation "h"
:space-evenly false
:class "sidebar-todo-item"
(label :xalign 0
:hexpand true
:class "txt-small"
:text {task}
:wrap true
)
(button
:valign "center"
:class "sidebar-todo-btn"
:onclick "scripts/todo del '${task}' && ${EWW_CMD} update todolist=\"$(cat json/todo.json | gojq -c -M)\""
(label
:class "icon-material txt-norm"
:text "Remove"
)
)
)
)
)
)
)
)
)
)
)
)
)
(eventbox
:onclick "scripts/toggle-sideright.sh &"
: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_HEIGHT >= 2 ? '' : 'bar-bottom-height'})
)
)
)
)
(defwindow sideright
:monitor 0
:stacking "fg"
:namespace "eww"
:geometry (geometry
:anchor "top right"
:height "100%"
)
(sideright_widget)
)
+33
View File
@@ -0,0 +1,33 @@
(defwidget visualizer_widget []
(box
:class "visualizer-bg visualizer-height ${open_visualizer ? '' : 'visualizer-hide'}"
(overlay
:hexpand true
(box
:class "visualizer-columns"
(for cavacol in cavajson
(box
:class "visualizer-cavacol"
:valign "end"
:style "
min-height: ${round(cavacol[0] / 10, 0)}px;
background-color: ${cavacol[0] == 0 ? 'transparent' : 'mix(${(mcover.color.colors.color3 == 'null' ? accent : mcover.color.colors.color3)}, rgba(220, 220, 220, 0.1), 0.2)'};
"
)
)
)
)
)
)
(defwindow visualizer
:monitor 0
:stacking "bg"
:namespace "eww"
:exclusive true
:geometry (geometry
:anchor "bottom center"
:width "100%"
)
(visualizer_widget)
)