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

649 lines
24 KiB
Plaintext

(defvar oquery "")
(defvar rev_ostg false)
(deflisten hyprjson `scripts/hyprsettings`)
(defwidget checkboxhyprctl [value changevalue]
(eventbox
:onclick "hyprctl keyword ${changevalue} ${1 - value} && scripts/hyprsettings tickle"
(box
:class "osettings-checkbox"
:halign "end"
:style "${value == 1 ? 'background-color: #8C66FF' : ''}"
)
)
)
(defwidget checkboxcmd [value changecmd]
(eventbox
:onclick "${changecmd}"
(box
:class "osettings-checkbox"
:halign "end"
:style "${value == 1 ? 'background-color: #8C66FF' : ''}"
)
)
)
(defwidget osettings []
(revealer
:reveal rev_ostg
:transition "slideright"
:duration "250ms"
(revealer
:reveal rev_ostg
:transition "crossfade"
:duration "300ms"
(box
:class "osettings-window"
:orientation "v"
:space-evenly false
(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: 765px;"
(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"
(box
:orientation "v"
:space-evenly false
(label
:halign "start"
:wrap true
:class "osettings-section"
: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
(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"
: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
(label
:halign "start"
:wrap true
:class "osettings-text"
:text "Brightness"
)
(scale
:class "osettings-slider"
:value "${brightness.level}"
:onchange "light -S {}"
)
)
)
)
)
; Session control
(revealer
:reveal "${matches('session lock logout suspend log out shutdown shut down poweroff power off',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
(label
:halign "start"
:wrap true
:class "osettings-section"
: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 "scripts/toggle-osettings.sh && ~/.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 "scripts/toggle-osettings.sh && 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 "scripts/toggle-osettings.sh && kill 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 "scripts/toggle-osettings.sh && systemctl poweroff"
"Shutdown"
)
)
)
)
)
; Mouse
(revealer
:reveal "${matches('mouse and touchpad touch pad mouse speed osu raw input sensitivity disable while typing disable_while_typing tap to click clickfinger_behavior',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
(label
:halign "start"
:wrap true
:class "osettings-section"
:text "Mouse & Touchpad"
)
(revealer
:reveal "${matches('mouse speed osu raw input sensitivity',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
(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"
:value "${hyprjson.input_sensitivity * 50 + 50}"
:onchange "hyprctl keyword input:sensitivity $(echo - | awk '{print {} / 50 - 1}') && scripts/hyprsettings tickle"
)
)
)
)
)
(revealer
:reveal "${matches('touch pad touchpad disable while typing disable_while_typing',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
(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('touch pad touchpad tap to click clickfinger_behavior',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
(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"
)
)
)
)
)
)
; Appearance
(revealer
:reveal "${matches('appearance looks customization blur size blur passes blur strength blur xray',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
(label
:halign "start"
:wrap true
:class "osettings-section"
:text "Blur"
)
(centerbox
:orientation "h"
:space-evenly false
:halign "fill"
(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"
(label
:halign "start"
:wrap true
:class "osettings-text"
:text "Blur size"
)
(scale
:class "osettings-slider"
: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"
(label
:halign "start"
:wrap true
:class "osettings-text"
:text "Blur passes"
)
(scale
:class "osettings-slider"
: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"
(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"
)
)
)
)
)
)
(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"
(box
:space-evenly false
:orientation "v"
(label
:halign "start"
:wrap true
:class "osettings-section"
: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"
(label
:halign "start"
:wrap true
:class "osettings-text"
:text "Gaps: Inner"
)
(scale
:class "osettings-slider"
: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"
(label
:halign "start"
:wrap true
:class "osettings-text"
:text "Gaps: Outer"
)
(scale
:class "osettings-slider"
: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"
(label
:halign "start"
:wrap true
:class "osettings-text"
:text "Border size"
)
(scale
:class "osettings-slider"
:value "${hyprjson.border_size}"
:tooltip "Border size: ${hyprjson.border_size}"
:onchange "hyprctl keyword general:border_size {} && scripts/hyprsettings tickle"
)
)
)
)
)
(revealer
:reveal "${matches('appearance looks customization gaps gaps_in inner gaps: inner gaps_out outer gaps: outer space border_size border size border thickness reload config configuration blur size blur strength blur passes',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"
"Reload config"
)
)
)
; Hyprland
(revealer
:reveal "${matches('hyprland options open the wiki guide help social hypr development discord',oquery)}"
:transition "slidedown"
:duration "0ms"
(box
:space-evenly false
:orientation "v"
(label
:halign "start"
:wrap true
:class "osettings-section"
:text "Hyprland options"
)
(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"
)
)
)
)
)
; Calendar
(revealer
:reveal "${'calendar' == oquery}"
:transition "slidedown"
:duration "0ms"
(box
:orientation "v"
:space-evenly false
(label
:halign "start"
:wrap true
:class "osettings-section"
:text "Calendar"
)
(calendar)
)
)
)
)
)
)
)
)
)
(defwindow osettings
:focusable true
:wm-ignore true
:monitor 0
; :focusable true
:geometry (geometry
:x "0"
:y "0"
; :width "27.8%"
; :width "535px"
:width "0px"
:height "100%"
; :height "1048px"
:anchor "bottom left"
)
(osettings)
)