diff --git a/.scripts/setup/pkgs-installer.sh b/.scripts/setup/pkgs-installer.sh index 86a8548..ca56f0c 100755 --- a/.scripts/setup/pkgs-installer.sh +++ b/.scripts/setup/pkgs-installer.sh @@ -12,7 +12,7 @@ declare -A PACKAGES=( ["BASE_PACKAGES"]="inetutils v4l2loopback bind-utils zellij bat dust aria2 fzf neofetch bat zsh fish-shell brightnessctl bluez cronie git stow eza dbus seatd elogind polkit NetworkManager gnome-keyring polkit-gnome pipewire wireplumber inotify-tools xorg gnome-keyring polkit-gnome mtpfs ffmpeg libnotify" ["DEVEL_PACKAGES"]="glib glib-devel gtk+3-devel gtk-layer-shell-devel base-devel startup-notification-devel cairo-devel xcb-util-devel xcb-util-cursor-devel xcb-util-xrm-devel xcb-util-wm-devel" ["AMD_DRIVERS"]="opencv Vulkan-Headers Vulkan-Tools Vulkan-ValidationLayers-32bit mesa-vulkan-radeon mesa-vulkan-radeon-32bit vulkan-loader vulkan-loader-32bit libspa-vulkan libspa-vulkan-32bit amdvlk mesa-dri mesa-vaapi" - ["HYPRLAND_PACKAGES"]="Waybar avizo dunst swaybg mpvpaper grim jq slurp cliphist wl-clipboard swayidle pavucontrol nemo eog pavucontrol evince xorg-server-xwayland xdg-desktop-portal-gtk xdg-desktop-portal-wlr xdg-utils qt5-x11extras qt5-wayland qt6-wayland" + ["HYPRLAND_PACKAGES"]="eww nerd-fonts-symbols-ttf Waybar avizo dunst swaybg mpvpaper grim jq slurp cliphist wl-clipboard swayidle pavucontrol nemo eog pavucontrol evince xorg-server-xwayland xdg-desktop-portal-gtk xdg-desktop-portal-wlr xdg-utils qt5-x11extras qt5-wayland qt6-wayland" ["SYSTEM_APPS"]="alacritty octoxbps blueman wifish wpa_gui glow" ) diff --git a/hypr-configs/hyprland/eww/assets/perfil.png b/hypr-configs/hyprland/eww/assets/perfil.png deleted file mode 100644 index 6a62be5..0000000 Binary files a/hypr-configs/hyprland/eww/assets/perfil.png and /dev/null differ diff --git a/hypr-configs/hyprland/eww/bar/bar.scss b/hypr-configs/hyprland/eww/bar/bar.scss index 47dcc51..be5565f 100644 --- a/hypr-configs/hyprland/eww/bar/bar.scss +++ b/hypr-configs/hyprland/eww/bar/bar.scss @@ -1,134 +1,160 @@ -* { - all: unset; + +.barwidget { + background-color: $base; + padding: 5px; } -.bar-widget { - border-radius: 2px; - background-color: $background; +.icon { + font-size: 20px; + min-width: 1em; + min-height: 1em; + font-family: "Symbols Nerd Font"; + padding: 2px 0px; } -.apps { - background-color: $bg-alt; -} - -.uptime { - font-size: 0.9rem; - color: $fg-alt; - padding: 0.2rem; -} - -.launcher { - color: $green; - font-size: 1.4rem; - padding: 0 0.3rem 0 0; -} - -.spotify { - color: $green; - font-size: 1.5rem; -} - -.central-icon { - font-size: 1.5rem; -} - -.bell { - font-size: 1.5rem; - color: $yellow; -} - -.firefox { - color: $cyan; - font-size: 1.5rem; - padding: 0 0.2rem 0 0; +.revealtouch { + font-size: 20px; + margin: 5px 0px; + color: $surface2; } .workspaces { - font-size: 1.2rem; - border-radius: 1rem; - margin: 0 0 0 -0.3rem; - - .icon { - &.current { - color: $green; - } - } - - button { - &.empty { - color: $black; - } - - &.occupied { - color: lighten($color: $fg-alt2, $amount: 10%); - } - - &.current { - color: $green; - } - - &:hover { - &.empty { - color: lighten($color: $black, $amount: 5%); - } - &.occupied { - color: lighten($color: $black, $amount: 20%); - } - &.current { - color: darken($color: $green, $amount: 10%); - } - } - } + padding: 5px; } -.volume { - font-size: 1.3rem; - .volume-bar scale trough { - all: unset; - background-color: $black; - border-radius: 1rem; - min-width: 0.4rem; - min-height: 3rem; - margin-bottom: 0.5rem; - box-shadow: 0 0 2px 1px rgba(black, 0.3); - } - - .volume-bar scale trough highlight { - all: unset; - background: $green; - border-radius: 1rem; - } +.workspaces label { + font-size: 18; + padding-right: 5px; + padding: 2px 5px 2px 0px; } -.clock { - font-family: "SF Pro"; - font-size: 1.4rem; - - &.hour { - font-weight: bold; - color: $fg; - } - - &.minute { - color: $fg-alt; - } - - &.separator { - color: $fg-alt; - } - .timebox { - font-size: 0.5rem; - - &.magenta { - color: $magenta; - } - - &.green { - color: $green; - } - - &.yellow { - color: $yellow; - } - } +.widget { + padding: 5px 5px; + border-radius: 5px; + background-color: $surface0; + margin: 5px 2px; + color: $white0; + // border-style: solid; + // border-color: $white0; + // border-width: 2px; +} + +.clock label { + font-size: 20px; +} + +.bat_scale trough{ + min-height: 50px; + min-width: 18px; + border-radius: 5px; + slider { + all: unset; + } +} + +.bat_scale trough highlight{ + border-radius: 5px; + background-color: $accent; +} + +.charging trough highlight { + background-color: $green; +} + +.dying trough highlight { + background-color: $red; +} + +// .mpd label { +// color: $sky; +// } +// +// .playerctl label { +// color: $sapphire; +// } + +.mpd_controls label { + font-family: "Symbols Nerd Font"; + min-width: 1em; + min-height: 1em; + font-size: 30px; + padding: 15px; +} + +.seektime { + trough { + min-height: 10px; + min-width: 180px; + + slider { + background-color: $white2; + border-radius: 25px; + min-height: 20px; + min-width: 20px; + margin: -10px; + } + + highlight { + background-color: $red; + } + } +} + +.sidempdctl { + margin: 5px; + label { + font-size: 30px; + padding-right: 5px; + min-height: 1em; + min-width: 1em; + } +} + +.mpdvolumeseek { + @extend .seektime; + trough { + min-height: 100px; + min-width: 10px; + highlight { + background-color: $white0; + } + } +} + +.touch label { + font-size: 20px; +} + +.mtitle { + color: $white0; + font-size: 20px; + margin-top: 30px; +} + +.launchicon { + @extend .icon; + color: $accent; +} + +.picon { + @extend .icon; + font-size: 18px; +} + +.lightning { + color: $surface0 +} + +.workspacething, .workspacethingactive { + transition: 500ms; + border-radius: 5; + margin: 6px; +} + +.workspacething { + background-color: $surface2; +} + +.workspacethingactive { + background-color: $accent; } diff --git a/hypr-configs/hyprland/eww/bar/bar.yuck b/hypr-configs/hyprland/eww/bar/bar.yuck index 61e99fc..3db6ed8 100644 --- a/hypr-configs/hyprland/eww/bar/bar.yuck +++ b/hypr-configs/hyprland/eww/bar/bar.yuck @@ -1,257 +1,330 @@ -(defwidget bar [] - (box :class "bar-widget" :orientation "v" :space-evenly true :halign "center" - (start) - (center) - (apps) - (and) + +(defwindow bar + :geometry (geometry + :x "0%" + :y "0%" + :width "42" + :height "1080" + :anchor "center left") + ;; :reserve (struts :distance "60" :side "left") + ;; :stacking "bg" + :exclusive true + :monitor 0 + ;; :windowtype "dock" + :wm-ignore false + (barstruct)) + +(defwidget barstruct [] + (box + :orientation "h" + :space-evenly false + (revealer + :transition "slideright" + :reveal revealcontrolpanel + (control_widget)) + (centerbox + :class "barwidget" + :orientation "v" + :height "1080" + ;; :space-evenly true + (top) + (middle) + (bottom) + ))) + +(defwidget top [] + (box + :orientation "v" + :space-evenly false + :valign "start" + :class "top_modules" + :height "450" + :vexpand false + (home) + (workspaces) + (hiddenctl) )) +(defwidget middle [] + (box + :orientation "v" + :space-evenly false + :valign "center" + :vexpand false + :class "center_modules" + :height "180" + (playerctl) + )) -(defwidget start [] - (box :class "start" :orientation "v" :halign "center" :valign "start" - (launcher) - ) -) - - -(defwidget center [] - (box :class "center" :halign "center" :orientation "v" - (workspaces) - ) -) - -(defwidget apps [] - (box :class "apps" :spacing 10 :space-evenly false :valign "end" :halign "center" :orientation "v" - (volume) - (spotify) - (firefox) - ) -) - -(defwidget and [] - (box :class "" :valign "end":orientation "v" :space-evenly false :spacing 15 - (bell) - (central-icon) +(defwidget bottom [] + (box + :orientation "v" + :space-evenly false + :valign "end" + :class "bottom_modules" + :vexpand false + :hexpand false + (stray) + (sliders) + (battery) (clock) - ) -) - -(defwidget launcher [] - (eventbox - :cursor "pointer" - :halign "center" - (button - :class "launcher" - :valign "start" - :onclick "actions --launcher" - :width 25 - "" ))) - -(defwidget spotify [] - (eventbox - :cursor "pointer" - :halign "center" - (button - :class "launcher" - :valign "start" - :onclick "env LD_PRELOAD=/usr/lib/spotify-adblock.so spotify --uri=%U &" - :width 25 - "" ))) - -(defwidget firefox [] - (eventbox - :cursor "pointer" - :halign "center" - (button - :class "firefox" - :valign "start" - :onclick "firefox &" - :width 25 - "󰾔" ))) - -(defwidget central-icon [] - (eventbox - :cursor "pointer" - :halign "center" - (button - :class "central-icon" - :valign "start" - :onclick "eww open --toggle central" - :width 20 - "󰙪" ))) - - -(defwidget bell [] - (eventbox - :cursor "pointer" - :halign "center" - (button - :class "bell" - :valign "start" - :onclick "eww open --toggle notifications" - :width 20 - "󰂚" ))) + )) (defwidget workspaces [] - (box - :class "workspaces" - :halign "start" - :spacing 10 - :orientation "v" - :space-evenly false - (for workspace in hyprland - (eventbox - :cursor "pointer" - :onscroll "echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs hyprctl dispatch workspace" - :halign "center" - (button - :class "${workspace.current ? "current" : ""} ${workspace.windows > 0 ? "occupied" : "empty"}" - :onclick "hyprctl dispatch workspace ${workspace.id}" - (button - :width 25 - :class "icon ${workspace.current ? "current" : ""} ${workspace.windows > 0 ? "occupied" : "empty"}" - {workspace.current ? "" : ""} - ) - ) - ) - ) - ) -) - -(defwidget music [] (eventbox - :onhover "eww update music-rev=true" - :onhoverlost "eww update music-rev=false" + :cursor "pointer" (box - :space-evenly false - :spacing 10 + :class "workspaces widget" :orientation "v" - (eventbox - :cursor "pointer" + :space-evenly false + (for workspace in {workspacejson} (button - :class "musicbar-art" - :orientation "v" - :onclick "eww open-many --toggle player-closer player" - :style "background-image: url('${music-art}');" - ) - ) - (label - :class "musicbar-title" - :orientation "v" - :limit-height 10 - :limit-width 35 - :text music-title - ) - (revealer - :transition "slideright" - :reveal music-rev - :duration "500ms" - (box - :spacing 10 - :orientation "h" - (eventbox - :cursor "pointer" - (button - :class "musicbar-previous-icon" - :onclick "./scripts/mediacontrol --previous" - "" - ) - ) - (eventbox - :cursor "pointer" - (button - :class "musicbar-toggle-icon" - :onclick "./scripts/mediacontrol --toggle" - music-toggle - ) - ) - (eventbox - :cursor "pointer" - (button - :class "musicbar-next-icon" - :onclick "./scripts/mediacontrol --next" - "" - ) - ) - ) - ) - ) - ) -) + :onclick "swaymsg -t command workspace number ${workspace.name}" + (box + :hexpand false + :width 10 + :height { workspace.focused ? 60 : !workspace.empty ? 40 : 30} + :class { workspace.focused ? "workspacethingactive" : "workspacething"})))))) -(defwidget volume [] - (eventbox - :onhover "eww update volume_rev=true" - :onhoverlost "eww update volume_rev=false" +(defwidget home [] (box - :class "volume" - :space-evenly false - :orientation "v" - (revealer - :class "volume-bar" - :transition "slideup" - :reveal volume_rev + :class "widget" + :hexpand false + :vexpand false (eventbox - :cursor "pointer" - :halign "center" - (scale - :orientation "v" - :tooltip {volume == "muted" ? "Muted" : "${volume}%"} - :value {volume == "muted" ? "0" : volume} - :min 0 - :max 101 - :onchange "pamixer -u && pamixer --set-volume {}" - :flipped true - ) - ) - ) - (eventbox - :cursor "pointer" - :onscroll "echo {} | sed -e 's/up/--up/g' -e 's/down/--down/g' | xargs volume" - (button - :class "volume icon" - :style {volume == 0 || volume == "muted" ? "color: #dd6777;" : "color: #cacaca;"} - :tooltip {volume == "muted" ? "Muted" : "${volume}%" } - :onclick "volume --toggle" - {volume == 0 || volume == "muted" ? "󰝟" : - volume < 30 ? "" : - volume < 75 ? "" : ""} - ) - ) - ) - ) -) + ;; :onclick "~/.config/eww/meowidgets/scripts/launch" + ;; :onclick "~/.config/eww/meowayland/scripts/launch" + ;; :onclick "./scripts/pop control" + :onclick "${EWW_CMD} update revealcontrolpanel=${ !revealcontrolpanel }" + :onrightclick "${EWW_CMD} open wallpaperselect --toggle" + :cursor "pointer" + (label :text "" :halign "center" :class "launchicon" :style "padding: 2px 0px;")))) - - -(defwidget clock [] - (box - :class "clock" - :orientation "v" +(defwidget stray [] + (box + :class "widget" :space-evenly false - :spacing 4 - :halign "center" :valign "end" - (label - :class "clock hour" - :text hour - ) - (box :class "timebox" :spacing 4 - ) - (label - :class "clock minute" - :text minute) - ) -) + :orientation "v" + (eventbox + :onclick "${EWW_CMD} update revealsystray=${!revealsystray}" + (label :angle {!revealsystray ? 90 : 270} :class "revealtouch" :tooltip "reveal systray" :text "")) + (revealer + :reveal revealsystray + :transition "slideup" + (systray + :icon_size 20 + :pack-direction "down" + :hexpand true + :vexpand true)) + )) +(defwidget clock [] + (eventbox + :cursor "pointer" + :onclick "${EWW_CMD} open calendar --toggle" + (box + :orientation "v" + :space-evenly false + :class "widget clock" -(defwindow bar + (label :text thour) + (label :text tmin) + (label :text tpm)))) + +(defwidget battery [] + (box + :orientation "v" + :space-evenly false + :class "widget" + (overlay + (scale + :class "${EWW_BATTERY.BAT0.status == 'Charging' ? 'charging': bat0 < 16 ? 'dying': 'normal'} bat_scale" + :value "${bat0}" + :orientation "v" + :max 100 + :min 0 + :active false + :flipped true) + (label + :class "lightning" + :visible {EWW_BATTERY.BAT0.status == "Charging"} + :text "󱐋")) + (label :text "${EWW_BATTERY.BAT0.capacity}%" :limit-width 3 :show-truncated false))) + +(defwidget hiddenctl [] + (eventbox + :cursor "pointer" + :onclick {reveal3 ? "${EWW_CMD} update reveal3=false" : "${EWW_CMD} update reveal3=true"} + (box + :orientation "v" + :class "widget" + :space-evenly false + (revealer + :reveal reveal3 + :transition "slideup" + :duration "500ms" + (box + :class "touch" + :orientation "v" + :spacing 5 + (button :onclick "swaymsg kill" + (label :class "icon" :text "󰅙")) + (button :onclick "wofi --show=drun -i -I" + (label :class "icon" :text "󰀻")) + (button :onclick "./scripts/touchkey.sh" + (label :class "icon" :text "󰌌")))) + (label :angle {reveal3 ? 90 : 270} :class "revealtouch" :tooltip "touch control" :text "") + (revealer + :reveal {!reveal3} + :transition "slidedown" + ;; (tasklist))))) + )))) + +(defwidget playerctl [] + (eventbox + :cursor "pointer" + (box + :class "playerctl widget" + :orientation "v" + :space-evenly true + :spacing 5 + (eventbox + :onclick "${EWW_CMD} open music --toggle" + (image :path { pcover == "" ? "./image/emptympd.png" : pcover } :image-width 20 :image-height 20)) + (button :onclick "playerctl previous" + (label :class "picon" :text "󰒮")) + (button :onclick "playerctl play-pause" + (label :class "picon" :text { pstatus == "Playing" ? "" : "" })) + (button :onclick "playerctl next" + (label :class "picon" :text "󰒭")) + ))) + +(defwidget sliders [] + (box + :class "widget" + :orientation "v" + :space-evenly false + :spacing 5 + :valign "end" + (button :onclick "alacritty -e nmtui" :tooltip wifi_essid + (label :class "icon" :style "font-size: 18px;" :text wifi_icon)) + (reveal_on_hover + :revealval reveal1 + :revealvalstr "reveal1" + (box + :orientation "v" + :space-evenly false + :class "sound" + (label :class "icon" :text {volumemute == 'false' ? "󰕾" : "󰖁"}) + ;; {volumemute == 'no' ? volume : " Muted"}) + ) + (scale + :class "volslide" + :value volume + :onchange "pamixer --set-volume {}" + :orientation "v" + :tooltip "${volume}%" + :max 100 + :min 0 + :flipped true)) + (reveal_on_hover + :revealval reveal2 + :revealvalstr "reveal2" + (box + :orientation "v" + :space-evenly false + :class "bright" + (label :class "icon" :text "󰃞")) + (scale + :class "brislide" + :value brightness + :onchange "brightnessctl set {}%" + :orientation "v" + :tooltip "${brightness}%" + :max 100 + :min 0 + :flipped true)) + )) + +(defwidget reveal_on_hover [revealval revealvalstr ?class ?transition] + (box + :class "reveal_on_hover ${class}" + :orientation "v" + :space-evenly false + :valign "end" + (eventbox + :onhover "${EWW_CMD} update ${revealvalstr}=true" + :onhoverlost "${EWW_CMD} update ${revealvalstr}=false" + (box + :space-evenly false + :orientation "v" + (children :nth 0) + (revealer + :reveal revealval + :transition {transition ?:"slidedown"} + :duration "500ms" + (children :nth 1)))))) + +;; other windows +(defwindow calendar + :geometry (geometry :x "0" + :y "0" + :width "100" + :height "35" + :anchor "bottom left") + :stacking "overlay" + :monitor 0 + (box + :class "popup" + (box + :class "unbarwidget" + (calendar :day calendar_day :year calendar_year :class "cal")))) + +(defwindow music + :geometry (geometry :x "0" + :y "0" + :width "440" + :height "200" + :anchor "center left") + :stacking "overlay" :monitor 0 - :exclusive true - :geometry (geometry :x "0%" - :y "0%" - :height "99%" - :width "4%" - :anchor "center left") - :reserve (struts :side "top" :distance "4%") - (bar)) + (box + :class "popup" + (box + :orientation "h" + :class "unbarwidget" + :space-evenly false + :spacing 20 + (image :style "margin: 5px;" :image-height 190 :image-width 190 :path { pcover == "" ? "./image/emptympd.png" : pcover }) + (box + :orientation "v" + :space-evenly false + :width 210 + :height 200 + (scroll + :hscroll true + :vscroll false + (label :class "mtitle" :text psong)) + (scroll + :hscroll true + :vscroll false + (label :class "mauthor" :text partist)) + (box + :orientation "h" + :class "mpd_controls" + :style "margin-top: 10px;" + (button :onclick "playerctl previous" + (label :text "󰒮")) + (button :style "padding-right: 3px;" :onclick "playerctl play-pause" + (label :text { pstatus == "Playing" ? "" : ""} )) + (button :onclick "playerctl next" (label :text "󰒭"))) + (scale + :class "seektime" + :value { ptime.position } + :orientation "h" + ;; :onchange "playerctl position {}" + :min 0 + :max { ptime.duration } + :tooltip { ptime.readable })) + ))) diff --git a/hypr-configs/hyprland/eww/bottom_bar/bar.scss b/hypr-configs/hyprland/eww/bottom_bar/bar.scss new file mode 100644 index 0000000..6f15960 --- /dev/null +++ b/hypr-configs/hyprland/eww/bottom_bar/bar.scss @@ -0,0 +1,214 @@ + +.barwidget { + background-color: $base; + padding: 5px; +} + +.widget { + padding: 5px; + margin: 5px; + border-radius: 5px; + background-color: $surface0; + color: $white0; +} + +.icon { + font-size: 20px; + min-width: 1em; + min-height: 1em; + font-family: "Symbols Nerd Font"; + padding: 0px 2px; +} + +.largetouchicon { + font-size: 30px; + min-width: 1em; + min-height: 1em; + font-family: "Symbols Nerd Font"; + margin: 5px; + padding: 5px; + color: $white0; + background-color: $surface1; + border-radius: 5px; +} + +.workspaces { + padding: 5px; +} + +.workspacething, .workspacethingactive { + transition: 500ms ease; + border-radius: 5; + margin: 6px; +} + +.workspacething { + background-color: $surface2; +} + +.workspacethingactive { + background-color: $accent; +} + +.clock label { + font-size: 20px; + // font-weight: bold; +} + +.bat_scale { + trough { + min-height: 20px; + min-width: 50px; + border-radius: 5px; + slider { + all: unset; + } + highlight { + border-radius: 5px; + background-color: $accent; + } + } +} + +.charging trough highlight { + background-color: $green; +} + +.dying trough highlight { + background-color: $red; +} + +.lightning { + color: $surface0 +} + +// for the music popup +.mpd_controls label { + font-family: "Symbols Nerd Font"; + min-width: 1em; + min-height: 1em; + font-size: 30px; + padding: 15px; +} + +.seektime { + trough { + min-height: 10px; + min-width: 180px; + + slider { + background-color: $white2; + border-radius: 25px; + min-height: 20px; + min-width: 20px; + margin: -10px; + } + + highlight { + background-color: $accent; + } + } +} + +.sidempdctl { + margin: 5px; + label { + font-size: 30px; + padding-right: 5px; + min-height: 1em; + min-width: 1em; + } +} + +.mpdvolumeseek { + @extend .seektime; + trough { + min-height: 100px; + min-width: 10px; + highlight { + background-color: $white0; + } + } +} + +.mtitle { + color: $white0; + font-size: 20px; + margin-top: 30px; +} + +.sliderctl { + @extend .seektime; + trough { + min-height: 10px; + min-width: 350px; + } +} + +.cavascale { + all: unset; + trough { + all: unset; + border-radius: 24px; + min-height: 18px; + min-width: 5px; + margin: 1px; + highlight { + background-color: $white0; + border-radius: 24px; + } + slider { + all:unset; + } + } +} + +.icontitle { + min-width: 1em; + min-height: 1em; + margin: 5px; + padding: 5px; + label { + color: $white0; + margin: 0px 5px; + } + background-color: $surface1; + border-radius: 5px; +} + +.icontitlesel { + min-width: 1em; + min-height: 1em; + margin: 5px; + padding: 5px; + label { + color: $surface0; + margin: 0px 5px; + // font-weight: bold; + } + background-color: $accent; + border-radius: 5px; +} + +.launchicon { + @extend .icon; + color: $accent; +} + +.overbat { + all: unset; + trough { + min-height: 8px; + min-width: 10px; + border-radius: 0px; + padding: 0px 2px 1px 0px; + background-color: unset; + slider { + all: unset; + } + highlight { + // background-color: $white0; + border-radius: 0px; + } + } +} diff --git a/hypr-configs/hyprland/eww/bottom_bar/bar.yuck b/hypr-configs/hyprland/eww/bottom_bar/bar.yuck new file mode 100644 index 0000000..a0706de --- /dev/null +++ b/hypr-configs/hyprland/eww/bottom_bar/bar.yuck @@ -0,0 +1,215 @@ +(defwindow bar + :geometry (geometry + :x "0%" + :y "0%" + :width "100%" + :height 40 + :anchor "bottom center") + :exclusive true + :monitor 0 + :wm-ignore false + (barstruct)) + +(defwidget barstruct [] + ;; (box + ;; :orientation "v" + ;; :space-evenly false + (centerbox + :class "barwidget" + :orientation "h" + :height 60 + (left) + (middle) + (right)) + ;; (revealer + ;; :transition "slideup" + ;; :reveal revealcontrolpanel + ;; (box + ;; :class "barwidget" + ;; :orientation "h" + ;; :space-evenly false + ;; (box + ;; :orientation "v" + ;; :space-evenly false + ;; (user) + ;; (chooser)) + ;; (overview) + ;; (timer) + ;; (touchpad) + ;; ))) + ) + +(defwidget left [] + (box + :orientation "h" + :space-evenly false + :halign "start" + :valign "fill" + (home) + (workspaces) + ;; (cavapipe) + )) + +(defwidget middle [] + (box + :orientation "h" + :space-evenly false + :halign "center" + :valign "fill" + (tasklist :iconsize 42) + )) + +(defwidget right [] + (box + :orientation "h" + :space-evenly false + :halign "end" + :valign "fill" + (button :class "widget" :onclick "./scripts/touchkey.sh && ${EWW_CMD} update revealcontrolpanel=false" + (label :class "icon" :style "padding-left: 3px;" :text "󰌌")) + (playerctl) + (sysicons) + ;; (battery) + (clock) + )) + +(defwidget workspaces [] + (eventbox + :cursor "pointer" + (box + :class "workspaces widget" + :orientation "h" + :space-evenly false + (for i in {"[0, 1, 2, 3, 4]"} + (button + :onclick "swaymsg -t command workspace number ${workspacejson[i].name}" + (box + :hexpand false + :height 10 + ;; :width { workspace.focused ? 100 : !workspace.empty ? 80 : 50} + :class { workspacejson[i].focused ? "workspacethingactive" : "workspacething"} + :orientation "h" + :space-evenly false + (box + :width 50) + (revealer + :reveal { !workspacejson[i].empty || workspacejson[i].focused } + :transition "slideright" + (box + :width 30)) + (revealer + :reveal { workspacejson[i].focused } + :transition "slideright" + (box + :width 20)) + )))))) + +(defwidget clock [] + (box + :orientation "h" + :class "clock widget" + :space-evenly false + (button + :onclick "${EWW_CMD} update reveal1=${!reveal1} reveal2=false reveal3=false" + (label :text "${thour}:${tmin} ${tpm}")))) + +(defwidget sysicons [] + (box + :class "widget" + :valign "fill" + (button + :onclick "${EWW_CMD} update reveal1=false reveal2=${!reveal2} reveal3=false" + :class "icon" + (box + :orientation "h" + :space-evenly false + :spacing 5 + (label :tooltip wifi_essid :class "icon" :text wifi_icon) + (label :tooltip "${volume}%" :class "icon" :text {volumemute == 'false' ? "󰕾" : "󰖁"}) + (overlay + :tooltip "${bat0}%" + (label :class "icon" :text "") + (scale + :hexpand false + :orientation "h" + :active false + :min 0 + :max 100 + :value bat0 + :class "overbat ${EWW_BATTERY.BAT0.status == 'Charging' ? 'charging' : ''}")) + )))) + +(defwidget battery [] + (box + :orientation "h" + :space-evenly false + :class "widget" + (overlay + (scale + :class "${EWW_BATTERY.BAT0.status == 'Charging' ? 'charging': bat0 < 16 ? 'dying': 'normal'} bat_scale" + :value "${bat0}" + :orientation "h" + :max 100 + :min 0 + :flipped true + :active false) + (label + :class "lightning" + :visible {EWW_BATTERY.BAT0.status == "Charging"} + :text "󱐋")) + (label :text "${bat0}%"))) + +(defwidget playerctl [] + (overlay + (box + :halign "fill" + :width 150 + :class { pcover != "" ? "mpdcover" : "widget"} + :style "background-image: url('${pcover}')") + (box + ;; :class "widget" + :orientation "h" + :space-evenly false + :spacing 5 + :halign "center" + :valign "center" + (eventbox + :onclick "${EWW_CMD} update reveal1=false reveal2=false reveal3=${!reveal3}" + (image :path { pcover == "" ? "./image/emptympd.png" : pcover } :image-width 30 :image-height 30 :style "padding: 0px 5px;")) + (button :onclick "playerctl previous" + (label :class "icon" :text "󰒮")) + (button :onclick "playerctl play-pause" + (label :class "icon" :text { pstatus == "Playing" ? "" : "" })) + (button :onclick "playerctl next" + (label :class "icon" :text "󰒭")) + ))) + +(defwidget home [] + (box + :class "widget" + :hexpand false + :vexpand false + (eventbox + ;; :onclick "~/.config/eww/meowidgets/scripts/launch" + ;; :onclick "~/.config/eww/meowayland/scripts/launch" + ;; :onclick "./scripts/pop control" + :onclick "${EWW_CMD} update revealcontrolpanel=${ !revealcontrolpanel }" + :onrightclick "${EWW_CMD} open wallpaperselect --toggle" + :cursor "pointer" + (label :text "" :halign "center" :class "launchicon" :style "padding: 0px 4px;")))) + +;; (defwidget cavapipe [] +;; (box +;; :class "widget" +;; :orientation "h" +;; :space-evenly true +;; (for bar in {cavajson} +;; (scale +;; :class "cavascale" +;; :orientation "v" +;; :value bar +;; :min 0 +;; :max 100 +;; :flipped true)))) + +(include "./bottom_bar/sidectl.yuck") diff --git a/hypr-configs/hyprland/eww/bottom_bar/sidectl.yuck b/hypr-configs/hyprland/eww/bottom_bar/sidectl.yuck new file mode 100644 index 0000000..2db9e15 --- /dev/null +++ b/hypr-configs/hyprland/eww/bottom_bar/sidectl.yuck @@ -0,0 +1,272 @@ + +(defwindow sidectl1 + :geometry (geometry + :x "0%" + :y "0%" + :width 320 + :height 0 + :anchor "bottom right") + :monitor 0 + :stacking "overlay" + (revealer + :reveal reveal1 + :transition "slideup" + (box + :orientation "v" + :valign "end" + :space-evenly false + (box + :height 700 + :class "popup" + (notiweathertoggle)) + + (box + :class "popup" + (box + :class "unbarwidget" + (calendar + :day calendar_day + :year calendar_year + :class ""))) + ))) + +(defwindow sidectl2 + :geometry (geometry + :x 50 + :y 0 + :width 200 + :height 0 + :anchor "bottom right") + :monitor 0 + :stacking "overlay" + (revealer + :reveal reveal2 + :transition "slideup" + (box + :class "popup" + :orientation "v" + :space-evenly false + (box + :orientation "v" + :class "widget" + :spacing 20 + :space-evenly false + + (box + :orientation "v" + :height 150 + (box + :orientation "h" + (togglebuttons + :icon wifi_icon + :class {wifi_radio == "enabled" ? "icontitlesel" : "icontitle"} + :text {wifi_radio == "enabled" ? wifi_essid == "" ? "Disconnected" : "Connected" : "Off"} + :subtext { wifi_essid == "" ? "..." : wifi_essid} + :toggle {wifi_radio == "enabled" ? "nmcli radio wifi off" : "nmcli radio wifi on"}) + + (togglebuttons + :icon "" + :class {caffeine ? "icontitlesel" : "icontitle"} + :text "Caffeine" + :subtext {caffeine ? "on" : "off"} + :toggle {caffeine ? "swaymsg [app_id='.*'] inhibit_idle none && ${EWW_CMD} update caffeine=false" : "swaymsg [app_id='.*'] inhibit_idle open && ${EWW_CMD} update caffeine=true"})) + + (box + :orientation "h" + (togglebuttons + :icon "" + :class "icontitle" + :text "Theme" + :subtext theme + :toggle "${EWW_CMD} update reveal2=false && ~/.config/eww/themeswitch/scripts/pop") + + (togglebuttons + :icon "" + :class {notifications.dnd ? "icontitlesel" : "icontitle"} + :text "Do not disturb" + :subtext {notifications.dnd ? "on" : "off"} + :toggle "./scripts/notifManage --toggle") + )) + + (sliderctl :icon {volumemute == 'false' ? "󰕾" : "󰖁"} :value volume :onchange "pamixer --set-volume {}") + (sliderctl :icon "󰃞" :value brightness :onchange "brightnessctl set {}%") + + (box + :orientation "h" + :space-evenly false + :halign "end" + (overlay + (scale + :class "${EWW_BATTERY.BAT0.status == 'Charging' ? 'charging': bat0 < 16 ? 'dying': 'normal'} bat_scale" + :value "${bat0}" + :orientation "h" + :max 100 + :min 0 + :active false) + (label + :class "lightning" + :visible {EWW_BATTERY.BAT0.status == "Charging"} + :text "󱐋")) + (label :text "${bat0}%")) +)))) + +(defwidget togglebuttons [icon class text ?subtext toggle] + (button + :onclick toggle + (box + :orientation "h" + :class class + :space-evenly false + (label + :class "icon" + :halign "start" + :text icon) + (box + :orientation "v" + :hexpand true + :halign "center" + (label + :text text) + (label + :limit-width 17 + :text subtext))))) + +(defwidget sliderctl [icon value onchange] + (box + :orientation "h" + :space-evenly false + :hexpand true + :spacing 5 + + (label + :class "icon" + :text icon + :style "margin-left: 5px;") + + (scale + :class "sliderctl" + :orientation "h" + :value value + :tooltip "${value}%" + :min 0 + :max 100 + :onchange onchange))) + +(defwindow sidectl3 + :geometry (geometry + :x 150 + :y 0 + :width 440 + :height 0 + :anchor "bottom right") + :monitor 0 + :stacking "overlay" + (revealer + :reveal reveal3 + :transition "slideup" + (box + :class "popup" + (box + :orientation "h" + :class "unbarwidget" + :space-evenly false + :spacing 20 + (image :style "margin: 5px;" :image-height 190 :image-width 190 :path { pcover == "" ? "./image/emptympd.png" : pcover }) + (box + :orientation "v" + :space-evenly false + :width 210 + :height 200 + (scroll + :hscroll true + :vscroll false + (label :class "mtitle" :text psong)) + (scroll + :hscroll true + :vscroll false + (label :class "mauthor" :text partist)) + (box + :orientation "h" + :class "mpd_controls" + :style "margin-top: 10px;" + (button :onclick "playerctl previous" (label :text "󰒮")) + (button :onclick "playerctl play-pause" + (label :text { pstatus == "Playing" ? "" : ""} )) + (button :onclick "playerctl next" + (label :text "󰒭"))) + (scale + :class "seektime" + :value { ptime.position } + :orientation "h" + :onchange "playerctl position {}" + :min 0 + :max { ptime.duration } + :tooltip { ptime.readable })) + ;; (box + ;; :orientation "v" + ;; :space-evenly false + ;; :valign "center" + ;; :halign "end" + ;; :class "sidempdctl" + ;; (scale + ;; :value { pside.volume } + ;; :orientation "v" + ;; :class "mpdvolumeseek" + ;; :onchange "playerctl volume {}" + ;; :min 0 + ;; :max 100 + ;; :flipped true + ;; :tooltip "volume: ${pside.volume}") + ;; (button + ;; :onclick "playerctl shuffle toggle" + ;; (label + ;; :text {pside.shuffle == "true" ? "󰒝" : "󰒞"})) + ;; (button + ;; :onclick "playerctl loop ${pside.loop == 'Track' ? 'Playlist' : 'Track'}" + ;; (label + ;; :text {pside.loop == "Track" ? "󰑘" : "󰑖"})) + ;; ) + )))) + +(defwindow sidectl4 + :geometry (geometry + :x 0 + :y 0 + :width 340 + :height 0 + :anchor "bottom left" + ) + :stacking "overlay" + :monitor 0 + (revealer + :reveal revealcontrolpanel + :transition "slideup" + (box + :class "popup" + (control_widget :short true)))) + +(defwidget touchpad [] + (box + :class "unbarwidget" + :orientation "h" + :width 180 + (box + :orientation "h" + (box + :orientation "v" + (button :onclick "swaymsg floating toggle" + (label :class "largetouchicon" :text "󱟱")) + (button :onclick "foot -D ~" + (label :class "largetouchicon" :text "")) + (button :onclick "./scripts/pop scrop" + (label :class "largetouchicon" :text "󰆞")) + ) + (box + :orientation "v" + (button :onclick "swaymsg kill" + (label :class "largetouchicon" :text "󰅙")) + (button :onclick "${EWW_CMD} update revealcontrolpanel=false && (cd && wofi --show=drun -i -I)" + (label :class "largetouchicon" :text "󰀻")) + (button :onclick "./scripts/touchkey.sh && ${EWW_CMD} update revealcontrolpanel=false" + (label :class "largetouchicon" :text "󰌌")) + )))) diff --git a/hypr-configs/hyprland/eww/central/central.scss b/hypr-configs/hyprland/eww/central/central.scss deleted file mode 100644 index 077a184..0000000 --- a/hypr-configs/hyprland/eww/central/central.scss +++ /dev/null @@ -1,242 +0,0 @@ -.central-widget { - @include window; - background-color: $bg; - color: $fg; - padding: 1rem; -} - -.profile { - background-color: $bg-alt; - background-repeat: no-repeat; - background-size: cover; - background-position: center; - min-height: 4rem; - min-width: 4rem; - border-radius: .4rem; -} - -.name { - color: $fg; - font-weight: bolder; -} - -.wm { - color: $fg-alt; - font-weight: bold; -} - -.lock, .exit { - font-size: 1.2rem; - background-color: $bg-alt; - padding: .7rem 1.2rem .7rem 1rem; - border-radius: .4rem; -} - -.system-info { - background-color: $bg-alt; -} - - -.music { - background-color: $bg-alt; - - border-radius: .4rem; - padding: .8rem; -} - -.player { - font-family: "JetBrainsMono Nerd Font"; - min-height: 1rem; - border-radius: .1rem; - margin: .1rem .8rem; -} - -.player-art { - background-color: $bg-alt; - background-repeat: no-repeat; - background-size: cover; - background-position: center; - min-height: 4rem; - min-width: 4rem; - border-radius: .4rem; -} - -.player-info { - border-radius: .4rem; - -} - -.player-title { - font-size: 1rem; - padding: .1rem 0; - font-weight: bolder; -} - -.player-artist { - color: $white; - padding: .2rem 0; -} - -.player-bar scale trough highlight { - background-image: linear-gradient(to right, $bg-alt, $green); - border-radius: .4rem; -} - -.player-bar scale trough { - all: unset; - background-color: rgba($fg-alt, 0.3); - box-shadow: 0px 0px 2px 1px rgba(0, 0, 0, 0.5); - border-radius: .4rem; - min-height: .25rem; - min-width: 18rem; - margin: .2rem 0; -} - -.player-position { - font-size: .9rem; - font-weight: 500; - color: $fg-alt; -} - -.player-controls { - font-size: 5rem; - background-color: $bg-alt; -} - -.player-toggle { - font-size: 1.4rem; - color: $fg; -} - -.player-previous, -.player-next { - font-size: 1.2rem; - color: $fg-alt; -} - -.player-toggle:hover, -.player-previous:hover, -.player-next:hover { - color: $green; -} - -.player-shuffle, -.player-loop { - font-size: 1rem; -} - -.spotify-icon { - font-family: "Font Awesome 6 Brands"; - font-size: 1.25rem; - color: $green; - border-radius: .4rem; -} -.box-control { - background-color: $bg-alt; - padding: 1.5rem; - margin: 1rem 1.5rem; - border-radius: .4rem; - -} - -.time { - font-size: 4rem; -} - -.date { - font-size: 1.3rem; -} - -.timeboxes { - font-size: .6rem; - margin: -.1rem 0; - - .magenta { - color: $magenta; - } - - .green { - color: $green; - } - - .yellow { - color: $yellow; - } -} - - -.calendar { - font-size: 1.1rem; - font-weight: 500; - background-color: $bg-alt; - border-radius: .4rem; - padding: .4rem; - - calendar { - - &.button { - color: $fg-alt; - - &:hover { - background-color: $black; - border-radius: 1rem; - } - } - - &:selected { - color: $green; - text-shadow: 0 0 3px lighten($color: $bg-alt, $amount: 10%); - border-radius: 1rem; - } - - &.header { - background-color: transparent; - border: none; - } - - &.highlight { - color: $green; - } - - &:indeterminate { - color: $gray; - } - } - } - - .system { - .progress { - background-color: $bg-alt; - padding: .4rem; - border-radius: .4rem; - - circular-progress { - background-color: $black; - - &.ram { - color: $magenta; - } - - &.cpu { - color: $yellow; - label { margin-left: 1px;} - } - - &.temp { - color: $red; - label { margin: .2rem .5rem .2rem .2rem;} - - } - - &.disk { - color: $green; - } - } - } - - .icon { - font-size: 1.2rem; - padding: 1.2rem; - } - - } diff --git a/hypr-configs/hyprland/eww/central/central.yuck b/hypr-configs/hyprland/eww/central/central.yuck deleted file mode 100644 index 75adf2e..0000000 --- a/hypr-configs/hyprland/eww/central/central.yuck +++ /dev/null @@ -1,273 +0,0 @@ -(defwidget central [] - (box :class "central-widget" :space-evenly false :orientation "v" :spacing 10 - (box-profile) - (box-calendar) - (box-system) - (music) - ) -) - -(defwidget box-profile [] - (box - :class "box-profile" - :space-evenly false - :hexpand false - :spacing 10 - (box :class "profile" - :style "background-image: url('${perfil}')" - :valign "start" - ) - (box - :class "box-about" - :halign "start" - :spacing 5 - (box - :orientation "v" :space-evenly false :halign "start" - (label :class "name" :halign "start" :text {name}) - (label :class "wm" :halign "start" :text {wm}) - (box - (label :class "uptime" :text `Uptime: ${uptime}`) - ))) - (box - :halign "end" - :valign "center" - :hexpand true - :spacing 10 - (eventbox - :cursor "pointer" - (button - :class "lock" - :onclick "poweroff&" - "" - )) - (eventbox - :cursor "pointer" - (button - :class "exit" - :onclick "eww open --toggle powercontrol && eww close central" - "⏻" - ))))) - -(defwidget box-system [] - (box - :class "system" - :spacing 10 - (ram) - (cpu) - (temp) - (disk) - ) -) - -(defwidget system_progress [data icon css tip] - (box - :class "progress" - (circular-progress - :class css - :value data - :thickness 7 - :tooltip tip - (overlay - :valign "center" - (label - :class "icon" - :text icon - ) - ) - ) - ) -) - - -(defwidget cpu [] - (system_progress - :css "cpu" - :tip "CPU ${round(EWW_CPU.avg,0)}%" - :data {round(EWW_CPU.avg, 0)} - :icon "󰻠" - ) -) - -(defwidget ram [] - (system_progress - :css "ram" - :tip "RAM ${round(EWW_RAM.used_mem / 1048576, 2)}MB" - :data {round(EWW_RAM.used_mem_perc, 0)} - :icon "󰍛" - ) -) - -(defwidget temp [] - (system_progress - :css "temp" - :tip "Temperature ${EWW_TEMPS["AMDGPU_EDGE"]}°C" - :data {round(EWW_TEMPS.AMDGPU_EDGE, 0)} - :icon "󰔄" - ) -) - -(defwidget disk [] - (system_progress - :css "disk" - :tip "SSD ${round(EWW_DISK["/"].used_perc, 2)}%" - :data {round(EWW_DISK["/"].used_perc, 0)} - :icon "󰗮" - ) -) - - -(defwidget music [] - (box - :class "music" - :space-evenly false - :spacing 15 - :halign "start" - (box - :class "player-art" - :style "background-image: url('${music-art}')" - ) - (box - :class "player-info" - :space-evenly false - :orientation "v" - (label :class "player-title" :halign "start" :valign "center" :text music-title :limit-width 30 ) - (label :class "player-artist" :halign "start" :valign "center" :text music-artist :limit-width 30 ) - (box - :space-evenly false - :orientation "v" - :valign "end" - (box - :class "player-bar" - :halign "center" - :valign "end" - :hexpand true - (eventbox - :cursor "pointer" - (scale - :onchange "playerctl -p spotify position {}" - :min 0 - :max music-lengths - :value music-positions - ) - ) - ) - (box - :class "player-position" - :space-evenly true - :valign "start" - - (label - :class "player-time" - :halign "start" - :text "${music-position} / ${music-length}" - ) - (box - :class "player-controls" - :valign "center" - :space-evenly false - :halign "end" - :spacing 10 - (eventbox - :cursor "pointer" - (button - :class "player-previous" - :onclick "scripts/mediacontrol --previous" - "" - ) - ) - (eventbox - :cursor "pointer" - (button - :class "player-toggle" - :onclick "scripts/mediacontrol --toggle" - music-toggle - ) - ) - (eventbox - :cursor "pointer" - (button - :class "player-next" - :onclick "scripts/mediacontrol --next" - "" - ) - ) - ) -) - ) - ) - ) -) - -(defwidget box-calendar [] - (box - :class "calendar-main-box" - :space-evenly false - :orientation "v" - :spacing 20 - (box - :class "date" - :space-evenly false - :orientation "v" - (box - :space-evenly false - :halign "center" - :spacing 10 - (label - :class "time" - :text hour) - (box - :class "timeboxes" - :space-evenly false - :valign "center" - :orientation "v" - :spacing 5 - (box - :class "timebox-1" - "󰝤" - ) - (box - :class "timebox green" - "󰝤" - ) - ) - (label - :class "time" - :text minute - ) - ) - (box - :halign "center" - :valign "start" - (label - :class "today" - :text date - ) - ) - ) - (box - :class "cal" - :orientation "v" - (box - :class "cal-inner-box" - (calendar - :class "calendar" - :day calendar-day - :month calendar-month - :year calendar-year - :show-day-names true - :show-heading true - :show-details true - ) - ) - ) - ) -) - -(defwindow central - :monitor 0 - :geometry (geometry :x "-1%" - :y "0%" - :height "85%" - :anchor "center left") - :reserve (struts :side "top" :distance "4%") - (central)) diff --git a/hypr-configs/hyprland/eww/colors.scss b/hypr-configs/hyprland/eww/colors.scss new file mode 100644 index 0000000..e1e86ab --- /dev/null +++ b/hypr-configs/hyprland/eww/colors.scss @@ -0,0 +1 @@ +@import "./themes/oxocarbon.scss" diff --git a/hypr-configs/hyprland/eww/control_panel/control_panel.scss b/hypr-configs/hyprland/eww/control_panel/control_panel.scss new file mode 100644 index 0000000..9500c5e --- /dev/null +++ b/hypr-configs/hyprland/eww/control_panel/control_panel.scss @@ -0,0 +1,167 @@ + +.controlpanelwindow { + background-color: $base; + padding: 5px; +} + +.userinfo label { + font-size: 18px; + color: $white0; +} + +.titlesel { + font-size: 20px; + // font-weight: bold; + margin: 5px; + padding: 5px; + color: $base; + background-color: $accent; + border-radius: 5px; +} + +.title { + font-size: 20px; + margin: 5px; + padding: 5px; + color: $white0; + background-color: $surface1; + border-radius: 5px; +} + +.tricontrol label { + @extend .title; + font-size: 22px; + font-family: "Symbols Nerd font"; + padding: 5px; +} +.timer { + font-size: 40px; +} + +.timer_butt button { + background-color: $accent; + margin: 5px; + padding: 10px; + border-radius: 5px; +} + +.timer_butt label { + color: $base; + font-size: 20px; +} + +.bigslide trough { + border-radius: 5px; + margin: 5px; + min-width: 60px; + background-color: $surface1; + slider { + all: unset; + min-width: 20px; + min-height: 20px; + } +} + +.bigslide trough highlight{ + background-color: $surface2; + border-radius: 5px; +} + +.slideicon { + min-width: 1em; + min-height: 1em; + font-family: "Symbols Nerd Font"; + font-size: 30px; + margin-bottom: 15px; +} + +.unbarwidget { + padding: 5px; + border-radius: 5px; + background-color: $surface0; + margin: 5px; + color: $white0; +} + +.quoteauthor { + color: $white0; + font-size: 14px; + margin: 5px; +} + +.quote { + // color: $light_blue; + font-size: 18px; + margin: 5px; +} + +.coolmpd label { + color: $white0; +} + +.mpdcover { + transition: 500ms ease; + background-color: $surface0; + margin: 5px; + border-radius: 5px; + background-repeat: no-repeat; + background-size: cover; + background-position: center; + opacity: 0.3; +} + +.circiconcontain { + border-radius: 70px; + background-color: $surface0; +} + +.circiconcontain label { + font-family: "Symbols Nerd Font"; + font-size: 30px; + min-width: 1em; + min-height: 1em; + border-radius: 70px; + color: $white0; +} + +.circsys { + color: $accent; + background-color: $surface1; +} + +.revcal { + font-size: 13px; +} + +.wmctrlslide { + trough { + min-width: 160px; + min-height: 10px; + slider { + background-color: $white2; + min-height: 15px; + min-width: 15px; + margin: -10px; + border-radius: 25px; + } + } +} + +.fadeoutbox { + background-image: linear-gradient(180deg, transparent, $surface0); + border-radius: 5px; +} + +// stupid window overview thing +.overviewworkspace { + background-color: $surface1; + border-radius: 5px; +} + +.overviewwindow { + background-color: $base; + border-radius: 5px; + border-style: solid; + border-color: $surface2; + border-width: 2px; +} diff --git a/hypr-configs/hyprland/eww/control_panel/control_panel.yuck b/hypr-configs/hyprland/eww/control_panel/control_panel.yuck new file mode 100644 index 0000000..2c78638 --- /dev/null +++ b/hypr-configs/hyprland/eww/control_panel/control_panel.yuck @@ -0,0 +1,503 @@ +(defwindow control_panel + :geometry (geometry + :x 10 + :y 10 + :width 340 + :height 1000 + :anchor "top left" + ) + :stacking "overlay" + :monitor 0 + (control_widget)) + +(defwidget control_widget[?short] + (box + :class "controlpanelwindow" + :space-evenly false + :orientation "v" + :valign "fill" + :vexpand true + (user) + (chooser) + ;; (weather) + (coolmpd :h 150 :permashow true) + (box + :orientation "h" + :space-evenly false + :height 160 + :halign "fill" + (timer) + (bigslide)) + (box + :space-evenly false + :orientation "v" + :vexpand true + :visible {!short} + (tricontrol) + (notiweathertoggle)) + )) + +(defwidget tricontrol[] + (eventbox + :cursor "pointer" + (box + :class "tricontrol unbarwidget" + :orientation "h" + :space-evenly true + :height 60 + :halign "fill" + (button :onclick "./scripts/pop colourpick" (label :text "󰈊")) + (button :onclick "./scripts/pop scrop" (label :text "󰆞")) + (button :onclick "~/.config/eww/themeswitch/scripts/pop" (label :text ""))))) + +(defwidget chooser [] + (box + :orientation "v" + :halign "fill" + :height 60 + :class "unbarwidget" + :space-evenly false + (box + :orientation "h" + + (button + :onclick "${EWW_CMD} update reveal4=${!reveal4} reveal5=false reveal6=false" + :onrightclick "foot nvim ~/Documents/fuck.txt" + (label :class {reveal4 ? "titlesel" : "title"} :text "Notes")) + (button + :onclick "${EWW_CMD} update reveal5=${!reveal5} reveal4=false reveal6=false" + (label :class {reveal5 ? "titlesel" : "title"} :text "System")) + (button + :onclick "${EWW_CMD} update reveal6=${!reveal6} reveal5=false reveal4=false" + (label :class {reveal6 ? "titlesel" : "title"} :text "Sway"))) + + (notes) + (sysinfo) + (wmctrl))) + + +(defwidget notes [] + (revealer + :reveal reveal4 + :transition "slideup" + (box + :height 140 + (box + :orientation "h" + (scroll + :hscroll true + :vscroll true + (label :text notesc)))))) + +(defwidget wmctrl [] + (revealer + :reveal reveal6 + :transition "slideup" + (scroll + :hscroll false + :vscroll true + :height 140 + (box + :orientation "v" + :valign "fill" + :space-evenly false + :spacing 5 + (wmslider + :name "gaps outer" + :val gapsouter + :onchange "swaymsg gaps outer all set {}" + :max 300 + :reset "${EWW_CMD} update gapsouter=0 && swaymsg gaps outer all set 0") + (wmslider + :name "gaps inner" + :val gapsinner + :onchange "swaymsg gaps inner all set {}" + :max 150 + :reset "${EWW_CMD} update gapsinner=15 && swaymsg gaps inner all set 15") + (wmslider + :name "border size" + :val borderpixel + :onchange "swaymsg default_border pixel {} && swaymsg '[app_id=\".*\"] border pixel {}'" + :max 50 + :reset "${EWW_CMD} update borderpixel=2 && swaymsg default_border pixel 2 && swaymsg '[app_id=\".*\"] border pixel 2'") + (box + :orientation "h" + :space-evenly false + :halign "center" + :spacing 10 + (label :text "natural scrolling") + (checkbox + :onchecked "swaymsg input \"type:touchpad\" natural_scroll enable" + :onunchecked "swaymsg input \"type:touchpad\" natural_scroll disable")) + (box + :orientation "h" + :space-evenly false + :halign "center" + :spacing 10 + (label :text "disable when typing") + (checkbox + :onchecked "swaymsg input \"type:touchpad\" dwt enable" + :onunchecked "swaymsg input \"type:touchpad\" dwt disable" + )) + + (box + :orientation "h" + :space-evenly false + :halign "center" + :spacing 10 + (label :text "caffeine") + (checkbox + :onchecked "swaymsg [app_id='.*'] inhibit_idle open && ${EWW_CMD} update caffeine=true" + :onunchecked "swaymsg [app_id='.*'] inhibit_idle none && ${EWW_CMD} update caffeine=false" + )) +)))) + +(defwidget sysinfo [] + (revealer + :reveal reveal5 + :transition "slideup" + (box + :orientation "h" + :height 140 + (systat :icon "󰻠" :val { EWW_CPU.avg }) + (systat :icon "󰍛" :val { EWW_RAM.used_mem_perc }) + (systat :icon "" :val { EWW_BATTERY.BAT0.capacity }) + ))) + +(defwidget wmslider [name val onchange max reset] + (box + :orientation "h" + :space-evenly false + :halign "center" + :width 20 + :vexpand false + :valign "center" + :spacing 10 + (label + :text name) + (scale + :min 0 + :max max + :class "wmctrlslide" + :tooltip val + :value val + :onchange onchange) + (button + :onclick reset + :style "padding: 0px 8px 0px 3px;" + ""))) + +(defwidget systat [icon val] + (overlay + (circular-progress + :halign "center" + :valign "center" + :class "circsys" + :thickness 40 + :value val) + + (box + :class "circiconcontain" + :halign "center" + :valign "center" + :height 55 + :width 55 + (label :text icon)))) + +(defwidget user[] + (revealer + :reveal {!reveal4 && !reveal5 && !reveal6} + :transition "slideup" + (box + :orientation "h" + :space-evenly false + :height 140 + :width 320 + :class "unbarwidget" + :valign "start" + :halign "fill" + :hexpand true + (image :style "margin: 10px;" :image-width 80 :image-height 80 :path "./image/fieshidle.gif") + (scroll + :hscroll true + :vscroll false + :hexpand true + (box + :orientation "v" + :class "userinfo" + :space-evenly false + :valign "center" + :halign "center" + (label :halign "start" :text "${datehour < 12 ? 'Good morning' : datehour < 18 ? 'Good afternoon' : datehour < 22 ? 'Good evening' : 'Good night'} ${hostname}") + (label :halign "start" :text uptime :style "font-size: 12px;")))))) + +(defwidget notiweathertoggle[] + (box + :orientation "v" + :halign "fill" + :valign "fill" + :vexpand true + :class "unbarwidget" + :space-evenly false + (box + :orientation "h" + (button + :onclick "${EWW_CMD} update revealweather=false" + (label :class {!revealweather ? "titlesel" : "title"} :text "Notifications")) + (button + :onclick "${EWW_CMD} update revealweather=true" + (label :class {revealweather ? "titlesel" : "title"} :text "Weather"))) + + (box + :orientation "h" + :vexpand true + :hexpand true + :space-evenly false + (revealer + :reveal {!revealweather} + :transition "slideright" + (notificationlog)) + (revealer + :reveal revealweather + :transition "slideleft" + (weather))))) + +(defwidget weather[] + (overlay + (box + :orientation "v" + :halign "fill" + :valign "fill" + :width 320 + :vexpand true + :space-evenly false + (weathermain) + (scroll + :hscroll false + :vscroll true + :vexpand true + (box + :orientation "v" + :valign "start" + :space-evenly false + (for hour in {weatherjson.hourly} + (weatherhour :hour hour))))) + (box + :valign "end" + :hexpand true + :vexpand false + :height 80 + :class "fadeoutbox") + )) + +(defwidget weatherhour[hour] + (box + :class "smallentry" + :orientation "h" + :height 80 + :halign "fill" + :valign "center" + :vexpand false + :space-evenly true + :spacing 10 + (label :style "font-size: 20px;" :text {hour.time}) + (image + :image-width 50 + :image-height 50 + :path "./image/weather/${hour.icon}.svg") + (box + :orientation "v" + :space-evenly false + :valign "center" + :spacing 10 + (label :halign "start" :text "${hour.FeelsLikeC}°C") + (label :halign "start" :text "rain: ${hour.chanceofrain}%")))) + +(defwidget weathermain[] + (box + :class "mainentry" + :orientation "h" + :halign "fill" + :height 150 + :space-evenly false + :spacing 10 + (image + :image-width 100 + :image-height 100 + :style "margin: 10px;" + :path "./image/weather/${weatherjson.icon}.svg") + (scroll + :hscroll true + :vscroll false + :valign "fill" + :hexpand true + (box + :orientation "v" + (label :halign "start" :text {weatherjson.weatherDesc[0].value}) + (label :halign "start" :text "Feels like ${weatherjson.FeelsLikeC}°C") + (label :halign "start" :text "← ${weatherjson.windspeedKmph} km/h") + ;; (label :halign "start" :text "${weatherjson.visibility} km") + ;; (label :halign "start" :text "${weatherjson.precipMM} mm") + )))) + +(defwidget timer[] + (box + :orientation "v" + :class "unbarwidget" + :space-evenly false + :width 180 + :valign "fill" + (label :class "timer" :valign "center" :vexpand true :text timerdis) + (box + :orientation "h" + :class "timer_butt" + :valign "end" + (button :onclick "./scripts/timer.py timedec" (label :text "-")) + (button :onclick "./scripts/timer.py toggle" (label :style "padding-right: 3px;" :text { !matches(timerdis, ":") ? "󱎫" : "󱫎"})) + (button :onclick "./scripts/timer.py timeinc" (label :text "+"))))) + +(defwidget bigslide [] + (box + :valign "fill" + :halign "fill" + :class "unbarwidget" + :hexpand true + :space-evenly true + (bigvol) + (bigbright))) + +(defwidget bigvol [] + (overlay + (scale + :width 50 + :class "bigslide" + :value volume + :onchange "pamixer --set-volume {}" + :orientation "v" + :tooltip "${volume}%" + :max 100 + :min 0 + :flipped true) + (label + :class "slideicon" + :valign "end" + :text {volumemute == 'false' ? "󰕾" : "󰖁"}))) + +(defwidget bigbright [] + (overlay + (scale + :width 50 + :class "bigslide" + :value brightness + :onchange "brightnessctl set {}%" + :orientation "v" + :tooltip "${brightness}%" + :max 100 + :min 0 + :flipped true) + (label + :class "slideicon" + :valign "end" + :text "󰃞"))) + +(defwidget notificationlog [] + (box + :halign "fill" + :valign "fill" + :width 320 + :vexpand true + :space-evenly false + :orientation "v" + (overlay + :vexpand true + (scroll + :hscroll false + :vscroll true + :vexpand true + :valign "fill" + (box + :orientation "v" + :valign "start" + :space-evenly false + (for noti in {notifications.notifications} + (singlenotif :noti noti :initial false)))) + + (box + :valign "end" + :hexpand true + :vexpand false + :height 80 + :class "fadeoutbox")) + (box + :orientation "h" + (button + :onclick "./scripts/notifManage --clear" + (label + :class "title" + :text "Clear All")) + (button + :onclick "./scripts/notifManage --toggle" + (label + :class { notifications.dnd ? "titlesel" : "title"} + :text "Do Not Disturb"))))) + +(defwidget quote [] + (box + :class "quotewid unbarwidget" + :halign "fill" + :valign "fill" + :vexpand true + :space-evenly false + :orientation "v" + (scroll :vexpand true :hscroll true :vscroll true + (label + :class "quote" + :text {quotejson.content} + :wrap true + :width 300)) + (label + :class "quoteauthor" + :text "- ${quotejson.author}"))) + +(defwidget coolmpd [h permashow] + (overlay + (box + :orientation "v" + :halign "fill" + :height h + :class { pcover != "" ? "mpdcover" : "unbarwidget"} + :style "background-image: url('${pcover}')" + :visible {permashow ? true : pcover != "" }) + (box + :orientation "h" + :space-evenly false + :halign "center" + :valign "center" + :spacing 10 + (image :image-width 100 :image-height 100 :path { pcover == "" ? "./image/emptympd.png" : pcover }) + (box + :orientation "v" + :space-evenly false + :width 200 + :halign "center" + :valign "center" + :class "coolmpd" + (scroll + :hscroll true + :vscroll false + (label :style "font-size: 20px;" :text psong)) + (scroll + :hscroll true + :vscroll false + (label :text partist)) + (box + :orientation "h" + :class "mpd_controls" + (button :onclick "playerctl previous" + (label :text "󰒮")) + (button :style "padding-right: 3px;" :onclick "playerctl play-pause" + (label :text { pstatus == "Playing" ? "" : ""} )) + (button :onclick "playerctl next" + (label :text "󰒭"))))))) + +(include "./control_panel/windowswitcher.yuck") diff --git a/hypr-configs/hyprland/eww/control_panel/windowswitcher.yuck b/hypr-configs/hyprland/eww/control_panel/windowswitcher.yuck new file mode 100644 index 0000000..9449efd --- /dev/null +++ b/hypr-configs/hyprland/eww/control_panel/windowswitcher.yuck @@ -0,0 +1,58 @@ + +;; Credits to T0kyob0y + +(defwidget overview[] + (box + :space-evenly false + :class "unbarwidget" + :orientation "h" + :hexpand true + (scroll + :hscroll true + :vscroll false + :hexpand true + (box + :orientation "h" + :space-evenly true + :spacing 10 + (for i in {[0, 1, 2, 3, 4]} + (button + ;; :ondropped "notify-send 'real'" + :onclick "${EWW_CMD} update revealcontrolpanel=false && swaymsg -t command workspace number ${i+1}" + ;; :onclick "swaymsg -t command workspace number ${i+1}" + (box + :class "overviewworkspace" + :space-evenly false + ;; :height {round(1080/5.8, 0)} + :vexpand true + :width {round(1920/5.8, 0)} + (for j in {windows[i]} + (windowapp :w j) + )) + )))))) + +(defwidget windowapp [w] + (box + :style " + margin-left: ${round(((w.rect.x)/5.8), 0)}px; + margin-top: ${round(w.rect.y/5.8, 0)}px; + margin-right: -${round((w.rect.x + w.rect.width)/5.8, 0)}px; + margin-bottom: -${round(((w.rect.y + w.rect.height)/5.8), 0)}px; + " + :hexpand false + :vexpand false + :halign "start" + :valign "start" + :class "overviewwindow" + (eventbox + :valign "center" + :halign "center" + :dragvalue "${w.pid}" + :dragtype "text" + (image + :valign "center" + :halign "center" + :image-height {round(w.rect.width/5.8 * 45/100, 0)} + :image-width {round(w.rect.height/5.8 * 45/100, 0)} + :path {w.path} + )))) diff --git a/hypr-configs/hyprland/eww/dashboard/dashboard.scss b/hypr-configs/hyprland/eww/dashboard/dashboard.scss new file mode 100644 index 0000000..520ab90 --- /dev/null +++ b/hypr-configs/hyprland/eww/dashboard/dashboard.scss @@ -0,0 +1,20 @@ + +.heading { + font-size: 25px; + color: $accent; + margin: 5px; +} + +.dmpdcontrol { + margin: 10px; +} + +.dmpdcontrol label { + font-size: 20px; + margin: 0px 8px; +} + +.dicons label { + font-size: 25px; + margin-right: 6px; +} diff --git a/hypr-configs/hyprland/eww/dashboard/dashboard.yuck b/hypr-configs/hyprland/eww/dashboard/dashboard.yuck new file mode 100644 index 0000000..5374bc4 --- /dev/null +++ b/hypr-configs/hyprland/eww/dashboard/dashboard.yuck @@ -0,0 +1,160 @@ + +;; Dashboard design is made by tsukki9696 +(defwindow dashboard + :geometry (geometry + :x 0 + :y 0 + :width 800 + :height 420 + :anchor "center") + :stacking "overlay" + :monitor 0 + (structure)) + +(defwidget structure[] + (box + :class "popup" + :space-evenly false + :orientation "v" + (duser :name "Failed" :tag "failed.sh" :pfp "./image/roundpfp.png") + (box + :space-evenly true + :orientation "h" + :vexpand true + (box + :space-evenly false + :orientation "v" + (coolmpd :h 150 :permashow true) + (box + :space-evenly false + :orientation "h" + (box + :width 130 + :space-evenly false + :orientation "v" + (dbutt) + (theme)) + (dcal) + )) + (box + :orientation "v" + :space-evenly false + (dnotes) + (quote)) + ))) + +(defwidget duser [name tag pfp] + (box + :orientation "h" + :space-evenly false + :halign "start" + :hexpand true + :class "unbarwidget" + :style "background-color: inherit;" + :spacing 15 + (image :image-width 50 :image-height 50 :path pfp) + (label :text "|" :style "color: #262626; font-size: 30px;") + (box + :orientation "v" + :space-evenly true + :halign "start" + (label :style "font-weight: bold; font-size: 18px;" :text "Hello, ${name}") + (label :halign "start" :text tag)))) + +(defwidget dnotes [] + (box + :class "notes unbarwidget" + :space-evenly false + :orientation "v" + :vexpand true + (label :class "heading" :text "Agenda") + (box + :vexpand true + :width 350 + (scroll + :hscroll true + :vscroll true + (label :style "font-size: 16px;" :text notesc))))) + +(defwidget dmpd [] + (overlay + (box + :class "mpdcover" + :style "background-image: url('${pcover}')" + :height 150) + (box + :orientation "v" + :space-evenly false + :spacing 10 + :valign "center" + (scroll + :hscroll true + :vscroll false + (label :style "font-size: 18px;" :text psong)) + (scroll + :hscroll true + :vscroll false + (label :text partist)) + ;; (scale + ;; :hexpand false + ;; :width 60 + ;; :class "seektime" + ;; :value current + ;; :orientation "h" + ;; :min -5 + ;; :max 100 + ;; :onscroll "mpc -q seek +1" + ;; :tooltip "${ctime}/${ttime}") + (box + :orientation "h" + :space-evenly false + :spacing 40 + :halign "center" + :class "dmpdcontrol" + (button :onclick "./scripts/music_info --prev" (label :text "󰒮")) + (button :onclick "./scripts/music_info --toggle" (label :text { pstatus == "Playing" ? "" : ""})) + (button :onclick "./scripts/music_info --next" (label :text "󰒭")))))) + +(defwidget dcal [] + (box + :class "unbarwidget mincal" + :height 190 + :hexpand true + (calendar + :show-details false + :show-heading true + :show-day-names false + :show-week-numbers false + :day calendar_day + :year calendar_year))) + +(defwidget dbutt[] + (box + :space-evenly true + :orientation "h" + :height 130 + (box + :space-evenly true + :orientation "v" + (button :class "dicons unbarwidget" :onclick "notify-send 'shutdown' 'but its impractical'" (label :text "")) + (button :class "dicons unbarwidget" :onclick "notify-send 'restart' 'but its impractical'" (label :text ""))) + (box + :space-evenly true + :orientation "v" + (button :class "dicons unbarwidget" :onclick "notify-send 'lock' 'but its impractical'" (label :text "")) + (button :class "dicons unbarwidget" :onclick "notify-send 'log out' 'but its impractical'" (label :text "󰍃"))))) + +(defwidget theme [] + (button + :class "unbarwidget" + :vexpand true + :onclick "./scripts/toggletheme toggle" + (label :style "font-size: 18px;" :text ""))) + +;; (defwidget dquote [] +;; (box +;; :class "unbarwidget" +;; :height "120" +;; :valign "center" +;; (literal +;; :content quoteliteral))) diff --git a/hypr-configs/hyprland/eww/desktop/desktop.scss b/hypr-configs/hyprland/eww/desktop/desktop.scss new file mode 100644 index 0000000..453f1fd --- /dev/null +++ b/hypr-configs/hyprland/eww/desktop/desktop.scss @@ -0,0 +1,11 @@ + +.desktoptext { + font-size: 18px; + color: $white0; + text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; +} + +.desktopbox:hover { + border: solid 2px; + border-color: $surface2; +} diff --git a/hypr-configs/hyprland/eww/desktop/desktop.yuck b/hypr-configs/hyprland/eww/desktop/desktop.yuck new file mode 100644 index 0000000..d45cdad --- /dev/null +++ b/hypr-configs/hyprland/eww/desktop/desktop.yuck @@ -0,0 +1,41 @@ +(defwindow desktopicons + :geometry (geometry + :x 20 + :y 20 + :width 100 + :height 600 + :anchor "top right") + :stacking "bottom" + :monitor 0 + (box + :orientation "v" + :space-evenly "false" + :spacing 10 + + (eventbox + :dragtype "file" + :class "desktopbox" + :onclick "thunar ${homedir}/.local/share/Trash/files" + :ondropped "notify-send {}" + (box + :orientation "v" + :space-evenly false + :height 100 + :valign "end" + (image :width 100 :height 100 :image-width 80 :image-height 80 :path trashcanpath) + (label :class "desktoptext" :text "Trash"))) + + (for i in '["amogus"]' + (imagesicon :name i)))) + +(defwidget imagesicon [name] + (eventbox + :onclick "feh ./image/desktop/${name}.png" + :class "desktopbox" + (box + :orientation "v" + :space-evenly false + :height 100 + :valign "end" + (image :width 100 :height 100 :image-width 80 :image-height 80 :path "./image/desktop/${name}.png") + (label :class "desktoptext" :text "${name}.png")))) diff --git a/hypr-configs/hyprland/eww/dock/dock.scss b/hypr-configs/hyprland/eww/dock/dock.scss new file mode 100644 index 0000000..2acf7c1 --- /dev/null +++ b/hypr-configs/hyprland/eww/dock/dock.scss @@ -0,0 +1,6 @@ + +.dockindicate { + transition: 500ms ease; + background-color: $white0; + border-radius: 5px; +} diff --git a/hypr-configs/hyprland/eww/dock/dock.yuck b/hypr-configs/hyprland/eww/dock/dock.yuck new file mode 100644 index 0000000..d1aa8b9 --- /dev/null +++ b/hypr-configs/hyprland/eww/dock/dock.yuck @@ -0,0 +1,64 @@ +(defwindow dock + :geometry (geometry + :x 0 + :y 0 + :width 10 + :height 54 + :anchor "bottom center") + :stacking "overlay" + :monitor 0 + (dockstruct)) + +(defwidget dockstruct [] + (eventbox + :onhover "${EWW_CMD} update revealdock=true" + :onhoverlost "${EWW_CMD} update revealdock=false" + (box + :orientation "v" + :space-evenly false + :valign "end" + (box + :height 4) + (revealer + :reveal revealdock + :transition "slideup" + (box + :class "popup" + :height 60 + :orientation "h" + :halign "center" + (tasklist :iconsize 50)))))) + +(defwidget tasklist [iconsize] + (box + :orientation "h" + :space-evenly true + :spacing 10 + (for task in {tasksjson} + (button + :tooltip { task.name } + :onclick { task.pid != 'null' ? 'swaymsg "[pid=${task.pid}] focus"' : '(cd && gtk-launch ${task.app_id}) &'} + (box + :orientation "v" + :space-evenly false + (image + :image-width iconsize + :image-height iconsize + :path {task.path}) + + (scroll + :hscroll true + :vscroll false + (box + :orientation "h" + :halign "center" + :space-evenly false + :spacing 3 + (for focus in {task.focused} + (box + :class "dockindicate" + :hexpand false + :width { focus ? 10 : 5 } + :height 3)))) + ))))) + diff --git a/hypr-configs/hyprland/eww/eww.scss b/hypr-configs/hyprland/eww/eww.scss index 59dc794..46ce59f 100644 --- a/hypr-configs/hyprland/eww/eww.scss +++ b/hypr-configs/hyprland/eww/eww.scss @@ -1,31 +1,139 @@ +@import './colors.scss'; +@import './bar/bar.scss'; +// @import './bottom_bar/bar.scss'; +@import './control_panel/control_panel.scss'; +@import './dashboard/dashboard.scss'; +@import './dock/dock.scss'; +@import './desktop/desktop.scss'; +@import './notification/notification.scss'; + * { - all: unset; - transition: 200ms; + all: unset; + color: $white0; + font-size: 15px; + font-family: "Iosevka Nerd Font"; + // font-weight: bold; + // font-smooth: never; } -@mixin window { - background-color: $background; - margin: 0.2rem; +tooltip { + background-color: $surface0; + color: $white0; + border-radius: 5px; + border-style: solid; + border-width: 2px; + border-color: $surface2; } -$shadow: #151515; -$background: #171717; -$bg-alt: #171518; -$bg-alt2: #312f32; -$fg: #f0f0f0; -$fg-alt: #cacaca; -$fg-alt2: #a0a0a0; -$black: #262626; -$gray: #bababa; -$red: #fa8e89; -$green: #9ec49f; -$yellow: #faf889; -$blue: #89b4fa; -$magenta: #e889fa; -$cyan: #89eafa; -$white: #ffffff; +scale { + all: unset; + trough { + background-color: $surface2; + border-radius: 24px; + min-height: 80px; + min-width: 10px; + margin : 5px; -@import "bar/bar.scss"; -@import "central/central.scss"; -@import "notifications/notifications.scss"; -@import "volume/volume.scss"; + slider { + background-color: $white2; + border-radius: 25px; + min-height: 15px; + min-width: 15px; + margin: -10px; + } + + highlight { + background-color: $white0; + border-radius: 24px; + } + } +} + +button { + transition-duration: 0.5s; + border-radius: 5px; +} +button:hover { + background-color: $surface2; +} + + +calendar { + all: unset; + background-color: $surface0; + font-size: 20; + color: $white0; +} + +calendar:selected { + color: $base; + background-color: $accent; + border-radius: 25px; +} + +calendar.header { + color: $accent; + font-weight: bold; +} + +calendar:indeterminate { + color: $surface2; +} + +checkbutton { + border-radius: 24px; + background-color: $surface1; + padding: 4px; + check { + min-height: 15px; + min-width: 15px; + color: $white0; + } +} + +checkbutton:checked { + check{ + border-radius: 24px; + background-color: $white0; + } +} + +.popup { + background-color: $base; + padding: 5px; + border-radius: 5px; + border-style: solid; + border-color: $surface2; + border-width: 2px; + margin: 10px; +} + +entry { + // image: url('./image/screenshot.png'); + padding: 5px; + margin: 5px; + border-radius: 5px; + border-style: solid; + border-color: $surface2; + background-color: $surface1; + color: $white0; +} + +.mainentry { + background-color: $surface1; + padding: 5px; + border-radius: 5px; + margin: 5px; +} + +.mainentry label { + font-size: 18px; + color: $white0; +} + +.smallentry { + @extend .mainentry; + label { + font-size: 15px; + } +} diff --git a/hypr-configs/hyprland/eww/eww.yuck b/hypr-configs/hyprland/eww/eww.yuck index 5d0ac34..631e17a 100644 --- a/hypr-configs/hyprland/eww/eww.yuck +++ b/hypr-configs/hyprland/eww/eww.yuck @@ -1,42 +1,127 @@ -(include "bar/bar.yuck") -(include "central/central.yuck") -(include "notifications/notifications.yuck") -(include "volume/volume.yuck") +(defpoll thour :initial "0" :interval "60s" "date +'%I'") +(defpoll tmin :initial "0" :interval "60s" "date +'%M'") +(defpoll tpm :initial "0" :interval "60s" "date +'%p'") +(defpoll volumemute :initial "false" :interval "1s" "pamixer --get-mute") +(defpoll volume :initial "0" :interval "1s" "pamixer --get-volume") +(defpoll brightness :initial "0" :interval "2s" "brightnessctl -m | awk -F, '{print substr($4, 0, length($4)-1)}' | tr -d '%'") +(defpoll wifi_icon :initial "" :interval "30s" "./scripts/wifi --ICON") +(defpoll wifi_essid :initial "" :interval "30s" "./scripts/wifi --ESSID") +(defpoll wifi_radio :initial "off" :interval "2s" "nmcli radio wifi") +(defpoll calendar_day :initial "1" :interval "20h" "date '+%d'") +(defpoll calendar_year :initial "2000" :interval "20h" "date '+%Y'") +(defpoll bat0 :initial "0" :interval "30s" "bash ./scripts/sys_info --bat") +;; (defpoll baticon :initial "" :interval "30s" "bash ./scripts/sys_info --baticon") +;; (defpoll batstat :interval "30s" "cat /sys/class/power_supply/BAT0/status") +(defpoll homedir :initial "" :interval "24h" "echo ~") -(deflisten hyprland `scripts/workspace`) -(deflisten name `scripts/sysinfo.sh --name`) -(deflisten kernel `scripts/sysinfo.sh --kernel`) -(deflisten os `scripts/sysinfo.sh --os`) -(deflisten wm `scripts/sysinfo.sh --wm`) -(deflisten uptime `scripts/sysinfo.sh --uptime`) +(deflisten workspacejson + :initial '[{"focused": true, "empty": false, "name": 1}, {"focused": false, "empty": true, "name": 2}, {"focused": false, "empty": true, "name": 3}, {"focused": false, "empty": true, "name": 4}, {"focused": false, "empty": true, "name": 5}]' + "./scripts/workspace.py") -(defvar perfil "assets/perfil.png") +;; used mainly in control panel and dashboard +(defpoll hostname :initial "idk" :interval "24h" 'echo "$(whoami)"') +(defpoll uptime :initial "idk" :interval "1m" "uptime -p") +(defpoll weatherjson + :initial '{ + "FeelsLikeC": "0", + "FeelsLikeF": "0", + "cloudcover": "0", + "humidity": "0", + "localObsDateTime": "2000-00-00 07:27 AM", + "observation_time": "07:27 AM", + "precipInches": "0.0", + "precipMM": "0.0", + "pressure": "0", + "pressureInches": "0", + "temp_C": "0", + "temp_F": "0", + "uvIndex": "0", + "visibility": "0", + "visibilityMiles": "0", + "weatherCode": "727", + "weatherDesc": [{"value": "Idk"}], + "weatherIconUrl": [{"value": ""}], + "winddir16Point": "", + "winddirDegree": "0", + "windspeedKmph": "0", + "windspeedMiles": "0", + "icon": "idk", + "hourly": [] + }' + :interval "1h" + :run-while revealcontrolpanel + "./scripts/weather.py") +(defpoll datehour :initial "12" :interval "30m" "date +'%H'") +(defpoll notesc :interval "2s" :run-while reveal4 "cat -s ~/Documents/fuck.txt") +(deflisten timerdis `./scripts/timer.py subscribe`) +(defpoll quotejson :interval "1h" `./scripts/quote.py`) -;; Music -(defpoll music-art :interval "1s" "scripts/mediacontrol coverloc") -(defpoll music-title :interval "1s" "scripts/mediacontrol title") -(defpoll music-artist :interval "1s" "scripts/mediacontrol artist") -(defpoll music-toggle :interval "1s" "scripts/mediacontrol statusicon") -(defpoll music-status :interval "1s" "scripts/mediacontrol status") -(defpoll music-position :interval "1s" "scripts/mediacontrol position") -(defpoll music-length :interval "1s" "scripts/mediacontrol length") -(defpoll music-positions :interval "1s" "scripts/mediacontrol positions") -(defpoll music-lengths :interval "1s" "scripts/mediacontrol lengths") -(defpoll music-shuffle-color :interval "1s" "scripts/mediacontrol shufflecolor") -(defpoll music-shuffle-status :interval "1s" "playerctl -p spotify shuffle") -(defpoll music-loop-icon :interval "1s" "scripts/mediacontrol loopicon") -(defpoll music-loop-color :interval "1s" "scripts/mediacontrol loopcolor") -(defpoll music-loop-status :interval "1s" "playerctl -p spotify loop") -(defvar music-rev false) +;; dock +(deflisten tasksjson :initial "[]" "./scripts/tasklist.py") +(defvar revealdock false) -;; Volume -(deflisten volume `scripts/volume`) -(defvar volume_rev false) +;; fucking desktop icons +(defpoll trashcanpath :interval "24h" "./scripts/iconfetch.py trashcan_empty") -;; Date -(defpoll hour :interval "1s" "date '+%H'") -(defpoll minute :interval "1s" "date '+%M'") -(defpoll date :interval "1h" "date '+%a, %d %B'") -(defpoll calendar-day :interval "1h" "date '+%d'") -(defpoll calendar-month :interval "1h" "date '+%m'") -(defpoll calendar-year :interval "1h" "date '+%Y'") +;; sys info +;; (defpoll cpu :interval "1s" :run-while reveal5 "bash ./scripts/sys_info --cpu") +;; (defpoll mem :interval "1s" :run-while reveal5 "bash ./scripts/sys_info --mem") +(defvar gapsouter 0) +(defvar gapsinner 10) +(defvar borderpixel 2) +(defvar caffeine false) + +; Notifications +(deflisten notifications :initial '{ + "count": 0, + "dnd": false, + "notifications": [], + "popups": [] + }' + "./scripts/notifCatch" +) + +;; cava pipe ("borrowed from tail-r") +;; (deflisten cavajson :initial "[]" "./scripts/cava_pipe.sh") + +;; playerctl +(deflisten psong "playerctl metadata --format '{{ title }}' -F") +(deflisten partist "playerctl metadata --format '{{ artist }}' -F") +(deflisten pcover "./scripts/pollcover.sh") +(deflisten pstatus "playerctl status -F") +(deflisten ptime + :initial '{ + "position": 0, + "duration": 0, + "readable": "0:00" + }' + "playerctl -F metadata -f '{ \"position\": {{position/1000000}}, \"duration\": {{mpris:length/1000000}}, \"readable\": \"{{duration(position)}}/{{duration(mpris:length)}}\" }'") +;; (deflisten pside "playerctl -F metadata -f '{ \"volume\": {{volume*100}}, \"shuffle\": \"{{shuffle}}\", \"loop\": \"{{loop}}\" }'") + +;; wallpaper thing +(defvar wallpapers "[]") + +;; windows for workspace switching +(defvar windows "[[], [], [], [], []]") + +(defvar reveal1 false) +(defvar reveal2 false) +(defvar reveal3 false) +(defvar reveal4 false) +(defvar reveal5 false) +(defvar reveal6 false) +(defvar revealweather false) +(defvar revealsystray false) +(defvar revealcontrolpanel false) + +(defpoll theme :interval "24h" "./scripts/toggletheme") + + +(include "./bar/bar.yuck") +;; (include "./bottom_bar/bar.yuck") +(include "./control_panel/control_panel.yuck") +(include "./dashboard/dashboard.yuck") +(include "./dock/dock.yuck") +(include "./desktop/desktop.yuck") +(include "./notification/notification.yuck") +(include "./wallpapers/wallpapers.yuck") diff --git a/hypr-configs/hyprland/eww/image/desktop/amogus.png b/hypr-configs/hyprland/eww/image/desktop/amogus.png new file mode 100644 index 0000000..5a579a2 Binary files /dev/null and b/hypr-configs/hyprland/eww/image/desktop/amogus.png differ diff --git a/hypr-configs/hyprland/eww/image/desktop/cirno.png b/hypr-configs/hyprland/eww/image/desktop/cirno.png new file mode 100644 index 0000000..1a2a32d Binary files /dev/null and b/hypr-configs/hyprland/eww/image/desktop/cirno.png differ diff --git a/hypr-configs/hyprland/eww/image/desktop/koishi.png b/hypr-configs/hyprland/eww/image/desktop/koishi.png new file mode 100644 index 0000000..071838a Binary files /dev/null and b/hypr-configs/hyprland/eww/image/desktop/koishi.png differ diff --git a/hypr-configs/hyprland/eww/image/desktop/marisa.png b/hypr-configs/hyprland/eww/image/desktop/marisa.png new file mode 100644 index 0000000..ec72571 Binary files /dev/null and b/hypr-configs/hyprland/eww/image/desktop/marisa.png differ diff --git a/hypr-configs/hyprland/eww/image/desktop/reisen.png b/hypr-configs/hyprland/eww/image/desktop/reisen.png new file mode 100644 index 0000000..b643653 Binary files /dev/null and b/hypr-configs/hyprland/eww/image/desktop/reisen.png differ diff --git a/hypr-configs/hyprland/eww/image/emptympd.png b/hypr-configs/hyprland/eww/image/emptympd.png new file mode 100644 index 0000000..126795e Binary files /dev/null and b/hypr-configs/hyprland/eww/image/emptympd.png differ diff --git a/hypr-configs/hyprland/eww/image/eyedropper.png b/hypr-configs/hyprland/eww/image/eyedropper.png new file mode 100644 index 0000000..05ce622 Binary files /dev/null and b/hypr-configs/hyprland/eww/image/eyedropper.png differ diff --git a/hypr-configs/hyprland/eww/image/fieshidle.gif b/hypr-configs/hyprland/eww/image/fieshidle.gif new file mode 100644 index 0000000..cede31b Binary files /dev/null and b/hypr-configs/hyprland/eww/image/fieshidle.gif differ diff --git a/hypr-configs/hyprland/eww/image/idk.svg b/hypr-configs/hyprland/eww/image/idk.svg new file mode 100644 index 0000000..19df66c --- /dev/null +++ b/hypr-configs/hyprland/eww/image/idk.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/hypr-configs/hyprland/eww/image/loading.gif b/hypr-configs/hyprland/eww/image/loading.gif new file mode 100644 index 0000000..b3ee14d Binary files /dev/null and b/hypr-configs/hyprland/eww/image/loading.gif differ diff --git a/hypr-configs/hyprland/eww/image/roundpfp.png b/hypr-configs/hyprland/eww/image/roundpfp.png new file mode 100644 index 0000000..dedd5f1 Binary files /dev/null and b/hypr-configs/hyprland/eww/image/roundpfp.png differ diff --git a/hypr-configs/hyprland/eww/image/screenshot.png b/hypr-configs/hyprland/eww/image/screenshot.png new file mode 100644 index 0000000..f878ddb Binary files /dev/null and b/hypr-configs/hyprland/eww/image/screenshot.png differ diff --git a/hypr-configs/hyprland/eww/image/weather/clear-n.svg b/hypr-configs/hyprland/eww/image/weather/clear-n.svg new file mode 100644 index 0000000..160f3b4 --- /dev/null +++ b/hypr-configs/hyprland/eww/image/weather/clear-n.svg @@ -0,0 +1 @@ + diff --git a/hypr-configs/hyprland/eww/image/weather/clear.svg b/hypr-configs/hyprland/eww/image/weather/clear.svg new file mode 100644 index 0000000..9544086 --- /dev/null +++ b/hypr-configs/hyprland/eww/image/weather/clear.svg @@ -0,0 +1 @@ + diff --git a/hypr-configs/hyprland/eww/image/weather/clouds.svg b/hypr-configs/hyprland/eww/image/weather/clouds.svg new file mode 100644 index 0000000..c804515 --- /dev/null +++ b/hypr-configs/hyprland/eww/image/weather/clouds.svg @@ -0,0 +1 @@ + diff --git a/hypr-configs/hyprland/eww/image/weather/few-clouds-n.svg b/hypr-configs/hyprland/eww/image/weather/few-clouds-n.svg new file mode 100644 index 0000000..caa5bbc --- /dev/null +++ b/hypr-configs/hyprland/eww/image/weather/few-clouds-n.svg @@ -0,0 +1 @@ + diff --git a/hypr-configs/hyprland/eww/image/weather/few-clouds.svg b/hypr-configs/hyprland/eww/image/weather/few-clouds.svg new file mode 100644 index 0000000..7af8d87 --- /dev/null +++ b/hypr-configs/hyprland/eww/image/weather/few-clouds.svg @@ -0,0 +1 @@ + diff --git a/hypr-configs/hyprland/eww/image/weather/fog.svg b/hypr-configs/hyprland/eww/image/weather/fog.svg new file mode 100644 index 0000000..ebc141b --- /dev/null +++ b/hypr-configs/hyprland/eww/image/weather/fog.svg @@ -0,0 +1 @@ + diff --git a/hypr-configs/hyprland/eww/image/weather/idk.svg b/hypr-configs/hyprland/eww/image/weather/idk.svg new file mode 100644 index 0000000..19df66c --- /dev/null +++ b/hypr-configs/hyprland/eww/image/weather/idk.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/hypr-configs/hyprland/eww/image/weather/rain-light.svg b/hypr-configs/hyprland/eww/image/weather/rain-light.svg new file mode 100644 index 0000000..ea0540a --- /dev/null +++ b/hypr-configs/hyprland/eww/image/weather/rain-light.svg @@ -0,0 +1 @@ + diff --git a/hypr-configs/hyprland/eww/image/weather/rain.svg b/hypr-configs/hyprland/eww/image/weather/rain.svg new file mode 100644 index 0000000..9c37e74 --- /dev/null +++ b/hypr-configs/hyprland/eww/image/weather/rain.svg @@ -0,0 +1 @@ + diff --git a/hypr-configs/hyprland/eww/image/weather/snow.svg b/hypr-configs/hyprland/eww/image/weather/snow.svg new file mode 100644 index 0000000..b0a5728 --- /dev/null +++ b/hypr-configs/hyprland/eww/image/weather/snow.svg @@ -0,0 +1 @@ + diff --git a/hypr-configs/hyprland/eww/image/weather/storm.svg b/hypr-configs/hyprland/eww/image/weather/storm.svg new file mode 100644 index 0000000..ffad691 --- /dev/null +++ b/hypr-configs/hyprland/eww/image/weather/storm.svg @@ -0,0 +1 @@ + diff --git a/hypr-configs/hyprland/eww/notification/notification.scss b/hypr-configs/hyprland/eww/notification/notification.scss new file mode 100644 index 0000000..b7e78fc --- /dev/null +++ b/hypr-configs/hyprland/eww/notification/notification.scss @@ -0,0 +1,36 @@ + +.notifbox { + background-color: $surface1; + border-radius: 5px; + padding: 5px; + margin: 5px; +} + +.notiftitle { + font-size: 18px; + color: $white0; +} + +.notifbody { + font-size: 15px; + color: $white0; +} + +.notifclose { + font-family: "Symbols Nerd Font"; + font-size: 25px; + min-width: 1em; + min-height: 1em; + color: $red; +} + +.notiflabel { + font-size: 18px; + margin-bottom: 5px; +} + +.notifactions { + font-size: 15px; + margin: 5px; + color: $white0; +} diff --git a/hypr-configs/hyprland/eww/notification/notification.yuck b/hypr-configs/hyprland/eww/notification/notification.yuck new file mode 100644 index 0000000..0be847f --- /dev/null +++ b/hypr-configs/hyprland/eww/notification/notification.yuck @@ -0,0 +1,90 @@ + +(defwindow notifypopup + :geometry (geometry + :x 0 + :y 0 + :width 480 + :height 0 + :anchor "top right") + :stacking "overlay" + :monitor 0 + (revealer + :reveal { arraylength(notifications.popups) > 0 } + :transition "slidedown" + (box + :orientation "v" + :space-evenly false + :spacing 5 + (for noti in {notifications.popups} + (singlenotif :noti noti :initial true))))) + +(defwidget singlenotif [noti initial] + (box + :orientation "v" + :class "${initial ? 'popup' : 'notifbox'}" + :space-evenly false + + (centerbox + :orientation "h" + :class "notifbar" + (image :halign "start" :image-width 30 :image-height 30 :path {noti.icon != "null" ? noti.icon : "./image/idk.svg"}) + (scroll + :halign "center" + :valign "center" + :hexpand true + :hscroll true + :vscroll false + :width 200 + (label + :class "notiflabel" + :text {noti.app})) + (button + :halign "end" + :onclick "./scripts/notifManage --close ${noti.id}" + (label + :class "notifclose" + :text ""))) + + (box + :orientation "h" + :halign "fill" + :height 80 + :space-evenly false + :spacing 10 + (image :image-width 80 :image-height 80 :visible {noti.image != "null"} :path {noti.image != "null" ? noti.image : "./image/idk.svg"}) + + (button + :onclick "./scripts/notifManage --dismiss ${noti.id}" + :onrightclick "./scripts/notifManage --close ${noti.id}" + :tooltip "${noti.time}" + :hexpand true + :vexpand true + (box + :orientation "v" + :space-evenly false + :valign "center" + (scroll + :hscroll true + :vscroll false + :hexpand true + (label + :class "notiftitle" + :text {noti.summary})) + (scroll + :hscroll true + :vscroll false + :hexpand true + (label + :class "notifbody" + :visible {noti.body != "null"} + :text {noti.body}))))) + + (box + :orientation "h" + (for action in {noti.actions} + (button + :onclick "./scripts/notifManage --action ${noti.id} ${action[0]} && ./scripts/notifManage --close ${noti.id}" + (label + :class "notifactions" + :text {action[1]})) + )))) diff --git a/hypr-configs/hyprland/eww/notifications/notifications.scss b/hypr-configs/hyprland/eww/notifications/notifications.scss deleted file mode 100644 index 584bac2..0000000 --- a/hypr-configs/hyprland/eww/notifications/notifications.scss +++ /dev/null @@ -1,12 +0,0 @@ - -.notifications { - background-color: $bg; - color: $fg-alt; - margin: 1rem; - border-radius: .4rem; -} - -.title { - font-size: 1.5rem; - color: $fg; -} diff --git a/hypr-configs/hyprland/eww/notifications/notifications.yuck b/hypr-configs/hyprland/eww/notifications/notifications.yuck deleted file mode 100644 index 97d7e53..0000000 --- a/hypr-configs/hyprland/eww/notifications/notifications.yuck +++ /dev/null @@ -1,31 +0,0 @@ -(defwidget notifications [] - (box - :class "notifications" - (box - :class "title" - :space-evenly false - :valign "start" - :halign "center" - (label :text "Notifications") - ) - ) - -) - - - - - - - - - -(defwindow notifications - :monitor 0 - :geometry (geometry :x "1%" - :y "0%" - :height "75%" - :width "25%" - :anchor "center left") - :reserve (struts :side "top" :distance "4%") - (notifications)) diff --git a/hypr-configs/hyprland/eww/scripts/__pycache__/iconfetch.cpython-312.pyc b/hypr-configs/hyprland/eww/scripts/__pycache__/iconfetch.cpython-312.pyc new file mode 100644 index 0000000..cb7f7f3 Binary files /dev/null and b/hypr-configs/hyprland/eww/scripts/__pycache__/iconfetch.cpython-312.pyc differ diff --git a/hypr-configs/hyprland/eww/scripts/apps.py b/hypr-configs/hyprland/eww/scripts/apps.py deleted file mode 100644 index 2f6e501..0000000 --- a/hypr-configs/hyprland/eww/scripts/apps.py +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env python - -import glob -import sys -import os -import json -import subprocess -import gi - -gi.require_version("Gtk", "3.0") - -from gi.repository import Gtk -from configparser import ConfigParser - -cache_file = os.path.expandvars("$XDG_CACHE_HOME/apps.json") - -def get_gtk_icon(icon_name): - theme = Gtk.IconTheme.get_default() - icon_info = theme.lookup_icon(icon_name, 128, 0) - - if icon_info is not None: - return icon_info.get_filename() - -def get_desktop_entries(query=None): - desktop_files = glob.glob(os.path.join("/usr/share/applications", "*.desktop")) - entries = [] - - for file_path in desktop_files: - parser = ConfigParser() - parser.read(file_path) - - if parser.getboolean("Desktop Entry", "NoDisplay", fallback=False): - continue # Skip entries with NoDisplay=true - - app_name = parser.get("Desktop Entry", "Name") - icon_path = get_gtk_icon(parser.get("Desktop Entry", "Icon", fallback="")) - comment = parser.get("Desktop Entry", "Comment", fallback="") - - entry = { - "name": app_name, - "icon": icon_path, - "comment": comment, - "desktop": os.path.basename(file_path), - } - entries.append(entry) - return entries - -def update_cache(entries): - with open(cache_file, "w") as file: - file.write(json.dumps(entries, indent=2)) - -def get_cached_entries(): - if os.path.exists(cache_file): - with open(cache_file, "r") as file: - content = file.read().strip() - if content: - try: - return json.loads(content) - except json.JSONDecodeError: - pass - - entries = get_desktop_entries() - update_cache(entries) - return entries - -def filter_entries(entries, query): - filtered_data = [ - entry for entry in entries - if query.lower() in entry["name"].lower() - or (entry["comment"] and query.lower() in entry["comment"].lower()) - ] - return filtered_data - -def update_eww(entries): - update = ["eww", "update", "apps={}".format(json.dumps(entries))] - subprocess.run(update) - -if __name__ == "__main__": - if len(sys.argv) > 2 and sys.argv[1] == "--query": - query = sys.argv[2] - else: - query = None - - entries = get_cached_entries() - - if query is not None: - filtered = filter_entries(entries, query) - update_eww(filtered) - else: - update_eww(entries) \ No newline at end of file diff --git a/hypr-configs/hyprland/eww/scripts/brightness b/hypr-configs/hyprland/eww/scripts/brightness deleted file mode 100644 index 7b49220..0000000 --- a/hypr-configs/hyprland/eww/scripts/brightness +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -current_brightness=1.0 - -function set_brightness() { - gdbus call -e -d de.mherzberg -o /de/mherzberg/wlrbrightness -m de.mherzberg.wlrbrightness.set $1 &> /dev/null -} - -echo "Ajuste o brilho com o scroll do mouse." -echo "Gire o scroll para cima para aumentar o brilho e para baixo para diminuir." -echo "Pressione Ctrl+C para sair." - -while true; do - read -r -n 1 scroll - if [[ "$scroll" == $'\x1b[A' ]]; then - # Scroll para cima - current_brightness=$(echo "$current_brightness + 0.1" | bc) - if (( $(echo "$current_brightness > 1.0" | bc -l) )); then - current_brightness=1.0 - fi - sudo bash -c "set_brightness $current_brightness" - elif [[ "$scroll" == $'\x1b[B' ]]; then - # Scroll para baixo - current_brightness=$(echo "$current_brightness - 0.1" | bc) - if (( $(echo "$current_brightness < 0.0" | bc -l) )); then - current_brightness=0.0 - fi - sudo bash -c "set_brightness $current_brightness" - fi -done diff --git a/hypr-configs/hyprland/eww/scripts/cava_config b/hypr-configs/hyprland/eww/scripts/cava_config new file mode 100644 index 0000000..3dac3b0 --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/cava_config @@ -0,0 +1,12 @@ +[general] + +framerate = 20 +bars = 30 + +[output] + +method = raw +raw_target = /dev/stdout +data_format = ascii +bit_format = 8bit +ascii_max_range = 100 diff --git a/hypr-configs/hyprland/eww/scripts/cava_pipe.sh b/hypr-configs/hyprland/eww/scripts/cava_pipe.sh new file mode 100755 index 0000000..3412023 --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/cava_pipe.sh @@ -0,0 +1,5 @@ +#!/bin/bash +confPath="$HOME/.config/eww/carbonmonoxide/scripts/cava_config" + +# Main +cava -p $confPath | while read -r line; do echo $line| sed -e 's/;/,/g'; done | while read -r line; do echo "["`echo ${line/%?/}`"]"; done diff --git a/hypr-configs/hyprland/eww/scripts/details b/hypr-configs/hyprland/eww/scripts/details deleted file mode 100644 index e80d436..0000000 --- a/hypr-configs/hyprland/eww/scripts/details +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/bash - -if [[ $1 == "--name" ]]; then - fullname=$(getent passwd "$(whoami)" | cut -d ':' -f 5 | cut -d ',' -f 1 | tr -d "\n") - if [ -z "$fullname" ]; then - echo "$(whoami)@$(hostnamectl | awk 'FNR==1 {print $3}')" - else - echo "$fullname" - fi -fi - -if [[ $1 == "--kernel" ]]; then - echo "$(uname -r)" -fi - -if [[ $1 == "--os" ]]; then - echo "$(cat /etc/os-release | awk 'NR==1' | awk -F '"' '{print $2}')" -fi - -if [[ $1 == "--pkgs" ]]; then - echo "$(yay -Q | wc -l)" -fi - -if [[ $1 == "--wm" ]]; then - echo "$XDG_CURRENT_DESKTOP" -fi \ No newline at end of file diff --git a/hypr-configs/hyprland/eww/scripts/iconfetch.py b/hypr-configs/hyprland/eww/scripts/iconfetch.py new file mode 100755 index 0000000..f5d0cc0 --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/iconfetch.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +import gi +gi.require_version('Gtk', '3.0') +from gi.repository import Gtk +import sys + +def fetch(icon_name): + icon_theme = Gtk.IconTheme.get_default() + icon = icon_theme.lookup_icon(icon_name, 48, 0) + if icon: + return icon.get_filename() + else: + return + +if __name__ == "__main__": + print(fetch(sys.argv[1])) diff --git a/hypr-configs/hyprland/eww/scripts/mediacontrol b/hypr-configs/hyprland/eww/scripts/mediacontrol deleted file mode 100644 index 37a710b..0000000 --- a/hypr-configs/hyprland/eww/scripts/mediacontrol +++ /dev/null @@ -1,242 +0,0 @@ -#!/usr/bin/bash - -# ╔╦╗ ╦ ╦ ╔═╗ ╦ ╔═╗ -# ║║║ ║ ║ ╚═╗ ║ ║ -# ╩ ╩ ╚═╝ ╚═╝ ╩ ╚═╝ - -# author Niraj -# github niraj998 - -# ┌─┐┌─┐┌┐┌┌─┐┬┌─┐┬ ┬┬─┐┌─┐┌┬┐┬┌─┐┌┐┌┌─┐ -# │ │ ││││├┤ ││ ┬│ │├┬┘├─┤ │ ││ ││││└─┐ -# └─┘└─┘┘└┘└ ┴└─┘└─┘┴└─┴ ┴ ┴ ┴└─┘┘└┘└─┘ - -# uncomment your music players below. -# - -[ -n "$(pgrep spotify)" ] && Control="spotify" -#[ -n "$(pgrep firefox)" ] && Control="firefox" -# [ -n "$(pgrep rhythmbox)" ] && Control="rhythmbox" -# [ -n "$(pgrep audacious)" ] && Control="audacious" -# [ -n "$(pgrep clementine)" ] && Control="clementine" -# [ -n "$(pgrep strawberry)" ] && Control="strawberry" - -# saves covers here -Cover=/tmp/cover.png -# if cover not found in metadata use this instead -bkpCover=~/.config/bspwm/assets/fallback.webp - -# ┌─┐┬ ┌─┐┬ ┬┌─┐┬─┐┌─┐┌┬┐┬ ┌─┐┌─┐┬─┐┬┌─┐┌┬┐┌─┐ -# ├─┘│ ├─┤└┬┘├┤ ├┬┘│ │ │ └─┐│ ├┬┘│├─┘ │ └─┐ -# ┴ ┴─┘┴ ┴ ┴ └─┘┴└─└─┘ ┴ ┴─┘ └─┘└─┘┴└─┴┴ ┴ └─┘ - -########################## Title ########################## -title() { - title=$(playerctl --player=$Control metadata --format {{title}}) - [ -z "$title" ] && title="Eagerly awaiting the music." - echo "$title" -} - -########################## Artist ########################## -artist() { - artist=$(playerctl --player=$Control metadata --format {{artist}}) - [ -z "$artist" ] && artist="Artist" - echo "$artist" -} - -########################## Album ########################## -album() { - album=$(playerctl --player=$Control metadata --format {{album}}) - [ -z "$album" ] && album="Album" - echo "$album" -} - -########################## Status ########################## -status() { - status=$(playerctl --player=$Control status) - [ -z "$status" ] && status="Stopped" - echo "$status" -} - -########################## Time ########################## -position() { - time=$(playerctl --player=$Control position --format "{{ duration(position) }}") - [ -z "$time" ] && time="0:00" - echo "$time" -} - -positions() { - position=$(playerctl --player=$Control metadata --format "{{ duration(position) }}") - [ -z "$position" ] && position="0:00" - time=$position - if [[ $time == *:* ]]; then - minutes=${time%%:*} - seconds=${time#*:} - seconds=$((${seconds#0})) - else - minutes=${time:0:1} - seconds=${time:2:2} - fi - total_seconds=$((minutes * 60 + seconds)) - echo $total_seconds -} - -########################## Length ########################## -length() { - length=$(playerctl --player=$Control metadata --format "{{ duration(mpris:length) }}") - [ -z "$length" ] && length="0:00" - echo "$length" -} - -lengths() { - length=$(playerctl --player=$Control metadata --format "{{ duration(mpris:length) }}") - [ -z "$length" ] && length="0:00" - time=$length - if [[ $time == *:* ]]; then - minutes=${time%%:*} - seconds=${time#*:} - seconds=$((${seconds#0})) - else - minutes=${time:0:1} - seconds=${time:2:2} - fi - total_seconds=$((minutes * 60 + seconds)) - echo $total_seconds -} - -########################## trackNumber ########################## -playlist() { - playlist=$(playerctl --player=$Control metadata xesam:trackNumber) - [ -z "$playlist" ] && playlist="0" - echo "$playlist" -} - -########################## Cover ########################## -cover() { - albumart="$(playerctl --player=$Control metadata mpris:artUrl | sed -e 's/open.spotify.com/i.scdn.co/g')" - [ $(playerctl --player=$Control metadata mpris:artUrl) ] && curl -s "$albumart" --output $Cover || cp $bkpCover $Cover - echo "$Cover" -} - -########################## Statusicon ########################## -statusicon() { - icon="" - [ $(playerctl --player=$Control status) = "Playing" ] && icon="" - [ $(playerctl --player=$Control status) = "Paused" ] && icon="󰐊" - echo "$icon" -} - -########################## Shuffle ########################## -shufflecolor() { - color="#a0a0a0" - [ $(playerctl --player=$Control shuffle) = "On" ] && color="#9ec49f" - [ $(playerctl --player=$Control shuffle) = "Off" ] && color"#a0a0a0" - echo "$color" -} - -########################## Loop ########################## -loopicon() { - icon=" " - [ $(playerctl --player=$Control loop) = "None" ] && icon=" " - [ $(playerctl --player=$Control loop) = "Track" ] && icon" " - [ $(playerctl --player=$Control loop) = "Playlist" ] && icon=" " - echo "$icon" -} - -loopcheck() { - command=$(playerctl -p spotify loop) - - if [[ $command == "None" ]]; then - playerctl -p spotify loop Playlist - fi - - if [[ $command == "Playlist" ]]; then - playerctl -p spotify loop Track - fi - - if [[ $command == "Track" ]]; then - playerctl -p spotify loop None - fi -} - -loopcolor() { - color="#9ec49f" - [ $(playerctl --player=$Control loop) = "None" ] && color="#a0a0a0" - [ $(playerctl --player=$Control loop) = "Track" ] && color"#9ec49f" - [ $(playerctl --player=$Control loop) = "Playlist" ] && color"#9ec49f" - echo "$color" -} - -########################## Lyrics ########################## -lyrics() { - Title=$(playerctl --player=$Control metadata --format {{title}}) - Artist=$(playerctl --player=$Control metadata --format {{artist}}) - URL="https://api.lyrics.ovh/v1/$Artist/$Title" - lyrics=$(curl -s "$(echo "$URL" | sed s/" "/%20/g | sed s/"&"/%26/g | sed s/,/%2C/g | sed s/-/%2D/g)" | jq '.lyrics') - [ "$lyrics" = "null" ] && lyrics=$(curl -s --get "https://makeitpersonal.co/lyrics" --data-urlencode "artist=$Artist" --data-urlencode "title=$Title") - printf "$lyrics" | less -} - -# ┬ ┬┌─┐┬ ┌─┐ -# ├─┤├┤ │ ├─┘ -# ┴ ┴└─┘┴─┘┴ - -doc() { - echo "Usage: - MediaControl [Options] - -Options: - --previous previous song - --next next song - --toggle toggle between play-pause song - --stop stop song - --shuffle shuffle playlist - --loop loop toggle - title shows title of current song - album shows album of current song - artist shows artist of current song - status music status (playing/paused/stopped) - statusicon music status icons (playing/paused/stopped) - shufflecolor huffle status color - loopicon loop status icon - loopcolor loop status color - coverloc saves cover and shows location to cover of current song - showcover opens cover using feh - position shows current position of song - positions shows current position of song in seconds - length shows length of song - lengths shows length of song in seconds - playlist shows playlist position of current song - lyrics shows lyrics" -} - -# ┌─┐┌─┐┌┬┐┬┌─┐┌┐┌┌─┐ -# │ │├─┘ │ ││ ││││└─┐ -# └─┘┴ ┴ ┴└─┘┘└┘└─┘ - -case $1 in ---next) playerctl --player=$Control next ;; ---previous) playerctl --player=$Control previous ;; ---toggle) playerctl --player=$Control play-pause ;; ---stop) playerctl --player=$Control stop ;; ---shuffle) playerctl --player=$Control shuffle toggle ;; ---loop) loopcheck ;; -title) title ;; -artist) artist ;; -album) album ;; -status) status ;; -statusicon) statusicon ;; -shufflecolor) shufflecolor ;; -loopicon) loopicon ;; -loopcolor) loopcolor ;; -player) echo "$Control" ;; -coverloc) cover ;; -showcover) cover | xargs feh ;; -position) position ;; -positions) positions ;; -length) length ;; -lengths) lengths ;; -playlist) playlist ;; -lyrics) lyrics ;; -*) doc ;; -esac diff --git a/hypr-configs/hyprland/eww/scripts/music_info b/hypr-configs/hyprland/eww/scripts/music_info new file mode 100755 index 0000000..796ec54 --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/music_info @@ -0,0 +1,150 @@ +#!/bin/bash + +# got this script from adi1090x, I did not make this + +## Get data +STATUS="$(mpc status)" +COVER="/tmp/.music_cover.jpg" +MUSIC_DIR="$HOME/Music" + +## Get status +get_status() { + if [[ $STATUS == *"[playing]"* ]]; then + echo "" + else + echo "" + fi +} + +poll() { + while [[ 1 == 1 ]]; do + STATUS="$(mpc status)" + if [[ -z $STATUS ]]; then + sleep 30 + fi + $1 + mpc idle >/dev/null + done +} + +## Get song +get_song() { + song=$(mpc -f %title% current) + if [[ -z "$song" ]]; then + echo "Offline" + else + echo "$song" + fi +} + +## Get artist +get_artist() { + artist=$(mpc -f %artist% current) + if [[ -z "$artist" ]]; then + echo "Offline" + else + echo "$artist" + fi +} + +## Get time +get_time() { + time=$(mpc status | grep "%)" | awk '{print $4}' | tr -d '(%)') + if [[ -z "$time" ]]; then + echo "0" + else + echo "$time" + fi +} +get_ctime() { + ctime=$(mpc status | grep "#" | awk '{print $3}' | sed 's|/.*||g') + if [[ -z "$ctime" ]]; then + echo "0:00" + else + echo "$ctime" + fi +} +get_ttime() { + ttime=$(mpc -f %time% current) + if [[ -z "$ttime" ]]; then + echo "0:00" + else + echo "$ttime" + fi +} + +## Get cover +get_cover() { + ffmpeg -i "${MUSIC_DIR}/$(mpc current -f %file%)" "${COVER}" -y &>/dev/null + STATUS=$? + + # Check if the file has a embbeded album art + if [ "$STATUS" -eq 0 ]; then + echo "$COVER" + else + echo "image/emptympd.png" + fi +} + +get_volume() { + # gotta get rid of spaces lol + vol=$(mpc status "%volume%" | awk '{print $1}' | tr -d '%') + if [[ -z "$vol" ]]; then + echo "0" + else + echo "$vol" + fi +} + +get_random() { + random=$(mpc status "%random%") + if [[ -z "$random" ]]; then + echo "no" + else + echo "$random" + fi +} + +get_single() { + single=$(mpc status "%single%") + if [[ -z "$single" ]]; then + echo "no" + else + echo "$single" + fi +} + +## Execute accordingly +if [[ "$1" == "--song" ]]; then + poll get_song +elif [[ "$1" == "--artist" ]]; then + poll get_artist +elif [[ "$1" == "--status" ]]; then + poll get_status +elif [[ "$1" == "--time" ]]; then + get_time +elif [[ "$1" == "--ctime" ]]; then + get_ctime +elif [[ "$1" == "--ttime" ]]; then + get_ttime +elif [[ "$1" == "--cover" ]]; then + poll get_cover +elif [[ "$1" == "--volume" ]]; then + poll get_volume +elif [[ "$1" == "--single" ]]; then + poll get_single +elif [[ "$1" == "--random" ]]; then + poll get_random +elif [[ "$1" == "--toggle" ]]; then + mpc -q toggle +elif [[ "$1" == "--next" ]]; then + { + mpc -q next + get_cover + } +elif [[ "$1" == "--prev" ]]; then + { + mpc -q prev + get_cover + } +fi diff --git a/hypr-configs/hyprland/eww/scripts/netspeed b/hypr-configs/hyprland/eww/scripts/netspeed deleted file mode 100644 index 3b4b505..0000000 --- a/hypr-configs/hyprland/eww/scripts/netspeed +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# thanks to Luke Smith - -update() { - sum=0 - for arg; do - read -r i <"$arg" - sum=$((sum + i)) - done - cache=${XDG_CACHE_HOME:-$HOME/.cache}/${1##*/} - [ -f "$cache" ] && read -r old <"$cache" || old=0 - printf %d\\n "$sum" >"$cache" - printf %d\\n $((sum - old)) -} - -tx=$(update /sys/class/net/enp4s0/statistics/tx_bytes) -rx=$(update /sys/class/net/enp4s0/statistics/rx_bytes) - -[ "$1" = "down" ] && printf "%4sB\\n" $(numfmt --to=iec $rx) && exit -[ "$1" = "up" ] && printf "%4sB\\n" $(numfmt --to=iec $tx) && exit diff --git a/hypr-configs/hyprland/eww/scripts/network b/hypr-configs/hyprland/eww/scripts/network deleted file mode 100644 index 5f439c1..0000000 --- a/hypr-configs/hyprland/eww/scripts/network +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/bash - -ID="$(ip link | awk '/state UP/ {print $2}')" -NAME="$(ip link | awk '/state UP/ {print $2}' | cut -c 1-6)" - -net_stat() { - if (ping -c 1 archlinux.org || ping -c 1 google.com) &>/dev/null; then - if [[ $ID == e* ]]; then - echo " " - fi - else - echo " " - fi -} - -net_color() { - if (ping -c 1 archlinux.org || ping -c 1 google.com) &>/dev/null; then - echo "#A39EC4" - else - echo "#dd6777" - fi -} - -case "$1" in -stat) - net_stat | head -n1 - ;; -icon) - net_stat | tail -n1 - ;; -color) - net_color - ;; -esac diff --git a/hypr-configs/hyprland/eww/scripts/notifCatch b/hypr-configs/hyprland/eww/scripts/notifCatch new file mode 100755 index 0000000..a360832 --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/notifCatch @@ -0,0 +1,254 @@ +#!/usr/bin/python + +# juminai @ github + +import gi +import datetime +import os +import typing +import sys +import json +import subprocess +import dbus +import dbus.service +from iconfetch import fetch + +gi.require_version("GdkPixbuf", "2.0") +gi.require_version("Gtk", "3.0") + +from dbus.mainloop.glib import DBusGMainLoop +from gi.repository import GLib +from gi.repository import Gtk, GdkPixbuf +from html.parser import HTMLParser + +# Taken from Juminai (and slightly modified) +# Hi I'm Failed and I just stole this from tokyobot + +log_file = os.path.expandvars("/tmp/eww/notifications.json") +cache_dir = os.path.expandvars("/tmp/eww/notifications_img") +eww_dir = os.getcwd() + +os.makedirs(cache_dir, exist_ok=True) + +active_popups = {} + +def clean_text(text): + class HTMLTagStripper(HTMLParser): + def __init__(self): + super().__init__() + self.reset() + self.strict = False + self.convert_charrefs = True + self.text = [] + + def handle_data(self, data): + self.text.append(data) + + def get_text(self): + return "".join(self.text) + + stripper = HTMLTagStripper() + stripper.feed(text) + text = stripper.get_text() + + return text.strip() + +class NotificationDaemon(dbus.service.Object): + def __init__(self): + bus_name = dbus.service.BusName("org.freedesktop.Notifications", dbus.SessionBus()) + dbus.service.Object.__init__(self, bus_name, "/org/freedesktop/Notifications") + self.dnd = self.read_log_file()["dnd"] + + @dbus.service.method("org.freedesktop.Notifications", in_signature="susssasa{sv}i", out_signature="u") + def Notify(self, app_name, replaces_id, app_icon, summary, body, actions, hints, expire_timeout): + command = "zsh /home/$(whoami)/.config/eww/scripts/notifClose > /dev/null 2>&1 & " + subprocess.run(command, shell=True) + + if int(replaces_id) != 0: + id = int(replaces_id) + else: + log_data = self.read_log_file() + notifications = log_data.get('notifications', []) + + if notifications: + id = notifications[0]['id'] + 1 + else: + id = 1 + + actions = list(actions) + acts = [[str(actions[i]), str(actions[i + 1])] for i in range(0, len(actions), 2)] + + details = { + "id": id, + "app": app_name or None, + "summary": clean_text(summary) or None, + "body": clean_text(body) or None, + "time": datetime.datetime.now().strftime("%H:%M"), + "actions": acts, + "icon": fetch(app_name) + } + + if app_icon.strip(): + if os.path.isfile(app_icon) or app_icon.startswith("file://"): + details["image"] = app_icon + else: + details["image"] = self.get_gtk_icon(app_icon) + else: + details["image"] = None + + if "image-data" in hints: + details["image"] = f"{cache_dir}/{details['id']}.png" + self.save_img_byte(hints["image-data"], details["image"]) + + self.save_notification(details) + if not self.dnd: + self.save_popup(details) + return id + + @dbus.service.method("org.freedesktop.Notifications", in_signature="", out_signature="ssss") + def GetServerInformation(self): + return ("eww notification daemon", "klyn", "1.0", "1.2") + + @dbus.service.method("org.freedesktop.Notifications", in_signature="", out_signature="as") + def GetCapabilities(self): + return ('actions', 'body', 'icon-static', 'persistence') + + @dbus.service.signal("org.freedesktop.Notifications", signature="us") + def ActionInvoked(self, id, action): + return (id, action) + + @dbus.service.method("org.freedesktop.Notifications", in_signature="us", out_signature="") + def InvokeAction(self, id, action): + self.ActionInvoked(id, action) + + @dbus.service.signal("org.freedesktop.Notifications", signature="uu") + def NotificationClosed(self, id, reason): + return (id, reason) + + @dbus.service.method("org.freedesktop.Notifications", in_signature="u", out_signature="") + def CloseNotification(self, id): + current = self.read_log_file() + current["notifications"] = [n for n in current["notifications"] if n["id"] != id] + current["count"] = len(current["notifications"]) + + self.write_log_file(current) + self.NotificationClosed(id, 2) + self.DismissPopup(id) + + @dbus.service.method("org.freedesktop.Notifications", in_signature="", out_signature="") + def ToggleDND(self): + self.dnd = not self.dnd + self.update_dnd_state() + + @dbus.service.method("org.freedesktop.Notifications", in_signature="", out_signature="") + def GetDNDState(self): + return self.dnd + + def update_dnd_state(self): + current = self.read_log_file() + current["dnd"] = self.dnd + self.write_log_file(current) + + + def get_gtk_icon(self, icon_name): + theme = Gtk.IconTheme.get_default() + icon_info = theme.lookup_icon(icon_name, 128, 0) + + if icon_info is not None: + return icon_info.get_filename() + + + def save_img_byte(self, px_args: typing.Iterable, save_path: str): + GdkPixbuf.Pixbuf.new_from_bytes( + width=px_args[0], + height=px_args[1], + has_alpha=px_args[3], + data=GLib.Bytes(px_args[6]), + colorspace=GdkPixbuf.Colorspace.RGB, + rowstride=px_args[2], + bits_per_sample=px_args[4], + ).savev(save_path, "png") + + + def write_log_file(self, data): + output_json = json.dumps(data) + print (output_json) + subprocess.run(["eww", "-c", eww_dir, "update", f"notifications={output_json}"]) + + + with open(log_file, "w") as log: + log.write(output_json) + + + def read_log_file(self): + try: + with open(log_file, "r") as log: + return json.load(log) + except (FileNotFoundError, json.JSONDecodeError): + with open(log_file, "w") as log: + initial_data = {"count": 0, "dnd": False, "notifications": [], "popups": []} + json.dump(initial_data, log) + return initial_data + + + + def save_notification(self, notification): + current = self.read_log_file() + current["notifications"].insert(0, notification) + current["count"] = len(current["notifications"]) + + + self.write_log_file(current) + + + @dbus.service.method("org.freedesktop.Notifications", in_signature="", out_signature="") + def ClearAll(self): + for notify in self.read_log_file()['notifications']: + self.NotificationClosed(notify['id'], 2) + empty = {"count": 0, "dnd": self.dnd, "notifications": [], "popups": []} + + self.write_log_file(empty) + + + def save_popup(self, notification): + global active_popups + + current = self.read_log_file() + if len(current["popups"]) >= 3: + oldest_popup = current["popups"].pop() + self.DismissPopup(oldest_popup["id"]) + + current["popups"].insert(0, notification) + self.write_log_file(current) + + popup_id = notification["id"] + active_popups[popup_id] = GLib.timeout_add_seconds(6, self.DismissPopup, popup_id) + + + @dbus.service.method("org.freedesktop.Notifications", in_signature="u", out_signature="") + def DismissPopup(self, id): + global active_popups + + current = self.read_log_file() + current["popups"] = [n for n in current["popups"] if n["id"] != id] + self.write_log_file(current) + + active_popups.pop(id, None) + + + @dbus.service.method("org.freedesktop.Notifications", in_signature="", out_signature="") + def Listen(self): + print(json.dumps(self.read_log_file)) + subprocess.run(["eww", "-c", eww_dir, "update", f"notifications={json.dumps(self.read_log_file())}"]) + +def main(): + DBusGMainLoop(set_as_default=True) + loop = GLib.MainLoop() + NotificationDaemon() + try: + loop.run() + except KeyboardInterrupt: + exit(0) + +if __name__ == "__main__": + main() diff --git a/hypr-configs/hyprland/eww/scripts/notifManage b/hypr-configs/hyprland/eww/scripts/notifManage new file mode 100755 index 0000000..9e6d1ea --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/notifManage @@ -0,0 +1,55 @@ +#!/usr/bin/bash + +# Taken from Juminai + +dismiss() { + dbus-send --session --type=method_call \ + --dest=org.freedesktop.Notifications \ + /org/freedesktop/Notifications \ + org.freedesktop.Notifications.DismissPopup \ + uint32:$1 +} + +close() { + dbus-send --session --type=method_call \ + --dest=org.freedesktop.Notifications \ + /org/freedesktop/Notifications \ + org.freedesktop.Notifications.CloseNotification \ + uint32:$1 +} + +action() { + dbus-send --session --type=method_call \ + --dest=org.freedesktop.Notifications \ + /org/freedesktop/Notifications \ + org.freedesktop.Notifications.InvokeAction \ + uint32:$1 string:$2 +} + +clear_all() { + dbus-send --session --type=method_call \ + --dest=org.freedesktop.Notifications \ + /org/freedesktop/Notifications \ + org.freedesktop.Notifications.ClearAll +} + +listen() { + dbus-send --session --type=method_call \ + --dest=org.freedesktop.Notifications \ + /org/freedesktop/Notifications \ + org.freedesktop.Notifications.Listen +} + +toggle_dnd() { + dbus-send --session --type=method_call \ + --dest=org.freedesktop.Notifications \ + /org/freedesktop/Notifications \ + org.freedesktop.Notifications.ToggleDND +} + +if [[ $1 == '--dismiss' ]]; then dismiss $2 $3; fi +if [[ $1 == '--close' ]]; then close $2; fi +if [[ $1 == '--action' ]]; then action $2 $3; fi +if [[ $1 == '--clear' ]]; then clear_all; fi +if [[ $1 == '--listen' ]]; then listen; fi +if [[ $1 == '--toggle' ]]; then toggle_dnd; fi diff --git a/hypr-configs/hyprland/eww/scripts/pollcover.sh b/hypr-configs/hyprland/eww/scripts/pollcover.sh new file mode 100755 index 0000000..b822ad4 --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/pollcover.sh @@ -0,0 +1,3 @@ +playerctl metadata --format '{{ mpris:artUrl }}' -F | while read location; do + echo $location | cut -c 8- +done diff --git a/hypr-configs/hyprland/eww/scripts/pop b/hypr-configs/hyprland/eww/scripts/pop new file mode 100755 index 0000000..2d87bab --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/pop @@ -0,0 +1,91 @@ +#!/bin/bash + +# change this to your eww bin. Don't question mine +EWW_BIN="$(which eww) -c $HOME/.config/eww/carbonmonoxide" +# EWW_BIN="$HOME/Packages/eww/target/release/eww" + +dashboard() { + LOCK_FILE="$HOME/.config/eww-dashboard.lock" + + run() { + ${EWW_BIN} open dashboard + } + + if [[ ! -f "$LOCK_FILE" ]]; then + touch "$LOCK_FILE" + run && echo "ok good!" + else + ${EWW_BIN} close dashboard + rm "$LOCK_FILE" && echo "closed" + fi +} + +control() { + LOCK_FILE="$HOME/.config/eww-control.lock" + + run() { + ${EWW_BIN} open control_panel + } + + if [[ ! -f "$LOCK_FILE" ]]; then + touch "$LOCK_FILE" + run && echo "ok good!" + else + ${EWW_BIN} close control_panel + rm "$LOCK_FILE" && echo "closed" + fi +} + +calendar() { + LOCK_FILE="$HOME/.config/eww-calendar.lock" + + run() { + ${EWW_BIN} open calendar + } + + if [[ ! -f "$LOCK_FILE" ]]; then + touch "$LOCK_FILE" + run && echo "ok good!" + else + ${EWW_BIN} close calendar + rm "$LOCK_FILE" && echo "closed" + fi +} + +music() { + LOCK_FILE="$HOME/.config/eww-music.lock" + + run() { + ${EWW_BIN} open music + } + + if [[ ! -f "$LOCK_FILE" ]]; then + touch "$LOCK_FILE" + run && echo "ok good!" + else + ${EWW_BIN} close music + rm "$LOCK_FILE" && echo "closed" + fi +} + +if [ "$1" = "calendar" ]; then + calendar +elif [ "$1" = "music" ]; then + music +elif [ "$1" = "control" ]; then + control +elif [ "$1" = "dashboard" ]; then + dashboard +elif [ "$1" = "colourpick" ]; then + COLOUR=$(grim -g "$(slurp -p)" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt:- | awk -F ' ' 'NR==2 {print $3}') + wl-copy "$COLOUR" + notify-send -a colourpicker -i ~/.config/eww/carbonmonoxide/image/eyedropper.png -t 3000 "$COLOUR" "Colour copied to clipboard" +elif [ "$1" = "scrop" ]; then + # control + # sleep 0.5 + grim -g "$(slurp)" - | wl-copy + notify-send -a screenshot -i ~/.config/eww/carbonmonoxide/image/screenshot.png -t 3000 "Screenshot Taken" "Image copied to clipboard" +elif [ "$1" = "sscreen" ]; then + # control + grim - | wl-copy +fi diff --git a/hypr-configs/hyprland/eww/scripts/popup b/hypr-configs/hyprland/eww/scripts/popup deleted file mode 100644 index b6c5364..0000000 --- a/hypr-configs/hyprland/eww/scripts/popup +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/bash - -open_updates() { - $HOME/.config/eww/scripts/updates up -} - -case "$1" in -updates) - open_updates - ;; -esac diff --git a/hypr-configs/hyprland/eww/scripts/quote.py b/hypr-configs/hyprland/eww/scripts/quote.py new file mode 100755 index 0000000..e2d4924 --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/quote.py @@ -0,0 +1,15 @@ +#!/usr/bin/python3 +import requests +import json + +try: + req = requests.get("https://api.quotable.io/random").text + res = json.loads(req) +except: + res = { + "content": "I can't get quotes, you are not online right now", + "author": "quote widget" + } +# print(f"(box :valign 'fill' :vexpand true :orientation 'v' :space-evenly false (scroll :height 100 :width 300 :hscroll true :vscroll true (label :class 'quote' :text `\"{res['content']}\"` :wrap true :width 300)) (label :class 'quoteauthor' :text `- {res['author']}`))") +print(json.dumps(res)) + diff --git a/hypr-configs/hyprland/eww/scripts/study b/hypr-configs/hyprland/eww/scripts/study deleted file mode 100644 index c194769..0000000 --- a/hypr-configs/hyprland/eww/scripts/study +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/bash - -cd ~/ESA\ 2024/ && okular Edital.pdf Horário.pdf & gnome-clocks diff --git a/hypr-configs/hyprland/eww/scripts/sys_info b/hypr-configs/hyprland/eww/scripts/sys_info new file mode 100755 index 0000000..0a66bc6 --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/sys_info @@ -0,0 +1,112 @@ + +#!/bin/bash + +## Files and Data +PREV_TOTAL=0 +PREV_IDLE=0 +cpuFile="/tmp/.cpu_usage" + +## Get CPU usage +get_cpu() { + if [[ -f "${cpuFile}" ]]; then + fileCont=$(cat "${cpuFile}") + PREV_TOTAL=$(echo "${fileCont}" | head -n 1) + PREV_IDLE=$(echo "${fileCont}" | tail -n 1) + fi + + CPU=(`cat /proc/stat | grep '^cpu '`) # Get the total CPU statistics. + unset CPU[0] # Discard the "cpu" prefix. + IDLE=${CPU[4]} # Get the idle CPU time. + + # Calculate the total CPU time. + TOTAL=0 + + for VALUE in "${CPU[@]:0:4}"; do + let "TOTAL=$TOTAL+$VALUE" + done + + if [[ "${PREV_TOTAL}" != "" ]] && [[ "${PREV_IDLE}" != "" ]]; then + # Calculate the CPU usage since we last checked. + let "DIFF_IDLE=$IDLE-$PREV_IDLE" + let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL" + let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10" + echo "${DIFF_USAGE}" + else + echo "?" + fi + + # Remember the total and idle CPU times for the next check. + echo "${TOTAL}" > "${cpuFile}" + echo "${IDLE}" >> "${cpuFile}" +} + +## Get Used memory +get_mem() { + printf "%.0f\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}') +} + +## Get Brightness +get_blight() { + CARD=`ls /sys/class/backlight | head -n 1` + + if [[ "$CARD" == *"intel_"* ]]; then + BNESS=`xbacklight -get` + LIGHT=${BNESS%.*} + else + BNESS=`blight -d $CARD get brightness` + PERC="$(($BNESS*100/255))" + LIGHT=${PERC%.*} + fi + + echo "$LIGHT" +} + +## Get Battery +get_battery() { + battery_info=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0) + battery_percentage=$(echo "$battery_info" | grep -E "percentage" | awk '{print $2}' | tr -d '%') + battery_state=$(echo "$battery_info" | grep -E "state" | awk '{print $2}') + + case $battery_state in + "discharging") + if [ "$battery_percentage" -le 10 ]; then + notify-send -a battery "Battery percentage 10%" "HOLY FUCK PLEASE CHARGE ME" + elif [ "$battery_percentage" -le 15 ]; then + notify-send -a battery "Battery Percentage 15%" "You should probably plug in the charger" + fi + ;; + esac + + echo $battery_percentage +} + +get_battery_icon () { + battery_info=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0) + battery_percentage=$(echo "$battery_info" | grep -E "percentage" | awk '{print $2}' | tr -d '%') + icon="" + + if [ "$battery_percentage" -le 20 ]; then + icon="" + elif [ "$battery_percentage" -le 40 ]; then + icon="" + elif [ "$battery_percentage" -le 60 ]; then + icon="" + elif [ "$battery_percentage" -le 80 ]; then + icon="" + fi + + echo $icon +} + +## Execute accordingly +if [[ "$1" == "--cpu" ]]; then + get_cpu +elif [[ "$1" == "--mem" ]]; then + get_mem +elif [[ "$1" == "--blight" ]]; then + get_blight +elif [[ "$1" == "--bat" ]]; then + get_battery +elif [[ "$1" == "--baticon" ]]; then + get_battery_icon +fi diff --git a/hypr-configs/hyprland/eww/scripts/sysinfo.sh b/hypr-configs/hyprland/eww/scripts/sysinfo.sh deleted file mode 100644 index edc23b7..0000000 --- a/hypr-configs/hyprland/eww/scripts/sysinfo.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -get_username() { - fullname=$(getent passwd "$(whoami)" | cut -d ':' -f 5 | cut -d ',' -f 1 | tr -d "\n") - if [ -z "$fullname" ]; then - username="$(whoami)" - else - username="${fullname%% *}" - fi - - # Transforma todo o texto em maiúsculas - username="${username^}" - - echo "@$username" -} -get_kernel_version() { - echo "$(uname -r)" -} - -get_operating_system() { - echo "$(cat /etc/os-release | awk 'NR==1' | awk -F '"' '{print $2}')" -} - -get_installed_packages() { - echo "$(yay -Q | wc -l)" -} - -get_window_manager() { - echo "$XDG_CURRENT_DESKTOP" -} - -get_uptime() { - echo "$(uptime -p | sed -e 's/up //g')" -} - -# Main function -main() { - case "$1" in - "--name") - get_username - ;; - "--kernel") - get_kernel_version - ;; - "--os") - get_operating_system - ;; - "--pkgs") - get_installed_packages - ;; - "--wm") - get_window_manager - ;; - "--uptime") - get_uptime - ;; - *) - echo "Usage: $0 {--name|--kernel|--os|--pkgs|--wm|--uptime}" - exit 1 - ;; - esac -} - -# Call the main function with the provided arguments -main "$@" diff --git a/hypr-configs/hyprland/eww/scripts/system b/hypr-configs/hyprland/eww/scripts/system deleted file mode 100644 index 59f568b..0000000 --- a/hypr-configs/hyprland/eww/scripts/system +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/bash - -## Files and Data -PREV_TOTAL=0 -PREV_IDLE=0 -cpuFile="/tmp/.cpu_usage" - -## Get CPU usage -get_cpu() { - if [[ -f "${cpuFile}" ]]; then - fileCont=$(cat "${cpuFile}") - PREV_TOTAL=$(echo "${fileCont}" | head -n 1) - PREV_IDLE=$(echo "${fileCont}" | tail -n 1) - fi - - CPU=($(cat /proc/stat | grep '^cpu ')) # Get the total CPU statistics. - unset CPU[0] # Discard the "cpu" prefix. - IDLE=${CPU[4]} # Get the idle CPU time. - - # Calculate the total CPU time. - TOTAL=0 - - for VALUE in "${CPU[@]:0:4}"; do - let "TOTAL=$TOTAL+$VALUE" - done - - if [[ "${PREV_TOTAL}" != "" ]] && [[ "${PREV_IDLE}" != "" ]]; then - # Calculate the CPU usage since we last checked. - let "DIFF_IDLE=$IDLE-$PREV_IDLE" - let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL" - let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10" - echo "${DIFF_USAGE}" - else - echo "?" - fi - - # Remember the total and idle CPU times for the next check. - echo "${TOTAL}" >"${cpuFile}" - echo "${IDLE}" >>"${cpuFile}" -} - -## Get Used memory -get_mem() { - printf "%.0f\n" "$(free -m | grep Mem | awk '{print ($3/$2)*100}')" -} - -get_mem_mb() { - free -m | sed -n 's/^Mem:\s\+[0-9]\+\s\+\([0-9]\+\)\s.\+/\1/p' -} - -## Execute accordingly -if [[ "$1" == "--cpu" ]]; then - get_cpu -elif [[ "$1" == "--mem" ]]; then - get_mem -elif [[ "$1" == "--memb" ]]; then - get_mem_mb -fi diff --git a/hypr-configs/hyprland/eww/scripts/tasklist.py b/hypr-configs/hyprland/eww/scripts/tasklist.py new file mode 100755 index 0000000..efe50f0 --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/tasklist.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python3 +from iconfetch import fetch +import subprocess +import json +import os +import i3ipc + +eww_bin= [subprocess.getoutput("which eww"), "-c", f"{os.getcwd()}"] + +def recurse(apps, workspace, output): + for l in workspace.descendants(): + if not l.pid or not l.app_id: + continue + app_id = l.app_id.lower() + + if app_id == "com.github.xournalpp.xournalpp": + app_id = "xournalpp" + + rect = { + "x": 0, + "y": 0, + "width": 0, + "height": 0 + } + + rect["x"] = l.rect.x - output.rect.x + rect["y"] = l.rect.y - output.rect.y + + rect["width"] = l.rect.width * 1920/output.rect.width + rect["height"] = l.rect.height * 1080/output.rect.height + rect["x"] *= 1920/output.rect.width + rect["y"] *= 1080/output.rect.height + + apps.append({ + "app_id": app_id, + "name": l.name, + "pid": l.pid, + "focused": l.focused, + "rect": rect, + "path": fetch(app_id) or fetch("unknown") + }) + +def update(i3, e): + + root = i3.get_tree() + + apps = [] + windows = [[] for _ in range(10)] + + for output in root.nodes: + if output.name == "__i3": + continue + + for workspace in output.nodes: + found = [] + recurse(found, workspace, output) + + apps.extend(found) + # if output["name"] == "eDP-1": + # windows[int(workspace["name"])-1] = found + windows[int(workspace.name)-1] = found + + # change this yourself lol + appsdict = { + "firefox": [], + "thunar": [], + "xournalpp": [], + "discord": [], + "foot": [] + } + # translate to launch cmd + appsexec = { + "discord": "discord-wayland", + "xournalpp": "com.github.xournalpp.xournalpp", + "foot": "org.codeberg.dnkl.foot", + } + + appsjson = [] + + for app in apps: + a = app.copy() + name = a["app_id"] + + if name not in appsdict: + appsdict[name] = [] + appsdict[name].append(a) + + for key, value in appsdict.items(): + if len(value) == 0: + appsjson.append(dict( + path = fetch(key), + name = key, + app_id = key if key not in appsexec else appsexec[key], + pid = None, + focused = [] + )) + + else: + f = [] + for v in value: + f.append(v["focused"]) + + appsjson.append(dict( + path = value[0]["path"], + name = value[0]["name"], + app_id = value[0]["app_id"].lower(), + pid = value[0]["pid"], + focused = f + )) + + + subprocess.run(eww_bin + ["update", f"windows={json.dumps(windows)}"]) + subprocess.run(eww_bin + ["update", f"tasksjson={json.dumps(appsjson)}"]) + +def main(): + i3 = i3ipc.Connection(auto_reconnect=True) + update(i3, None) + i3.on(i3ipc.Event.WINDOW, update) + i3.main() + + +if __name__ == "__main__": + main() diff --git a/hypr-configs/hyprland/eww/scripts/timer.py b/hypr-configs/hyprland/eww/scripts/timer.py new file mode 100755 index 0000000..91ec498 --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/timer.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python3 +import time +import os +import sys +import subprocess + +eww_bin= [subprocess.getoutput("which eww"), "-c", f"{os.getcwd()}"] + +def startstop(): + if os.path.exists("/tmp/timerstamp"): + os.remove("/tmp/timerstamp") + os.popen("notify-send 'timer stopped'") + else: + with open("/tmp/timerstamp", "x") as f: + f.write(str(time.time())) + os.popen("notify-send 'timer start'") + + + +# fuck it, I'm sure we don't need the loop function +def readtime(): + if not os.path.exists("/tmp/timer"): + with open("/tmp/timer", "x") as f: + f.write("25") + + while True: + with open("/tmp/timer") as f: + timer = int(f.read()) + + if os.path.exists("/tmp/timerstamp"): + current = time.time() + with open("/tmp/timerstamp") as f: + timestamp = float(f.read()) + + if current - timestamp >= timer*60: + os.remove("/tmp/timerstamp") + os.popen("notify-send 'time is up'") + print("OwO") + subprocess.run(eww_bin + ["update", f"timerdis=OwO"]) + else: + m, s = divmod((timer*60) - (current-timestamp), 60) + print (f"{int(m)}:{int(s)}") + subprocess.run(eww_bin + ["update", f"timerdis={int(m)}:{int(s)}"]) + else: + print(timer) + subprocess.run(eww_bin + ["update", f"timerdis={timer}"]) + + time.sleep(1) + + +def loop(): + if not os.path.exists("/tmp/timer"): + with open("/tmp/timer", "x") as f: + f.write("25") + + while True: + with open("/tmp/timer") as f: + timer = int(f.read()) + + current = time.time() + if os.path.exists("/tmp/timerstamp"): + with open("/tmp/timerstamp") as f: + timestamp = float(f.read()) + + if current - timestamp >= timer*60: + os.remove("/tmp/timerstamp") + os.popen("notify-send 'time is up'") + + time.sleep(1) + +def substate(): + if os.path.exists("/tmp/timerstamp"): + print("stop") + else: + print("start") + +def timeinc(): + with open("/tmp/timer", "r") as f: + timer = int(f.read()) + + timer+=5 + with open("/tmp/timer", "w") as f: + f.write(str(timer)) + subprocess.run(eww_bin + ["update", f"timerdis={timer}"]) + +def timedec(): + with open("/tmp/timer", "r") as f: + timer = int(f.read()) + + timer-=5 + with open("/tmp/timer", "w") as f: + f.write(str(timer)) + subprocess.run(eww_bin + ["update", f"timerdis={timer}"]) + +a = sys.argv[1] + +if a == "loop": + loop() +if a == "toggle": + startstop() +if a == "subscribe": + readtime() +if a == "substate": + substate() +if a == "timedec": + timedec() +if a == "timeinc": + timeinc() diff --git a/hypr-configs/hyprland/eww/scripts/toggletheme b/hypr-configs/hyprland/eww/scripts/toggletheme new file mode 100755 index 0000000..c06267b --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/toggletheme @@ -0,0 +1,138 @@ +#!/bin/bash +scss_theme="$HOME/.config/eww/carbonmonoxide/colors.scss" +# dark="oxocarbon" +# light="oxocarbon_light" + +switch_theme () { + echo '@import '"\"./themes/$1.scss\"" > $scss_theme + + if [[ -f "$HOME/.config/foot/themes/$1.ini" ]]; then + sed -i "s/include=.*/include=~\/.config\/foot\/themes\/$1.ini/" $HOME/.config/foot/foot.ini + fi + + if [[ -f "$HOME/.config/wofi/themes/$1.css" ]]; then + sed -i "s/@import.*/@import \".config\/wofi\/themes\/$1.css\";/" $HOME/.config/wofi/style.css + fi + + inactivebg=$(sed -n "s/\$surface0: \(.*\);/\1/p" $HOME/.config/eww/carbonmonoxide/themes/$1.scss) + bg=$(sed -n "s/\$surface2: \(.*\);/\1/p" $HOME/.config/eww/carbonmonoxide/themes/$1.scss) + text=$(sed -n "s/\$white0: \(.*\);/\1/p" $HOME/.config/eww/carbonmonoxide/themes/$1.scss) + urgent="#ee5396" + + if [ -n $surface0 ] && [ -n $surface2 ] && [ -n $white0 ]; then + swaymsg "client.focused $bg $bg $text $bg" + swaymsg "client.unfocused $inactivebg $inactivebg $text $inactivebg" + swaymsg "client.focused_inactive $inactivebg $inactivebg $text $inactivebg" + swaymsg "client.urgent $urgent $urgent $text $urgent" + fi + + sleep 1 + notify-send -a Theme "Theme selected" "$1" +} + +current=`cat $scss_theme | sed 's/@import \".\/themes\/\(.*\).scss\"/\1/'` + +if [[ $1 == "toggle" ]]; then + case $current in + "oxocarbon") + switch_theme "oxocarbon_light" + swaymsg output \* bg ~/.config/sway/wallpaper/tile.png tile + ;; + "oxocarbon_light") + switch_theme "catppuccin" + swaymsg output \* bg ~/.config/sway/wallpaper/catppuccinlan.png fill + ;; + "catppuccin") + switch_theme "rosepine" + swaymsg output \* bg ~/.config/sway/wallpaper/rosepine.jpg fill + ;; + "rosepine") + switch_theme "swamp" + swaymsg output \* bg ~/.config/sway/wallpaper/swamp.png fill + ;; + "swamp") + switch_theme "biscuit" + swaymsg output \* bg ~/.config/sway/wallpaper/biscuitcat.png fill + ;; + "biscuit") + switch_theme "camellia" + swaymsg output \* bg ~/.config/sway/wallpaper/camelliawoman.jpg fill + ;; + *) + switch_theme "oxocarbon" + swaymsg output \* bg ~/.config/sway/wallpaper/tile.png tile + ;; + esac +elif [[ $1 == "select" ]]; then + case $2 in + "oxocarbon_light") + switch_theme "oxocarbon_light" + swaymsg output \* bg ~/.config/sway/wallpaper/tile.png tile + ;; + "catppuccin") + switch_theme "catppuccin" + swaymsg output \* bg ~/.config/sway/wallpaper/catppuccinlan.png fill + ;; + "catppuccin_latte") + switch_theme "catppuccin_latte" + swaymsg output \* bg ~/.config/sway/wallpaper/forrest.png fill + ;; + "rosepine") + switch_theme "rosepine" + swaymsg output \* bg ~/.config/sway/wallpaper/rosepine.jpg fill + ;; + "swamp") + switch_theme "swamp" + swaymsg output \* bg ~/.config/sway/wallpaper/swamp.png fill + ;; + "biscuit") + switch_theme "biscuit" + swaymsg output \* bg ~/.config/sway/wallpaper/biscuitcat.png fill + ;; + "camellia") + switch_theme "camellia" + swaymsg output \* bg ~/.config/sway/wallpaper/camelliawoman.jpg fill + ;; + *) + switch_theme "oxocarbon" + swaymsg output \* bg ~/.config/sway/wallpaper/tile.png tile + ;; + esac +elif [[ $1 == "setup" ]]; then + case $current in + "oxocarbon_light") + switch_theme "oxocarbon_light" + swaymsg output \* bg ~/.config/sway/wallpaper/tile.png tile + ;; + "catppuccin") + switch_theme "catppuccin" + swaymsg output \* bg ~/.config/sway/wallpaper/catppuccinlan.png fill + ;; + "catppuccin_latte") + switch_theme "catppuccin_latte" + swaymsg output \* bg ~/.config/sway/wallpaper/forrest.png fill + ;; + "rosepine") + switch_theme "rosepine" + swaymsg output \* bg ~/.config/sway/wallpaper/rosepine.jpg fill + ;; + "swamp") + switch_theme "swamp" + swaymsg output \* bg ~/.config/sway/wallpaper/swamp.png fill + ;; + "biscuit") + switch_theme "biscuit" + swaymsg output \* bg ~/.config/sway/wallpaper/biscuitcat.png fill + ;; + "camellia") + switch_theme "camellia" + swaymsg output \* bg ~/.config/sway/wallpaper/camelliawoman.jpg fill + ;; + *) + switch_theme "oxocarbon" + swaymsg output \* bg ~/.config/sway/wallpaper/tile.png tile + ;; + esac +else + echo $current +fi diff --git a/hypr-configs/hyprland/eww/scripts/touchkey.sh b/hypr-configs/hyprland/eww/scripts/touchkey.sh new file mode 100755 index 0000000..e327c89 --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/touchkey.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +PID=$(pidof wvkbd-mobintl) + +if [ -z $PID ]; then + wvkbd-mobintl & +else + kill $PID +fi diff --git a/hypr-configs/hyprland/eww/scripts/trashput.sh b/hypr-configs/hyprland/eww/scripts/trashput.sh new file mode 100755 index 0000000..d41c909 --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/trashput.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +file=$(echo $1 | cut -c 7-) + +mv $file ~/.local/share/Trash/files diff --git a/hypr-configs/hyprland/eww/scripts/updates b/hypr-configs/hyprland/eww/scripts/updates deleted file mode 100644 index 3f621b1..0000000 --- a/hypr-configs/hyprland/eww/scripts/updates +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -if ! updates_arch=$(checkupdates 2>/dev/null | wc -l); then - updates_arch=0 -fi - -if ! updates_aur=$(yay -Qum 2>/dev/null | wc -l); then - updates_aur=0 -fi - -updates=$((updates_arch + updates_aur)) - -check() { - if [ "$updates" -gt 0 ]; then - bspc rule -a \* -o state=floating && alacritty -e $SHELL -c 'yay -Syu' - fi -} - -case "$1" in -up) - check - ;; -get) - echo "$updates" - ;; -esac diff --git a/hypr-configs/hyprland/eww/scripts/user.sh b/hypr-configs/hyprland/eww/scripts/user.sh deleted file mode 100644 index a846ff4..0000000 --- a/hypr-configs/hyprland/eww/scripts/user.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -get_username() { - echo "$(whoami)" -} - -get_kernel_version() { - echo "$(uname -r)" -} - -get_operating_system() { - echo "$(cat /etc/os-release | awk 'NR==1' | awk -F '"' '{print $2}')" -} - -get_installed_packages() { - echo "$(yay -Q | wc -l)" -} - -get_window_manager() { - echo "$XDG_CURRENT_DESKTOP" -} - -# Main function -main() { - case "$1" in - "--name") - get_username - ;; - "--kernel") - get_kernel_version - ;; - "--os") - get_operating_system - ;; - "--pkgs") - get_installed_packages - ;; - "--wm") - get_window_manager - ;; - *) - echo "Usage: $0 {--name|--kernel|--os|--pkgs|--wm}" - exit 1 - ;; - esac -} - -# Call the main function with the provided arguments -main "$@" diff --git a/hypr-configs/hyprland/eww/scripts/volume b/hypr-configs/hyprland/eww/scripts/volume deleted file mode 100644 index 9399795..0000000 --- a/hypr-configs/hyprland/eww/scripts/volume +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -pamixer --get-volume-human | tr -d '%' - -pactl subscribe | rg --line-buffered "on sink" | while read -r _; do - pamixer --get-volume-human | tr -d '%' -done diff --git a/hypr-configs/hyprland/eww/scripts/wallhaven.py b/hypr-configs/hyprland/eww/scripts/wallhaven.py new file mode 100755 index 0000000..3eb5f25 --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/wallhaven.py @@ -0,0 +1,56 @@ +#! /usr/bin/env python3 + +import requests +import json +import sys +import os +import subprocess +import shutil + +imgdir = "/tmp/wallpapers" +eww_bin= [subprocess.getoutput("which eww"), "-c", f"{os.getcwd()}"] + +try: + if sys.argv[1] == "search": + if os.path.exists(imgdir): + shutil.rmtree(imgdir) + os.mkdir(imgdir) + else: + os.mkdir(imgdir) + + data = json.loads(requests.get(f"https://wallhaven.cc/api/v1/search?q={'+'.join(sys.argv[2:])}&ratios=landscape").text) + + smaller = [] + count = 0 + for d in data["data"]: + + if count == 15: + break + count += 1 + + img_data = requests.get(d["thumbs"]["small"]).content + with open(imgdir+"/"+d["id"]+".png", "wb") as f: + f.write(img_data) + + smaller.append({"path": imgdir+"/"+d["id"]+".png", "fav": d["favorites"], "views": d["views"], "url": d["path"]}) + + subprocess.run(eww_bin+["update", f"wallpapers={json.dumps(smaller)}"]) + + # print(json.dumps(smaller)) + elif sys.argv[1] == "select": + url = sys.argv[2] + + if not url: + raise Exception("No url provided") + img_data = requests.get(url).content + with open(imgdir+"/selected.png", "wb") as f: + f.write(img_data) + + subprocess.run(["swaymsg", "output", "*", "bg", imgdir+"/selected.png", "fill"]) + + elif sys.argv[1] == "reset": + subprocess.run(["swaymsg", "output", "*", "bg", os.path.expandvars("$HOME/.config/sway/wallpaper/tile.png"), "tile"]) + +except Exception as e: + print(e) + print("{}") diff --git a/hypr-configs/hyprland/eww/scripts/weather.py b/hypr-configs/hyprland/eww/scripts/weather.py new file mode 100755 index 0000000..8cdce02 --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/weather.py @@ -0,0 +1,151 @@ +#!/usr/bin/python3 +import requests +import json +import time + +mytime = time.localtime() +day = (6 < mytime.tm_hour < 20) + +code_icon = { + 113: "clear", + 116: "few-clouds", + 119: "clouds", + 122: "clouds", + 143: "fog", + 176: "rain", + 179: "snow", + 182: "snow", + 185: "snow", + 200: "storm", + 227: "snow", + 230: "storm", + 248: "fog", + 260: "fog", + 263: "rain-light", + 266: "rain-light", + 281: "rain-light", + 284: "rain-light", + 293: "rain-light", + 296: "rain-light", + 299: "rain", + 302: "rain", + 305: "rain", + 308: "rain", + 311: "rain", + 353: "rain-light", + 356: "rain", +} + +code_icon_n = { + 113: "clear-n", + 116: "few-clouds-n", + 119: "clouds", + 122: "clouds", + 143: "fog", + 176: "rain", + 179: "snow", + 182: "snow", + 185: "snow", + 200: "storm", + 227: "snow", + 230: "storm", + 248: "fog", + 260: "fog", + 263: "rain-light", + 266: "rain-light", + 281: "rain-light", + 284: "rain-light", + 293: "rain-light", + 296: "rain-light", + 299: "rain", + 302: "rain", + 305: "rain", + 308: "rain", + 311: "rain", + 353: "rain-light", + 356: "rain", +} + +try: + req = requests.get(r"https://wttr.in/?format=j1", timeout=15).text + req = json.loads(req) + res = req["current_condition"][0].copy() + + code = int(res["weatherCode"]) + if day: + if code in code_icon: + res["icon"] = code_icon[code] + else: + res["icon"] = "idk" + else: + if code in code_icon_n: + res["icon"] = code_icon_n[code] + else: + res["icon"] = "idk" + + # hourly + + it = 0 + while it < 8 and int(req["weather"][0]["hourly"][it]["time"]) < mytime.tm_hour * 100: + it += 1 + + res["hourly"] = [] + for i in range(8): + res["hourly"].append(req["weather"][(it+i)//8]["hourly"][(it+i)%8].copy()) + + for hour in res["hourly"]: + t = int(hour["time"])//100 + if t > 12: + hour["time"] = f"{t-12}pm" + elif t == 12: + hour["time"] = "12pm" + elif t == 0: + hour["time"] = "12am" + else: + hour["time"] = f"{t}am" + + code = int(hour["weatherCode"]) + if day: + if code in code_icon: + hour["icon"] = code_icon[code] + else: + hour["icon"] = "idk" + else: + if code in code_icon_n: + hour["icon"] = code_icon_n[code] + else: + hour["icon"] = "idk" + + + print(json.dumps(res)) + +except Exception as e: + # print(e) + print(""" +{ + "FeelsLikeC": "0", + "FeelsLikeF": "0", + "cloudcover": "0", + "humidity": "0", + "localObsDateTime": "2000-00-00 07:27 AM", + "observation_time": "07:27 AM", + "precipInches": "0.0", + "precipMM": "0.0", + "pressure": "0", + "pressureInches": "0", + "temp_C": "0", + "temp_F": "0", + "uvIndex": "0", + "visibility": "0", + "visibilityMiles": "0", + "weatherCode": "727", + "weatherDesc": [{"value": "Idk"}], + "weatherIconUrl": [{"value": ""}], + "winddir16Point": "", + "winddirDegree": "0", + "windspeedKmph": "0", + "windspeedMiles": "0", + "icon": "idk", + "hourly": [] + } + """) diff --git a/hypr-configs/hyprland/eww/scripts/wifi b/hypr-configs/hyprland/eww/scripts/wifi new file mode 100755 index 0000000..16f2baa --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/wifi @@ -0,0 +1,35 @@ +#!/bin/bash + +status=$(nmcli g | grep -oE "disconnected") +essid=$(nmcli c | grep wlp0s20f3 | awk '{print ($1)}') +strength=$(awk 'NR==3 {printf("%.0f\n",$3*10/7)}' /proc/net/wireless) + +if [ $status ] ; then + icon="󰤭" + text="" + col="#f38ba8" + +else + if [ $strength -le 25 ]; then + icon="󰤟" + elif [ $strength -le 50 ]; then + icon="󰤢" + elif [ $strength -le 75 ]; then + icon="󰤥" + else + icon="󰤨" + fi + + text="${essid}" + col="#b4befe" +fi + + + +if [[ "$1" == "--COL" ]]; then + echo $col +elif [[ "$1" == "--ESSID" ]]; then + echo $text +elif [[ "$1" == "--ICON" ]]; then + echo $icon +fi diff --git a/hypr-configs/hyprland/eww/scripts/workspace b/hypr-configs/hyprland/eww/scripts/workspace deleted file mode 100644 index 73b7ce1..0000000 --- a/hypr-configs/hyprland/eww/scripts/workspace +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -WORKSPACES_NUMBER=5 - -workspaces() { - WORKSPACE_WINDOWS=$(hyprctl workspaces -j | jq 'map({key: .id | tostring, value: .windows}) | from_entries') - CURRENT="$(hyprctl -j monitors | jq '.[0].activeWorkspace.name')" - - seq 1 $WORKSPACES_NUMBER | \ - jq --argjson windows "${WORKSPACE_WINDOWS}" \ - --argjson current "${CURRENT}" \ - --slurp -Mc 'map(tostring) | map({id: ., windows: ($windows[.]//0), current: ($current == .)})' -} - -workspaces -socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do - workspaces -done diff --git a/hypr-configs/hyprland/eww/scripts/workspace.py b/hypr-configs/hyprland/eww/scripts/workspace.py new file mode 100755 index 0000000..c56729c --- /dev/null +++ b/hypr-configs/hyprland/eww/scripts/workspace.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 + +import subprocess +import json +import os +import i3ipc + +eww_bin= [subprocess.getoutput("which eww"), "-c", f"{os.getcwd()}"] + +def get_workspaces(i3): + result = i3.get_workspaces() + + active = [] + + for i in range(1, 6): + active.append(dict( + focused = False, + empty = True, + name = i + )) + + for res in result: + if not res.output == "eDP-1": continue + if res.num%10-1 > 4 or res.num%10-1 < 0: + continue + active[res.num%10-1]["empty"] = False + if res.focused: + active[res.num%10-1]["focused"] = True + + return active + +def update(i3, e): + print(json.dumps(get_workspaces(i3)), flush=True) + +def main(): + i3 = i3ipc.Connection(auto_reconnect=True) + update(i3, None) + i3.on(i3ipc.Event.WORKSPACE, update) + i3.main() + +if __name__ == "__main__": + main() diff --git a/hypr-configs/hyprland/eww/themes/biscuit.scss b/hypr-configs/hyprland/eww/themes/biscuit.scss new file mode 100644 index 0000000..172f5e9 --- /dev/null +++ b/hypr-configs/hyprland/eww/themes/biscuit.scss @@ -0,0 +1,20 @@ +// by Tsukki + +$base: #1A1515; +$surface0: #2d2424; +$surface1: #453636; +$surface2: #725a5a; +$white0: #DCC9BC; +$white1: #ffe9c7; +$white2: #ffe9c7; +$red: #CF223E; +$green: #959A6B; + +$base08: #F07342; +$base0B: #768F80; +$base0C: #756D94; +$base0D: #614F76; +$base0E: #7B3D79; +$base0F: #AE3F82; + +$accent: $base08; diff --git a/hypr-configs/hyprland/eww/themes/biscuit_light.scss b/hypr-configs/hyprland/eww/themes/biscuit_light.scss new file mode 100644 index 0000000..00c24e6 --- /dev/null +++ b/hypr-configs/hyprland/eww/themes/biscuit_light.scss @@ -0,0 +1,23 @@ +// by Tsukki + +$base: #FFF7EB; +$surface0: #E0CFC6; +$surface1: #C1AEAE; +$surface2: #A38A8A; +$white0: #483939; +$white1: #2D2424; +$white2: #2D2424; + +$red: #B54851; +$green: #938579; // green??? I think??? + +$base04: #9C8181; +$base08: #D0796D; +$base09: #C6846C; +$base0B: #878985; +$base0C: #877B85; +$base0D: #79657A; +$base0E: #794F65; +$base0F: #9F596C; + +$accent: $base08; diff --git a/hypr-configs/hyprland/eww/themes/camellia.scss b/hypr-configs/hyprland/eww/themes/camellia.scss new file mode 100644 index 0000000..4eddcf8 --- /dev/null +++ b/hypr-configs/hyprland/eww/themes/camellia.scss @@ -0,0 +1,29 @@ +// By Vixima + +$BG : #17181C; +$MidBG : #1E1F24; +$LightBG : #26272B; +$DarkGrey : #333438; +$LightGrey: #8F9093; +$DarkFG : #B0B1B4; +$MidFG : #CBCCCE; +$FG : #E4E5E7; +$Pink : #FA3867; +$Orange : #F57F3D; +$Gold : #F5CA32; +$Lime : #65DB3D; +$Turquoise: #53DFCA; +$Blue : #4CB2E5; +$Violet : #9A57F5; +$Red : #FA4242; + +$base: #17181C; +$surface0: #1E1F24; +$surface1: #26272B; +$surface2: #333438; +$white0: #E4E5E7; +$white1: $FG; +$white2: $FG; +$red: $Red; +$green: $Lime; +$accent: $Pink; diff --git a/hypr-configs/hyprland/eww/themes/catppuccin.scss b/hypr-configs/hyprland/eww/themes/catppuccin.scss new file mode 100644 index 0000000..19e2fbc --- /dev/null +++ b/hypr-configs/hyprland/eww/themes/catppuccin.scss @@ -0,0 +1,27 @@ +$rosewater: #f5e0dc; +$flamingo: #f2cdcd; +$pink: #f5c2e7; +$mauve: #cba6f7; +$red: #f38ba8; +$maroon: #eba0ac; +$peach: #fab387; +$yellow: #f9e2af; +$green: #a6e3a1; +$teal: #94e2d5; +$sky: #89dceb; +$sapphire: #74c7ec; +$blue: #89b4fa; +$lavender: #b4befe; +$white0: #cdd6f4; +$white1: #bac2de; +$white2: #a6adc8; +$overlay2: #9399b2; +$overlay1: #7f849c; +$overlay0: #6c7086; +$surface2: #585b70; +$surface1: #45475a; +$surface0: #313244; +$base: #1e1e2e; +$mantle: #181825; +$crust: #11111b; +$accent: $mauve; diff --git a/hypr-configs/hyprland/eww/themes/catppuccin_latte.scss b/hypr-configs/hyprland/eww/themes/catppuccin_latte.scss new file mode 100644 index 0000000..cab6295 --- /dev/null +++ b/hypr-configs/hyprland/eww/themes/catppuccin_latte.scss @@ -0,0 +1,27 @@ +$rosewater: #dc8a78; +$flamingo: #dd7878; +$pink: #ea76cb; +$mauve: #8839ef; +$red: #d20f39; +$maroon: #e64553; +$peach: #fe640b; +$yellow: #df8e1d; +$green: #40a02b; +$teal: #179299; +$sky: #04a5e5; +$sapphire: #209fb5; +$blue: #1e66f5; +$lavender: #7287fd; +$white0: #4c4f69; +$white1: #5c5f77; +$white2: #6c6f85; +$overlay2: #7c7f93; +$overlay1: #8c8fa1; +$overlay0: #9ca0b0; +$surface2: #acb0be; +$surface1: #bcc0cc; +$surface0: #ccd0da; +$base: #eff1f5; +$mantle: #e6e9ef; +$crust: #dce0e8; +$accent: #7287fd; diff --git a/hypr-configs/hyprland/eww/themes/fullerene.scss b/hypr-configs/hyprland/eww/themes/fullerene.scss new file mode 100644 index 0000000..596f2eb --- /dev/null +++ b/hypr-configs/hyprland/eww/themes/fullerene.scss @@ -0,0 +1,36 @@ +// by Gwynsav + +$black :#0c0c0c; +$gray100 :#161616; +$gray90 :#1f1f1f; +$gray80 :#262626; +$gray70 :#393939; +$gray60 :#525252; +$gray50 :#6f6f6f; +$gray40 :#8d8d8d; +$gray30 :#a8a8a8; +$gray20 :#c6c6c6; +$gray10 :#e0e0e0; +$white :#f4f4f4; + +$red :#c1374b; +$red_dark :#902c3b; +$green :#32ae80; +$green_dark :#2a8664; +$yellow :#e1a36b; +$yellow_dark :#d78438; +$blue :#738be7; +$blue_dark :#546ad8; +$magenta :#9e7ad5; +$magenta_dark :#875fd4; +$cyan :#2b9eb0; +$cyan_dark :#1f7a89; + +$base: $black; +$surface0: $gray80; +$surface1: $gray70; +$surface2: $gray60; +$white0: $gray10; +$white1: $white; +$white2: $white; +$accent: $magenta; diff --git a/hypr-configs/hyprland/eww/themes/oxocarbon.scss b/hypr-configs/hyprland/eww/themes/oxocarbon.scss new file mode 100644 index 0000000..7270ff3 --- /dev/null +++ b/hypr-configs/hyprland/eww/themes/oxocarbon.scss @@ -0,0 +1,18 @@ + +$base: #161616; +$surface0: #262626; +$surface1: #393939; +$surface2: #525252; +$white0: #dde1e6; +$white1: #f2f4f8; +$white2: #ffffff; +$teal: #08bdba; +$sapphire: #3ddbd9; +$sky: #78a9ff; +$maroon: #ee5396; +$blue: #33b1ff; +$red: #ff7eb6; +$green: #42be65; +$lavender: #be95ff; +$light_blue: #82cfff; +$accent: $red; diff --git a/hypr-configs/hyprland/eww/themes/oxocarbon_light.scss b/hypr-configs/hyprland/eww/themes/oxocarbon_light.scss new file mode 100644 index 0000000..c615515 --- /dev/null +++ b/hypr-configs/hyprland/eww/themes/oxocarbon_light.scss @@ -0,0 +1,17 @@ +$base: #f2f4f8; +$surface0: #dde1e6; +$surface1: #f2f4f8; +$surface2: #ffffff; +$white0: #525252; +$white1: #393939; +$white2: #262626; +$teal: #08bdba; +$sapphire: #3ddbd9; +$sky: #78a9ff; +$maroon: #ee5396; +$blue: #0f62fe; +$red: #ff7eb6; +$green: #42be65; +$lavender: #be95ff; +$light_blue: #82cfff; +$accent: $red; diff --git a/hypr-configs/hyprland/eww/themes/rosepine.scss b/hypr-configs/hyprland/eww/themes/rosepine.scss new file mode 100644 index 0000000..ded364f --- /dev/null +++ b/hypr-configs/hyprland/eww/themes/rosepine.scss @@ -0,0 +1,25 @@ +$base: #191724; +$surface0: #26233a; +$surface1: #403d52; +$surface2: #524f67; +$white0: #e0def4; +$white1: #e0def4; +$white2: #e0def4; + +$muted: #6e6a86; +$subtle: #908caa; +$text: #e0def4; +$love: #eb6f92; +$gold: #f6c177; +$rose: #ebbcba; +$pine: #31748f; +$foam: #9ccfd8; +$iris: #c4a7e7; +$surface: #1f1d2e; +$highlight-low: #21202e; +$highlight-med: #403d52; +$highlight-high: #524f67; + +$red: $love; +$green: $foam; +$accent: $iris; diff --git a/hypr-configs/hyprland/eww/themes/swamp.scss b/hypr-configs/hyprland/eww/themes/swamp.scss new file mode 100644 index 0000000..6f51499 --- /dev/null +++ b/hypr-configs/hyprland/eww/themes/swamp.scss @@ -0,0 +1,23 @@ +// by masroof-maindak (Mujtaba) + +// required +$base: #242015; +$surface0: #3A3124; +$surface1: #4d3f32; +$surface2: #5f4e41; +$white0: #D2C3A4; +$white1: #ebe0bb; +$white2: #F1E9D0; +$red: #a82d56; +$green: #61a0a8; + +// other +$base04: #B8A58C; +$base09: #b06733; +$base0A: #db930d; +$base0B: #7a7653; +$base0D: #91506C; +$base0E: #b05d61; +$base0F: #ba6d36; + +$accent: $base0A; diff --git a/hypr-configs/hyprland/eww/volume/volume.scss b/hypr-configs/hyprland/eww/volume/volume.scss deleted file mode 100644 index e69de29..0000000 diff --git a/hypr-configs/hyprland/eww/volume/volume.yuck b/hypr-configs/hyprland/eww/volume/volume.yuck deleted file mode 100644 index 3d058b2..0000000 --- a/hypr-configs/hyprland/eww/volume/volume.yuck +++ /dev/null @@ -1,52 +0,0 @@ -(defwidget volume [] - (eventbox - :onhover "eww update volume_rev=true" - :onhoverlost "eww update volume_rev=false" - (box - :class "volume" - :space-evenly false - :orientation "v" - (revealer - :class "volume-bar" - :transition "slideup" - :reveal volume_rev - (eventbox - :cursor "pointer" - :halign "center" - (scale - :orientation "v" - :tooltip {volume == "muted" ? "Muted" : "${volume}%"} - :value {volume == "muted" ? "0" : volume} - :min 0 - :max 101 - :onchange "pamixer -u && pamixer --set-volume {}" - :flipped true - ) - ) - ) - (eventbox - :cursor "pointer" - :onscroll "echo {} | sed -e 's/up/--up/g' -e 's/down/--down/g' | xargs volume" - (button - :class "volume icon" - :style {volume == 0 || volume == "muted" ? "color: #dd6777;" : "color: #cacaca;"} - :tooltip {volume == "muted" ? "Muted" : "${volume}%" } - :onclick "volume --toggle" - {volume == 0 || volume == "muted" ? "󰝟" : - volume < 30 ? "" : - volume < 75 ? "" : ""} - ) - ) - ) - ) -) - -(defwindow volume - :monitor 0 - :geometry (geometry :x "1%" - :y "0%" - :height "75%" - :width "25%" - :anchor "center left") - :reserve (struts :side "top" :distance "4%") - (volume)) diff --git a/hypr-configs/hyprland/eww/wallpapers/wallpapers.yuck b/hypr-configs/hyprland/eww/wallpapers/wallpapers.yuck new file mode 100644 index 0000000..7bb4b7e --- /dev/null +++ b/hypr-configs/hyprland/eww/wallpapers/wallpapers.yuck @@ -0,0 +1,71 @@ + +(defwindow wallpaperselect + :geometry (geometry + :x 0 + :y 0 + :width 415 + :height 600 + :anchor "center") + :stacking "overlay" + :monitor 0 + :focusable true + (box + :class "popup" + (wallpaperselectwidget))) + +(defwidget wallpaperselectwidget [] + (eventbox + ;; :onhoverlost "${EWW_CMD} close wallpaperselect" + (box + :orientation "v" + :class "unbarwidget" + :space-evenly false + (box + :orientation "h" + :space-evenly false + (input + :hexpand true + :onaccept "./scripts/wallhaven.py search {}" + :timeout "20000ms") + (button + :onclick "${EWW_CMD} update wallpapers=[] && ./scripts/wallhaven.py reset" + ;; :style "padding: 0px 8px 0px 3px;" + (label + :class "icon" + :text ""))) + + (scroll + :hscroll false + :vscroll true + :vexpand true + (box + :orientation "v" + :space-evenly false + :valign "start" + (image + :style "margin: 50px 0px 5px 0px;" + :hexpand false + :vexpand false + :path "./image/fieshidle.gif" + :visible {arraylength(wallpapers) == 0}) + + (label + :visible {arraylength(wallpapers) == 0} + :text "No wallpapers yet") + + (for wall in wallpapers + (box + :orientation "v" + :space-evenly false + :class "mainentry" + :spacing 5 + (button + :onclick "./scripts/wallhaven.py select ${wall.url}" + (image :image-height 225 :image-width 400 :path {wall.path})) + (box + :orientation "h" + :space-evenly true + (label :text "${wall.views} 󰈈") + (label :text "${wall.fav} 󰣐") + )))) + ))))