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
+47
View File
@@ -0,0 +1,47 @@
(defwidget bgdecor_widget []
(overlay
(box
:width RES_WIDTH
:height RES_HEIGHT
)
(image
:path "images/menus/corner_topleft.svg"
:halign "start"
:valign "start"
:image-width BG_ROUNDING
:image-height BG_ROUNDING
)
(image
:path "images/menus/corner_topright.svg"
:halign "end"
:valign "start"
:image-width BG_ROUNDING
:image-height BG_ROUNDING
)
(image
:path "images/menus/corner_bottomleft.svg"
:halign "start"
:valign "end"
:image-width BG_ROUNDING
:image-height BG_ROUNDING
)
(image
:path "images/menus/corner_bottomright.svg"
:halign "end"
:valign "end"
:image-width BG_ROUNDING
:image-height BG_ROUNDING
)
)
)
(defwindow bgdecor
:monitor 0
:stacking "bg"
:namespace "noblur"
:geometry (geometry
:width "100%"
:height "100%"
)
(bgdecor_widget)
)
+268
View File
@@ -0,0 +1,268 @@
(defwidget bottomsheet_back_widget []
(box
:orientation "v"
:space-evenly false
:style "
${open_bottomsheet ? ANIM_ENTER[anim_set] : ANIM_EXIT[anim_set]}
${open_bottomsheet ? '' : ('margin-bottom: -400px;')}
"
(eventbox
:onclick "scripts/toggle-bottomsheet.sh --close &"
:onrightclick "scripts/toggle-bottomsheet.sh --close &"
:onmiddleclick "scripts/toggle-bottomsheet.sh --close &"
)
(box
:class "window"
:style "min-height: 300px;"
(box ; Media cover background (behind blur)
:class "bottomsheet-back-bg"
;:style "background-image: url('${mcover.image}');"
)
)
)
)
(defwidget bottomsheet_widget []
(eventbox
:onhoverlost {pinned_bottomsheet ? '' : 'scripts/toggle-bottomsheet.sh --close &'}
:style "
"
(box
:orientation "v"
:space-evenly false
:style "
${open_bottomsheet ? ANIM_ENTER[anim_set] : ANIM_EXIT[anim_set]}
${open_bottomsheet ? '' : ('margin-bottom: -400px;')}
border-radius: 10px;
margin-left: 5px;
"
:width "1910px"
(eventbox
:onclick "scripts/toggle-bottomsheet.sh --close &"
:onrightclick "scripts/toggle-bottomsheet.sh --close &"
:onmiddleclick "scripts/toggle-bottomsheet.sh --close &"
)
(box
:class "window"
:orientation "h"
:spacing 17
:style "
margin: 0px 20px;
margin-bottom: -309px;
"
(for colheight in cavajson
(box
:class "bottomsheet-cavacol"
:valign "center"
:style "
min-height: ${round(colheight[0] / 3.5, 0)}px;
background-color: ${colheight[0] == 0 ? 'transparent' : 'mix(${(mcover.color.colors.color3 == 'null' ? coloraccent : mcover.color.colors.color3)}, rgba(220, 220, 220, 0.1), 0.2)'};
"
)
)
)
(box ; Real stuff
:height 300
:space-evenly false
:orientation "v"
:style "
margin: 5px;
"
(box
:orientation "h"
:space-evenly false :spacing -35
:class "bottomsheet-bg"
:style "background-color: ${mcover.materialcolor.secondaryContainerRgba == 'null' ? "rgba(0,0,0,0.5)" : mcover.materialcolor.secondaryContainerRgba}"
(box ; Pin button
:orientation "v"
:spacing 15
:valign "start"
:class "bottomsheet-windowctl"
(button
:width 50 :height 50
:onclick "scripts/toggle-bottomsheet.sh --close &"
:class "bottomsheet-windowctl-btn"
:style "
${mcover.materialcolor.secondaryContainer == 'null' ? '' : 'background-color: ${mcover.materialcolor.secondaryContainer};'}
${mcover.materialcolor.onSecondaryContainer == 'null' ? '' : 'color: ${mcover.materialcolor.onSecondaryContainer};'}
"
"keyboard_double_arrow_down"
)
(button
:width 50 :height 50
:onclick "${EWW_CMD} update pinned_bottomsheet=${!pinned_bottomsheet} &"
:class "bottomsheet-windowctl-btn${pinned_bottomsheet ? '-true' : ''}"
:style "
${mcover.materialcolor.secondaryContainer == 'null' ? '' : 'background-color: ${mcover.materialcolor.secondaryContainer};'}
${mcover.materialcolor.onSecondaryContainer == 'null' ? '' : 'color: ${mcover.materialcolor.onSecondaryContainer};'}
"
"push_pin"
)
)
(box ; Media cover (foreground)
:valign "center"
:class "bottomsheet-music-cover"
:style "
${mcover.image == 'null' ? 'min-width: 200px;' :
'
background-image: url(\'${mcover.image}\');
min-width: 200px;
box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.7);
'}
"
)
(scroll
:hscroll true :vscroll false
:width {RES_WIDTH / 2}
:hexpand true
:style "margin-left: 15px; margin-right: 30px;"
(box
:orientation "v"
:space-evenly false
:class "bottomsheet-music-info"
(label
:xalign 0
:class "bottomsheet-music-title"
:style "
color: ${mcover.materialcolor.onPrimaryContainer == 'null' ? coloraccent : mcover.materialcolor.onPrimaryContainer};
"
:wrap true
:text {strlength(mname.title) == 0 ? 'Music' : mname.title}
)
(label
:xalign 0 :yalign 0
:vexpand true
:class "bottomsheet-music-artist"
:style "color: ${mcover.materialcolor.onPrimaryContainer == 'null' ? coloraccent : mcover.materialcolor.onPrimaryContainer};"
:text {mname.artist}
)
(box
:orientation "h"
:halign "start"
:class "bottomsheet-music-controlsbox"
(button
:class "bar-icon-material bottomsheet-music-btn"
:style "color: ${mcover.materialcolor.onPrimaryContainer == 'null' ? coloraccent : mcover.materialcolor.onPrimaryContainer};"
:onclick "playerctl previous"
"skip_previous"
)
(button
:class "bar-icon-material bottomsheet-music-btn"
:style "color: ${mcover.materialcolor.onPrimaryContainer == 'null' ? coloraccent : mcover.materialcolor.onPrimaryContainer};"
:onclick "playerctl play-pause"
"${mplay == 'Playing' ? 'pause' : 'play_arrow'}"
)
(button
:class "bar-icon-material bottomsheet-music-btn"
:style "color: ${mcover.materialcolor.onPrimaryContainer == 'null' ? coloraccent : mcover.materialcolor.onPrimaryContainer};"
:onclick "playerctl next || playerctl position `bc <<< \"100 * $(playerctl metadata mpris:length) / 1000000 / 100\"`"
"skip_next"
)
)
)
)
(scroll ; Volume mixer
:halign "end"
; :vscroll true :hscroll false
:width 500
(box
:orientation "V"
:space-evenly false :spacing 10
:style "padding: 15px;"
(for app in audiojson
(box
:space-evenly false :orientation "h" :spacing 10
(image
:class "bottomsheet-mixer-app-icon"
:style "${mcover.materialcolor.secondaryContainer == 'null' ? '' : 'background-color: ${mcover.materialcolor.secondaryContainer};'}"
:path {app.icon}
:image-width 30
:image-height 30
)
(box
:orientation "h"
:space-evenly true ; Even I can't believe I'd ever write this
:hexpand true
:spacing 5
(for ser in {app["volume"]}
(eventbox
:onscroll "pactl set-sink-input-volume ${ser[0]} $(echo {} | sed -e \"s/up/+5/g\" -e \"s/down/-5/g\")%"
:onrightclick "pactl set-sink-input-volume ${ser[0]} 100%"
:onclick "pactl set-sink-input-volume ${ser[0]} 0%"
(box
:hexpand true
:space-evenly false
:orientation "h"
:class "bottomsheet-mixer-app-serial"
:style "${mcover.materialcolor.secondaryContainer == 'null' ? '' : 'background-color: ${mcover.materialcolor.secondaryContainer};'}"
(label
:xalign 0 :hexpand true
:class "bottomsheet-mixer-app-num"
:style "${mcover.materialcolor.onSecondaryContainer == 'null' ? '' : 'color: ${mcover.materialcolor.onSecondaryContainer};'}"
:text "#${ser[0]}"
)
(box
:style "margin: 0px 10px;"
(circular-progress
:value {ser[1] > 100 ? 100 : ser[1]}
:start-at 75 :thickness 3
:width 37 :height 37
:class "bottomsheet-mixer-app-circle"
:style "color: ${mcover.materialcolor.onSecondaryContainer == 'null' ? coloraccent : mcover.materialcolor.onSecondaryContainer};"
(label
:class "bottomsheet-mixer-app-incircle"
:style "color: ${mcover.materialcolor.onSecondaryContainer == 'null' ? coloraccent : mcover.materialcolor.onSecondaryContainer};"
:text "${ser[1]}"
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
(defwindow bottomsheet
:monitor 0
:stacking "fg"
:namespace "eww-lowopacity"
; :focusable true
:geometry (geometry
:anchor "bottom center"
:y 5
:width "1910px"
)
(bottomsheet_widget)
)
(defwindow bottomsheet_back
:monitor 0
:stacking "bg"
:namespace "noblur"
:geometry (geometry
:anchor "bottom center"
:y 1
:width "100%"
)
(bottomsheet_back_widget)
)
(defwindow bottomline
:monitor 0
:stacking "fg"
:namespace "eww"
:geometry (geometry
:anchor "bottom center"
:width "100%"
)
(eventbox :onclick "scripts/toggle-bottomsheet.sh &" (box :height 1))
)
+832
View File
@@ -0,0 +1,832 @@
(defwidget switch [ value ]
(box
:halign "end"
:space-evenly false
:class "switch-bg-${value}"
:style "
min-width: 40px;
min-height: 20px;
"
(box
:valign "center"
:class "switch-fg-${value}"
:style "
${ANIM_ENTER[1]}
${(value == true || value > 0) ? 'margin-left: 20px;' : 'margin-left: 4px;'}
min-width: ${(value == true || value > 0) ? 20 : 12}px;
min-height: ${(value == true || value > 0) ? 20 : 12}px;
"
(label :class "switch-fg-icon bar-txt-norm" :text {(value == true || value > 0) ? 'check' : ''})
)
)
)
(defwidget settings_button [ text onclick ]
(button
:onclick {onclick}
:class "dashboard-settings-button"
(label :text {text})
)
)
(defwidget settings-title [ name ]
(box
:space-evenly false
:style "margin-bottom: 5px;"
(label :class "dashboard-settings-title-txt" :text {name})
)
)
(defwidget settings-title-small [ name ]
(box
:space-evenly false
:style "margin: 2px 0px;"
(label :class "dashboard-settings-title-txtsmall" :text {name})
)
)
(defwidget settings-option-binary [ name value ]
(box
:space-evenly false :hexpand true :valign "center"
(label :xalign 0 :hexpand true :class "dashboard-settings-txt" :text {name})
(switch :value value)
)
)
(defwidget settings_option_mousesens []
(box
:orientation "h"
:space-evenly false :spacing 3
:hexpand true
(eventbox
:cursor "pointer"
:onclick "hyprctl keyword input:force_no_accel ${1 - hyprjson.force_no_accel} &"
(box
:orientation "v"
:space-evenly false
:class "dashboard-settings-option-group-left dashboard-settings-option-group-minsize"
(label :vexpand true :class "dashboard-settings-option-toggle-icon" :text "arrow_selector_tool")
(label :style "margin-bottom: 10px;" :class "dashboard-settings-option-toggle-txt" :text {hyprjson.force_no_accel == 1 ? 'Raw input' : ('Accel: ' + hyprjson.input_sensitivity)})
)
)
(box
:hexpand true
:class "dashboard-settings-option-group-right"
(scale
:class "dashboard-settings-scale"
:value {hyprjson.input_sensitivity * 50 + 50}
:onchange "hyprctl keyword input:sensitivity $(echo - | awk '{print {} / 50 - 1}') && scripts/hyprsettings tickle &"
)
)
)
)
(defwidget settings_option_blursize []
(box
:orientation "h"
:space-evenly false :spacing 3
(eventbox
:cursor "pointer"
:onclick "hyprctl keyword decoration:blur:enabled ${1 - hyprjson.blur} && scripts/hyprsettings tickle &"
(box
:orientation "v"
:space-evenly false
:class "dashboard-settings-option-group-left dashboard-settings-option-group-minsize"
(label :vexpand true :class "dashboard-settings-option-toggle-icon" :text "straighten")
(label :style "margin-bottom: 10px;" :class "dashboard-settings-option-toggle-txt" :text "Size")
)
)
(box
:hexpand true
:class "dashboard-settings-option-group-right"
(scale
:class "dashboard-settings-scale"
:tooltip {hyprjson.blur_size}
:value {hyprjson.blur_size}
:onchange "hyprctl keyword decoration:blur:size {} && scripts/hyprsettings tickle &"
)
)
)
)
(defwidget settings_option_blurpasses []
(box
:orientation "h"
:space-evenly false :spacing 3
(eventbox
:cursor "pointer"
:onclick "hyprctl keyword decoration:blur:enabled ${1 - hyprjson.blur} && scripts/hyprsettings tickle &"
(box
:orientation "v"
:space-evenly false
:class "dashboard-settings-option-group-left dashboard-settings-option-group-minsize"
(label :vexpand true :class "dashboard-settings-option-toggle-icon" :text "control_point_duplicate")
(label :style "margin-bottom: 10px;" :class "dashboard-settings-option-toggle-txt" :text "Passes")
)
)
(box
:hexpand true
:class "dashboard-settings-option-group-right"
(scale
:class "dashboard-settings-scale"
:tooltip {hyprjson.blur_passes}
:value {hyprjson.blur_passes}
:onchange "hyprctl keyword decoration:blur:passes {} && scripts/hyprsettings tickle &"
)
)
)
)
(defwidget settings_option_gapsin []
(box
:orientation "h"
:space-evenly false :spacing 3
(box
:orientation "v"
:space-evenly false
:class "dashboard-settings-option-group-left dashboard-settings-option-group-minsize"
(label :vexpand true :class "dashboard-settings-option-toggle-icon" :text "fullscreen_exit")
(label :style "margin-bottom: 10px;" :class "dashboard-settings-option-toggle-txt" :text "Inner")
)
(box
:hexpand true
:class "dashboard-settings-option-group-right"
(scale
:class "dashboard-settings-scale"
:tooltip {hyprjson.gaps_in}
:value {hyprjson.gaps_in}
:onchange "hyprctl keyword general:gaps_in {} && scripts/hyprsettings tickle &"
)
)
)
)
(defwidget settings_option_gapsout []
(box
:orientation "h"
:space-evenly false :spacing 3
(box
:orientation "v"
:space-evenly false
:class "dashboard-settings-option-group-left dashboard-settings-option-group-minsize"
(label :vexpand true :class "dashboard-settings-option-toggle-icon" :text "fullscreen")
(label :style "margin-bottom: 10px;" :class "dashboard-settings-option-toggle-txt" :text "Outer")
)
(box
:hexpand true
:class "dashboard-settings-option-group-right"
(scale
:class "dashboard-settings-scale"
:tooltip {hyprjson.gaps_out}
:value {hyprjson.gaps_out}
:onchange "hyprctl keyword general:gaps_out {} && scripts/hyprsettings tickle &"
)
)
)
)
(defwidget settings_option_bordersize []
(box
:orientation "h"
:space-evenly false :spacing 3
(box
:orientation "v"
:space-evenly false
:class "dashboard-settings-option-group-left dashboard-settings-option-group-minsize"
(label :vexpand true :class "dashboard-settings-option-toggle-icon" :text "line_weight")
(label :style "margin-bottom: 10px;" :class "dashboard-settings-option-toggle-txt" :text "Thickness")
)
(box
:hexpand true
:class "dashboard-settings-option-group-right"
(scale
:class "dashboard-settings-scale"
:tooltip {hyprjson.border_size}
:value {hyprjson.border_size}
:onchange "hyprctl keyword general:border_size {} && scripts/hyprsettings tickle &"
)
)
)
)
(defwidget settings_option_rounding []
(box
:orientation "h"
:space-evenly false :spacing 3
(box
:orientation "v"
:space-evenly false
:class "dashboard-settings-option-group-left dashboard-settings-option-group-minsize"
(label :vexpand true :class "dashboard-settings-option-toggle-icon" :text "rounded_corner")
(label :style "margin-bottom: 10px;" :class "dashboard-settings-option-toggle-txt" :text "Rounding")
)
(box
:hexpand true
:class "dashboard-settings-option-group-right"
(scale
:class "dashboard-settings-scale"
:tooltip {hyprjson.rounding}
:value {hyprjson.rounding}
:onchange "hyprctl keyword decoration:rounding {} && scripts/hyprsettings tickle &"
)
)
)
)
(defwidget settings_option_touchpad []
(box
:orientation "h"
:spacing 3
(eventbox
:cursor "pointer"
:onclick "hyprctl keyword input:touchpad:disable_while_typing ${1 - hyprjson.touchpad_disable_while_typing} &"
(box
:class "dashboard-settings-option-group-left dashboard-settings-option-group-pad"
(settings-option-binary :name "Disable while typing" :value {hyprjson.touchpad_disable_while_typing})
)
)
(eventbox
:cursor "pointer"
:onclick "hyprctl keyword input:touchpad:clickfinger_behavior ${1 - hyprjson.touchpad_clickfinger_behavior} &"
(box
:class "dashboard-settings-option-group-right dashboard-settings-option-group-pad"
(settings-option-binary :name "Tap to click" :value {hyprjson.touchpad_clickfinger_behavior})
)
)
)
)
(defwidget settings_option_blurtoggles []
(box
:orientation "h"
:spacing 3
(eventbox
:cursor "pointer"
:onclick "hyprctl keyword decoration:blur:enabled ${1 - hyprjson.blur} && scripts/hyprsettings tickle &"
(box
:class "dashboard-settings-option-group-left dashboard-settings-option-group-pad"
(settings-option-binary :name "Enable blur" :value {hyprjson.blur})
)
)
(eventbox
:cursor "pointer"
:onclick "hyprctl keyword decoration:blur:xray ${1 - hyprjson.blur_xray} && scripts/hyprsettings tickle &"
(box
:class "dashboard-settings-option-group-right dashboard-settings-option-group-pad"
(settings-option-binary :name "Blur xray" :value {hyprjson.blur_xray})
)
)
)
)
(defwidget settings_option_language []
(box
:vexpand true
(scroll
:hscroll true :vscroll false :hexpand true
(box
:spacing 5
(for language in langs
(button
:class "dashboard-option-lang${language.name_ibus == lang_ibus.name_ibus ? '-true' : '-false'}"
:onclick "ibus engine ${language.name_ibus} && eww update lang_ibus='${language}' &"
(box
:space-evenly false :orientation "h" :spacing 5
(box
:valign "center"
:class "dashboard-lang-indicator-${language.name_ibus == lang_ibus.name_ibus}"
)
(box
:space-evenly false :orientation "v"
:valign "center"
(label :xalign 0
:limit-width 24
:text {language.name}
)
(label :xalign 0
:limit-width 24
:wrap true
:text "${language.name_method}"
)
)
)
)
)
)
)
)
)
(defwidget settings_option_debuggingtoggles []
(box
:orientation "h"
:spacing 3
(eventbox
:cursor "pointer"
:onclick "hyprctl keyword debug:damage_tracking ${2 - hyprjson.damage_tracking} && scripts/hyprsettings tickle &"
(box
:class "dashboard-settings-option-group-left dashboard-settings-option-group-pad"
(settings-option-binary :name "Damage tracking" :value {hyprjson.damage_tracking})
)
)
(eventbox
:cursor "pointer"
:onclick "hyprctl keyword debug:overlay ${1 - hyprjson.overlay} && scripts/hyprsettings tickle &"
(box
:class "dashboard-settings-option-group-right dashboard-settings-option-group-pad"
(settings-option-binary :name "Show FPS" :value {hyprjson.overlay})
)
)
)
)
(defwidget settings_mouse_widget []
(box
:orientation "v"
:space-evenly false :spacing 10
:class "dashboard-setting-section-pad"
(settings-title :name "Devices")
(settings-title-small :name "Mouse")
(settings_option_mousesens)
(settings-title-small :name "Touchpad")
(settings_option_touchpad)
(settings-title-small :name "Keyboard")
(settings_option_language)
)
)
(defwidget settings_blur_widget []
(box
:orientation "v"
:space-evenly false :spacing 10
:class "dashboard-setting-section-pad"
(settings-title :name "Blur")
(settings-title-small :name "Modes")
(settings_option_blurtoggles)
(settings-title-small :name "Strength")
(settings_option_blursize)
(settings_option_blurpasses)
)
)
(defwidget settings_gaps_widget []
(box
:orientation "v"
:space-evenly false :spacing 10
:class "dashboard-setting-section-pad"
(settings-title :name "Window settings")
(settings-title-small :name "Gaps")
(box :spacing 5
(settings_option_gapsin)
(settings_option_gapsout)
)
(settings-title-small :name "Borders")
(box :spacing 5
(settings_option_bordersize)
(settings_option_rounding)
)
)
)
(defwidget settings_hyprland_widget []
(box
:orientation "v"
:space-evenly false :spacing 10
:class "dashboard-setting-section-pad"
(settings-title :name "Hyprland")
(settings_button :text "Reload config" :onclick "hyprctl reload &")
(settings-title-small :name "Debugging stuff")
(settings_option_debuggingtoggles)
(settings-title-small :name "Help & Support")
(box :spacing 5
(settings_button :text "Open Hyprland Wiki" :onclick "scripts/toggle-dashboard.sh --close && xdg-open https://wiki.hyprland.org/ &")
(settings_button :text "Hypr Dev. Discord server" :onclick "scripts/toggle-dashboard.sh --close && xdg-open https://discord.com/invite/hQ9XvMUjjr &")
)
)
)
(defwidget dashboard_widget []
(box
:space-evenly false :orientation "h"
(overlay
(box
:class "dashboard-bg"
:height RES_HEIGHT
:width RES_WIDTH
)
(box
:valign "end"
(revealer ; Audio visualizer (cava)
:reveal {open_dashboard >= 3}
:duration "100ms"
:transition "crossfade"
(box
:orientation "h"
:spacing 17
(for colheight in cavajson
(box
:class "dashboard-cavacol"
:valign "end"
:style "
min-height: ${round(colheight[0] / 2.5, 0)}px;
"
)
)
)
)
)
(image
:path "images/menus/corner_topleft.svg"
:halign "start"
:valign "start"
:image-width BG_ROUNDING
:image-height BG_ROUNDING
)
(image
:path "images/menus/corner_topright.svg"
:halign "end"
:valign "start"
:image-width BG_ROUNDING
:image-height BG_ROUNDING
)
(image
:path "images/menus/corner_bottomleft.svg"
:halign "start"
:valign "end"
:image-width BG_ROUNDING
:image-height BG_ROUNDING
)
(image
:path "images/menus/corner_bottomright.svg"
:halign "end"
:valign "end"
:image-width BG_ROUNDING
:image-height BG_ROUNDING
)
(box
:halign "center" :valign "start"
:style "
${open_dashboard >= 1 ? ANIM_ENTER[anim_set] : ANIM_EXIT[anim_set]};
margin-top: ${open_dashboard >= 1 ? 40 : 90}px;
"
(revealer ; Time and date
:reveal {open_dashboard >= 1}
:duration "100ms"
:transition "crossfade"
(box
:orientation "v"
:space-evenly false
(label
:class "dashboard-clock-time"
:text "${time.hour}:${time.minute}"
)
(label
:class "dashboard-clock-date"
:text "${time.day}, ${day_only} ${time.monthname} ${time.year}"
)
)
)
)
(box
:halign "start" :valign "start"
:style "
${open_dashboard >= 1 ? ANIM_ENTER[anim_set] : ANIM_EXIT[anim_set]};
margin-top: ${open_dashboard >= 1 ? 50 : 100}px;
margin-left: 50px;
"
(revealer ; User
:reveal {open_dashboard >= 1}
:duration "100ms"
:transition "crossfade"
(box
:orientation "h"
:space-evenly false
:spacing 15
(box
:halign "center" :valign "center"
:class "dashbaord-user-pic"
:style "background-image: url('/var/lib/AccountsService/icons/${username}');"
)
(box
:orientation "v"
:space-evenly false
(label :xalign 0
:class "dashboard-user-realname"
:text "${realname}"
)
(label :xalign 0
:class "dashboard-user-username"
:text "${username}"
)
)
)
)
)
(box
:halign "end" :valign "start"
(revealer ; Close button
:reveal {open_dashboard >= 1}
:duration "100ms"
:transition "crossfade"
(eventbox
:onclick "scripts/toggle-dashboard.sh --close &"
:cursor "pointer"
(box
:style "
${open_dashboard >= 1 ? ANIM_ENTER[anim_set] : ANIM_EXIT[anim_set]};
${open_dashboard >= 1 ? '' : 'margin-top: 100px;'}
padding: 50px;
"
(box
:orientation "v"
:space-evenly false
:spacing -5
(label
:class "dashboard-close-btn-icon"
:text "close"
)
(label
:class "dashboard-close-btn-txt"
:text "Close"
)
)
)
)
)
)
(box ; Session control
:halign "end" :valign "center"
(revealer
:reveal {open_dashboard >= 2}
:duration "100ms"
:transition "crossfade"
(box
:orientation "v" :space-evenly false :spacing 30
:style "
${open_dashboard >= 2 ? ANIM_ENTER[anim_set] : ANIM_EXIT[anim_set]};
${open_dashboard >= 2 ? '' : 'margin-bottom: -100px;'}
"
(eventbox
:halign "end"
:cursor "pointer"
:onclick "gtklock &"
(box :space-evenly false :orientation "v"
:class "dashboard-session-btn"
(label :class "dashboard-session-btn-icon" :text "lock")
(label :class "dashboard-close-btn-txt" :text "Lock")
)
)
(box :orientation "h" :space-evenly false :spacing 10
:halign "end"
:style "
${ANIM_ENTER[anim_set]}
${rev_session_1 ? '' : 'margin-right: -210px;'}
"
(eventbox
:cursor "pointer"
:onclick "${EWW_CMD} update rev_session_1=${!rev_session_1} &"
(box :space-evenly false :orientation "v"
:class "dashboard-session-btn"
(label :class "dashboard-session-btn-icon" :text "bedtime")
(label :class "dashboard-close-btn-txt" :text "Sleep")
)
)
(eventbox
:cursor "e-resize"
:onclick "${EWW_CMD} update rev_session_1=false && systemctl suspend &"
(label :width 200 :class "dashboard-session-btn-txt" :text "Click to confirm")
)
)
(box :orientation "h" :space-evenly false :spacing 10
:halign "end"
:style "
${ANIM_ENTER[anim_set]}
${rev_session_2 ? '' : 'margin-right: -210px;'}
"
(eventbox
:cursor "pointer"
:onclick "${EWW_CMD} update rev_session_2=${!rev_session_2} &"
(box :space-evenly false :orientation "v"
:class "dashboard-session-btn"
(label :class "dashboard-session-btn-icon" :text "power_settings_new")
(label :class "dashboard-close-btn-txt" :text "Shutdown")
)
)
(eventbox
:cursor "e-resize"
:onclick "${EWW_CMD} update rev_session_2=false && systemctl poweroff &"
(label :width 200 :class "dashboard-session-btn-txt" :text "Click to confirm")
)
)
(box :orientation "h" :space-evenly false :spacing 10
:halign "end"
:style "
${ANIM_ENTER[anim_set]}
${rev_session_3 ? '' : 'margin-right: -210px;'}
"
(eventbox
:cursor "pointer"
:onclick "${EWW_CMD} update rev_session_3=${!rev_session_3} &"
(box :space-evenly false :orientation "v"
:class "dashboard-session-btn"
(label :class "dashboard-session-btn-icon" :text "restart_alt")
(label :class "dashboard-close-btn-txt" :text "Restart")
)
)
(eventbox
:cursor "e-resize"
:onclick "${EWW_CMD} update rev_session_3=false && reboot &"
(label :width 200 :class "dashboard-session-btn-txt" :text "Click to confirm")
)
)
)
)
)
(box
:halign "start" :valign "center"
(revealer ; Settings sections
:reveal {open_dashboard >= 2}
:duration "100ms"
:transition "crossfade"
(box
:orientation "h" :space-evenly false
:width 700
:style "
${open_dashboard >= 2 ? ANIM_ENTER[anim_set] : ANIM_EXIT[anim_set]};
${open_dashboard >= 2 ? '' : 'margin-bottom: -100px;'}
"
(eventbox
:onscroll "scripts/scroll-settings {} &"
(box
:class "dashboard-settings-highlight${scroll_offset_settings == -1 ? '-hide' : ''}"
:halign "start" :valign "start"
:style "
${ANIM_ENTER[1]}
margin-right: -4px; margin-top: ${20+117*scroll_offset_settings}px;
"
)
)
(eventbox
:onscroll "scripts/scroll-settings {} &"
(box
:orientation "v" :space-evenly false :spacing 30
(eventbox
:halign "start"
:cursor "pointer"
:onclick {scroll_offset_settings == 0 ? '${EWW_CMD} update scroll_offset_settings=-1 &' : '${EWW_CMD} update scroll_offset_settings=0 &'}
(box :space-evenly false :orientation "v"
:class "dashboard-session-btn"
(label :class "dashboard-session-btn-icon" :text "keyboard_alt")
(label :class "dashboard-close-btn-txt" :text "Devices")
)
)
(eventbox
:halign "start"
:cursor "pointer"
:onclick {scroll_offset_settings == 1 ? '${EWW_CMD} update scroll_offset_settings=-1 &' : '${EWW_CMD} update scroll_offset_settings=1 &'}
(box :space-evenly false :orientation "v"
:class "dashboard-session-btn"
(label :class "dashboard-session-btn-icon" :text "lens_blur")
(label :class "dashboard-close-btn-txt" :text "Blur")
)
)
(eventbox
:halign "start"
:cursor "pointer"
:onclick {scroll_offset_settings == 2 ? '${EWW_CMD} update scroll_offset_settings=-1 &' : '${EWW_CMD} update scroll_offset_settings=2 &'}
(box :space-evenly false :orientation "v"
:class "dashboard-session-btn"
(label :class "dashboard-session-btn-icon" :text "wysiwyg")
(label :class "dashboard-close-btn-txt" :text "Window")
)
)
(eventbox
:halign "start"
:cursor "pointer"
:onclick {scroll_offset_settings == 3 ? '${EWW_CMD} update scroll_offset_settings=-1 &' : '${EWW_CMD} update scroll_offset_settings=3 &'}
(box :space-evenly false :orientation "v"
:class "dashboard-session-btn"
(label :class "dashboard-session-btn-icon" :text "water_drop")
(label :class "dashboard-close-btn-txt" :text " Hyprland")
)
)
)
)
(revealer
:reveal {scroll_offset_settings != -1}
:duration "100ms"
:transition "slideright"
(eventbox
:hexpand true
(scroll
:hexpand true
:hscroll false :vscroll true
:class "dashboard-settings-panel"
:width 560
(box
:orientation "v"
:style "
margin-top: -${scroll_offset_settings * SCROLL_MULTIPLIER_SETTINGS}px;
${ANIM_ENTER[1]}
"
; :space-evenly false
(settings_mouse_widget)
(settings_blur_widget)
(settings_gaps_widget)
(settings_hyprland_widget)
)
)
)
)
)
)
)
)
(box
:valign "center"
:style "
margin-left: -${RES_WIDTH / 2 + 200}px;
"
:orientation "h" :space-evenly false :spacing 70
(box
(revealer ; Directories
:reveal {open_dashboard >= 2}
:duration "100ms"
:transition "crossfade"
(box
:orientation "v" :space-evenly false :spacing 15
:style "
${open_dashboard >= 2 ? ANIM_ENTER[anim_set] : ANIM_EXIT[anim_set]};
${open_dashboard >= 2 ? '' : 'margin-bottom: -100px;'}
"
(box
:orientation "h" :space-evenly false :spacing 15
(label :text "Directories" :class "dashboard-section-txt")
)
(box
:orientation "v" :spacing 5
(for dir in directories
(eventbox
:cursor "pointer"
:onclick "scripts/toggle-dashboard.sh --close && xdg-open ${dir.path} &"
(box
:orientation "h" :space-evenly false :spacing 15
(label :text {dir.icon} :class "dashboard-section-icon")
(label :text {dir.name} :class "dashboard-section-txt")
)
)
)
)
)
)
)
(box
(revealer ; Websites
:reveal {open_dashboard >= 2}
:duration "100ms"
:transition "crossfade"
(box
:orientation "v" :space-evenly false :spacing 15
:style "
${open_dashboard >= 2 ? ANIM_ENTER[anim_set] : ANIM_EXIT[anim_set]};
${open_dashboard >= 2 ? '' : 'margin-bottom: -100px;'}
"
(box
:orientation "h" :space-evenly false :spacing 15
(label :text "Websites" :class "dashboard-section-txt")
)
(box
:orientation "v" :spacing 5
(for site in websites
(eventbox
:cursor "pointer"
:onclick "scripts/toggle-dashboard.sh --close && xdg-open ${site.url} &"
(box
:orientation "h" :space-evenly false :spacing 15
(label :text {site.icon} :class "dashboard-section-icon-nerd")
(label :text {site.name} :class "dashboard-section-txt")
)
)
)
)
)
)
)
)
)
)
(defwindow dashboard
:stacking "overlay"
:focusable true
:monitor 0
:namespace "eww"
:geometry (geometry
:anchor "center center"
:height "100%"
:width "100%"
)
(dashboard_widget)
)
+234
View File
@@ -0,0 +1,234 @@
(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 ${800*OVERVIEW_SCALE}px;
margin-bottom: ${(RES_HEIGHT - BAR_HEIGHT + GAPS * 2 * 2) * OVERVIEW_SCALE}px;
margin-top: ${GAPS * OVERVIEW_SCALE * 2}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.class == 'workspace' ? '' : 'powerview-ws-window'}"
:style "
${ws-window.address == selected ? ('border: 1px solid' + coloraccent) : ''};
${ws-window.address == '_none' ? 'border: none' : ''};
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
:halign "center"
:class "bar-pad"
:width 290
:height 60
(box
:space-evenly false
:orientation "h"
:spacing 5
(overlay
(input
:width 280
:height {BAR_HEIGHT}
:class "bar-bg-noshadow bar-bg-pad powerview-search-txt"
: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 "Type to search"
)
)
)
)
)
)
(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 "bar-bg shadow-pad window-border"
(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"
:width {round(RES_WIDTH / 1.7, 0)}
:orientation "h"
:class "bar-bg shadow-pad window-border powerview-info"
(label :xalign 0
:class "bar-txt-larger bar-txt-norm"
:text "${overview_hover_name.class}"
)
(label
:class "bar-txt-larger bar-txt-norm"
:style "margin: 0px 50px;"
:text "${overview_hover_name.title}"
)
(label :xalign 1
:class "bar-txt-larger bar-txt-norm"
: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
:width 502
:height {RES_HEIGHT - BAR_HEIGHT - GAPS*3}
(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/dark/app.svg'}
:image-width 33
:image-height 33
)
)
)
)
)
)
)
)
)
)
(defwindow powerview
:stacking "overlay"
:focusable true
:monitor 0
:namespace "eww"
:geometry (geometry
:anchor "top center"
)
(powerview_widget)
)
+679
View File
@@ -0,0 +1,679 @@
(defwidget togglehyprctl [value changecmd option-label option-icon icon-style]
(eventbox
:cursor "pointer"
:onclick "${changecmd}${1 - value} && scripts/hyprsettings tickle &"
(box
:orientation "v"
:space-evenly false :spacing -10
:height 100 :width 100
:class "sidebar-hyprtoggle"
(label
:class "sidebar-hyprtoggle-name bar-txt-norm"
:text option-label
)
(label
:vexpand true
:class "sidebar-hyprtoggle-icon${icon-style == 1 ? '-material' : ''} sidebar-hyprtoggle-icon-${value} bar-txt-norm"
:text option-icon
)
(box
:halign "center" :valign "end"
:class "sidebar-hyprtoggle-onoff sidebar-hyprtoggle-onoff-${value}"
)
)
)
)
(defwidget hyprtoggles_widget []
(box
:orientation "v"
:space-evenly false :spacing 10
:class "sidebar-hyprtoggle-scrollbg"
(box
:orientation "h" :space-evenly false :spacing 5
(settings_option_mousesens)
; (togglehyprctl
; :value {mousemode}
; :changecmd "eww update mousemode="
; :option-label "Mouse"
; :option-icon "Mouse"
; :icon-style 0
; )
(eventbox
:cursor "pointer"
:onclick "eww update mousemode=${1 - mousemode} &"
(box :space-evenly false :spacing 15
:class "dashboard-settings-option-group dashboard-settings-option-group-pad"
(label :xalign 0 :hexpand true :class "dashboard-settings-txt bar-txt-norm" :text "Scroll\\\naccessibility")
(label :class "sidebar-optn-icon bar-txt-norm" :text "${mousemode == 1 ? 'mouse' : ''}")
)
)
)
(box
:orientation "h"
:spacing 5
(eventbox
:cursor "pointer"
:onclick "hyprctl keyword decoration:blur:enabled ${1 - hyprjson.blur} && scripts/hyprsettings tickle &"
(box :space-evenly false :spacing 10
:class "dashboard-settings-option-group-left dashboard-settings-option-group-pad"
(label :class "sidebar-optn-icon bar-txt-norm" :text "blur_on")
(settings-option-binary :name "Enable blur" :value {hyprjson.blur})
)
)
(eventbox
:cursor "pointer"
:onclick "hyprctl keyword decoration:blur:xray ${1 - hyprjson.blur_xray} && scripts/hyprsettings tickle &"
(box :space-evenly false :spacing 10
:class "dashboard-settings-option-group-right dashboard-settings-option-group-pad"
(label :class "sidebar-optn-icon bar-txt-norm" :text "preview")
(settings-option-binary :name "Blur xray" :value {hyprjson.blur_xray})
)
)
)
(box
:orientation "h"
:spacing 5
(eventbox
:cursor "pointer"
:onclick "hyprctl keyword input:touchpad:disable_while_typing ${1 - hyprjson.touchpad_disable_while_typing} &"
(box :space-evenly false :spacing 10
:class "dashboard-settings-option-group-left dashboard-settings-option-group-pad"
(label :class "sidebar-optn-icon bar-txt-norm" :text "keyboard")
(settings-option-binary :name "→ Disable touchpad" :value {hyprjson.touchpad_disable_while_typing})
)
)
(eventbox
:cursor "pointer"
:onclick "hyprctl keyword input:touchpad:clickfinger_behavior ${1 - hyprjson.touchpad_clickfinger_behavior} &"
(box :space-evenly false :spacing 10
:class "dashboard-settings-option-group-right dashboard-settings-option-group-pad"
(label :class "sidebar-optn-icon bar-txt-norm" :text "touch_app")
(settings-option-binary :name "Tap to click" :value {hyprjson.touchpad_clickfinger_behavior})
)
)
)
(button
:vexpand true
:onclick "hyprctl reload &"
:class "dashboard-settings-button"
(label :class "bar-txt bar-txt-norm" :text "Reload config")
)
)
)
(defwidget waifu_widget []
(box
:orientation "h"
:space-evenly false
:class "sidebar-waifu-scrollbg"
:spacing 13
(box
:space-evenly false :orientation "h"
(revealer
:reveal {mousemode == 1}
:transition "slideright"
:duration "200ms"
(eventbox
:onscroll "scripts/scroll-waifu {} &"
:width 100
(box
:orientation "v"
:height {SCROLL_MULTIPLIER_WAIFUTAGS * SCROLL_TOSHOW_WAIFUTAGS}
(box
:orientation "v"
:spacing 6
: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 bar-txt-norm"
:onclick "${EWW_CMD} update waifu=\"$(scripts/waifu-get.py ${WAIFU_CATEGORIES_ARGS[id]})\" &"
{WAIFU_CATEGORIES[id]}
)
)
)
)
)
)
(revealer
:reveal {mousemode == 0}
:transition "slideleft"
:duration "200ms"
(scroll
:vscroll true :hscroll false
:vexpand true
:width 100
(box
:orientation "v" :spacing 6
(for id in WAIFU_TAG_ID
(button
:class "sidebar-waifu-tag"
:onclick "${EWW_CMD} update waifu=\"$(scripts/waifu-get.py ${WAIFU_CATEGORIES_ARGS[id]})\" &"
{WAIFU_CATEGORIES[id]}
)
)
)
)
)
)
(eventbox
:onscroll "scripts/scroll-sideleft-favourite {} &"
:hexpand true
(scroll
:hexpand true
:hscroll true :vscroll false
(overlay
(box
:class "sidebar-waifu-pic-bg"
)
(box
:class "sidebar-waifu-pic"
:style "
${ANIM_ENTER[0]}
background-image: url('${waifu.path}');
${waifu['size'][0] / waifu['size'][1] > 395 / 530 ?
'background-size: auto 100%;' : 'background-size: 100% auto;'
}
"
)
(revealer
:valign "end"
:reveal {rev_waifustatus}
:duration "100ms"
:transition "slidedown"
(label
:valign "end"
:class "txt-smaller sidebar-waifu-status"
:text {waifu_status}
)
)
)
)
)
)
)
(defwidget sideleft_widget []
(eventbox
:onhoverlost "${open_sideleft ?
(EWW_CMD + ' update bar_offset=0 && ' + EWW_CMD + ' update open_sideleft=false &') : ''}"
(box
:space-evenly false
:halign "end"
:style "
${open_sideleft ? ANIM_ENTER[anim_set] : ANIM_EXIT[anim_set]}
${open_sideleft ? '' : 'margin-left: -594px;'}
"
; ↑ PERFECTLY LEAVE 1 PIXEL ON THE RIGHT EDGE AWAAHAHAHAHAH
(box
:orientation "v"
:space-evenly false :spacing -5
:halign "start"
:style "
min-width: 595px;
"
(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"
:onrightclick "playerctl next || playerctl position `bc <<< \"100 * $(playerctl metadata mpris:length) / 1000000 / 100\"`"
:onclick "${open_sideleft ?
(EWW_CMD + ' update bar_offset=0 && ' + EWW_CMD + ' update open_sideleft=false &') :
(EWW_CMD + ' open sideleft && ' + EWW_CMD + ' update bar_offset=1 && ' + EWW_CMD + ' update open_sideright=false && ' + EWW_CMD + ' update open_sideleft=true &')}"
(box
:space-evenly false :orientation "h"
:class "window"
:halign "end"
(box
:space-evenly false :spacing 10
:height {BAR_HEIGHT} :width 390
:class "sidebar-bg sidebar-bg-pad window-shadow"
(label :xalign 0
:class "bar-icon-material-hugeass bar-txt-norm"
:text ""
)
(label :xalign 0
:hexpand true
:class "bar-txt-hugeass bar-txt-norm"
:text "Knock"
)
(label :xalign 1
:class "bar-txt-small bar-txt-norm"
:text "Unhover to close"
)
)
)
)
(box ; Body
:space-evenly false
:orientation "v"
:class "window"
:vexpand true
(box ; Media controls
:orientation "v" :space-evenly false
:vexpand true
:class "sidebar-bg"
(box
:class "sidebar-music-box"
:hexpand true
(overlay
:hexpand true
(box ; 1. The background
:class "sidebar-music-thumbnail"
:height 200
: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
:height 200
:style "
background: radial-gradient(mix(${mcover.materialcolor.primaryContainer == 'null' ? coloraccent : mcover.materialcolor.primaryContainer}, rgba(0, 0, 0, 0.4), 0.95) 50%, mix(${mcover.color.colors.color4 == 'null' ? coloraccent : mcover.color.colors.color4}, rgba(0, 0, 0, 0.4), 0.95) 50%);
"
)
(box ; 3. Text and controls
:orientation "v"
:space-evenly false :spacing -5
(box ; Media source, output
:space-evenly false
:orientation "h"
(label :xalign 0
:hexpand true
:class "sidebar-music-source"
:text "${mcover.color.source}"
:style "color: ${mcover.materialcolor.onPrimaryContainer == 'null' ? coloraccent : mcover.materialcolor.onPrimaryContainer};"
)
(box
:orientation "h" :space-evenly false :spacing 5
:halign "end"
:class "sidebar-music-output"
:style "
${mcover.materialcolor.primary == 'null' ? '' : 'background-color: ${mcover.materialcolor.primary};'}
${mcover.materialcolor.onPrimary == 'null' ? '' : 'color: ${mcover.materialcolor.onPrimary};'}
"
(label
:class "bar-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 + ';')};
"
)
)
)
(box ; Title, play button
:space-evenly false
:orientation "h"
(scroll
:hexpand true
:height 50
:hscroll true :vscroll false
:style "margin: 15px;"
(box
:orientation "v"
:space-evenly false
:valign "center"
(label :xalign 0
:class "sidebar-music-title"
:style "
color: ${mcover.materialcolor.onPrimaryContainer == 'null' ? coloraccent : mcover.materialcolor.onPrimaryContainer};
"
:text "${strlength(mname.title) == 0 ? 'Music' : mname.title}"
)
(label :xalign 0
:class "sidebar-music-artist"
:style "
color: ${mcover.materialcolor.onPrimaryContainer == 'null' ? coloraccent : mcover.materialcolor.onPrimaryContainer};
"
:text "${mname.artist}"
)
)
)
(button
:valign "center"
:class "sidebar-music-playbtn"
:style "
${mcover.materialcolor.primary == 'null' ? '' : 'background-color: ${mcover.materialcolor.primary};'}
${mcover.materialcolor.onPrimary == 'null' ? '' : 'color: ${mcover.materialcolor.onPrimary};'}
"
:onclick "playerctl play-pause"
"${mplay == 'Playing' ? 'pause' : 'play_arrow'}"
)
)
(box ; Slider and skip track buttons
:space-evenly false
:orientation "h"
(button
:class "sidebar-music-trackbtn"
:style "
${mcover.materialcolor.onPrimaryContainer == 'null' ? '' : ('color: ' + mcover.materialcolor.onPrimaryContainer + ';')}
"
:onclick "playerctl previous"
"skip_previous"
)
(overlay
:hexpand true
(box
:hexpand true
:valign "center"
:class "sidebar-music-progress"
:style "
background-image:
linear-gradient(to right,
${mcover.materialcolor.onPrimaryContainer == 'null' ? coloraccent : mcover.materialcolor.onPrimaryContainer} ${music.position}%,
rgba(200, 200, 200, 0.6) ${music.position}%);
"
)
(label
:class "sidebar-music-progress-btn"
: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\"`"
; )
(button
:class "sidebar-music-trackbtn"
:style "
color: ${mcover.materialcolor.onPrimaryContainer};
"
:onclick "playerctl next || playerctl position `bc <<< \"100 * $(playerctl metadata mpris:length) / 1000000 / 100\"`"
"skip_next"
)
)
)
)
)
(box ; Favourite settings >> Waifu
:orientation "v"
:space-evenly false :spacing -20
:vexpand true
(eventbox
:onscroll "scripts/scroll-sideleft-favourite {} &"
(box ; The text
:orientation "h"
:space-evenly false
:valign "start"
:height {BAR_HEIGHT}
:class "sidebar-section-title"
(label :xalign 0
:class "bar-icon-material-hugeass sidebar-section-title-icon"
:text ""
)
(label :xalign 0
:hexpand true
:class "bar-txt-hugeass sidebar-section-title-text"
:text "${SIDELEFT_FAVOURITE_TITLES[sideleft_favourite_page - 1]}"
)
(label :xalign 1
:class "bar-txt-small sidebar-section-title-text"
:text {sideleft_favourite_page == 1 ? '>>' : 'Uses waifu.im, nekos.life, and waifu.pics API'}
)
)
)
(box
:class "sidebar-favourite-pad"
:orientation "h" :space-evenly false :spacing 0
:vexpand true
(eventbox
:onscroll "scripts/scroll-sideleft-favourite {} &"
(box ; 1: Quick toggles
:style "
${ANIM_ENTER[1]}
${sideleft_favourite_page > 1 ? 'margin-left: -600px;' : ''}
"
(hyprtoggles_widget)
)
)
(box ; 2: Waifu
:style "
${ANIM_ENTER[1]}
${sideleft_favourite_page > 2 ? 'margin-left: -600px;' :
sideleft_favourite_page < 2 ? 'margin-right: -600px;' : ''}
"
(waifu_widget)
)
)
)
(revealer
:reveal {sideleft_favourite_page == 1}
:transition "slideup"
:duration {sideleft_favourite_page == 1 ? '0ms' : '100ms'}
(eventbox
:onscroll "scripts/scroll-sideleft-favourite {} &"
:hexpand true
(box ; Resources
:orientation "v"
:space-evenly false
(box ; The text
:space-evenly false
:height {BAR_HEIGHT}
:class "sidebar-section-title"
(label :xalign 0
:class "bar-icon-material-hugeass sidebar-section-title-icon"
:text ""
)
(label :xalign 0
:hexpand true
:class "bar-txt-hugeass sidebar-section-title-text"
:text "Resources"
)
; (label :xalign 1
; :class "bar-txt-small sidebar-section-title-text"
; :text "no"
; )
)
(box ; Actual stuff
:orientation "h"
:space-evenly false :spacing 10
:class "sidebar-resource-pad"
(box
:class "sidebar-resource-value"
:width 140 :height 180
(box
:orientation "v" :space-evenly false :spacing 13
:halign "center" :valign "center"
(circular-progress
:width 80 :height 80
:start-at 75
:class "sidebar-resource-circle"
:value {EWW_CPU.avg > 100 ? 100 : EWW_CPU.avg}
:thickness 5
(label :class "sidebar-resource-icon-large-material" :text "")
)
(label
:class "sidebar-resource-txt"
:text "${round(EWW_CPU.avg, 0)}%"
)
)
)
(box
:orientation "v" :space-evenly false :spacing 10
:hexpand true
(box
:orientation "h" :space-evenly false :spacing 10
(box
:class "sidebar-resource-value"
:width 120 :height 120
:valign "start"
(box
:orientation "v" :space-evenly false :spacing 13
:halign "center" :valign "center"
(circular-progress
:width 55 :height 55
:start-at 75
:class "sidebar-resource-circle"
:value {memory.percentage > 100 ? 100 : memory.percentage}
:thickness 4
(label :class "sidebar-resource-icon-small" :text "")
)
(label
:class "sidebar-resource-txt-small"
:text "${memory.used}/${memory.total}"
)
)
)
(box
:class "sidebar-resource-value"
:width 120 :height 120
:valign "start"
(box
:orientation "v" :space-evenly false :spacing 13
:halign "center" :valign "center"
(circular-progress
:width 55 :height 55
:start-at 75
:class "sidebar-resource-circle"
:value {memory.swappercentage > 100 ? 100 : memory.swappercentage}
:thickness 4
(label :class "sidebar-resource-icon-small" :text "")
)
(label
:class "sidebar-resource-txt-small"
:text "${memory.swapused}/${memory.swaptotal}"
)
)
)
(box
:class "sidebar-resource-value"
:hexpand true :height 120
:valign "start"
(box
:orientation "v" :space-evenly false :spacing 13
:halign "center" :valign "center"
(circular-progress
:width 55 :height 55
:start-at 75
:class "sidebar-resource-circle"
:value {battery.percentage > 100 ? 100 : battery.percentage}
:thickness 4
(label :class "sidebar-resource-icon-small" :text "Bolt")
)
(label
:class "sidebar-resource-txt-small"
:text "${battery.percentage}%"
)
)
)
)
(box
:class "sidebar-resource-value"
:valign "start"
(box
:orientation "h" :space-evenly false :spacing 15
:valign "center"
(label
:valign "center"
:class "sidebar-resource-icon-small"
:text ""
)
(progress
:valign "center"
:hexpand true
:class "sidebar-resource-prog"
:value {diskfreepercent}
)
(label
:valign "center"
:class "sidebar-resource-txt-small"
:text "${diskfree}/${disksize} free"
)
)
)
)
)
)
)
)
(box ; Quote
:orientation "v"
:space-evenly false
:spacing -10
:valign "end"
(eventbox
:onscroll "scripts/scroll-quote {} &"
:onclick "${EWW_CMD} update quote_index=${(quote_index + 1 + arraylength(quote_content)) % arraylength(quote_content)} &"
(box
:orientation "v"
:space-evenly false :spacing -20
(box ; The text
:space-evenly false
:height {BAR_HEIGHT}
:class "sidebar-section-title"
(label :xalign 0
:class "bar-icon-material-hugeass sidebar-section-title-icon"
:text ""
)
(label :xalign 0
:hexpand true
:class "bar-txt-hugeass sidebar-section-title-text"
:text "Quote!"
)
(label :xalign 1
:class "bar-txt-small sidebar-section-title-text"
:text "${quote_index+1}/${arraylength(quote_content)}"
)
)
(box
:class "sidebar-quote bar-txt-norm"
:orientation "v" :space-evenly false :spacing 10
:height 150
(label :xalign 0 :yalign 0
:vexpand true
:text {quote_content[quote_index]}
:wrap true
)
(label :xalign 1
:text {quote_author[quote_index]}
:wrap true
)
)
(box
:height 20
)
)
)
)
)
)
)
)
)
)
(defwindow sideleft
:monitor 0
:stacking "fg"
:namespace "eww"
:geometry (geometry
:height "100%"
:anchor "top left"
)
(sideleft_widget)
)
+476
View File
@@ -0,0 +1,476 @@
(defwidget sideright_widget []
(eventbox
:onhoverlost "${open_sideright ?
(EWW_CMD + ' update bar_offset=0 && ' + EWW_CMD + ' update open_sideright=false &') : ''}"
(box
:height RES_HEIGHT
:space-evenly false
:halign "end"
:style "
${open_sideright ? ANIM_ENTER[anim_set] : ANIM_EXIT[anim_set]}
${open_sideright ? '' : 'margin-right: -594px;'}
"
; ↑ PERFECTLY LEAVE 1 PIXEL ON THE RIGHT EDGE AWAAHAHAHAHAH
(box
:orientation "v"
:space-evenly false :spacing -5
:halign "end"
:style "
min-width: 595px;
"
(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 "${open_sideright ?
(EWW_CMD + ' update bar_offset=0 && ' + EWW_CMD + ' update open_sideright=false &') :
(EWW_CMD + ' open sideright && ' + EWW_CMD + ' update bar_offset=-1 && ' + EWW_CMD + ' update open_sideleft=false && ' + EWW_CMD + ' update open_sideright=true &')}"
(box
:space-evenly false :orientation "h"
:class "window"
(box
:space-evenly false :spacing 10
:halign "start"
:height {BAR_HEIGHT} :width 390
:class "sidebar-bg sidebar-bg-pad"
(label :xalign 0
:class "bar-icon-material-hugeass"
:text "Settings"
)
(label :xalign 0
:hexpand true
:class "bar-txt-hugeass"
:text "System"
)
(label :xalign 1
:class "bar-txt-small"
:text "Unhover to close"
)
)
)
)
(box
:class "window"
:vexpand true
(box
:orientation "v" :space-evenly false :spacing -15
:vexpand true
:class "sidebar-bg"
(box ; Quick toggles
:orientation "h"
:space-evenly false :spacing 10
:class "sidebar-quicktoggle"
(box ; Wifi
:width 50 :height 50
:orientation "h"
:space-evenly false :spacing 3
(button
:class "sidebar-quicktoggle-btn${net.essid == 'lo' ? '' : '-active'} sidebar-quicktoggle-btn-left"
:onclick "scripts/net toggle &"
:width 50 :height 50
(label
:class "bar-icon-material-hugeass"
:text {WIFI_ICONS[net.level]}
)
)
(button
:class "sidebar-quicktoggle-btn${net.essid == 'lo' ? '' : '-active'} sidebar-quicktoggle-btn-right"
:onclick "${EWW_CMD} update bar_offset=0 && ${EWW_CMD} update open_sideright=false && XDG_CURRENT_DESKTOP=GNOME gnome-control-center wifi &"
:width 30 :height 50
(label
:class "bar-icon-material-hugeass"
:text ""
)
)
)
(box ; Bluetooth
:width 50 :height 50
:orientation "h"
:space-evenly false :spacing 3
(button
:class "sidebar-quicktoggle-btn${bluetooth.text == 'Bluetooth off' ? '' : '-active'} sidebar-quicktoggle-btn-left"
:onclick "scripts/bluetooth toggle &"
:width 50 :height 50
(label
:class "bar-icon-material-hugeass"
:text {bluetooth.icon}
)
)
(button
:class "sidebar-quicktoggle-btn${bluetooth.text == 'Bluetooth off' ? '' : '-active'} sidebar-quicktoggle-btn-right"
:onclick "${EWW_CMD + ' update bar_offset=0 && ' + EWW_CMD + ' update open_sideright=false &'}& blueberry &"
:width 30 :height 50
(label
:class "bar-icon-material-hugeass"
:text ""
)
)
)
(box ; Night light + Brightness
:hexpand true
:width 50 :height 50
:orientation "h"
:space-evenly false
(button
:class "sidebar-quicktoggle-btn${hyprjson.nightlight ? '-active' : ''} ${rev_power ? '' : 'sidebar-quicktoggle-btn-left'}"
:onclick "scripts/toggle-nightlight.sh &"
:width 50 :height 50
(label
:halign "center"
:class "bar-icon-material-hugeass"
:text {hyprjson.nightlight ? "Nightlight" : ""}
)
)
(revealer
:reveal {!rev_power}
:transition "slideleft"
:duration "100ms"
:hexpand true
(box
:width 100
:hexpand true
:class "sidebar-quicktoggle-btn sidebar-quicktoggle-btn-right"
:style "margin-left: 3px;"
:tooltip "Scroll !"
; (eventbox
; :hexpand true
; :onscroll "echo {} | sed -e 's/down/-U 3/g' -e 's/up/-A 3/g' | xargs light &"
; (overlay
; :hexpand true
; (box
; :hexpand true
; :valign "center"
; :class "sidebar-brightness-progress"
; :style "
; background-image:
; linear-gradient(to right, ${coloraccent} ${brightness.level}%, rgba(200, 200, 200, 0.6) ${brightness.level}%);
; "
; )
; (label
; :class "sidebar-brightness-progress-btn"
; :valign "center"
; :xalign {brightness.level / 100}
; :style "
; color: ${coloraccent};
; "
; :text "●"
; )
; )
; )
(scale
:value "${brightness.level}"
:onchange "light -S {}"
:hexpand true
:class "sidebar-quicktoggle-slider"
)
)
)
)
(box ; Power
:halign "end"
:width 50 :height 50
:orientation "h"
:space-evenly false
(revealer
:reveal {rev_power}
:transition "slideleft"
:duration "100ms"
(box
:class "sidebar-quicktoggle-btn sidebar-quicktoggle-btn-left"
:style "margin-right: 3px;"
(eventbox
:width 50 :height 50
:cursor "pointer"
:class "sidebar-quicktoggle-power-optn"
:onclick "gtklock &"
(label
:halign "center"
:class "sidebar-quicktoggle-power-icon"
:text "Lock"
)
)
(eventbox
:width 50 :height 50
:cursor "pointer"
:class "sidebar-quicktoggle-power-optn"
:onclick "scripts/dashactivate 'systemctl suspend' &"
(label
:halign "center"
:class "sidebar-quicktoggle-power-icon"
:text ""
)
)
(eventbox
:width 50 :height 50
:cursor "pointer"
:class "sidebar-quicktoggle-power-optn"
:onclick "scripts/dashactivate 'loginctl terminate-user $USER' &"
(label
:halign "center"
:class "sidebar-quicktoggle-power-icon"
:text "Logout"
)
)
(eventbox
:width 50 :height 50
:cursor "pointer"
:class "sidebar-quicktoggle-power-optn"
:onclick "scripts/dashactivate 'systemctl poweroff' &"
(label
:halign "center"
:class "sidebar-quicktoggle-power-icon"
:text ""
)
)
(eventbox
:width 50 :height 50
:cursor "pointer"
:class "sidebar-quicktoggle-power-optn"
:onclick "scripts/dashactivate 'systemctl reboot' &"
(label
:halign "center"
:class "sidebar-quicktoggle-power-icon"
:text ""
)
)
)
)
(button
:class "sidebar-quicktoggle-btn${rev_power ? '-active ' : ''} ${rev_power ? 'sidebar-quicktoggle-btn-right' : ''}"
:onclick "${EWW_CMD} update rev_power='${!rev_power}'"
:width 50 :height 50
(label
:halign "center"
:class "bar-icon-material-hugeass"
:text {rev_power ? '' : 'Key'}
)
)
)
)
(box ; Notifications
:space-evenly false :orientation "v"
:vexpand true
(box ; The text
:space-evenly false
:height {BAR_HEIGHT} :width 400
:class "sidebar-section-title"
(label :xalign 0
:class "bar-icon-material-hugeass sidebar-section-title-icon"
:text "Notifications"
)
(label :xalign 0
:hexpand true
:class "bar-txt-hugeass sidebar-section-title-icon"
:text "Notifications"
)
)
(scroll
:vexpand true
:style "margin: 0 15px;"
(box
:space-evenly false :orientation "v" :spacing -10
(box
:space-evenly false
:orientation "v"
(for app in notifications
(box
:space-evenly false :orientation "v"
:spacing 10
:class "sidebar-notification"
(box
:valign "center"
:space-evenly false :orientation "v"
(box
:space-evenly false :orientation "h"
:spacing 5
(label :xalign 0
:hexpand true
:class "bar-txt bar-txt-norm"
:text {app['summary']}
:limit-width 40
)
(label :xalign 1
:class "bar-txt-smaller bar-txt-norm"
:text "${app['app_name']}"
:limit-width 20
)
(label :xalign 1
:class "bar-txt-small bar-txt-norm"
:text " • ${app['time']}"
:limit-width 20
)
)
(box
(label :xalign 0 :hexpand true :wrap true
:class "bar-txt-small bar-txt-sub"
:text {app['body']}
; :limit-width 45
)
)
)
; (label :xalign 0
; :hexpand true
; :width 175
; :class "sidebar-notif-appname"
; :text {app.name}
; :wrap true
; )
; (box
; :space-evenly false :orientation "h"
; :spacing 10
; (box
; :class "sidebar-notif-decor-left"
; :width 5
; )
; (box
; :space-evenly false :orientation "v"
; :spacing 10
; (for message in {app.content}
; (box
; :space-evenly false :orientation "v"
; (label :xalign 0
; :class "sidebar-notif-summary"
; :text {message[0]}
; ; :limit-width 60
; )
; (label :xalign 0
; :class "sidebar-notif-body"
; :text {message[1]}
; ; :limit-width 60
; )
; )
; )
; )
; )
)
)
)
)
)
(box
:height 20
)
)
(box ; Calendar
:orientation "v"
:space-evenly false
:spacing -10
(eventbox
:onscroll "scripts/scrollmonth {} &"
:onclick "${EWW_CMD} update monthshift=0 &"
(box ; The text
:space-evenly false
:height {BAR_HEIGHT} :width 400
:class "sidebar-section-title"
(label :xalign 0
:class "bar-icon-material-hugeass sidebar-section-title-icon"
:text ""
)
(label :xalign 0
:hexpand true
:class "bar-txt-hugeass sidebar-section-title-text"
:text "${calendartitle}"
)
(label :xalign 1
:class "bar-txt-small sidebar-section-title-text"
:text "Scroll to change month"
)
)
)
(box
:class "sidebar-content"
:orientation "h" :space-evenly false :spacing 10
(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"
: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"
:text "${day.day}"
)
)
)
)
)
)
)
(box
:orientation "v"
:space-evenly false
:hexpand true
:class "sidebar-todo-box"
(label
:class "bar-txt-hugeass sidebar-box-title"
:text "Todo"
)
(scroll
:hscroll false :vscroll true
:vexpand true
:style "margin: 5px 0;"
(box
:orientation "v"
:space-evenly false :spacing 10
(for task in todolist
(box
:orientation "h"
:space-evenly false
:class "sidebar-todo-item"
:spacing 5
(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 "bar-icon-material-large"
:text "Remove"
)
)
(label :xalign 0
:text {task}
:wrap true
)
)
)
)
)
)
)
(box
:height 20
)
)
)
)
)
)
)
)
(defwindow sideright
:monitor 0
:stacking "fg"
:namespace "eww"
:geometry (geometry
; :height "100%"
:anchor "top right"
)
(sideright_widget)
)
+178
View File
@@ -0,0 +1,178 @@
(defwidget supercontext_widget []
(eventbox
:onclick "scripts/toggle-supercontext.sh --close &"
(box
:width RES_WIDTH
:height RES_HEIGHT
:space-evenly false
(box
:halign "start" :valign "start"
:style "
transition: 0ms;
margin-left: ${supercontext_pos_x - (SUPERCONTEXT_DIAMETER / 2)}px;
margin-top: ${supercontext_pos_y - (SUPERCONTEXT_DIAMETER / 2)}px;
min-width: ${SUPERCONTEXT_DIAMETER}px;
min-height: ${SUPERCONTEXT_DIAMETER}px;
"
(overlay
(overlay
; (box
; :width SUPERCONTEXT_DIAMETER :height SUPERCONTEXT_DIAMETER
; )
; Button backgrounds (SVGs)
(revealer
:reveal {open_supercontext >= 1}
:duration "75ms"
:transition "crossfade"
(image
:class "supercontext-bg"
:path "images/menus/btn0.svg"
:image-width SUPERCONTEXT_DIAMETER :image-height SUPERCONTEXT_DIAMETER
)
)
(revealer
:reveal {open_supercontext >= 2}
:duration "75ms"
:transition "crossfade"
(image
:class "supercontext-bg"
:path "images/menus/btn1.svg"
:image-width SUPERCONTEXT_DIAMETER :image-height SUPERCONTEXT_DIAMETER
)
)
(revealer
:reveal {open_supercontext >= 3}
:duration "75ms"
:transition "crossfade"
(image
:class "supercontext-bg"
:path "images/menus/btn2.svg"
:image-width SUPERCONTEXT_DIAMETER :image-height SUPERCONTEXT_DIAMETER
)
)
(revealer
:reveal {open_supercontext >= 4}
:duration "75ms"
:transition "crossfade"
(image
:class "supercontext-bg"
:path "images/menus/btn3.svg"
:image-width SUPERCONTEXT_DIAMETER :image-height SUPERCONTEXT_DIAMETER
)
)
(revealer
:reveal {open_supercontext >= 5}
:duration "75ms"
:transition "crossfade"
(image
:class "supercontext-bg"
:path "images/menus/btn4.svg"
:image-width SUPERCONTEXT_DIAMETER :image-height SUPERCONTEXT_DIAMETER
)
)
)
(overlay ; Real button hitboxes
(box ; Button 0: Kill processes with the same process name as the focused window
:class "supercontext-btn"
:style "
opacity: ${open_supercontext >= 1 ? 1 : 0};
margin-left: ${SUPERCONTEXT_RADIUS + (sin(degtorad(SUPERCONTEXT_ROTATIONS[0])) * SUPERCONTEXT_DIST_FROM_CENTER) - SUPERCONTEXT_BUTTON_RADIUS}px;
margin-right: ${SUPERCONTEXT_DIAMETER - (SUPERCONTEXT_RADIUS + (round(sin(degtorad(SUPERCONTEXT_ROTATIONS[0])), 5) * SUPERCONTEXT_DIST_FROM_CENTER) + SUPERCONTEXT_BUTTON_RADIUS)}px;
margin-top: ${SUPERCONTEXT_RADIUS - (cos(degtorad(SUPERCONTEXT_ROTATIONS[0])) * SUPERCONTEXT_DIST_FROM_CENTER) - SUPERCONTEXT_BUTTON_RADIUS}px;
margin-bottom: ${SUPERCONTEXT_DIAMETER - (SUPERCONTEXT_RADIUS - (cos(degtorad(SUPERCONTEXT_ROTATIONS[0])) * SUPERCONTEXT_DIST_FROM_CENTER) + SUPERCONTEXT_BUTTON_RADIUS)}px;
"
(eventbox
:onclick "pkill $(ps -p $(hyprctl activewindow -j | gojq -r '.pid') -o comm=) &"
:tooltip "Brutally kill this window"
:cursor "pointer"
(label :class "supercontext-btn-icon bar-txt-norm" :text "Dangerous")
)
)
(box ; Button 1
:class "supercontext-btn"
:style "
opacity: ${open_supercontext >= 2 ? 1 : 0};
margin-left: ${SUPERCONTEXT_RADIUS + (sin(degtorad(SUPERCONTEXT_ROTATIONS[1])) * SUPERCONTEXT_DIST_FROM_CENTER) - SUPERCONTEXT_BUTTON_RADIUS}px;
margin-right: ${SUPERCONTEXT_DIAMETER - (SUPERCONTEXT_RADIUS + (round(sin(degtorad(SUPERCONTEXT_ROTATIONS[1])), 5) * SUPERCONTEXT_DIST_FROM_CENTER) + SUPERCONTEXT_BUTTON_RADIUS)}px;
margin-top: ${SUPERCONTEXT_RADIUS - (cos(degtorad(SUPERCONTEXT_ROTATIONS[1])) * SUPERCONTEXT_DIST_FROM_CENTER) - SUPERCONTEXT_BUTTON_RADIUS}px;
margin-bottom: ${SUPERCONTEXT_DIAMETER - (SUPERCONTEXT_RADIUS - (cos(degtorad(SUPERCONTEXT_ROTATIONS[1])) * SUPERCONTEXT_DIST_FROM_CENTER) + SUPERCONTEXT_BUTTON_RADIUS)}px;
"
(eventbox
:class "supercontext-btn-num"
:tooltip "Swap workspace windows with workspace..."
:onscroll "eww update ws_to_swap=$(( ${ws_to_swap == 0 ? activews : ws_to_swap} + $(echo {} | sed -e 's/down/-1/g' -e 's/up/+1/g') )) &"
:onclick "scripts/swapws ${activews} ${ws_to_swap} &"
:cursor "col-resize"
(label :class "bar-txt-norm" :text {ws_to_swap == 0 ? '' : ws_to_swap})
)
)
(box
:class "supercontext-btn"
:style "
opacity: ${open_supercontext >= 3 ? 1 : 0};
margin-left: ${SUPERCONTEXT_RADIUS + (sin(degtorad(SUPERCONTEXT_ROTATIONS[2])) * SUPERCONTEXT_DIST_FROM_CENTER) - SUPERCONTEXT_BUTTON_RADIUS}px;
margin-right: ${SUPERCONTEXT_DIAMETER - (SUPERCONTEXT_RADIUS + (round(sin(degtorad(SUPERCONTEXT_ROTATIONS[2])), 5) * SUPERCONTEXT_DIST_FROM_CENTER) + SUPERCONTEXT_BUTTON_RADIUS)}px;
margin-top: ${SUPERCONTEXT_RADIUS - (cos(degtorad(SUPERCONTEXT_ROTATIONS[2])) * SUPERCONTEXT_DIST_FROM_CENTER) - SUPERCONTEXT_BUTTON_RADIUS}px;
margin-bottom: ${SUPERCONTEXT_DIAMETER - (SUPERCONTEXT_RADIUS - (cos(degtorad(SUPERCONTEXT_ROTATIONS[2])) * SUPERCONTEXT_DIST_FROM_CENTER) + SUPERCONTEXT_BUTTON_RADIUS)}px;
"
(eventbox
:class "supercontext-btn-num"
:tooltip "Dump windows of this workspace to workspace..."
:onscroll "eww update ws_to_dump=$(( ${ws_to_dump == 0 ? activews : ws_to_dump} + $(echo {} | sed -e 's/down/-1/g' -e 's/up/+1/g') )) &"
:onclick "scripts/dumptows ${activews} ${ws_to_dump} &"
:cursor "col-resize"
(label :class "bar-txt-norm" :style {ws_to_dump == 0 ? 'font-family: Material Symbols Rounded' : ''} :text {ws_to_dump == 0 ? 'publish' : ws_to_dump})
)
)
(box
:class "supercontext-btn"
:style "
opacity: ${open_supercontext >= 4 ? 1 : 0};
margin-left: ${SUPERCONTEXT_RADIUS + (sin(degtorad(SUPERCONTEXT_ROTATIONS[3])) * SUPERCONTEXT_DIST_FROM_CENTER) - SUPERCONTEXT_BUTTON_RADIUS}px;
margin-right: ${SUPERCONTEXT_DIAMETER - (SUPERCONTEXT_RADIUS + (round(sin(degtorad(SUPERCONTEXT_ROTATIONS[3])), 5) * SUPERCONTEXT_DIST_FROM_CENTER) + SUPERCONTEXT_BUTTON_RADIUS)}px;
margin-top: ${SUPERCONTEXT_RADIUS - (cos(degtorad(SUPERCONTEXT_ROTATIONS[3])) * SUPERCONTEXT_DIST_FROM_CENTER) - SUPERCONTEXT_BUTTON_RADIUS}px;
margin-bottom: ${SUPERCONTEXT_DIAMETER - (SUPERCONTEXT_RADIUS - (cos(degtorad(SUPERCONTEXT_ROTATIONS[3])) * SUPERCONTEXT_DIST_FROM_CENTER) + SUPERCONTEXT_BUTTON_RADIUS)}px;
"
(eventbox
:onclick "~/.local/bin/record-script-fullscreen.sh &"
:tooltip "Record"
:cursor "pointer"
(label :class "supercontext-btn-icon bar-txt-norm" :text "radio_button_checked")
)
)
(box
:class "supercontext-btn"
:style "
opacity: ${open_supercontext >= 5 ? 1 : 0};
margin-left: ${SUPERCONTEXT_RADIUS + (sin(degtorad(SUPERCONTEXT_ROTATIONS[4])) * SUPERCONTEXT_DIST_FROM_CENTER) - SUPERCONTEXT_BUTTON_RADIUS}px;
margin-right: ${SUPERCONTEXT_DIAMETER - (SUPERCONTEXT_RADIUS + (round(sin(degtorad(SUPERCONTEXT_ROTATIONS[4])), 5) * SUPERCONTEXT_DIST_FROM_CENTER) + SUPERCONTEXT_BUTTON_RADIUS)}px;
margin-top: ${SUPERCONTEXT_RADIUS - (cos(degtorad(SUPERCONTEXT_ROTATIONS[4])) * SUPERCONTEXT_DIST_FROM_CENTER) - SUPERCONTEXT_BUTTON_RADIUS}px;
margin-bottom: ${SUPERCONTEXT_DIAMETER - (SUPERCONTEXT_RADIUS - (cos(degtorad(SUPERCONTEXT_ROTATIONS[4])) * SUPERCONTEXT_DIST_FROM_CENTER) + SUPERCONTEXT_BUTTON_RADIUS)}px;
"
(eventbox
:onclick "notify-send 'an extra button ;)'"
:tooltip "does nothing lol"
:cursor "pointer"
(label :class "supercontext-btn-icon bar-txt-norm" :text "-")
)
)
)
)
)
)
)
)
(defwindow supercontext
:stacking "overlay"
:focusable true
:monitor 0
:namespace "supercontext"
:geometry (geometry
:anchor "center center"
:height "100%"
:width "100%"
)
(supercontext_widget)
)