Files
illogical-impulse/tetrio/.config/eww/windows/osettings.yuck
T
2024-02-22 15:35:06 +07:00

857 lines
34 KiB
Plaintext
Executable File

(defwidget checkboxhyprctl [value changevalue]
(eventbox
:cursor "pointer"
:onclick "hyprctl keyword ${changevalue} ${1 - value} && scripts/hyprsettings tickle"
(box
:class "osettings-checkbox-${value}"
:halign "end"
)
)
)
(defwidget checkboxcmd [value changecmd]
(eventbox
:onclick "${changecmd}"
(box
:class "osettings-checkbox-${value}"
:halign "end"
)
)
)
(defwidget osettings []
(box
:orientation "v"
:space-evenly false
:style "
${anim_open_ostg ? 'transition: 300ms cubic-bezier(0.05, 0.7, 0.1, 1);' : 'transition: 200ms cubic-bezier(0.3, 0, 0.8, 0.15);'}
${rev_ostg ? '' : 'margin-left: -600px;'}
"
(eventbox
:onclick "scripts/toggle-osettings.sh --close &"
:onmiddleclick "scripts/toggle-osettings.sh --close &"
:onrightclick "scripts/toggle-osettings.sh --close &"
(box
:class "box-that-is-there" :style "min-height: 1px;"
)
)
(eventbox
; :onhoverlost "scripts/toggle-osettings.sh --close &"
(box
:orientation "v"
:space-evenly false
:class "osettings-window"
(box
:orientation "v"
:space-evenly false
(box
:class "osettings-heading"
:orientation "v"
:space-evenly false
(label
:halign "start"
:wrap true
:class "osettings-title"
:text "SETTINGS"
)
(label
:halign "start"
:wrap true
:class "osettings-subtitle"
:text "change the way hyprland behaves"
)
)
(box
:spacing 0
:space-evenly false
:class "osettings-search"
:orientation "h"
(input
:halign "start"
:class "osettings-search-text"
:onchange "${EWW_CMD} update oquery=\"$(echo {} | tr [:upper:] [:lower:])\""
)
(box)
(button
:halign "end"
:class "osettings-search-icon"
:style "font-weight: bolder;"
""
)
)
)
(box
:class "osettings-separator"
:orientation "v"
:space-evenly false
)
(scroll
; :vscroll true
; :hscroll false
; :halign "fill"
:class "osettings-content"
:style "min-height: 813px;"
(box
:halign "fill"
:class "osettings-scroll-bg"
:space-evenly false
:spacing 20
:orientation "v"
(box
:class "osettings-settings"
:orientation "v"
:space-evenly false
; Quick settings
(revealer
:reveal "${matches('quick settings volume audio brightness',oquery)}"
:transition "slidedown"
:duration "0ms"
(overlay
(box
:orientation "v"
:space-evenly false
:class "osettings-window-section osettings-window-quick"
(label
:xalign 0
:class "osettings-section osettings-section-quick"
:text "QUICK SETTINGS"
)
(revealer
:reveal "${matches('quick settings volume audio',oquery)}"
:transition "slidedown"
:duration "0ms"
(eventbox
:onscroll "echo {} | sed -e 's/down/-/g' -e 's/up/+/g' | xargs -I% wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.03%"
(box
:orientation "v"
:space-evenly false
:class "osettings-window-contents"
(centerbox
:orientation "h"
:space-evenly false
:halign "fill"
(label
:halign "start"
:wrap true
:class "osettings-text"
:text "Volume"
)
(box)
; (checkbox
; :halign "end"
; :class "osettings-checkbox"
; :onchecked "scripts/volume mute SINK"
; :onunchecked "scripts/volume mute SINK"
; )
(checkboxcmd
:value "${volume.audio}"
:changecmd "scripts/volume mute SINK"
)
)
(scale
:halign "fill"
:class "osettings-slider osettings-slider-quick osettings-slider-5"
:value "${volume.percent}"
:tooltip "volume on ${volume.percent}%"
:onchange "scripts/volume setvol SINK {}"
)
)
)
)
(revealer
:reveal "${matches('quick settings brightness',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:orientation "v"
:space-evenly false
:class "osettings-window-contents"
(label
:halign "start"
:wrap true
:class "osettings-text"
:text "Brightness"
)
(scale
:class "osettings-slider osettings-slider-quick osettings-slider-5"
:value "${brightness.level}"
:onchange "light -S {}"
)
)
)
)
(box
:halign "end" :valign "end"
:class "osettings-window-quick-bottomright"
)
(box
:halign "end" :valign "end"
:class "osettings-window-bottomright-cut"
)
)
)
; Session control
(revealer
:reveal "${matches('session lock logout suspend log out shutdown shut down poweroff power off',oquery)}"
:transition "slidedown"
:duration "0ms"
(overlay
(box
:space-evenly false
:orientation "v"
:class "osettings-window-section osettings-window-session"
(label
:xalign 0
:class "osettings-section osettings-section-session"
:text "SESSION"
)
(revealer
:reveal "${matches('session lock',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:orientation "v"
:space-evenly false
(button
:halign "fill"
:wrap true
:class "osettings-btn osettings-btn-neutral"
:onclick "~/.local/bin/lock.sh &"
"Lock"
)
)
)
(revealer
:reveal "${matches('session suspend',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:orientation "v"
:space-evenly false
(button
:halign "fill"
:wrap true
:class "osettings-btn osettings-btn-neutral"
:onclick "systemctl suspend &"
"Suspend"
)
)
)
(revealer
:reveal "${matches('session logout log out',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:orientation "v"
:space-evenly false
(button
:halign "fill"
:wrap true
:class "osettings-btn osettings-btn-destructive"
:onclick "pkill Hyprland &"
"Logout"
)
)
)
(revealer
:reveal "${matches('session shutdown shut down poweroff power off',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:orientation "v"
:space-evenly false
(button
:halign "fill"
:wrap true
:class "osettings-btn osettings-btn-destructive"
:onclick "systemctl poweroff &"
"Shutdown"
)
)
)
)
(box
:halign "end" :valign "end"
:class "osettings-window-session-bottomright"
)
(box
:halign "end" :valign "end"
:class "osettings-window-bottomright-cut"
)
)
)
; Mouse
(revealer
:reveal "${matches('mouse and touchpad touch pad mouse speed mouse acceleration osu raw input sensitivity disable while typing disable_while_typing tap to click clickfinger_behavior',oquery)}"
:transition "slidedown"
:duration "0ms"
(overlay
(box
:space-evenly false
:orientation "v"
:class "osettings-window-section osettings-window-mouse"
(label
:xalign 0
:class "osettings-section osettings-section-mouse"
:text "MOUSE & TOUCHPAD"
)
(revealer
:reveal "${matches('mouse and touchpad touch pad speed mouse acceleration osu raw input sensitivity',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
:class "osettings-window-contents"
(centerbox
:orientation "h"
:space-evenly false
:halign "fill"
(label
:halign "start"
:wrap true
:class "osettings-text"
:text "Raw Input"
)
(box)
(checkboxhyprctl
:value "${hyprjson.force_no_accel}"
:changevalue "input:force_no_accel"
:halign "end"
:class "osettings-checkbox"
)
)
(eventbox
:onrightclick "hyprctl keyword input:sensitivity 0"
(box
:space-evenly false
:orientation "v"
(label
:halign "start"
:wrap true
:class "osettings-text"
:text "Sensitivity"
)
(scale
:class "osettings-slider osettings-slider-mouse osettings-slider-3"
:value "${hyprjson.input_sensitivity * 50 + 50}"
:onchange "hyprctl keyword input:sensitivity $(echo - | awk '{print {} / 50 - 1}') && scripts/hyprsettings tickle"
)
)
)
)
)
(revealer
:reveal "${matches('mouse and touch pad touchpad disable while typing disable_while_typing',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
:class "osettings-window-contents"
(centerbox
:orientation "h"
:space-evenly false
:halign "fill"
(label
:halign "start"
:class "osettings-text"
:text "Disable touchpad while typing"
)
(box)
(checkboxhyprctl
:value "${hyprjson.touchpad_disable_while_typing}"
:changevalue "input:touchpad:disable_while_typing"
:class "osettings-checkbox"
)
)
)
)
(revealer
:reveal "${matches('mouse and touchpad touch pad tap to click clickfinger_behavior',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
:class "osettings-window-contents"
(centerbox
:orientation "h"
:space-evenly false
:halign "fill"
(label
:halign "start"
:class "osettings-text"
:text "Tap to click"
)
(box)
(checkboxhyprctl
:value "${hyprjson.touchpad_clickfinger_behavior}"
:changevalue "input:touchpad:clickfinger_behavior"
)
)
)
)
)
(box
:halign "end" :valign "end"
:class "osettings-window-mouse-bottomright"
)
(box
:halign "end" :valign "end"
:class "osettings-window-bottomright-cut"
)
)
)
; Appearance
(revealer
:reveal "${matches('appearance looks customization blur size blur passes blur strength blur xray',oquery)}"
:transition "slidedown"
:duration "0ms"
(overlay
(box
:space-evenly false
:orientation "v"
:class "osettings-window-section osettings-window-appearance"
(label
:xalign 0
:class "osettings-section osettings-section-appearance"
:text "BLUR"
)
(centerbox
:orientation "h"
:space-evenly false
:halign "fill"
:class "osettings-window-contents"
(label
:halign "start"
:class "osettings-text"
:text "Enable blur"
)
(box)
(checkboxhyprctl
:value "${hyprjson.blur}"
:changevalue "decoration:blur"
)
)
(revealer
:reveal "${matches('appearance looks customization blur size blur strength',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
:class "osettings-window-contents"
(label
:halign "start"
:wrap true
:class "osettings-text"
:text "Blur size"
)
(scale
:class "osettings-slider osettings-slider-5"
:value "${hyprjson.blur_size}"
:tooltip "Blur size: ${hyprjson.blur_size}"
:onchange "hyprctl keyword decoration:blur_size {} && scripts/hyprsettings tickle"
)
)
)
(revealer
:reveal "${matches('appearance looks customization blur passes blur strength',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
:class "osettings-window-contents"
(label
:halign "start"
:wrap true
:class "osettings-text"
:text "Blur passes"
)
(scale
:class "osettings-slider osettings-slider-5"
:value "${hyprjson.blur_passes * 10}"
:tooltip "Blur passes: ${hyprjson.blur_passes}"
:onchange "hyprctl keyword decoration:blur_passes $(({} / 10)) && scripts/hyprsettings tickle"
)
)
)
(revealer
:reveal "${matches('appearance looks customization blur xray',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
:class "osettings-window-contents"
(centerbox
:orientation "h"
:space-evenly false
:halign "fill"
(label
:halign "start"
:class "osettings-text"
:text "Blur xray"
)
(box)
(checkboxhyprctl
:value "${hyprjson.blur_xray}"
:changevalue "decoration:blur_xray"
)
)
)
)
)
(box
:halign "end" :valign "end"
:class "osettings-window-appearance-bottomright"
)
(box
:halign "end" :valign "end"
:class "osettings-window-bottomright-cut"
)
)
)
(revealer
:reveal "${matches('appearance looks customization gaps gaps_in inner gaps: inner gaps_out outer gaps: outer space border_size border size border thickness',oquery)}"
:transition "slidedown"
:duration "0ms"
(overlay
(box
:space-evenly false
:orientation "v"
:class "osettings-window-section osettings-window-gaps"
(label
:xalign 0
:class "osettings-section osettings-section-gaps"
:text "GAPS"
)
(revealer
:reveal "${matches('appearance looks customization gaps_in inner gaps: inner space',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
:class "osettings-window-contents"
(label
:halign "start"
:wrap true
:class "osettings-text"
:text "Gaps: Inner"
)
(scale
:class "osettings-slider osettings-slider-4"
:value "${hyprjson.gaps_in}"
:tooltip "Inner gaps: ${hyprjson.gaps_in}"
:onchange "hyprctl keyword general:gaps_in {} && scripts/hyprsettings tickle"
)
)
)
(revealer
:reveal "${matches('appearance looks customization gaps_out outer gaps: outer space',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
:class "osettings-window-contents"
(label
:halign "start"
:wrap true
:class "osettings-text"
:text "Gaps: Outer"
)
(scale
:class "osettings-slider osettings-slider-4"
:value "${hyprjson.gaps_out}"
:tooltip "Outer gaps: ${hyprjson.gaps_out}"
:onchange "hyprctl keyword general:gaps_out {} && scripts/hyprsettings tickle"
)
)
)
(revealer
:reveal "${matches('appearance looks customization border_size border size border thickness',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
:class "osettings-window-contents"
(label
:halign "start"
:wrap true
:class "osettings-text"
:text "Border size"
)
(scale
:class "osettings-slider osettings-slider-4"
:value "${hyprjson.border_size}"
:tooltip "Border size: ${hyprjson.border_size}"
:onchange "hyprctl keyword general:border_size {} && scripts/hyprsettings tickle"
)
)
)
)
(box
:halign "end" :valign "end"
:class "osettings-window-gaps-bottomright"
)
(box
:halign "end" :valign "end"
:class "osettings-window-bottomright-cut"
)
)
)
; Hyperland
(revealer
:reveal "${matches(oquery, 'hyperland')}"
:transition "slidedown"
:duration "0ms"
(overlay
(box
:space-evenly false
:orientation "v"
:class "osettings-window-section osettings-window-hyperland"
(label
:xalign 0
:class "osettings-section osettings-section-hyperland"
:text "HYPERLAND"
)
(revealer
:reveal "${matches(oquery, 'hyperland')}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
(button
:halign "fill"
:wrap true
:class "osettings-btn osettings-btn-neutral"
:onclick "notify-send whyyyyyyy 😭"
"Check the spelling and try again"
)
)
)
)
(box
:halign "end" :valign "end"
:class "osettings-window-hyperland-bottomright"
)
(box
:halign "end" :valign "end"
:class "osettings-window-bottomright-cut"
)
)
)
; Hyprland
(revealer
:reveal "${matches('hyprland options open the wiki guide help social hypr development discord reload config configuration',oquery)}"
:transition "slidedown"
:duration "0ms"
(overlay
(box
:space-evenly false
:orientation "v"
:class "osettings-window-section osettings-window-hyprland"
(label
:xalign 0
:class "osettings-section osettings-section-hyprland"
:text "HYPRLAND OPTIONS"
)
(revealer
:reveal "${matches('hyprland options reload config configuration',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
(button
:halign "fill"
:wrap true
:class "osettings-btn osettings-btn-neutral"
:onclick "cp ~/.config/hypr/hyprland.conf temporary_config.conf && cp temporary_config.conf ~/.config/hypr/hyprland.conf && rm temporary_config.conf &"
"Reload config"
)
)
)
(revealer
:reveal "${matches('hyprland open the wiki guide help',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
(button
:halign "fill"
:wrap true
:class "osettings-btn osettings-btn-informative"
:onclick "scripts/toggle-osettings.sh && xdg-open https://wiki.hyprland.org &"
"Open the wiki"
)
)
)
(revealer
:reveal "${matches('hyprland help social hypr development discord',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
(button
:halign "fill"
:wrap true
:class "osettings-btn osettings-btn-informative"
:onclick "scripts/toggle-osettings.sh xdg-open https://discord.com/invite/hQ9XvMUjjr &"
"Hypr Development Discord"
)
)
)
)
(box
:halign "end" :valign "end"
:class "osettings-window-hyprland-bottomright"
)
(box
:halign "end" :valign "end"
:class "osettings-window-bottomright-cut"
)
)
)
; Calendar
(revealer
:reveal "${'calendar' == oquery}"
:transition "slidedown"
:duration "0ms"
(overlay
(box
:orientation "v"
:space-evenly false
:class "osettings-window-section osettings-window-calendar"
(label
:xalign 0
:class "osettings-section osettings-section-calendar"
:text "CALENDAR"
)
(calendar)
)
(box
:halign "end" :valign "end"
:class "osettings-window-calendar-bottomright"
)
(box
:halign "end" :valign "end"
:class "osettings-window-bottomright-cut"
)
)
)
; Super secret settings
(revealer
:reveal "${oquery == '!secret' || oquery == '!sekret'}"
:transition "slidedown"
:duration "0ms"
(overlay
(box
:orientation "v"
:space-evenly false
:class "osettings-window-section osettings-window-secret"
(label
:xalign 0
:class "osettings-section osettings-section-secret"
:text "SUPER SECRET SETTINGS"
)
(button
:halign "fill"
:wrap true
:class "osettings-btn osettings-btn-informative"
:onclick "scripts/supersecretsettings/culture &"
"Activate culture mode"
)
(button
:halign "fill"
:wrap true
:class "osettings-btn osettings-btn-informative"
:onclick "scripts/supersecretsettings/doreload &"
"Reset these stuff"
)
(button
:halign "fill"
:wrap true
:class "osettings-btn osettings-btn-destructive"
:onclick "hyprctl keyword bind ,c,exec,wtype k"
"Bekome a KDE developer"
)
(button
:halign "fill"
:wrap true
:class "osettings-btn osettings-btn-destructive"
:onclick "hyprctl keyword unbind ,c"
"Un-become a KDE developer"
)
; (centerbox
; :orientation "h"
; :space-evenly false
; :halign "fill"
; (label
; :halign "start"
; :wrap true
; :class "osettings-text"
; :text "Culture mode"
; )
; (box)
; (checkboxcmd
; :value "${volume.audio}"
; :changecmd "notify-send 'i see ur a man of culture as well'"
; )
; )
)
(box
:halign "end" :valign "end"
:class "osettings-window-quick-bottomright"
)
(box
:halign "end" :valign "end"
:class "osettings-window-bottomright-cut"
)
)
)
)
)
)
)
)
)
)
(defwindow osettings
:wm-ignore true
:monitor 0
:focusable true
:geometry (geometry
:x "0px"
:y "32px"
:width "0px"
:height "1048px"
:anchor "top left"
)
(osettings)
)
(defwidget osettings-button []
(eventbox
:class "osettings-toggle-button-false"
:onmiddleclick "playerctl play-pause"
:onrightclick "playerctl next"
: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"
(button
:class "osettings-toggle-button-${rev_ostg}"
:onclick "scripts/toggle-osettings.sh &"
(label :class "icon" :text "")
)
)
)