Hyprland-dotfiles/eww/ml4w-sidebar/eww.yuck

185 lines
7.6 KiB
Plaintext
Raw Normal View History

2024-04-22 08:46:08 -04:00
;; Icons: https://github.com/GNOME/adwaita-icon-theme/tree/master/Adwaita
2024-04-20 11:57:31 -04:00
;; Variables
;; System vars
(defpoll HOST :interval "5s" `hostname`)
(defpoll CPU_USAGE :interval "1s" `../scripts/sys_info.sh --cpu`)
(defpoll MEM_USAGE :interval "1s" `../scripts/sys_info.sh --mem`)
(defpoll DISK_USAGE :interval "1s" `../scripts/sys_info.sh --disk`)
;; Widgets
;; resources
(defwidget ml4wlauncher []
(box :class "winbox"
(centerbox :orientation "h"
(box :class "ml4w-welcome" :orientation "v" :valign "center" :halign "center" :spacing 15 :space-evenly "false"
(button :style "background-image: url('../../apps/ml4w-welcome.png');" :class "ml4w_icon" :orientation "v" :valign "center" :halign "center" :onclick "../scripts/launch_app.sh --welcome")
(label :class "res_text" :valign "end" :halign "center" :text "Welcome App")
)
(box :class "ml4w-dotfiles" :orientation "v" :valign "center" :halign "center" :spacing 15 :space-evenly "false"
(button :style "background-image: url('../../apps/ml4w-dotfiles-settings.png');" :class "ml4w_icon" :orientation "v" :valign "center" :halign "center" :onclick "../scripts/launch_app.sh --dotfiles")
(label :class "res_text" :valign "end" :halign "center" :text "Dotfiles App")
)
(box :class "ml4w-hyprland" :orientation "v" :valign "center" :halign "center" :spacing 15 :space-evenly "false"
(button :style "background-image: url('../../apps/ml4w-hyprland-settings.png');" :class "ml4w_icon" :orientation "v" :valign "center" :halign "center" :onclick "../scripts/launch_app.sh --hyprland")
(label :class "res_text" :valign "end" :halign "center" :text "Hyprland App")
)
)
)
)
(defwidget resources []
(box :class "winbox"
(centerbox :orientation "h"
(box :class "res_box" :orientation "v" :valign "center" :halign "center" :spacing 15 :space-evenly "false"
(box :class "res_circle" :orientation "v" :valign "center" :halign "center"
(circular-progress :class "res_cpu" :value CPU_USAGE :thickness 15
2024-05-13 11:49:38 -04:00
(label :class "res_circle_small" :text "CPU" :show-truncated false)
2024-04-20 11:57:31 -04:00
)
)
(label :class "res_text" :valign "end" :halign "center" :text "${CPU_USAGE}%")
)
(box :class "res_box" :orientation "v" :valign "center" :halign "center" :spacing 15 :space-evenly "false"
(box :class "res_circle" :orientation "v" :valign "center" :halign "center"
(circular-progress :class "res_mem" :value MEM_USAGE :thickness 15
2024-05-13 11:49:38 -04:00
(label :class "res_circle_small" :text "MEMORY" :show-truncated false)
2024-04-20 11:57:31 -04:00
)
)
(label :class "res_text" :valign "end" :halign "center" :text "${MEM_USAGE}%")
)
(box :class "res_box" :orientation "v" :valign "center" :halign "center" :spacing 15 :space-evenly "false"
(box :class "res_circle" :orientation "v" :valign "center" :halign "center"
(circular-progress :class "res_disk" :value DISK_USAGE :thickness 15
2024-05-13 11:49:38 -04:00
(label :class "res_circle_small" :text "DISK" :show-truncated false)
2024-04-20 11:57:31 -04:00
)
)
(label :class "res_text" :valign "end" :halign "center" :text "${DISK_USAGE}%")
)
)
)
)
2024-04-22 08:46:08 -04:00
(defwidget close []
(box :class "winbox"
2024-05-02 09:59:08 -04:00
(button :tooltip "Close" :style "background-image: url('../assets/window-close-symbolic.svg');" :class "closeicon" :valign "center" :halign "center" :onclick "../scripts/eww.sh &")
2024-04-22 08:46:08 -04:00
)
)
2024-04-20 11:57:31 -04:00
;; powermenus
(defwidget logout []
(box :class "winbox"
2024-05-23 09:42:03 -04:00
(button :tooltip "Logout" :style "background-image: url('../assets/application-exit-symbolic-rtl.svg');" :class "powericons" :valign "center" :halign "center" :onclick "../../hypr/scripts/power.sh exit &")
2024-04-20 11:57:31 -04:00
)
)
2024-04-22 08:46:08 -04:00
2024-04-20 11:57:31 -04:00
(defwidget suspend []
(box :class "winbox"
2024-05-23 09:42:03 -04:00
(button :tooltip "Suspend" :style "background-image: url('../assets/media-playback-pause-symbolic.svg');" :class "powericons" :valign "center" :halign "center" :onclick "../../hypr/scripts/power.sh suspend &")
2024-04-20 11:57:31 -04:00
)
)
2024-04-22 08:46:08 -04:00
2024-04-20 11:57:31 -04:00
(defwidget lock []
(box :class "winbox"
2024-05-23 09:42:03 -04:00
(button :tooltip "Lock" :style "background-image: url('../assets/system-lock-screen-symbolic.svg');" :class "powericons" :valign "center" :halign "center" :onclick "../../hypr/scripts/power.sh lock &")
2024-04-20 11:57:31 -04:00
)
)
2024-04-22 08:46:08 -04:00
2024-04-20 11:57:31 -04:00
(defwidget reboot []
(box :class "winbox"
2024-05-23 09:42:03 -04:00
(button :tooltip "Reboot" :style "background-image: url('../assets/system-reboot-symbolic.svg');" :class "powericons" :valign "center" :halign "center" :onclick "../../hypr/scripts/power.sh reboot &")
2024-04-20 11:57:31 -04:00
)
)
2024-04-22 08:46:08 -04:00
2024-04-20 11:57:31 -04:00
(defwidget shutdown []
(box :class "winbox"
2024-05-23 09:42:03 -04:00
(button :tooltip "Shutdown" :style "background-image: url('../assets/system-shutdown-symbolic.svg');" :class "powericons" :valign "center" :halign "center" :onclick "../../hypr/scripts/power.sh shutdown &")
2024-04-20 11:57:31 -04:00
)
)
;; ** Windows *************************************************************************
2024-04-22 08:46:08 -04:00
(defwindow close
:geometry (geometry :x "455px"
:y "-7px"
:width "44px"
:height "44px"
:anchor "top right")
:stacking "fg"
:wm-ignore false
(close))
2024-04-20 11:57:31 -04:00
(defwindow ml4wlauncher
2024-04-21 04:29:05 -04:00
:geometry (geometry :x "5px"
:y "5px"
2024-04-20 11:57:31 -04:00
:width "480px"
:height "140px"
:anchor "top right")
:stacking "fg"
:wm-ignore false
(ml4wlauncher))
;; resources
(defwindow resources
2024-04-21 04:29:05 -04:00
:geometry (geometry :x "5px"
:y "140px"
2024-04-20 11:57:31 -04:00
:width "480px"
:height "180px"
:anchor "top right")
:stacking "fg"
:wm-ignore false
(resources))
;; powermenu
(defwindow logout
2024-04-21 04:29:05 -04:00
:geometry (geometry :x "5px"
:y "318px"
2024-04-20 11:57:31 -04:00
:width "80px"
:height "80px"
:anchor "top right")
:stacking "fg"
:wm-ignore false
(logout))
(defwindow suspend
2024-04-21 04:29:05 -04:00
:geometry (geometry :x "102px"
:y "318px"
2024-04-20 11:57:31 -04:00
:width "80px"
:height "80px"
:anchor "top right")
:stacking "fg"
:wm-ignore false
(suspend))
(defwindow lock
2024-04-21 04:29:05 -04:00
:geometry (geometry :x "204px"
:y "318px"
2024-04-20 11:57:31 -04:00
:width "80px"
:height "80px"
:anchor "top right")
:stacking "fg"
:wm-ignore false
(lock))
(defwindow reboot
2024-04-21 04:29:05 -04:00
:geometry (geometry :x "305px"
:y "318px"
2024-04-20 11:57:31 -04:00
:width "80px"
:height "80px"
:anchor "top right")
:stacking "fg"
:wm-ignore false
(reboot))
(defwindow shutdown
2024-04-21 04:29:05 -04:00
:geometry (geometry :x "405px"
:y "318px"
2024-04-20 11:57:31 -04:00
:width "80px"
:height "80px"
:anchor "top right")
:stacking "fg"
:wm-ignore false
(shutdown))
2024-04-22 08:46:08 -04:00