(defvar MD3_DECEL "400ms cubic-bezier(0.05, 0.7, 0.1, 1)") (defvar MD3_ACCEL "150ms cubic-bezier(0.3, 0, 0.8, 0.15)") (defwidget dashfs_resource [value unit icon name] (box :space-evenly false :orientation "v" (label :class "dashfs-resource-title" :text {name}) (box :space-evenly false :orientation "v" :class "dashfs-resource-box" :spacing 10 (circular-progress :width 80 :height 80 :start-at 75 :class "dashfs-resource-circle" :value {value} :thickness 4 (label :class "dashfs-resource-icon" :text {icon}) ) (label :halign "center" :class "dashfs-resource-label" :text "${value}${unit}" ) ) ) ) (defwidget cavacol_dashfs [nth dir] (box :valign "${dir == 'up' ? 'end' : ( dir == 'down' ? 'start' : 'fill' )}" :halign "${dir == 'right' ? 'start' : ( dir == 'left' ? 'end' : 'fill' )}" ; :width 20 :height 24 :class "dashfs-cava-column" :style " transition: 0ms; min-${dir == 'up' || dir == 'down' ? 'height' : 'width'}: ${cavajson[nth] / 3}px; " ) ) (defwidget dashfs_widget [] (eventbox :onclick "scripts/toggle-dashfs.sh --close &" (box :width {RES_WIDTH} :height {RES_HEIGHT} :class "dashfs-bg" (overlay (box :space-evenly false :orientation "v" :width {RES_WIDTH} :height {RES_HEIGHT} :class "dashfs-graph" :style " transition: ${anim_open_dashfs ? MD3_DECEL : MD3_ACCEL}; ${rev_dashfs ? '' : 'margin-left: -${RES_WIDTH}px; margin-right: ${RES_WIDTH}px;'} " ) ; Cava (left) (box :orientation "v" :halign "start" :valign "center" :height {RES_HEIGHT} :style " transition: ${anim_open_dashfs ? MD3_DECEL : MD3_ACCEL}; ${rev_dashfs ? 'margin-left: -24px' : 'margin-right: 400px; margin-left: -400px;'} " (cavacol_dashfs :dir "right" :nth 0) (cavacol_dashfs :dir "right" :nth 1) (cavacol_dashfs :dir "right" :nth 2) (cavacol_dashfs :dir "right" :nth 3) (cavacol_dashfs :dir "right" :nth 4) (cavacol_dashfs :dir "right" :nth 5) (cavacol_dashfs :dir "right" :nth 6) (cavacol_dashfs :dir "right" :nth 7) (cavacol_dashfs :dir "right" :nth 8) (cavacol_dashfs :dir "right" :nth 9) (cavacol_dashfs :dir "right" :nth 10) (cavacol_dashfs :dir "right" :nth 11) (cavacol_dashfs :dir "right" :nth 12) (cavacol_dashfs :dir "right" :nth 13) (cavacol_dashfs :dir "right" :nth 14) (cavacol_dashfs :dir "right" :nth 15) (cavacol_dashfs :dir "right" :nth 16) (cavacol_dashfs :dir "right" :nth 17) (cavacol_dashfs :dir "right" :nth 18) (cavacol_dashfs :dir "right" :nth 19) (cavacol_dashfs :dir "right" :nth 20) (cavacol_dashfs :dir "right" :nth 21) (cavacol_dashfs :dir "right" :nth 22) (cavacol_dashfs :dir "right" :nth 23) (cavacol_dashfs :dir "right" :nth 24) (cavacol_dashfs :dir "right" :nth 25) (cavacol_dashfs :dir "right" :nth 26) (cavacol_dashfs :dir "right" :nth 27) (cavacol_dashfs :dir "right" :nth 28) (cavacol_dashfs :dir "right" :nth 29) (cavacol_dashfs :dir "right" :nth 30) (cavacol_dashfs :dir "right" :nth 31) (cavacol_dashfs :dir "right" :nth 32) (cavacol_dashfs :dir "right" :nth 33) (cavacol_dashfs :dir "right" :nth 34) (cavacol_dashfs :dir "right" :nth 35) (cavacol_dashfs :dir "right" :nth 36) (cavacol_dashfs :dir "right" :nth 37) (cavacol_dashfs :dir "right" :nth 38) (cavacol_dashfs :dir "right" :nth 39) (cavacol_dashfs :dir "right" :nth 40) (cavacol_dashfs :dir "right" :nth 41) (cavacol_dashfs :dir "right" :nth 42) (cavacol_dashfs :dir "right" :nth 43) (cavacol_dashfs :dir "right" :nth 44) ) ; Cava (right) (box :orientation "v" :space-evenly false :halign "end" :valign "center" :height {RES_HEIGHT} :style " transition: ${anim_open_dashfs ? MD3_DECEL : MD3_ACCEL}; ${rev_dashfs ? 'margin-right: -24px;' : 'margin-left: 400px; margin-right: -400px;'} " (cavacol_dashfs :dir "left" :nth 49) (cavacol_dashfs :dir "left" :nth 48) (cavacol_dashfs :dir "left" :nth 47) (cavacol_dashfs :dir "left" :nth 46) (cavacol_dashfs :dir "left" :nth 45) (cavacol_dashfs :dir "left" :nth 44) (cavacol_dashfs :dir "left" :nth 43) (cavacol_dashfs :dir "left" :nth 42) (cavacol_dashfs :dir "left" :nth 41) (cavacol_dashfs :dir "left" :nth 40) (cavacol_dashfs :dir "left" :nth 39) (cavacol_dashfs :dir "left" :nth 38) (cavacol_dashfs :dir "left" :nth 37) (cavacol_dashfs :dir "left" :nth 36) (cavacol_dashfs :dir "left" :nth 35) (cavacol_dashfs :dir "left" :nth 34) (cavacol_dashfs :dir "left" :nth 33) (cavacol_dashfs :dir "left" :nth 32) (cavacol_dashfs :dir "left" :nth 31) (cavacol_dashfs :dir "left" :nth 30) (cavacol_dashfs :dir "left" :nth 29) (cavacol_dashfs :dir "left" :nth 28) (cavacol_dashfs :dir "left" :nth 27) (cavacol_dashfs :dir "left" :nth 26) (cavacol_dashfs :dir "left" :nth 25) (cavacol_dashfs :dir "left" :nth 24) (cavacol_dashfs :dir "left" :nth 23) (cavacol_dashfs :dir "left" :nth 22) (cavacol_dashfs :dir "left" :nth 21) (cavacol_dashfs :dir "left" :nth 20) (cavacol_dashfs :dir "left" :nth 19) (cavacol_dashfs :dir "left" :nth 18) (cavacol_dashfs :dir "left" :nth 17) (cavacol_dashfs :dir "left" :nth 16) (cavacol_dashfs :dir "left" :nth 15) (cavacol_dashfs :dir "left" :nth 14) (cavacol_dashfs :dir "left" :nth 13) (cavacol_dashfs :dir "left" :nth 12) (cavacol_dashfs :dir "left" :nth 11) (cavacol_dashfs :dir "left" :nth 10) (cavacol_dashfs :dir "left" :nth 9) (cavacol_dashfs :dir "left" :nth 8) (cavacol_dashfs :dir "left" :nth 7) (cavacol_dashfs :dir "left" :nth 6) (cavacol_dashfs :dir "left" :nth 5) (cavacol_dashfs :dir "left" :nth 4) (cavacol_dashfs :dir "left" :nth 3) (cavacol_dashfs :dir "left" :nth 2) (cavacol_dashfs :dir "left" :nth 1) (cavacol_dashfs :dir "left" :nth 0) ) ; Greet (box :space-evenly false :orientation "v" :halign "start" :valign "start" :class "dashfs-greet" :style " transition: ${anim_open_dashfs ? MD3_DECEL : MD3_ACCEL}; ${rev_dashfs ? '' : 'margin-left: -533px;'} " (label :xalign 0 :class "dashfs-greet-text" :text "${time.hour >= 21 ? 'Good night' : ( time.hour >= 18 ? 'Good evening' : ( time.hour >= 12 ? 'Good afternoon' : ( time.hour >= 5 ? 'Good morning' : 'Go to sleep' ) ) ) } ${realname}!" ) (label :xalign 0 :class "dashfs-greet-subtext" :text "It's not awesome, it's Hyprland!" ) ) ; Time (box :space-evenly false :orientation "v" :halign "end" :valign "start" :class "dashfs-clock" :style " transition: ${anim_open_dashfs ? MD3_DECEL : MD3_ACCEL}; ${rev_dashfs ? '' : 'margin-right: -533px;'} " (label :xalign 1 :class "dashfs-clock-time" :text "${time.hour}:${time.minute}") (label :xalign 1 :class "dashfs-clock-date" :text "${time.day}, ${time.date}") ) ; Calendar (box :space-evenly false :orientation "v" :halign "end" :valign "center" :style " transition: ${anim_open_dashfs ? MD3_DECEL : MD3_ACCEL}; ${rev_dashfs ? 'margin-right: 40px;' : 'margin-right: -533px;'} margin-bottom: 200px; " (box :space-evenly false :orientation "v" (eventbox :onscroll "scripts/scrollmonth {} &" (box :orientation "v" :space-evenly false (centerbox :style "padding: 0 12px;" (label :xalign 0 :class "dashfs-calendar-title" :text "${calendartitle}") (box) (box :halign "end" :valign "center" (box :halign "end" :valign "center" (button :onclick "scripts/scrollmonth up &" :halign "end" :valign "center" :class "winicon dashfs-monthbutton" (image :valign "center" :path "images/svg/dark/caretup.svg" ) ) (button :onclick "scripts/scrollmonth down &" :halign "end" :valign "center" :class "winicon dashfs-monthbutton" (image :valign "center" :path "images/svg/dark/caretdown.svg" ) ) ) ) ) (box :space-evenly false :orientation "v" :class "dashfs-section-nopad" (box (for day in weekdays (box :class "dashfs-calendar-button day${day.today}" (label :class "dashfs-calendar-text" :text "${day.day}") ) ) ) (for week in calendar (box (for day in week (button :class "dashfs-calendar-button dashfs-day${day.today}" (label :class "dashfs-calendar-text" :text "${day.day}") ) ) ) ) ) ) ) ) ) ; Fetch (box :orientation "v" :space-evenly false :halign "start" :valign "start" :style " transition: ${anim_open_dashfs ? MD3_DECEL : MD3_ACCEL}; ${rev_dashfs ? 'margin-left: 100px;' : 'margin-left: -533px;'} margin-top: 450px; " (label :class "dashfs-section-title" :text "# System") (box :space-evenly false :orientation "v" :class "dashfs-section" (box :orientation "h" :space-evenly false (label :class "dashfs-fetch-icon" :text "") (label :class "dashfs-fetch" :text "${username + '@' + hostname}") ) (box :orientation "h" :space-evenly false (label :class "dashfs-fetch-icon" :text "") (label :class "dashfs-fetch" :text "${kernel}") ) (box :orientation "h" :space-evenly false (label :class "dashfs-fetch-icon" :text "") (label :class "dashfs-fetch" :text "${uptime}") ) (box :orientation "h" :space-evenly false (label :class "dashfs-fetch-icon" :text "") (label :class "dashfs-fetch" :text "${wm}") ) (box :orientation "h" :space-evenly false (label :class "dashfs-fetch-icon" :text "") (label :class "dashfs-fetch" :text "${packages}") ) ) ) ; Session (box :orientation "v" :space-evenly false :halign "start" :valign "start" :style " transition: ${anim_open_dashfs ? MD3_DECEL : MD3_ACCEL}; ${rev_dashfs ? 'margin-left: 400px;' : 'margin-left: -533px;'} margin-top: 350px; " (label :class "dashfs-section-title" :text "# Session") (box :space-evenly false :orientation "v" :class "dashfs-section" (button :class "dashfs-section-button" :onclick "scripts/dashactivate '~/.local/bin/lock.sh' &" (box :orientation "h" :space-evenly false (label :class "dashfs-fetch-icon" :text "") (label :class "dashfs-fetch" :text "Lock") ) ) (button :class "dashfs-section-button" :onclick "scripts/dashactivate 'systemctl suspend' &" (box :orientation "h" :space-evenly false (label :class "dashfs-fetch-icon" :text "") (label :class "dashfs-fetch" :text "Sleep") ) ) (button :class "dashfs-section-button" :onclick "scripts/dashactivate 'loginctl terminate-user $USER' &" (box :orientation "h" :space-evenly false (label :class "dashfs-fetch-icon" :text "") (label :class "dashfs-fetch" :text "Logout") ) ) (button :class "dashfs-section-button" :onclick "scripts/dashactivate 'systemctl reboot' &" (box :orientation "h" :space-evenly false (label :class "dashfs-fetch-icon" :text "") (label :class "dashfs-fetch" :text "Reboot") ) ) (button :class "dashfs-section-button" :onclick "scripts/dashactivate 'systemctl poweroff' &" (box :orientation "h" :space-evenly false (label :class "dashfs-fetch-icon" :text "") (label :class "dashfs-fetch" :text "Shutdown") ) ) ) ) ; Quick dirs (box :orientation "v" :space-evenly false :halign "start" :valign "start" :style " transition: ${anim_open_dashfs ? MD3_DECEL : MD3_ACCEL}; ${rev_dashfs ? 'margin-left: 700px;' : 'margin-left: -533px;'} margin-top: 450px; " (label :class "dashfs-section-title" :text "# Quick dirs") (box :space-evenly false :orientation "v" :class "dashfs-section" (button :class "dashfs-section-button" :onclick "scripts/toggle-dashfs.sh --close && xdg-open ~/Documents &" (box :orientation "h" :space-evenly false (label :class "dashfs-fetch-icon" :text "") (label :class "dashfs-fetch" :text "Documents") ) ) (button :class "dashfs-section-button" :onclick "scripts/toggle-dashfs.sh --close && xdg-open ~/Downloads &" (box :orientation "h" :space-evenly false (label :class "dashfs-fetch-icon" :text "") (label :class "dashfs-fetch" :text "Downloads") ) ) (button :class "dashfs-section-button" :onclick "scripts/toggle-dashfs.sh --close && xdg-open ~/Music &" (box :orientation "h" :space-evenly false (label :class "dashfs-fetch-icon" :text "") (label :class "dashfs-fetch" :text "Music") ) ) (button :class "dashfs-section-button" :onclick "scripts/toggle-dashfs.sh --close && xdg-open ~/Pictures &" (box :orientation "h" :space-evenly false (label :class "dashfs-fetch-icon" :text "") (label :class "dashfs-fetch" :text "Pictures") ) ) (button :class "dashfs-section-button" :onclick "scripts/toggle-dashfs.sh --close && xdg-open ~/Videos &" (box :orientation "h" :space-evenly false (label :class "dashfs-fetch-icon" :text "") (label :class "dashfs-fetch" :text "Videos") ) ) ) ) ; Quick links (box :orientation "v" :space-evenly false :halign "start" :valign "start" :style " transition: ${anim_open_dashfs ? MD3_DECEL : MD3_ACCEL}; ${rev_dashfs ? 'margin-left: 1000px;' : 'margin-left: -533px;'} margin-top: 350px; " (label :class "dashfs-section-title" :text "# Quick links") (box :space-evenly false :orientation "v" :class "dashfs-section" (button :class "dashfs-section-button" :onclick "scripts/toggle-dashfs.sh --close && xdg-open 'https://discord.com/app' &" (box :orientation "h" :space-evenly false (label :class "dashfs-nerd-icon" :text "󰙯 ") (label :class "dashfs-fetch" :text "Discord") ) ) (button :class "dashfs-section-button" :onclick "scripts/toggle-dashfs.sh --close && xdg-open 'https://reddit.com' &" (box :orientation "h" :space-evenly false (label :class "dashfs-nerd-icon" :text " ") (label :class "dashfs-fetch" :text "Reddit") ) ) (button :class "dashfs-section-button" :onclick "scripts/toggle-dashfs.sh --close && xdg-open 'https://github.com' &" (box :orientation "h" :space-evenly false (label :class "dashfs-nerd-icon" :text " ") (label :class "dashfs-fetch" :text "GitHub") ) ) (button :class "dashfs-section-button" :onclick "scripts/toggle-dashfs.sh --close && xdg-open 'https://youtube.com' &" (box :orientation "h" :space-evenly false (label :class "dashfs-nerd-icon" :text " ") (label :class "dashfs-fetch" :text "Youtube") ) ) (button :class "dashfs-section-button" :onclick "scripts/toggle-dashfs.sh --close && xdg-open 'https://soundcloud.com' &" (box :orientation "h" :space-evenly false (label :class "dashfs-nerd-icon" :text " ") (label :class "dashfs-fetch" :text "SoundCloud") ) ) ) ) ; Taskbar ; (box :orientation "h" :space-evenly false ; :halign "center" :valign "end" ; :onscroll "echo {} | sed -e \"s/up/-1/g\" -e \"s/down/+1/g\" | xargs hyprctl dispatch workspace" ; :style " ; transition: ${anim_open_dashfs ? MD3_DECEL : MD3_ACCEL}; ; ${rev_dashfs ? '' : 'margin-bottom: -70px;'} ; " ; (for app in tasks ; (overlay ; (eventbox ; :class "dashfs-button-only" ; :onclick "${app.count > 0 ? ('hyprctl dispatch workspace ' + app.workspace[0] + ' &') : (app.exec)}& scripts/toggle-dashfs.sh --close &" ; (box ; :class "dashfs-button-pad" ; (box ; :class "dashfs-taskbaricon" ; :style " ; background-image: url('${app.icon}'); ; ${app.class == awin.class ? 'background-color: rgba(108, 112, 134, 0.4); border: 1px solid rgba(108, 112, 134, 0.15); border-top: 1px solid rgba(108, 112, 134, 0.15);' : ''} ; " ; ) ; ) ; ) ; (box :class "dashfs-taskbar-indicator-${app.class == awin.class ? 'true' : (app.count > 0 ? 'false' : 'none')}") ; ) ; ) ; ; Dummy keep alive ; (revealer :transition "slideright" :reveal false (label :text {awin.class})) ; ) ; Music (box :space-evenly false :orientation "h" :halign "center" :valign "start" :class "dashfs-music" :style " transition: ${anim_open_dashfs ? MD3_DECEL : MD3_ACCEL}; ${rev_dashfs ? 'margin-top: 40px;' : 'margin-top: -200px; margin-bottom: 200px;'} " (box :class "dashfs-music-cover" :style "background-image: url('${mcover.image}')" ) (eventbox :class "music-ctl-revealer" :onscroll "echo $(echo {} | sed -e 's/down/-/g' -e 's/up/+/g' | xargs -I% wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.03%) && scripts/volume osd" (box :space-evenly false :class "music-ctl-revealer" :orientation "v" :valign "center" (label :class "music-title-bar" :limit-width 50 :xalign 0 :style "font-size: 15pt; font-family: 'Rubik';" ;color: ${mcover.color.colors.color7}; :text "${mname.title == '' ? 'Not playing' : mname.title}" ) (revealer :transition "slidedown" :reveal "${mname.artist != ''}" :duration "20ms" (label :class "music-artist-bar" :limit-width 50 :xalign 0 :style "font-size: 11pt; font-family: 'Rubik';" :text "${mname.artist}" ) ) ) ) ) ; Resources (box :orientation "h" :space-evenly false :spacing 30 :halign "center" :valign "end" :style " transition: ${anim_open_dashfs ? MD3_DECEL : MD3_ACCEL}; ${rev_dashfs ? 'margin-bottom: 100px;' : 'margin-bottom: -500px;'} " (dashfs_resource :value {round(EWW_CPU.avg, 0)} :unit "%" :icon "" :name "CPU") (dashfs_resource :value {round(memory.percentage, 0)} :unit "% (${memory.used})" :icon "" :name "RAM") (dashfs_resource :value {round(memory.swappercentage, 0)} :unit "% (${memory.swapused})" :icon "" :name "Swap") (dashfs_resource :value {battery.percentage} :unit "%" :icon "" :name "Battery") (dashfs_resource :value {diskfreepercent} :unit "%" :icon "" :name "Free space") ) ; Icosahedron (image :orientation "h" :space-evenly false :spacing 30 :halign "end" :valign "end" :style " transition: ${anim_open_dashfs ? MD3_DECEL : MD3_ACCEL}; ${rev_dashfs ? 'margin-bottom: -250px; margin-right: -150px;' : 'margin-bottom: -900px; margin-top: 900px; margin-right: -900px; margin-left: 900px;'} " :path "images/svg/icosahedron.svg" :image-height 600 :image-width 600 ) ; Music (box :space-evenly false :orientation "v" :halign "start" :valign "end" :style " transition: ${anim_open_dashfs ? MD3_DECEL : MD3_ACCEL}; ${rev_dashfs ? 'margin-left: 40px; margin-bottom: 40px;' : 'margin-bottom: -200px; margin-top: 200px;'} " (label :xalign 0 :class "dashfs-quote-content" :text "${quote_content[3]}") (label :xalign 1 :class "dashfs-quote-author" :text "${quote_author[3]}") ) ) ) ) ) (defwindow dashfs :focusable true :windowtype "normal" :wm-ignore true :geometry (geometry :width 1920 :height 1080 :anchor "center center" ) :monitor 0 (dashfs_widget) )